Add advanced time/destinations set buttons.

Also align them in one row in the modal footer.
agranig/1_0_subfix
Andreas Granig 12 years ago
parent b8eeebb2de
commit 79118bd3d7

@ -376,25 +376,17 @@ sub preferences_callforward :Chained('base') :PathPart('preferences/callforward'
# TODO: if more than one entry in $cf_mapping->voip_cf_destination_set->voip_cf_destinations,
# show advanced mode and list them all; same for time sets
say ">>>>>>>>>>>>>>>>>>>>>>>> check_form_buttons";
return if NGCP::Panel::Utils::check_form_buttons(
c => $c, form => $cf_form,
fields => {
'advanced' =>
'cf_actions.advanced' =>
$c->uri_for_action('/subscriber/preferences_callforward_advanced',
[$c->req->captures->[0]], $cf_type, 'advanced'
),
'simple' =>
$c->uri_for_action('/subscriber/preferences_callforward',
[$c->req->captures->[0]], $cf_type
),
},
back_uri => $c->uri_for($c->action, $c->req->captures)
);
say ">>>>>>>>>>>>>>>>>>>>>>>> after check_form_buttons";
if($posted && $cf_form->validated) {
try {
$c->model('DB')->schema->txn_do( sub {
@ -539,7 +531,7 @@ sub preferences_callforward_advanced :Chained('base') :PathPart('preferences/cal
return if NGCP::Panel::Utils::check_form_buttons(
c => $c, form => $cf_form,
fields => {
'simple' =>
'cf_actions.simple' =>
$c->uri_for_action('/subscriber/preferences_callforward',
[$c->req->captures->[0], $cf_type],
),

@ -60,22 +60,53 @@ has_block 'fields' => (
render_list => [qw(submitid active_callforward callforward_controls_add)],
);
has_field 'simple' => (
has_field 'cf_actions' => (
type => 'Compound',
do_label => 0,
do_wrapper => 1,
wrapper_class => [qw(row pull-right)],
);
has_field 'cf_actions.save' => (
type => 'Button',
do_label => 0,
value => 'Save',
element_class => [qw(btn btn-primary)],
wrapper_class => [qw(pull-right)],
);
has_field 'cf_actions.simple' => (
type => 'Button',
do_label => 0,
value => 'Simple',
value => 'Simple View',
element_class => [qw(btn btn-tertiary)],
wrapper_class => [qw(pull-right)],
);
has_field 'save' => (
type => 'Submit',
element_class => [qw(btn btn-primary)],
has_field 'cf_actions.edit_time_sets' => (
type => 'Button',
do_label => 0,
value => 'Manage Time Sets',
element_class => [qw(btn btn-tertiary)],
wrapper_class => [qw(pull-right)],
);
has_field 'cf_actions.edit_destination_sets' => (
type => 'Button',
do_label => 0,
value => 'Manage Destination Sets',
element_class => [qw(btn btn-tertiary)],
wrapper_class => [qw(pull-right)],
);
has_block 'actions' => (
tag => 'div',
class => [qw(modal-footer)],
render_list => [qw(simple save)],
#render_list => [qw(save simple edit_time_sets edit_destination_sets)],
render_list => [qw(cf_actions)],
);
sub build_render_list {

@ -24,20 +24,35 @@ has_field 'destination' => (
},
);
has_field 'advanced' => (
has_field 'cf_actions' => (
type => 'Compound',
do_label => 0,
do_wrapper => 1,
wrapper_class => [qw(row pull-right)],
);
has_field 'cf_actions.save' => (
type => 'Button',
do_label => 0,
value => 'Save',
element_class => [qw(btn btn-primary)],
wrapper_class => [qw(pull-right)],
);
has_field 'cf_actions.advanced' => (
type => 'Button',
do_label => 0,
value => 'Advanced',
value => 'Advanced View',
element_class => [qw(btn btn-tertiary)],
wrapper_class => [qw(pull-right)],
);
has_field 'save' => (type => 'Submit', element_class => [qw(btn btn-primary)],);
has_block 'fields' => (
tag => 'div',
class => [qw(modal-body)],
render_list => [qw(submitid destination)],
);
has_block 'actions' => (tag => 'div', class => [qw(modal-footer)], render_list => [qw(advanced save)],);
has_block 'actions' => (tag => 'div', class => [qw(modal-footer)], render_list => [qw(cf_actions)],);
sub build_render_list {
return [qw(id fields actions)];

@ -39,6 +39,8 @@ div.ngcp-modal .help-inline {
z-index: 2000 !important;
}
/* remove left margin for repeatable elements */
div.ngcp-modal div.modal-body div.control-group.hfh-rep {
margin-left: 0;
}
@ -51,6 +53,12 @@ div.ngcp-modal div.modal-body div.control-group.hfh-rep div.controls div.hfh-rep
margin-left: 180px;
}
/* align buttons in one row in modal-footer */
div.modal-footer div.control-group div.controls {
margin-left: 5px;
}
/*
div.ngcp-modal .control-group.hfh-rep .controls {
margin-left: 0;

Loading…
Cancel
Save