Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: appengine/monorail/templates/tracker/admin-templates-page.ezt

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 [define category_css]css/ph_detail.css[end]
2 [include "../framework/master-header.ezt" "showtabs"]
3
4 [if-any read_only][include "../framework/read-only-rejection.ezt"]
5 [else]
6
7 <form action="adminTemplates.do" id="adminTemplates" method="POST">
8 <input type="hidden" name="token" value="[form_token]">
9
10 <input type="hidden" name="current_template_index" id="current_template_index" value="">
11 <h4>Issue templates</h4>
12 <div class="section">
13 <table>
14 <tr><td>Choose Template:<br>
15 <select size="35" id="template_menu" style="width:14em">
16 [for config.templates]
17 [if-any config.templates.can_view perms.EditProject]
18 <option value="[config.templates.index]">[config.templates.name]</optio n>
19 [end]
20 [end]
21 </select>
22 [if-any perms.EditProject]
23 <div style="padding-top:4px; text-align:center">
24 <input type="button" name="newbtn" id="newbtn" value="New...">
25 <input type="button" name="delbtn" id="delbtn" value="Delete">
26 </div>
27 [end]
28 </td>
29 <td style="color:#666; font-weight:bold;">
30 &nbsp;&rarr;&nbsp;<br><br>
31 &nbsp;&rarr;&nbsp;<br><br>
32 &nbsp;&rarr;&nbsp;<br><br>
33 </td>
34 <td id="edit_panel" class="closed">
35 <div style="border:2px solid #c3d9ff; padding: 4px 6px;">
36 <div class="ifClosed" style="width:52em; height:46em;">Select a template f rom the list.</div>
37 <div class="ifOpened">
38 [include "admin-templates-editor-part.ezt"]
39 </div>
40 </div>
41 </td>
42 </tr>
43 </table><br>
44
45 [if-any perms.EditProject]
46 Default template for project members:
47 <select name="default_template_for_developers" id="default_template_for_deve lopers">
48 [for config.templates]
49 <option value="[config.templates.name]" [is config.templates.template_id c onfig.default_template_for_developers]selected[end]>[config.templates.name]</opt ion>
50 [end]
51 </select><br><br>
52
53 Default template for non-members:
54 <select name="default_template_for_users" id="default_template_for_users">
55 [for config.templates]
56 <option value="[config.templates.name]" [is config.templates.template_id config.default_template_for_users]selected[end]>[config.templates.name]</option>
57 [end]
58 </select>
59 [end]
60
61
62 [for config.templates]
63 [if-any config.templates.can_view perms.EditProject]
64 <input type="hidden" name="name_[config.templates.index]" id="name_[config .templates.index]"
65 value="[config.templates.name]">
66 <input type="hidden" name="template_id_[config.templates.index]" id="templ ate_id_[config.templates.index]"
67 value="[config.templates.template_id]">
68 <input type="hidden" name="members_only_[config.templates.index]" id="memb ers_only_[config.templates.index]"
69 value="[config.templates.members_only]">
70 <input type="hidden" name="summary_[config.templates.index]" id="summary_[ config.templates.index]"
71 value="[config.templates.summary]">
72 <input type="hidden" name="summary_must_be_edited_[config.templates.index] " id="summary_must_be_edited_[config.templates.index]"
73 value="[config.templates.summary_must_be_edited]">
74 <input type="hidden" name="content_[config.templates.index]" id="content_[ config.templates.index]"
75 value="[config.templates.content]">
76 <input type="hidden" name="status_[config.templates.index]" id="status_[co nfig.templates.index]"
77 value="[config.templates.status]">
78 <input type="hidden" name="owner_[config.templates.index]" id="owner_[conf ig.templates.index]"
79 value="[config.templates.ownername]">
80 <input type="hidden" name="owner_defaults_to_member_[config.templates.inde x]" id="owner_defaults_to_member_[config.templates.index]"
81 value="[config.templates.owner_defaults_to_member]">
82 <input type="hidden" name="component_required_[config.templates.index]" id ="component_required_[config.templates.index]"
83 value="[config.templates.component_required]">
84 <input type="hidden" name="components_[config.templates.index]" id="compon ents_[config.templates.index]"
85 value="[config.templates.components]">
86
87 [for config.templates.complete_field_values]
88 [# TODO(jrobbins): support specifying multiple values of multivalued fie lds]
89 <input type="hidden"
90 name="field_value_[config.templates.index]_[config.templates.comp lete_field_values.field_id]"
91 id="field_value_[config.templates.index]_[config.templates.comple te_field_values.field_id]"
92 value="[config.templates.complete_field_values.val]">
93 [end]
94
95 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_0"
96 value="[config.templates.label0]">
97 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_1"
98 value="[config.templates.label1]">
99 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_2"
100 value="[config.templates.label2]">
101 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_3"
102 value="[config.templates.label3]">
103 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_4"
104 value="[config.templates.label4]">
105 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_5"
106 value="[config.templates.label5]">
107 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_6"
108 value="[config.templates.label6]">
109 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_7"
110 value="[config.templates.label7]">
111 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_8"
112 value="[config.templates.label8]">
113 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_9"
114 value="[config.templates.label9]">
115 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_10"
116 value="[config.templates.label10]">
117 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_11"
118 value="[config.templates.label11]">
119 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_12"
120 value="[config.templates.label12]">
121 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_13"
122 value="[config.templates.label13]">
123 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_14"
124 value="[config.templates.label14]">
125 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_15"
126 value="[config.templates.label15]">
127 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_16"
128 value="[config.templates.label16]">
129 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_17"
130 value="[config.templates.label17]">
131 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_18"
132 value="[config.templates.label18]">
133 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_19"
134 value="[config.templates.label19]">
135 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_20"
136 value="[config.templates.label20]">
137 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_21"
138 value="[config.templates.label21]">
139 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_22"
140 value="[config.templates.label22]">
141 <input type="hidden" name="label_[config.templates.index]" id="label_[conf ig.templates.index]_23"
142 value="[config.templates.label23]">
143 <input type="hidden" name="admin_names_[config.templates.index]" id="admin _names_[config.templates.index]"
144 value="[config.templates.admin_names]">
145 <input type="hidden" name="can_edit_[config.templates.index]" id="can_edit _[config.templates.index]"
146 value="[config.templates.can_edit]">
147 [end]
148 [end]
149
150 <br><br>
151
152 [define can_edit_any]No[end]
153 [for config.templates]
154 [if-any config.templates.can_view][if-any config.templates.can_edit]
155 [define can_edit_any]Yes[end]
156 [end][end]
157 [end]
158 [if-any perms.EditProject]
159 [define can_edit_any]Yes[end]
160 [end]
161
162 [is can_edit_any "Yes"]
163 <input type="submit" id="savechanges" name="btn" value="Save changes" class=" submit">
164 [end]
165
166 </div>[# section]
167
168 </form>
169 [end]
170
171 [include "../framework/footer-script.ezt"]
172 [include "field-value-widgets-js.ezt"]
173 <script type="text/javascript" nonce="[nonce]">
174 runOnLoad(function() {
175 function getParam(name, defaultVal){
176 if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(locatio n.search)) {
177 return decodeURIComponent(name[1]);
178 }
179 return defaultVal;
180 }
181
182 _setFieldIDs([[]
183 [for fields][fields.field_id][if-index fields last][else], [end][end]
184 ]);
185
186 [if-any perms.EditProject]
187 _templateNames.push(
188 [for config.templates]"[format "js"][config.templates.name][end]"[if-index config.templates last][else],[end][end]
189 )
190 [end]
191 if ($("template_menu") && $("template_menu").options.length > 0) {
192 var tindex = getParam('tindex', 0);
193 if (tindex >= $("template_menu").length) {
194 // If the specified template no longer exists default to the first one.
195 $("template_menu").options[[]0].selected = true;
196 } else {
197 $("template_menu").options[[]tindex].selected = true;
198 }
199 _selectTemplate(document.getElementById('template_menu'));
200 }
201
202 [# Catch changes that were not keystrokes, e.g., paste menu item.]
203 setInterval(_saveTemplate, 700);
204
205 _fetchOptions(
206 '[projectname]', 'issueOptions', CS_env.token, [project.cached_content_timest amp]);
207 _onload();
208
209 _dirty = _saveTemplate;
210
211 if ($("template_menu"))
212 $("template_menu").addEventListener("change", function() {
213 _selectTemplate($("template_menu"));
214 });
215 if ($("newbtn"))
216 $("newbtn").addEventListener("click", _newTemplate);
217 if ($("delbtn"))
218 $("delbtn").addEventListener("click", _deleteTemplate);
219
220 var acobElements = document.getElementsByClassName("acob");
221 for (var i = 0; i < acobElements.length; ++i) {
222 var el = acobElements[[]i];
223 el.addEventListener("focus", function(event) {
224 _acrob(null);
225 _acof(event);
226 });
227 }
228
229 var saveTemplateElements = document.getElementsByClassName("saveTemplate");
230 for (var i = 0; i < acobElements.length; ++i) {
231 var el = acobElements[[]i];
232 el.addEventListener("keyup", _saveTemplate);
233 el.addEventListener("change", _saveTemplate);
234 }
235 });
236 </script>
237
238 [include "../framework/master-footer.ezt"]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698