diff --git a/lib/NGCP/Panel/Controller/Billing.pm b/lib/NGCP/Panel/Controller/Billing.pm index 885282f082..ee00dfbd57 100644 --- a/lib/NGCP/Panel/Controller/Billing.pm +++ b/lib/NGCP/Panel/Controller/Billing.pm @@ -33,8 +33,6 @@ sub profile_list :Chained('/') :PathPart('billing') :CaptureArgs(0) { my $profiles_rs = $self->$dispatch_to($c); $c->stash(profiles_rs => $profiles_rs); - $c->stash(has_edit => 1); - $c->stash(has_delete => 0); $c->stash(template => 'billing/list.tt'); } @@ -134,7 +132,6 @@ sub create :Chained('profile_list') :PathPart('create') :Args(0) { sub fees_list :Chained('base') :PathPart('fees') :CaptureArgs(0) { my ($self, $c) = @_; - $c->stash(has_edit => 1); $c->stash(template => 'billing/fees.tt'); } @@ -318,7 +315,6 @@ sub zones_list :Chained('base') :PathPart('zones') :CaptureArgs(0) { $c->uri_for_action('/billing/zones', [$c->req->captures->[0]]) ); - $c->stash(has_edit => 0); $c->stash(template => 'billing/zones.tt'); } diff --git a/lib/NGCP/Panel/Controller/Domain.pm b/lib/NGCP/Panel/Controller/Domain.pm index c5a8cec9ae..1e4e15c5ae 100644 --- a/lib/NGCP/Panel/Controller/Domain.pm +++ b/lib/NGCP/Panel/Controller/Domain.pm @@ -15,7 +15,6 @@ sub auto :Does(ACL) :ACLDetachTo('/denied_page') :AllowedRole(admin) :AllowedRol sub dom_list :Chained('/') :PathPart('domain') :CaptureArgs(0) { my ($self, $c) = @_; - $c->stash(has_edit => 0); $c->stash(template => 'domain/list.tt'); } diff --git a/lib/NGCP/Panel/Controller/NCOS.pm b/lib/NGCP/Panel/Controller/NCOS.pm index 4deaa5c8d6..6d910057c4 100644 --- a/lib/NGCP/Panel/Controller/NCOS.pm +++ b/lib/NGCP/Panel/Controller/NCOS.pm @@ -21,8 +21,6 @@ sub levels_list :Chained('/') :PathPart('ncos') :CaptureArgs(0) { my $levels_rs = $self->$dispatch_to($c); $c->stash(levels_rs => $levels_rs); - $c->stash(has_edit => 1); - $c->stash(has_delete => 1); $c->stash(template => 'ncos/list.tt'); } @@ -157,8 +155,6 @@ sub pattern_list :Chained('base') :PathPart('pattern') :CaptureArgs(0) { return; } - $c->stash(has_edit => 1); - $c->stash(has_delete => 1); $c->stash(template => 'ncos/pattern_list.tt'); } diff --git a/lib/NGCP/Panel/Controller/Peering.pm b/lib/NGCP/Panel/Controller/Peering.pm index 3edc735856..95c651dc26 100644 --- a/lib/NGCP/Panel/Controller/Peering.pm +++ b/lib/NGCP/Panel/Controller/Peering.pm @@ -20,8 +20,6 @@ sub group_list :Chained('/') :PathPart('peering') :CaptureArgs(0) { NGCP::Panel::Utils::check_redirect_chain(c => $c); - $c->stash(has_edit => 1); - $c->stash(has_delete => 1); $c->stash(template => 'peering/list.tt'); } diff --git a/lib/NGCP/Panel/Controller/Rewrite.pm b/lib/NGCP/Panel/Controller/Rewrite.pm index d22a32376b..46c337f7d3 100644 --- a/lib/NGCP/Panel/Controller/Rewrite.pm +++ b/lib/NGCP/Panel/Controller/Rewrite.pm @@ -16,8 +16,6 @@ sub auto :Does(ACL) :ACLDetachTo('/denied_page') :AllowedRole(admin) :AllowedRol sub set_list :Chained('/') :PathPart('rewrite') :CaptureArgs(0) { my ( $self, $c ) = @_; - $c->stash(has_edit => 1); - $c->stash(has_delete => 1); $c->stash(template => 'rewrite/set_list.tt'); } @@ -119,8 +117,6 @@ sub rules_list :Chained('set_base') :PathPart('rules') :CaptureArgs(0) { $c->stash(rules_rs => $rules_rs); $c->stash(rules_uri => $c->uri_for_action("/rewrite/rules_root", [$c->req->captures->[0]])); - $c->stash(has_edit => 1); - $c->stash(has_delete => 1); $c->stash(template => 'rewrite/rules_list.tt'); } diff --git a/share/templates/billing/fees.tt b/share/templates/billing/fees.tt index 6b59c70ef0..436517d068 100644 --- a/share/templates/billing/fees.tt +++ b/share/templates/billing/fees.tt @@ -10,7 +10,6 @@ helper.create_flag = create_flag; helper.edit_flag = edit_fee_flag; helper.form_object = form; - helper.has_edit = has_edit; helper.ajax_uri = c.uri_for_action('/billing/fees_ajax', [c.req.captures.0]); helper.tmpuri = c.uri_for( profile.id, 'fees'); diff --git a/share/templates/billing/peaktimes.tt b/share/templates/billing/peaktimes.tt index 63c61a2854..2e05a612a8 100644 --- a/share/templates/billing/peaktimes.tt +++ b/share/templates/billing/peaktimes.tt @@ -58,12 +58,19 @@ helper.create_flag = peaktimes_special_createflag; helper.edit_flag = peaktimes_special_editflag; - helper.has_edit = 1; helper.ajax_uri = c.uri_for_action("/billing/peaktime_specials_ajax", [c.req.captures.0]); - helper.base_uri = c.uri_for(c.req.captures.0, "peaktimes","date"); 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[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = helper.tmpuri _ "/'+full[0]+'/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'; -%] diff --git a/share/templates/billing/zones.tt b/share/templates/billing/zones.tt index c108f787b8..517a09909b 100644 --- a/share/templates/billing/zones.tt +++ b/share/templates/billing/zones.tt @@ -9,7 +9,6 @@ helper.create_flag = create_flag; helper.edit_flag = edit_fee_flag; helper.form_object = form; - helper.has_edit = has_edit; helper.ajax_uri = c.uri_for_action( '/billing/zones_ajax',[c.req.captures.0] ); helper.tmpuri = c.uri_for( profile.id, 'zones'); diff --git a/share/templates/domain/list.tt b/share/templates/domain/list.tt index 7bebb0aaea..bd5a79e8f6 100644 --- a/share/templates/domain/list.tt +++ b/share/templates/domain/list.tt @@ -10,10 +10,15 @@ helper.create_flag = create_flag; helper.edit_flag = edit_flag; helper.form_object = form; - helper.has_edit = has_edit; helper.ajax_uri = c.uri_for( c.controller.action_for('ajax') ); - helper.base_uri = c.uri_for( c.controller.action_for("") ); - helper.extra_buttons = [["Preferences", "preferences"]]; + + helper.dt_buttons = [ + { name = 'Delete', uri = "/domain/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + { name = 'Preferences', uri = "/domain/'+full[0]+'/preferences", class = 'btn-small btn-tertiary', icon = 'icon-list' }, + ]; + helper.top_buttons = [ + { name = 'Create Domain', uri = c.uri_for('/domain/create'), icon = 'icon-star' }, + ]; PROCESS 'helpers/datatables.tt'; -%] diff --git a/share/templates/domain/preferences.tt b/share/templates/domain/preferences.tt index 9d6aae6a8b..5c4d6e879d 100644 --- a/share/templates/domain/preferences.tt +++ b/share/templates/domain/preferences.tt @@ -11,6 +11,10 @@ helper.form = form; helper.base_uri = c.uri_for(domain.id,'preferences'); + helper.top_buttons = [ + { name = 'Back', uri = c.uri_for(), icon = 'icon-arrow-left' }, + ]; + PROCESS 'helpers/pref_table.tt'; %] diff --git a/share/templates/helpers/datatables.tt b/share/templates/helpers/datatables.tt index d9e1fe1063..19e94ea12b 100644 --- a/share/templates/helpers/datatables.tt +++ b/share/templates/helpers/datatables.tt @@ -28,7 +28,8 @@ $(document).ready(function() { return '' + '