Skip to content

Commit

Permalink
Moving Settings to its own section
Browse files Browse the repository at this point in the history
This section will only be seen if the settings exists for that provider
  • Loading branch information
Erez Freiberger committed Oct 18, 2017
1 parent 52c09d4 commit 19b076f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
4 changes: 4 additions & 0 deletions app/views/ems_container/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@
%hr
= render :partial => "layouts/angular/multi_auth_credentials", :locals => {:record => @ems, :ng_model => "emsCommonModel"}
%div{"ng-if" => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings') || emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')"}
%hr
= render :partial => "/layouts/angular/per_provider_settings"
= render :partial => "layouts/angular/x_edit_buttons_angular", :locals => {:record => @ems, :restful => true}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
%h3
{{ emsOptionsModel.provider_options.advanced_settings.label }}
%p
{{ emsOptionsModel.provider_options.advanced_settings.help_text }}
%provider-option-section{"ng-repeat" => "section in emsOptionsModel.provider_options.advanced_settings.settings",
"label" => "{{ section.label }}",
"help_text" => "{{ section.help_text }}",
Expand Down
20 changes: 4 additions & 16 deletions app/views/layouts/angular/_multi_auth_credentials.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
- validate_url ||= (record.id || @selected_hosts) ? "update" : "create"
- legendtext ||= _("Endpoints")
- vm_scope ||= false
- main_scope = vm_scope ? "$parent.vm" : "$parent"


#auth_tabs
%h3
= legendtext
%ul.nav.nav-tabs
= miq_tab_header('default', nil, {'ng-click' => "changeAuthTab('default')"}) do
%i{"error-on-tab" => "default", :style => "color:#cc0000"}
Expand Down Expand Up @@ -33,24 +37,8 @@
= _("Web Services")
= miq_tab_header('ipmi', nil, {'ng-click' => "changeAuthTab('ipmi')"}) do
= _("IPMI")
= miq_tab_header('proxy_settings', nil, {'ng-click' => "changeAuthTab('proxy_settings')",
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')"}) do
%i{"error-on-tab" => "hawkular", :style => "color:#cc0000"}
= _("Proxy Settings")
= miq_tab_header('advanced_settings', nil, {'ng-click' => "changeAuthTab('advanced_settings')",
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')"}) do
%i{"error-on-tab" => "hawkular", :style => "color:#cc0000"}
= _("Advanced Settings")

.tab-content
= miq_tab_content('proxy_settings', 'default', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')") do
.form-group
.col-md-12.col-md-12
= render :partial => "layouts/angular-bootstrap/provider_proxy_settings"
= miq_tab_content('advanced_settings', 'default', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')") do
.form-group
.col-md-12.col-md-12
= render :partial => "layouts/angular-bootstrap/provider_advanced_settings"
= miq_tab_content('default', 'default') do
.form-group
.col-md-12{"ng-if" => "#{ng_model}.ems_controller == 'ems_container' || " + |
Expand Down
25 changes: 25 additions & 0 deletions app/views/layouts/angular/_per_provider_settings.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#settings_tabs
%h3
= _("Settings")
%ul.nav.nav-tabs
= miq_tab_header('proxy_settings', nil, 'ng-click' => "changeAuthTab('proxy_settings')",
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')") do
%i{"error-on-tab" => "proxy_settings", :style => "color:#cc0000"}
= _("Proxy")
= miq_tab_header('advanced_settings', nil, 'ng-click' => "changeAuthTab('advanced_settings')",
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')") do
%i{"error-on-tab" => "advanced_settings", :style => "color:#cc0000"}
= _("Advanced")

.tab-content
= miq_tab_content('proxy_settings', 'proxy_settings', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')") do
.form-group
.col-md-12.col-md-12
= render :partial => "layouts/angular-bootstrap/provider_proxy_settings"
= miq_tab_content('advanced_settings', 'proxy_settings', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')") do
.form-group
.col-md-12.col-md-12
= render :partial => "layouts/angular-bootstrap/provider_advanced_settings"

:javascript
miq_tabs_init('#settings_tabs');
4 changes: 0 additions & 4 deletions app/views/static/provider_option_section.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
%h4
{{ $ctrl.label }}
%p
{{ $ctrl.helpText }}
%provider-option-field-input{"ng-repeat" => "option in $ctrl.settings",
"option" => "option",
"section-name" => "{{ $ctrl.sectionName }}"}

0 comments on commit 19b076f

Please sign in to comment.