-
Notifications
You must be signed in to change notification settings - Fork 898
/
_export.html.haml
111 lines (108 loc) · 4.14 KB
/
_export.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
100
101
102
103
104
105
106
107
108
109
110
111
- url = url_for(:action => 'export_field_changed')
#profile_export_div
= render :partial => "layouts/flash_msg"
%h3
= _("Import")
- if @sb[:hide]
%table{:width => "100%"}
%tr
%td{:align => "right"}
#buttons
- if @sb[:conflict]
= button_tag(_("Commit"),
:class => "btn btn-primary disabled",
:title => (t = _("Resolve conflicts to import the file")),
:alt => t)
- else
= link_to(_('Commit'),
{:action => "export", :button => "import", :commit => true},
:class => "btn btn-primary",
:alt => (t = _("Commit Import")),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
= link_to(_('Cancel'),
{:action => "export", :button => "cancel_import"},
:class => "btn btn-default",
:alt => _("Cancel Changes"),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => _("Cancel Import"))
- else
#import_div
= form_tag({:action => "upload",
:type => "import",
:dbtype => @sb[:dbtype]},
:class => "form-horizontal",
:multipart => true,
:method => :post) do
.form-group
.col-md-4
= render :partial => "shared/file_chooser", :locals => {:object_name => "upload", :method => "file"}
:javascript
$("#upload_file").on("change", function() {
ImportSetup.setUpUploadImportButton('#upload_tags')
});
.col-md-6
= submit_tag(_("Upload"), :id => "upload_tags", :class => "btn btn-default", :disabled => true)
- if @sb[:hide] == false
%hr
%h3
= _("Export")
-# title = @sb[:dbtype] == "pp" ? "Profiles" : "Policies"
- case @sb[:dbtype]
- when "pp"
- title = "Profiles"
- when "p"
- title = "Policies"
- when "al"
- title = "Alerts"
.form-horizontal
.form-group
%label.col-md-2.control-label
= _("Export:")
.col-md-8
= select_tag('dbtype',
options_for_select([[_("Policy Profiles"), "pp"], [_("Policies"), "p"], [_("Alerts"), "al"]], @sb[:dbtype]),
:class => "selectpicker")
:javascript
miqInitSelectPicker();
miqSelectPickerEvent('dbtype', '#{url}')
.form-group
%label.col-md-2.control-label
= _("Available %{title}:") % {:title => title}
.col-md-8
%div{:style => "overflow: auto; width: 400px; border: 1px solid #999999;"}
= select_tag('choices_chosen[]',
options_for_select(@sb[:new][:choices].sort),
:class => "selected-policies",
:size => 15,
:style => "width: 400px",
:multiple => true)
%table{:width => "100%"}
%tr
%td{:align => "right"}
#buttons
- t = _("Export Selected %{title}") % {:title => title}
= link_to(_('Export'),
{:action => "export", :button => "export"},
:class => "btn btn-primary export-policies disabled",
:alt => t,
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
"data-submit" => "profile_export_div",
:remote => true,
"data-method" => :post,
:title => t)
:javascript
$('.selected-policies').change(function() {
if($(this).val()) {
$('.export-policies').removeClass('disabled');
} else {
$('.export-policies').addClass('disabled');
}
});