summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl
blob: 60406490f51f6c41c9214d9785dfaf599e3b0b3d (plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[% js_data = BLOCK %]
var useclassification = false;
var first_load = true;
var last_sel = [];
var cpts = new Array();
[% n = 1 %]
[% FOREACH p = user.get_selectable_products %]
  cpts['[% n FILTER js %]'] = [
    [%- FOREACH c = p.components %]'[% c.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  [% n = n+1 %]
[% END %]
var selected_components = [
  [%- FOREACH c = input.component %]'[% c FILTER js %]'
  [%- ',' UNLESS loop.last %] [%- END ~%] ];
[% END %]

[% PROCESS global/header.html.tmpl
  title = "Release Tracking Flags"
  javascript = js_data
  javascript_urls = [ 'extensions/TrackingFlags/web/js/admin.js', 'js/productform.js' ]
  style_urls = [ 'extensions/TrackingFlags/web/styles/admin.css' ]
%]

<script>
  var groups = [% groups || '[]' FILTER none %];
  var flag_values = [% values || '[]' FILTER none %];
  var flag_visibility = [% visibility || '[]' FILTER none %];
</script>

<div id="edit_mode">
  [% IF mode == 'edit' %]
    Editing <b>[% flag.name FILTER html %]</b>.
  [% ELSE %]
    New flag
  [% END %]
</div>

<form method="POST" action="page.cgi" onsubmit="return on_submit()">
<input type="hidden" name="id" value="tracking_flags_admin_edit.html">
<input type="hidden" name="mode" value="[% mode FILTER html %]">
<input type="hidden" name="flag_id" value="[% flag ? flag.flag_id : 0 FILTER html %]">
<input type="hidden" name="values" id="values" value="">
<input type="hidden" name="visibility" id="visibility" value="">
<input type="hidden" name="save" value="1">

[%# name/desc/etc %]

<table class="edit" cellspacing="0">

<tr class="header">
  <th colspan="3">Flag</th>
</tr>

<tr>
  <th>Name</th>
  <td><input name="flag_name" id="flag_name" value="[% flag.name FILTER html %]"></td>
  <td class="help">database field name</td>
</tr>

<tr>
  <th>Description</th>
  <td><input name="flag_desc" id="flag_desc" value="[% flag.description FILTER html %]"></td>
  <td class="help">visible name</td>
</tr>

<tr>
  <th>Type</th>
  <td>
    <select name="flag_type" id="flag_type">
      <option value=""></option>
      [% FOREACH type = tracking_flag_types %]
        <option value="[% type.name FILTER html %]"
                [% " selected" IF flag.flag_type == type.name %]>
          [% type.name FILTER html %]</option>
      [% END %]
    </select>
  </td>
  <td class="help">flag type used for grouping</td>
</tr>

<tr>
  <th>Sort Key</th>
  <td>
    <input name="flag_sort" id="flag_sort" value="[% flag.sortkey FILTER html %]">
    [
      <a class="txt_icon" href="#" onclick="inc_field('flag_sort', 5);return false">+5</a>
      | <a class="txt_icon" href="#" onclick="inc_field('flag_sort', -5);return false">-5</a>
    ]
  </td>
</tr>

<tr>
  <th>Enter [% terms.Bug %]</th>
  <td><input type="checkbox" name="flag_enter_bug" id="flag_enter_bug" value="1" [% "checked" IF flag.enter_bug %]></td>
  <td class="help">can be set on [% terms.bug %] creation</td>
</tr>

<tr>
  <th>Active</th>
  <td><input type="checkbox" name="flag_active" id="flag_active" value="1" [% "checked" IF flag.is_active %]></td>
</tr>

[% IF mode == 'edit' %]
  <tr>
    <th>[% terms.Bug %] Count</th>
    <td>[% flag.bug_count FILTER html %]</td>
  </tr>
[% END %]

</table>

[%# values %]

<table id="flag_values" class="edit" cellspacing="0">

<tr class="header">
  <th colspan="4">Values</th>
</tr>

<tr>
  <th>Value</th>
  <th>Setter</th>
  <th>Active</th>
</tr>

<tr>
  <td colspan="4">
    [ <a href="#" onclick="add_value();return false">New Value</a> ]
  </td>
</tr>

</table>

[%# visibility %]

<table id="flag_visibility" class="edit" cellspacing="0">

<tr class="header">
  <th colspan="3">Visibility</th>
</tr>

<tr>
  <th>Product</th>
  <th>Component</th>
</tr>

<tr id="flag_visibility_add">
  <td>
    <select id="product" onChange="selectProduct(Dom.get('product'), Dom.get('component'), null, null, '-- Any --')">
      <option value=""></option>
      [% FOREACH p = user.get_selectable_products %]
        <option value="[% p.name FILTER html %]"
          [% " selected" IF input.product == p.name %]>
          [% p.name FILTER html %]
        </option>
      [% END %]
    </select>
  </td>
  <td>
    <select id="component">
    </select>
  </td>
  <td>
    [ <a href="#" onclick="add_visibility();return false">Add</a> ]
  <td>
</tr>

</table>


[%# submit %]

<div>
  <input type="submit" name="submit" id="submit" value="[% mode == 'edit' ? 'Save Changes' : 'Add' %]">
  [% IF mode == "edit" && !flag.bug_count %]
    <input type="hidden" name="delete" id="delete" value="">
    <input type="submit" value="Delete Flag [% IF flag.activity_count %] and Activity[% END  %]"
          onclick="return delete_confirm('[% flag.name FILTER js FILTER html %]')">
  [% END %]
</div>

</form>

<hr>
<p>
Return to the <a href="page.cgi?id=tracking_flags_admin_list.html">list of Tracking Flags</a>.
</p>

[% INCLUDE global/footer.html.tmpl %]