diff --git a/share/templates/administrator/list.tt b/share/templates/administrator/list.tt index 218f2fbaad..a5d74206d4 100644 --- a/share/templates/administrator/list.tt +++ b/share/templates/administrator/list.tt @@ -11,7 +11,14 @@ helper.edit_flag = edit_flag; helper.form_object = form; helper.ajax_uri = c.uri_for( c.controller.action_for('ajax') ); - helper.base_uri = c.uri_for( c.controller.action_for("") ); + + helper.dt_buttons = [ + { name = 'Edit', uri = "/administrator/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/administrator/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + ]; + helper.top_buttons = [ + { name = 'Create Administrator', uri = c.uri_for('/administrator/create'), icon = 'icon-star' }, + ]; PROCESS 'helpers/datatables.tt'; -%] diff --git a/share/templates/contact/list.tt b/share/templates/contact/list.tt index 4b873b6416..0b8d01b025 100644 --- a/share/templates/contact/list.tt +++ b/share/templates/contact/list.tt @@ -11,7 +11,14 @@ helper.edit_flag = edit_flag; helper.form_object = form; helper.ajax_uri = c.uri_for( c.controller.action_for('ajax') ); - helper.base_uri = c.uri_for( c.controller.action_for("") ); + + helper.dt_buttons = [ + { name = 'Edit', uri = "/contact/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/contact/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + ]; + helper.top_buttons = [ + { name = 'Create Contact', uri = c.uri_for('/contact/create'), icon = 'icon-star' }, + ]; PROCESS 'helpers/datatables.tt'; -%] diff --git a/share/templates/customer/list.tt b/share/templates/customer/list.tt index 875e8692b1..b9e010ebf0 100644 --- a/share/templates/customer/list.tt +++ b/share/templates/customer/list.tt @@ -11,7 +11,15 @@ helper.edit_flag = edit_flag; helper.form_object = form; helper.ajax_uri = c.uri_for('/contract/customer/ajax'); - helper.base_uri = c.uri_for('/contract'); + + helper.dt_buttons = [ + { name = 'Edit', uri = "/contract/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/contract/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + { name = 'Details', uri = "/customer/'+full[0]+'/details", class = 'btn-small btn-tertiary' }, + ]; + helper.top_buttons = [ + { name = 'Create Customer', uri = c.uri_for('/customer/create'), icon = 'icon-star' }, + ]; PROCESS 'helpers/datatables.tt'; -%] diff --git a/share/templates/helpers/datatables.tt b/share/templates/helpers/datatables.tt index 2b50979cf1..d9e1fe1063 100644 --- a/share/templates/helpers/datatables.tt +++ b/share/templates/helpers/datatables.tt @@ -26,26 +26,13 @@ $(document).ready(function() { [% END -%] { "mRender": function ( data, type, full ) { return '' + - '
' + - [%- IF helper.has_edit != 0 %] - '' + - ' Edit' + - '' + - [%- END %] - [%- IF helper.has_delete != 0 %] - '' + - ' Delete' + - '' + - [%- END %] - [%- IF helper.extra_buttons.size %] - [% FOR b IN helper.extra_buttons %] - '' + - '[% b.0 %]' + - '' + - [% END %] - [% END %] - '
'; + '
' + [% FOR button IN helper.dt_buttons -%] + + '' + + ' [% button.name %]' + + '' + [% END -%] + + '
'; }, "mData": null, "bSortable": false, @@ -70,7 +57,11 @@ $(document).ready(function() {
- Create [% helper.name %] + [% FOR button IN helper.top_buttons -%] + + [% button.name %] + + [% END -%]
[% IF helper.messages -%]
diff --git a/share/templates/helpers/pref_table.tt b/share/templates/helpers/pref_table.tt index 7a6fc1426c..a29260b65e 100644 --- a/share/templates/helpers/pref_table.tt +++ b/share/templates/helpers/pref_table.tt @@ -1,4 +1,10 @@ -< Back +
+ [% FOR button IN helper.top_buttons -%] + + [% button.name %] + + [% END -%] +
[% IF helper.messages -%]
diff --git a/share/templates/peering/list.tt b/share/templates/peering/list.tt index 633e1c236c..79933eca13 100644 --- a/share/templates/peering/list.tt +++ b/share/templates/peering/list.tt @@ -12,10 +12,14 @@ helper.has_edit = has_edit; helper.has_delete = has_delete; helper.ajax_uri = c.uri_for_action( "/peering/ajax" ); - helper.base_uri = c.uri_for_action( "/peering/root" ); - helper.extra_buttons = [ - [ 'Peering Servers/Rules', 'servers'], + helper.dt_buttons = [ + { name = 'Edit', uri = "/peering/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/peering/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + { name = 'Details', uri = "/peering/'+full[0]+'/servers", class = 'btn-small btn-tertiary', icon = 'icon-list' }, + ]; + helper.top_buttons = [ + { name = 'Create Peering Group', uri = c.uri_for('/peering/create'), icon = 'icon-star' }, ]; PROCESS 'helpers/datatables.tt'; diff --git a/share/templates/peering/preferences.tt b/share/templates/peering/preferences.tt index 8152ab71f8..1120be088f 100644 --- a/share/templates/peering/preferences.tt +++ b/share/templates/peering/preferences.tt @@ -1,7 +1,6 @@ [% site_config.title = 'Peer Host "' _ server.name _ '" – Preferences' -%] [% - #helper.name = 'Domain'; helper.messages = messages; helper.edit_preference = edit_preference; @@ -12,6 +11,13 @@ helper.base_uri = c.uri_for_action("/peering/servers_preferences_root", [c.req.captures.0, c.req.captures.1]); + helper.dt_buttons = [ + { name = 'Edit', uri = "/peering/servers_preferences_root/" _ c.req.captures.0 _ "/" _ c.req.captures.1, class = 'btn-small btn-primary', icon = 'icon-edit' }, + ]; + helper.top_buttons = [ + { name = 'Back', uri = "/peering/" _ c.req.captures.0 _ "/servers/", icon = 'icon-arrow-left' }, + ]; + PROCESS 'helpers/pref_table.tt'; %] diff --git a/share/templates/peering/servers_rules.tt b/share/templates/peering/servers_rules.tt index a77aeab5df..663e6ff0d3 100644 --- a/share/templates/peering/servers_rules.tt +++ b/share/templates/peering/servers_rules.tt @@ -12,10 +12,14 @@ helper.has_edit = 1; helper.has_delete = 1; helper.ajax_uri = c.uri_for_action( "/peering/servers_ajax", [c.req.captures.0] ); - helper.base_uri = c.uri_for_action( "/peering/servers_root", [c.req.captures.0] ); - helper.extra_buttons = [ - [ 'Preferences', 'preferences'], + helper.dt_buttons = [ + { name = 'Edit', uri = "/peering/" _ c.req.captures.0 _ "/servers/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/peering/" _ c.req.captures.0 _ "/servers/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + { name = 'Preferences', uri = "/peering/" _ c.req.captures.0 _ "/servers/'+full[0]+'/preferences", class = 'btn-small btn-tertiary', icon = 'icon-list' }, + ]; + helper.top_buttons = [ + { name = 'Create Peering Server', uri = "/peering/" _ c.req.captures.0 _ "/servers/create", icon = 'icon-star' }, ]; PROCESS 'helpers/datatables.tt'; @@ -34,10 +38,15 @@ helper.has_edit = 1; helper.has_delete = 1; helper.ajax_uri = c.uri_for_action( "/peering/rules_ajax", [c.req.captures.0] ); - helper.base_uri = c.uri_for( group.id, "rules" ); - - helper.extra_buttons = undef; + helper.dt_buttons = [ + { name = 'Edit', uri = "/peering/" _ c.req.captures.0 _ "/rules/'+full[0]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' }, + { name = 'Delete', uri = "/peering/" _ c.req.captures.0 _ "/rules/'+full[0]+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' }, + ]; + helper.top_buttons = [ + { name = 'Create Peering Rule', uri = "/peering/" _ c.req.captures.0 _ "/rules/create", icon = 'icon-star' }, + ]; + PROCESS 'helpers/datatables.tt'; -%] [% # vim: set tabstop=4 syntax=html expandtab: -%]