forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_shared_form.html.haml
100 lines (97 loc) · 5.25 KB
/
_shared_form.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- @angular_form = true
.form-horizontal
%form#form_div{:name => "angularForm",
'ng-controller' => "configurationManagerFormController as vm",
'ng-show' => "vm.afterGet",
"miq-form" => true,
"model" => "vm.configurationManagerModel",
"model-copy" => "vm.modelCopy",
"form-changed" => "",
:novalidate => true}
= render :partial => "layouts/flash_msg"
%br
.form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"}
%label.col-md-2.control-label
= _("Name")
.col-md-8
%input.form-control{:type => "text",
:name => "name",
'ng-model' => "vm.configurationManagerModel.name",
:maxlength => ViewHelper::MAX_NAME_LEN,
:required => "",
"auto-focus" => ""}
%span.help-block{"ng-show" => "angularForm.name.$error.required"}
= _("Required")
.form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}", "ng-if" => "!vm.configurationManagerModel.zone_hidden"}
%label.col-md-2.control-label{"for" => "prov_zone"}
= _("Zone")
.col-md-8{"class" => @server_zones.empty? ? "has-error" : ""}
- if @server_zones.length <= 1
%input.form-control{"type" => "text",
"id" => "prov_zone",
"name" => "zone",
"ng-model" => "vm.configurationManagerModel.zone",
"maxlength" => 15,
"required" => "",
"readonly" => true,
"style" => "color: black;"}
- if @server_zones.empty?
%span.help-block
= _("No visible Zones found in current region")
- else
= select_tag('zone',
options_for_select(@server_zones.sort_by { |name, _name| name }),
"ng-model" => "vm.configurationManagerModel.zone",
"required" => "",
"selectpicker-for-select-tag" => "")
.form-group{"ng-class" => "{'has-error': angularForm.url.$invalid}"}
%label.col-md-2.control-label{"for" => "provider_url"}
= _("Url")
.col-md-8
%input.form-control{:type => "text",
:name => "url",
'ng-model' => "vm.configurationManagerModel.url",
:maxlength => ViewHelper::MAX_DESC_LEN,
"id" => "url",
:required => "",
"ng-trim" => false,
"detect_spaces" => "",
:prefix => "{{vm.prefix}}",
"main-scope" => "vm",
"reset-validation-status" => "default_auth_status"}
%span.help-block{"ng-show" => "angularForm.url.$error.required"}
= _("Required")
%span.help-block{"ng-show" => "angularForm.url.$error.detectedSpaces"}
= _("Spaces are prohibited")
.form-group
%label.col-md-2.control-label
= _("Verify Peer Certificate")
.col-md-8
%input{:type => "checkbox",
:name => "verify_ssl",
'ng-model' => "vm.configurationManagerModel.verify_ssl",
:prefix => "{{vm.prefix}}",
"main-scope" => "vm",
"reset-validation-status" => "default_auth_status"}
%hr
%h3
= _("Credentials")
%auth-credentials{'ng-show' => true,
'form-model' => 'vm.configurationManagerModel',
'model-copy' => 'vm.modelCopy',
'prefix' => '{{vm.prefix}}',
'user-required' => true,
'user-privileged' => true,
'password-required' => true,
'enable-valid-button' => 'vm.canValidateBasicInfo()',
'validate' => 'vm.validateClicked',
'post-validation-model-registry' => 'vm.postValidationModelRegistry',
'post-validation-model' => 'vm.postValidationModel',
'new-record' => 'vm.newRecord',
'check-authentication' => true}
= render :partial => "layouts/angular/generic_form_buttons"
:javascript
ManageIQ.angular.app.value('configurationManagerFormId', '#{@provider_manager.id || "new"}');
ManageIQ.angular.app.value('url', '#{url}');
ManageIQ.angular.app.value('modelName', '#{model}');
miq_bootstrap('#form_div');