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/helpers/pref_table.tt

88 lines
3.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

[% IF helper.messages -%]
<div class="row">
[% FOREACH m IN helper.messages -%]
<div class="alert alert-[% m.type %]">[% m.text %]</div>
[% END -%]
</div>
[% END -%]
<div style="margin-top:10px;"></div>
<table class="table table-bordered table-striped table-highlight table-hover" id="preferences_table">
<thead>
<tr>
[% # one for description -%]
<th></th>
<th>Name</th>
<th>Value</th>
[% # one for actions -%]
<th class="span3"></th>
</tr>
</thead>
<tbody>
[% FOREACH r IN helper.rows %]
<tr class="sw_action_row">
<td>
<a href="#" onclick="$.msgbox(
'[% r.description | html %]',
{
type:'info',
buttons:[
{type:'cancel',value:'Close'}
]
});"><i class="icon-question-sign"></i></a>
</td>
<td>
[% r.attribute %]
</td>
<td>
[% IF r.data_type == "boolean" %]
<input type="checkbox" disabled="disabled"
[% IF r.value == "yes" %]selected="selected"[% END %]/>
[% ELSIF r.data_type == "string" || r.data_type == "int" %]
[% IF r.max_occur == 1 %]
[% r.value %]
[% ELSE %]
[% FOR value IN r.value %]
[% r.value %]<br/>
[% END %]
[% END %]
[% ELSIF r.data_type == "enum" %]
<select disabled="disabled">
[% FOREACH e IN r.enums %]
<option [% IF r.value == e.value || (!r.value.defined && e.default_val == 1) %]selected="selected"[% END %]>[% e.label %]</option>
[% END %]
</select>
[% END %]
</td>
<td>
<div class="sw_actions pull-right">
<a style="display:inline;line-height:16px;" class="btn btn-small btn-primary" href="[% c.uri_for(helper.domain_id,'preferences') %]/[% r.id %]/edit"><i class="icon-edit" style="line-height:1em;margin-top:2px"></i> Edit</i></a>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>
[% IF helper.edit_preference -%]
<div id="mod_edit" class="modal hide" style="display:block">
<div class="modal-header">
<button id="mod_close" type="button" class="close">×</button>
<h3>Edit Preference [% helper.preference_meta.attribute %]</h3>
</div>
[% helper.form.render -%]
</div>
<script>
$(function () {
$('#mod_edit').modal({keyboard: false, backdrop: 'static'});
$('#mod_close').click(function(event) {
window.location.href="[% c.uri_for(helper.domain_id, 'preferences') %]";
});
});
</script>
[% END -%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]