<script type="text/javascript">
var uriForAction = function( data, type ){
    var q_template;
    console.log("type=" + type);
    switch(type){
    case 'template_previewed':
        q_template = '[%# c.uri_for_action("/invoice/template_view", ['provider_id']) -%]'+'/svg/parsed/previewed/svg/tt_id';
        break;
    case 'template_saved':
        q_template = '[% c.uri_for_action("/invoicetemplate/set_content_ajax", [tmpl.id]) -%]';
        break;
    case 'messages':
        q_template = '[% c.uri_for_action("/invoicetemplate/messages_ajax") -%]';
        break;
    default:
        q_template = '[% c.uri_for_action("/invoicetemplate/get_content_ajax", [tmpl.id]) -%]';
        break;
    }
    return q_template;
}
</script>
[% # vim: set tabstop=4 syntax=html expandtab: -%]
