|
|
[% site_config.title = 'Off-peak-times for ' _ profile.name -%]
|
|
|
|
|
|
<div class="row">
|
|
|
<span>
|
|
|
<a class="btn btn-primary btn-large" href="[% c.uri_for() %]"><i class="icon-arrow-left"></i> Back</a>
|
|
|
</span>
|
|
|
</div>
|
|
|
|
|
|
[% 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>
|
|
|
|
|
|
<h3>Weekdays</h3>
|
|
|
|
|
|
<table class="table table-bordered table-striped table-highlight table-hover">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>Weekday</th>
|
|
|
<th>Start - End</th>
|
|
|
<th class="ngcp-actions-column"></th>[% #Actions %]
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
[% FOR w IN weekdays %]
|
|
|
<tr class="sw_action_row">
|
|
|
<td>[% w.name %]</td>
|
|
|
<td>
|
|
|
[% FOR r IN w.ranges %]
|
|
|
[% r.start %] – [% r.end %] <br/>
|
|
|
[% END %]
|
|
|
</td>
|
|
|
<td class="ngcp-actions-column">
|
|
|
[% IF w.edit_link %]
|
|
|
<div class="sw_actions pull-right">
|
|
|
<a class="btn btn-small btn-primary" href="[% w.edit_link %]">
|
|
|
<i class="icon-edit"></i> Edit
|
|
|
</a>
|
|
|
</div>
|
|
|
[% END %]
|
|
|
</td>
|
|
|
</tr>
|
|
|
[% END %]
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
<h3>Dates</h3>
|
|
|
|
|
|
[%
|
|
|
helper.name = 'Date Definitions';
|
|
|
helper.show_create_button = 1;
|
|
|
helper.column_titles = [ '#', 'Date', 'Start-End' ];
|
|
|
helper.column_fields = [ 'id', 'date', 'startend' ];
|
|
|
|
|
|
helper.create_flag = peaktimes_special_createflag;
|
|
|
helper.edit_flag = peaktimes_special_editflag;
|
|
|
helper.ajax_uri = c.uri_for_action("/billing/peaktime_specials_ajax", [c.req.captures.0]);
|
|
|
helper.form_object = peaktimes_special_form;
|
|
|
helper.close_target = close_target;
|
|
|
|
|
|
helper.tmpuri = c.uri_for(c.req.captures.0, "peaktimes","date");
|
|
|
helper.dt_buttons = [
|
|
|
{ name = 'Edit', uri = helper.tmpuri _ "/'+full[\"id\"]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
|
|
|
{ name = 'Delete', uri = helper.tmpuri _ "/'+full[\"id\"]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
|
|
|
];
|
|
|
helper.top_buttons = [
|
|
|
{ name = 'Create Special Off-Peak Date', uri = helper.tmpuri _ "/create", icon = 'icon-star' },
|
|
|
];
|
|
|
|
|
|
PROCESS 'helpers/datatables.tt';
|
|
|
-%]
|
|
|
|
|
|
[% IF edit_flag -%]
|
|
|
[%
|
|
|
PROCESS "helpers/modal.tt";
|
|
|
modal_header(m.name = weekday.name);
|
|
|
-%]
|
|
|
|
|
|
<div class="modal-body">
|
|
|
[% FOREACH r IN weekday.ranges %]
|
|
|
<div class="row-fluid">
|
|
|
<input type="text" value="[% r.start %]" disabled="disabled" class="ngcp_time_range"> –
|
|
|
<input type="text" value="[% r.end %]" disabled="disabled" class="ngcp_time_range">
|
|
|
<a class="btn btn-primary pull-right" href="?delete=[% r.id %]"><i class="icon-trash"></i></a>
|
|
|
</div>
|
|
|
[% END %]
|
|
|
<div class="row-fluid">
|
|
|
<form action="[% form.action || c.uri_for(c.action,c.req.captures) %]" method="POST">
|
|
|
[% form.field('start').render %] –
|
|
|
[% form.field('end').render %]
|
|
|
[% form.field('add').render %]
|
|
|
</form>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
[%
|
|
|
modal_footer();
|
|
|
modal_script(m.close_target = c.uri_for_action('/billing/peaktimes', [c.req.captures.0]));
|
|
|
-%]
|
|
|
[% END -%]
|
|
|
[% # vim: set tabstop=4 syntax=html expandtab: -%]
|