diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index e6cde7e093..171eb5c84a 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -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], ), diff --git a/lib/NGCP/Panel/Form/SubscriberCFAdvanced.pm b/lib/NGCP/Panel/Form/SubscriberCFAdvanced.pm index 72ca4b739f..fa2153b6fa 100644 --- a/lib/NGCP/Panel/Form/SubscriberCFAdvanced.pm +++ b/lib/NGCP/Panel/Form/SubscriberCFAdvanced.pm @@ -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 { diff --git a/lib/NGCP/Panel/Form/SubscriberCFSimple.pm b/lib/NGCP/Panel/Form/SubscriberCFSimple.pm index 790edf4e34..00f08d7416 100644 --- a/lib/NGCP/Panel/Form/SubscriberCFSimple.pm +++ b/lib/NGCP/Panel/Form/SubscriberCFSimple.pm @@ -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)]; diff --git a/share/static/css/main.css b/share/static/css/main.css index 45dd418181..a2695015df 100644 --- a/share/static/css/main.css +++ b/share/static/css/main.css @@ -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;