-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erez Freiberger
committed
Jul 13, 2017
1 parent
1ab3b9b
commit 753aad9
Showing
5 changed files
with
66 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 9 additions & 21 deletions
30
app/views/layouts/angular-bootstrap/_provider_settings.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,17 @@ | ||
- ng_show ||= true | ||
- validate_url ||= 'log_depot_edit' | ||
- prefix ||= 'log' | ||
- prefix ||= 'provider_options' | ||
- vm_scope ||= false | ||
- main_scope = vm_scope ? "$parent.vm" : "$parent" | ||
|
||
|
||
%div{"ng-controller" => "emsCommonFormController as vm", "vm-scope" => "$parent.vm.model ? $parent.vm : $parent"} | ||
- textual_provider_settings_api.each do |section_name, settings_section| | ||
- textual_advanced_settings_api.each do |section_name, settings_section| | ||
%h4 | ||
= section_name.to_s.titleize | ||
- settings_section.each do |option_name, option| | ||
%div{"ng-show" => "#{ng_show}"} | ||
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_#{option_name}.$invalid}"} | ||
%label.col-md-2.control-label{"for" => "#{prefix}_#{option_name}"} | ||
= option_name.to_s.titleize | ||
.col-md-4 | ||
- hash_for_options = {"type" => "text", | ||
"id" => "#{prefix}_#{section_name}_#{option_name}", | ||
"name" => "#{prefix}_#{section_name}_#{option_name}", | ||
"ng-model" => "#{main_scope}.#{ng_model}.provider_options.#{section_name}.#{option_name}", | ||
"checkchange" => "", | ||
"ng-trim" => false, | ||
"detect_spaces" => "", | ||
"placeholder" => option[:global_default], | ||
"prefix" => "#{prefix}"} | ||
%input.form-control{hash_for_options} | ||
%span.help-block{"ng-show" => "angularForm.#{prefix}_#{option_name}.$error.detectedSpaces"} | ||
= _("Spaces are prohibited") | ||
= render :partial => "layouts/angular-bootstrap/provider_settings_section", | ||
:locals => {:ng_show => ng_show, | ||
:ng_model => ng_model, | ||
:id => id, | ||
:prefix => prefix, | ||
:section_name => section_name, | ||
:settings_section => settings_section} |
23 changes: 23 additions & 0 deletions
23
app/views/layouts/angular-bootstrap/_provider_settings_section.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
- ng_show ||= true | ||
- prefix ||= 'provider_options' | ||
- vm_scope ||= false | ||
- main_scope = vm_scope ? "$parent.vm" : "$parent" | ||
|
||
- settings_section.each do |option_name, option| | ||
%div{"ng-show" => "#{ng_show}"} | ||
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_#{option_name}.$invalid}"} | ||
%label.col-md-2.control-label{"for" => "#{prefix}_#{option_name}"} | ||
= option_name.to_s.titleize | ||
.col-md-4 | ||
- hash_for_options = {"type" => "text", | ||
"id" => "#{prefix}_#{section_name}_#{option_name}", | ||
"name" => "#{prefix}_#{section_name}_#{option_name}", | ||
"ng-model" => "#{main_scope}.#{ng_model}.provider_options.#{section_name}.#{option_name}", | ||
"checkchange" => "", | ||
"ng-trim" => false, | ||
"detect_spaces" => "", | ||
"placeholder" => option[:global_default], | ||
"prefix" => "#{prefix}"} | ||
%input.form-control{hash_for_options} | ||
%span.help-block{"ng-show" => "angularForm.#{prefix}_#{option_name}.$error.detectedSpaces"} | ||
= _("Spaces are prohibited") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters