OLD | NEW |
(Empty) | |
| 1 [define title]New Issue[end] |
| 2 [define category_css]css/ph_detail.css[end] |
| 3 [include "../framework/master-header.ezt" "showtabs"] |
| 4 |
| 5 [# Note: base permission for this page is CreateIssue] |
| 6 |
| 7 [if-any read_only][include "../framework/read-only-rejection.ezt"] |
| 8 [else] |
| 9 |
| 10 <div style="margin-top: 0; padding: 3px;" class="closed"> |
| 11 <form action="entry.do" method="POST" style="margin: 0; padding: 0" enctype="mu
ltipart/form-data" id="create_issue_form"> |
| 12 <input type="hidden" name="token" value="[form_token]"> |
| 13 <input type="hidden" name="template_name" value="[template_name]"> |
| 14 <input type="hidden" name="star" id="star_input" value="1"> |
| 15 <table cellpadding="0" cellspacing="0" border="0"> |
| 16 <tr><td> |
| 17 |
| 18 <table cellspacing="0" cellpadding="3" border="0" class="rowmajor vt"> |
| 19 [if-any offer_templates] |
| 20 <tr><th><label for="template_name">Template:</label></th> |
| 21 <td><select name="template_name" id="template_name" data-project-name="[p
rojectname]"> |
| 22 [for config.templates] |
| 23 [if-any config.templates.can_view] |
| 24 <option value="[config.templates.name]" [is config.templates.name temp
late_name]selected=selected[end]>[config.templates.name]</option> |
| 25 [end] |
| 26 [end] |
| 27 </td> |
| 28 </tr> |
| 29 [end] |
| 30 |
| 31 <tr><th><label for="summary">Summary:</label></th> |
| 32 <td colspan="2" class="inplace"> |
| 33 <input type="text" id="summary" name="summary" value="[initial_summary]"
required data-clear-summary-on-click="[clear_summary_on_click]"> |
| 34 [if-any errors.summary] |
| 35 <div class="fielderror">[errors.summary]</div> |
| 36 [end] |
| 37 </td> |
| 38 </tr> |
| 39 |
| 40 <tr><th rowspan="3"><label for="comment">Description:</label></th> |
| 41 <td colspan="2"> |
| 42 <textarea style="width:100%" cols="80" rows="15" name="comment" id="comm
ent" class="issue_text" required>[initial_description] |
| 43 </textarea> [# We want 1 final newline but 0 trailing spaces in the textarea] |
| 44 [if-any errors.comment] |
| 45 <div class="fielderror">[errors.comment]</div> |
| 46 [end] |
| 47 </td> |
| 48 </tr> |
| 49 |
| 50 <tr><td colspan="2"> |
| 51 <div id="attachmentareadeventry"></div> |
| 52 </td></tr> |
| 53 |
| 54 <tr> |
| 55 <td style="width: 12em"> |
| 56 [if-any allow_attachments] |
| 57 <span id="attachprompt"><img width="16" height="16" src="/static/images
/paperclip.png" border="0" alt="A paperclip"> |
| 58 <a href="#" id="attachafile">Attach a file</a></span> |
| 59 <div id="attachmaxsize" style="margin-left:1.2em; display:none">Max. at
tachments: [max_attach_size]</div> |
| 60 [if-any errors.attachments] |
| 61 <div class="fielderror">[errors.attachments]</div> |
| 62 [end] |
| 63 [else] |
| 64 <div style="color:#666">Issue attachment storage quota exceeded.</div> |
| 65 [end] |
| 66 </td> |
| 67 <td id="star_cell"> |
| 68 [# Note: if the user is permitted to enter an issue, they are permitted
to star it.] |
| 69 <a class="star" id="star" style="color:cornflowerblue;">★</a> |
| 70 Notify me of issue changes, if enabled in <a id="settings" target="new"
href="/hosting/settings">settings</a> |
| 71 </td> |
| 72 </tr> |
| 73 |
| 74 <tr [if-any page_perms.EditIssue page_perms.EditIssueStatus][else]style="d
isplay:none;"[end]><th width="10%"><label for="statusenter">Status:</label></th> |
| 75 <td class="inplace" style="width: 12em"> |
| 76 <input type="text" id="statusenter" autocomplete="off" name="status" val
ue="[initial_status]"> |
| 77 </td> |
| 78 </tr> |
| 79 <tr [if-any page_perms.EditIssue page_perms.EditIssueOwner][else]style="di
splay:none;"[end]><th width="10%"><label for="ownerenter">Owner:</label></th> |
| 80 <td class="inplace" style="width: 12em"> |
| 81 <input type="text" id="ownerenter" autocomplete="off" name="owner" valu
e="[initial_owner]"> |
| 82 [if-any errors.owner] |
| 83 <div class="fielderror">[errors.owner]</div> |
| 84 [end] |
| 85 </td> |
| 86 </tr> |
| 87 |
| 88 <tr [if-any page_perms.EditIssue page_perms.EditIssueCc][else]style="displ
ay:none;"[end]><th><label for="memberenter">Cc:</label></th> |
| 89 <td colspan="2" class="inplace"> |
| 90 <input type="text" multiple id="memberenter" autocomplete="off" name="cc
" value="[initial_cc]"> |
| 91 [if-any errors.cc] |
| 92 <div class="fielderror">[errors.cc]</div> |
| 93 [end] |
| 94 </td> |
| 95 </tr> |
| 96 |
| 97 [# TODO(jrobbins): page_perms.EditIssueComponent] |
| 98 <tr [if-any page_perms.EditIssue][else]style="display:none;"[end]><th><lab
el for="components">Components:</label></th> |
| 99 <td colspan="2" class="inplace"> |
| 100 <input type="text" id="components" autocomplete="off" name="components"
value="[initial_components]"> |
| 101 [if-any errors.components] |
| 102 <div class="fielderror">[errors.components]</div> |
| 103 [end] |
| 104 </td> |
| 105 </tr> |
| 106 |
| 107 <tbody [if-any page_perms.EditIssue][else]style="display:none;"[end] class
="collapse"> |
| 108 [define any_fields_to_reveal]No[end] |
| 109 [for fields] |
| 110 [if-any fields.applicable] |
| 111 [# TODO(jrobbins): determine applicability dynamically and update field
s in JS] |
| 112 <tr [if-any fields.display][else]class="ifExpand"[define any_fields_to_
reveal]Yes[end][end]> |
| 113 <th>[fields.field_name]:</th> |
| 114 <td colspan="2"> |
| 115 [include "field-value-widgets.ezt" fields.field_def.is_multivalued_b
ool] |
| 116 <div class="fielderror" style="display:none" id="error_custom_[field
s.field_id]"></div> |
| 117 </td> |
| 118 <tr> |
| 119 [end] |
| 120 [end] |
| 121 [is any_fields_to_reveal "Yes"] |
| 122 <tr class="ifCollapse"> |
| 123 <td colspan="2"><a href="#" class="toggleCollapse">Show all fields</a><
t/td> |
| 124 </tr> |
| 125 [end] |
| 126 </tbody> |
| 127 |
| 128 <tr [if-any page_perms.EditIssue][else]style="display:none;"[end]><th><lab
el for="label0">Labels:</label></th> |
| 129 <td colspan="2" class="labelediting"> |
| 130 [include "label-fields.ezt" "just-two"] |
| 131 </td> |
| 132 </tr> |
| 133 |
| 134 <tr [if-any page_perms.EditIssue][else]style="display:none;"[end]><th styl
e="white-space:nowrap"><label for="blocked_on">Blocked on:</label></th> |
| 135 <td class="inplace" colspan="2"> |
| 136 <input type="text" name="blocked_on" id="blocked_on" value="[initial_blo
cked_on]"> |
| 137 [if-any errors.blocked_on] |
| 138 <div class="fielderror">[errors.blocked_on]</div> |
| 139 [end] |
| 140 </td> |
| 141 </tr> |
| 142 <tr [if-any page_perms.EditIssue][else]style="display:none;"[end]><th><lab
el for="blocking">Blocking:</label></th> |
| 143 <td class="inplace" colspan="2"> |
| 144 <input type="text" name="blocking" id="blocking" value="[initial_blockin
g]" /> |
| 145 [if-any errors.blocking] |
| 146 <div class="fielderror">[errors.blocking]</div> |
| 147 [end] |
| 148 </td> |
| 149 </tr> |
| 150 |
| 151 [if-any show_captcha] |
| 152 <tr><th style="white-space:nowrap">Human Verification:</th> |
| 153 <td colspan="2"> |
| 154 [include "../framework/captcha-field.ezt"] |
| 155 </td> |
| 156 </tr> |
| 157 [end] |
| 158 |
| 159 [include "../framework/label-validation-row.ezt"] |
| 160 [include "../framework/component-validation-row.ezt"] |
| 161 </table> |
| 162 |
| 163 <div style="padding:6px"> |
| 164 <input type="submit" id="submit_btn" name="btn" value="Submit issue"> |
| 165 <input type="button" id="discard" name="nobtn" value="Discard"> |
| 166 </div> |
| 167 |
| 168 </td> |
| 169 </tr> |
| 170 </table> |
| 171 </form> |
| 172 </div> |
| 173 |
| 174 <div id="helparea"></div> |
| 175 |
| 176 [include "../framework/footer-script.ezt"] |
| 177 |
| 178 <script type="text/javascript" nonce="[nonce]"> |
| 179 runOnLoad(function() { |
| 180 |
| 181 if ($("template_name")) { |
| 182 $("template_name").addEventListener("change", function(event) { |
| 183 _switchTemplate(event.target.getAttribute("data-project-name"), |
| 184 event.target.value) |
| 185 }); |
| 186 } |
| 187 |
| 188 if ($("summary")) { |
| 189 var clearSummaryOnClick = $("summary").getAttribute("data-clear-summary-on-c
lick"); |
| 190 if (clearSummaryOnClick) { |
| 191 $("summary").addEventListener("keydown", function(event) { |
| 192 _clearOnFirstEvent(); |
| 193 }); |
| 194 } |
| 195 $("summary").addEventListener("click", function(event) { |
| 196 if (clearSummaryOnClick) { |
| 197 _clearOnFirstEvent(); |
| 198 } |
| 199 checksubmit(); |
| 200 }); |
| 201 $("summary").addEventListener("focus", function(event) { |
| 202 _acrob(null); |
| 203 _acof(event); |
| 204 }); |
| 205 $("summary").addEventListener("keyup", function(event) { |
| 206 _dirty(); |
| 207 checksubmit(); |
| 208 return true; |
| 209 }); |
| 210 } |
| 211 |
| 212 if ($("comment")) { |
| 213 $("comment").addEventListener("keyup", function(event) { |
| 214 _dirty(); |
| 215 return true; |
| 216 }); |
| 217 } |
| 218 if ($("settings")) { |
| 219 $("settings").addEventListener("focus", function(event) { |
| 220 _acrob(null); |
| 221 }); |
| 222 } |
| 223 if ($("statusenter")) { |
| 224 $("statusenter").addEventListener("focus", function(event) { |
| 225 _acof(event); |
| 226 }); |
| 227 $("statusenter").addEventListener("keyup", function(event) { |
| 228 _dirty(); |
| 229 return _confirmNovelStatus(event.target); |
| 230 }); |
| 231 } |
| 232 |
| 233 if ($("submit_btn")) { |
| 234 $("submit_btn").addEventListener("focus", function(event) { |
| 235 _acrob(null); |
| 236 }); |
| 237 $("submit_btn").addEventListener("click", function(event) { |
| 238 _acrob(null); |
| 239 _trimCommas(); |
| 240 userMadeChanges = false; |
| 241 TKR_isDirty = false; |
| 242 }); |
| 243 } |
| 244 if ($("discard")) { |
| 245 $("discard").addEventListener("focus", function(event) { |
| 246 _acrob(null); |
| 247 }); |
| 248 $("discard").addEventListener("click", function(event) { |
| 249 _acrob(null); |
| 250 _confirmDiscardEntry(event.target); |
| 251 event.preventDefault(); |
| 252 }); |
| 253 } |
| 254 |
| 255 window.allowSubmit = true; |
| 256 $("create_issue_form").addEventListener("submit", function() { |
| 257 if (allowSubmit) { |
| 258 allowSubmit = false; |
| 259 $("submit_btn").value = "Creating issue..."; |
| 260 $("submit_btn").disabled = "disabled"; |
| 261 } |
| 262 else { |
| 263 event.preventDefault(); |
| 264 } |
| 265 }); |
| 266 |
| 267 var _blockIdsToListeners = [[]"blocked_on", "blocking"]; |
| 268 for (var i = 0; i < _blockIdsToListeners.length; i++) { |
| 269 var id = _blockIdsToListeners[[]i]; |
| 270 if ($(id)) { |
| 271 $(id).addEventListener("focus", function(event) { |
| 272 _acrob(null); |
| 273 _acof(event); |
| 274 }); |
| 275 $(id).addEventListener("keyup", function(event) { |
| 276 _dirty(); |
| 277 return true; |
| 278 }); |
| 279 } |
| 280 } |
| 281 |
| 282 var _idsToAddDefaultListeners = [[]"ownerenter", "memberenter", "components"]; |
| 283 for (var i = 0; i < _idsToAddDefaultListeners.length; i++) { |
| 284 var id = _idsToAddDefaultListeners[[]i]; |
| 285 if ($(id)) { |
| 286 $(id).addEventListener("focus", function(event) { |
| 287 _acof(event); |
| 288 }); |
| 289 $(id).addEventListener("keyup", function(event) { |
| 290 _dirty(); |
| 291 return true; |
| 292 }); |
| 293 } |
| 294 } |
| 295 |
| 296 if ($("attachafile")) { |
| 297 $("attachafile").addEventListener("click", function(event) { |
| 298 _addAttachmentFields("attachmentareadeventry"); |
| 299 event.preventDefault(); |
| 300 }); |
| 301 } |
| 302 |
| 303 window.userMadeChanges = false; |
| 304 var inputs = document.querySelectorAll('input[type~="text"], textarea'); |
| 305 for (var i = 0; i < inputs.length; i++) { |
| 306 var el = inputs[[]i]; |
| 307 el.addEventListener("input", function(event) { |
| 308 if (event.target.id != "searchq") { |
| 309 userMadeChanges = true; |
| 310 } |
| 311 }); |
| 312 } |
| 313 |
| 314 window.onbeforeunload = function() { |
| 315 if (userMadeChanges || TKR_isDirty) { |
| 316 return "You have unsaved changes. Leave this page and discard them?"; |
| 317 } |
| 318 }; |
| 319 |
| 320 _lfidprefix = 'labelenter'; |
| 321 _onload(); |
| 322 [if-any any_errors] |
| 323 function _clearOnFirstEvent(){} |
| 324 [else] |
| 325 document.getElementById('summary').select(); |
| 326 [end] |
| 327 |
| 328 _fetchOptions("[projectname]", "issueOptions", |
| 329 CS_env.token, [project.cached_content_timestamp]); |
| 330 [if-any page_perms.EditIssue page_perms.EditIssueStatus page_perms.EditIssueOw
ner page_perms.EditIssueCc] |
| 331 setTimeout(_forceProperTableWidth, 100); |
| 332 [end] |
| 333 |
| 334 [if-any page_perms.EditIssue] |
| 335 _exposeExistingLabelFields(); |
| 336 [end] |
| 337 |
| 338 var field_error; |
| 339 [if-any errors.custom_fields] |
| 340 [for errors.custom_fields] |
| 341 field_error = document.getElementById('error_custom_' + [errors.custom_fie
lds.field_id]); |
| 342 field_error.innerText = "[errors.custom_fields.message]"; |
| 343 field_error.style.display = ""; |
| 344 [end] |
| 345 [end] |
| 346 |
| 347 |
| 348 |
| 349 function checksubmit() { |
| 350 var restrict_to_known = [if-any restrict_to_known]true[else]false[end]; |
| 351 var confirmmsg = document.getElementById('confirmmsg'); |
| 352 var cg = document.getElementById('cg'); |
| 353 var label_blocksubmitmsg = document.getElementById('blocksubmitmsg'); |
| 354 var component_blocksubmitmsg = document.getElementById('component_blocksubmitm
sg'); |
| 355 |
| 356 // Check for templates that require components. |
| 357 var component_required = [if-any component_required]true[else]false[end]; |
| 358 var components = document.getElementById('components'); |
| 359 if (components && component_required && components.value == "") { |
| 360 component_blocksubmitmsg.innerText = "You must specify a component for this
template."; |
| 361 } else { |
| 362 component_blocksubmitmsg.innerText = ""; |
| 363 } |
| 364 |
| 365 var submit = document.getElementById('submit_btn'); |
| 366 var summary = document.getElementById('summary'); |
| 367 if ((restrict_to_known && confirmmsg && confirmmsg.innerText) || |
| 368 (label_blocksubmitmsg && label_blocksubmitmsg.innerText) || |
| 369 (component_blocksubmitmsg && component_blocksubmitmsg.innerText) || |
| 370 (cg && cg.value == "") || |
| 371 (!allowSubmit) || |
| 372 (!summary.value [if-any must_edit_summary]|| summary.value == '[format "js
"][template_summary][end]'[end])) { |
| 373 submit.disabled='disabled'; |
| 374 } else { |
| 375 submit.disabled=''; |
| 376 } |
| 377 } |
| 378 checksubmit(); |
| 379 setInterval(checksubmit, 700); [# catch changes that were not keystrokes, e.g.,
paste menu item.] |
| 380 |
| 381 $("star").addEventListener("click", function (event) { |
| 382 _TKR_toggleStarLocal($("star"), "star_input"); |
| 383 }); |
| 384 |
| 385 }); |
| 386 </script> |
| 387 |
| 388 [# TODO(jrobbins): Re-enable keystrokes on issue entry after resolving issue 303
9] |
| 389 <!-- |
| 390 <script type="text/javascript" defer src="/static/third_party/js/kibbles-1.3.3.c
omp.js" nonce="[nonce]"></script> |
| 391 <script type="text/javascript" nonce="[nonce]"> |
| 392 runOnLoad(function() { |
| 393 _setupKibblesOnEntryPage('[project_home_url]/issues/list'); |
| 394 }); |
| 395 </script> |
| 396 --> |
| 397 |
| 398 [end] |
| 399 |
| 400 [include "field-value-widgets-js.ezt"] |
| 401 [include "../framework/master-footer.ezt"] |
OLD | NEW |