You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/share/templates/sound/handles_list.tt

101 lines
3.9 KiB

[% site_config.title = c.loc('Manage Sound Set [_1]', set_result.name) -%]
<div class="row">
<span>
<a class="btn btn-primary btn-large" href="[% c.uri_for('/back') %]"><i class="icon-arrow-left"></i> [% c.loc('Back') %]</a>
[% IF c.user.roles == "subscriberadmin" ||
((c.user.roles == "admin" || c.user.roles == "reseller") && !c.user.read_only)
-%]
<a class="btn btn-primary btn-large" href="[% c.uri_for_action('/sound/handles_load_default', [c.req.captures.0]) %]"><i class="icon-star"></i> [% c.loc('Load Default Files') %]</a>
[% END -%]
</span>
</div>
[% back_created = 1 -%]
[% IF messages -%]
<div class="row">
[% FOREACH m IN messages -%]
<div class="alert alert-[% m.type %]">[% m.text %]</div>
[% END -%]
</div>
[% END -%]
<div class="ngcp-separator"></div>
<div class="accordion" id="sound_groups">
[% FOREACH group IN sound_groups.pairs %]
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#sound_groups" href="#collapse[% group.key %]">[% group.key %]</a>
</div>
<div class="accordion-body collapse" id="collapse[% group.key %]">
<div class="accordion-inner">
<table class="table table-bordered table-striped table-highlight table-hover" id="sounds_table[% group.key %]">
<thead>
<tr>
[% # one for description -%]
<th>[% c.loc('Name') %]</th>
<th>[% c.loc('Filename') %]</th>
<th>[% c.loc('Loop') %]</th>
[% # one for actions -%]
<th></th>
</tr>
</thead>
<tbody>
[% FOREACH r IN group.value %]
<tr class="sw_action_row">
<td>
[% r.get_column("handlename") %]
</td>
<td>
[% r.get_column("filename") %]
</td>
<td>
<input type="checkbox" disabled="disabled" [% r.get_column('loopplay') ? 'checked="checked"' : '' %]>
</td>
<td>
<div class="sw_actions pull-right">
[% IF r.get_column("filename").size -%]
[% UNLESS c.user.read_only -%]
<a class="btn btn-small btn-primary" href="[% handles_base_uri _ "/" _ r.get_column("handleid") _ "/edit" %]"><i class="icon-edit"></i> [% c.loc('Edit') %]</a>
<a class="btn btn-small btn-secondary" data-confirm="Delete" href="[% handles_base_uri _ "/" _ r.get_column("handleid") _ "/delete" %]"><i class="icon-edit"></i> [% c.loc('Delete') %]</a>
[% END -%]
<a class="btn btn-small btn-tertiary" href="[% c.uri_for_action('/sound/handles_download', [c.req.captures.0, r.get_column('handleid')]) %]"><i class="icon-play"></i> [% c.loc('Play') %]</a>
[% ELSIF !c.user.read_only -%]
<a class="btn btn-small btn-primary" href="[% handles_base_uri _ "/" _ r.get_column("handleid") _ "/edit" %]"><i class="icon-edit"></i> [% c.loc('Upload') %]</a>
[% END -%]
</div>
</td>
</tr>
[% END %]
</tbody>
</table>
</div>
</div>
</div>
[% END %]
</div>
[% IF edit_flag || edit_default_flag;
PROCESS "helpers/modal.tt";
modal_header(m.create_flag=0,
m.name = edit_default_flag ? c.loc('Default Files') : file_result.handle.name );
form.render;
modal_footer();
END;
-%]
[% IF edit_flag || edit_default_flag -%]
<script>
$(function () {
$('#mod_edit').modal({keyboard: false, backdrop: 'static'});
$('#mod_close').click(function(event) {
window.location.href="[% handles_base_uri %]";
});
});
</script>
[% END -%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]