/
_edit_environment_variables.html.erb
56 lines (53 loc) · 2.29 KB
/
_edit_environment_variables.html.erb
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
<div class="form_content">
<div class="environment_variables_section popup_form">
<div class="plain-text-variables">
<h3><%= l.string("ENVIRONMENT_VARIABLES") %></h3>
<table class="variables">
<tbody>
<% scope[:form].object.getPlainTextVariables().each do |variable| -%>
<%= scope[:form].fields_for :variables, variable, :index => "" do |var_form| %>
<%= render :partial => "environment_variable_entry", :locals => {:scope => {:var_form => var_form, :is_secure => false, :is_changed => false}} -%>
<% end %>
<%- end -%>
</tbody>
</table>
<a class="add_item"><%= l.string("ADD") -%></a>
<table style="display: none;">
<tbody class="template">
<%= scope[:form].fields_for :variables, :index => "" do |var_form| -%>
<%= render :partial => "environment_variable_entry", :locals => {:scope => {:var_form => var_form, :is_secure => false, :is_changed => true}} -%>
<%- end -%>
</tbody>
</table>
</div>
<div class="secure-variables">
<h3><%= l.string("SECURE_ENVIRONMENT_VARIABLES") %></h3>
<table class="variables">
<tbody>
<% scope[:form].object.getSecureVariables().each do |variable| -%>
<%= scope[:form].fields_for :variables, variable, :index => "" do |var_form| %>
<%= render :partial => "environment_variable_entry", :locals => {:scope => {:var_form => var_form, :is_secure => true, :is_changed => false}} -%>
<% end %>
<%- end -%>
</tbody>
</table>
<a class="add_item"><%= l.string("ADD") -%></a>
<table style="display: none;">
<tbody class="template">
<%= scope[:form].fields_for :variables, :index => "" do |var_form| -%>
<%= render :partial => "environment_variable_entry", :locals => {:scope => {:var_form => var_form, :is_secure => true, :is_changed => true}} -%>
<%- end -%>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
(function ($) {
$(function () {
EnvironmentVariableEdit({tableRowSelector: '.environment-variable-edit-row'});
EnvironmentVariableAddRemove($('.secure-variables'));
EnvironmentVariableAddRemove($('.plain-text-variables'));
});
})(jQuery);
</script>