domain: remove edit button, add preferences link

agranig/1_0_subfix
Gerhard Jungwirth 12 years ago
parent 16f82c70fa
commit 7e3f856be0

@ -22,6 +22,8 @@ Catalyst Controller.
sub list :Chained('/') :PathPart('domain') :CaptureArgs(0) {
my ($self, $c) = @_;
$c->stash(has_edit => 0);
$c->stash(has_preferences => 1);
$c->stash(template => 'domain/list.tt');
}
@ -151,6 +153,16 @@ sub ajax :Chained('list') :PathPart('ajax') :Args(0) {
$c->detach( $c->view("JSON") );
}
sub preferences :Chained('base') :PathPart('preferences') :Args(0) {
my ($self, $c) = @_;
unless ( defined($c->stash->{'domain_result'}) ) {
return;
}
$c->stash(template => 'domain/preferences.tt');
}
=head1 AUTHOR
Andreas Granig,,,

@ -10,6 +10,8 @@
helper.create_flag = create_flag;
helper.edit_object = domain;
helper.form_object = form;
helper.has_edit = has_edit;
helper.has_preferences = has_preferences;
PROCESS 'helpers/datatables.tt';
-%]

@ -0,0 +1,5 @@
[% META title = 'Domain Preferences' -%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]

@ -143,9 +143,11 @@ $(document).ready(function() {
{ "mRender": function ( data, type, full ) {
return '' +
'<div class="sw_actions pull-right">' +
[%- IF helper.has_edit != 0 %]
'<a style="display:inline;line-height:16px;" class="btn btn-small btn-primary" href="[% c.uri_for( c.controller.action_for("") ) %]/' + full[0] + '/edit">' +
'<i class="icon-edit" style="line-height:1em;margin-top:2px"></i> Edit' +
'</a>' +
[%- END %]
'<a style="display:inline;line-height:16px;margin-left:5px;" class="btn btn-small btn-secondary" href="[% c.uri_for( c.controller.action_for("") ) %]/' + full[0] + '/delete" data-confirm="Delete">' +
'<i class="icon-trash" style="line-height:1em;margin-top:2px"></i> Delete' +
'</a>' +
@ -155,6 +157,18 @@ $(document).ready(function() {
"bSortable": false
}
],
"aoColumnDefs": [
[%- IF helper.has_preferences %]
{
"aTargets": [ 0 ],
"mRender": function ( data, type, full ) {
return '<a href="[% c.uri_for( c.controller.action_for("") ) %]/'+
full[0]+
'/preferences">'+data+'</a>';
}
},
[%- END %]
],
"fnDrawCallback": function( oSettings ) {
$('.sw_actions').hide();
$('.sw_action_row').hover(

Loading…
Cancel
Save