Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | [define category_css]css/ph_list.css[end] |
| 2 | [include "../framework/header.ezt" "showtabs"] |
| 3 | [include "../framework/js-placeholders.ezt"] |
| 4 | |
| 5 | [if-any read_only][include "../framework/read-only-rejection.ezt"] |
| 6 | [else] |
| 7 | |
| 8 | <form action="adminLabels.do" id="adminLabels" method="POST"> |
| 9 | <input type="hidden" name="token" value="[form_token]"> |
| 10 | |
| 11 | <h4>Predefined issue labels</h4> |
| 12 | <div class="section"> |
| 13 | [if-any perms.EditProject] |
| 14 | <table class="vt"> |
| 15 | <tr><td> |
| 16 | <textarea name="predefinedlabels" rows="12" cols="75" style="tab-size:18">[labels_text]</textarea> |
| 17 | [if-any errors.label_defs] |
| 18 | <div class="fielderror">[errors.label_defs]</div> |
| 19 | [end] |
| 20 | <div> |
| 21 | Each issue may have <b>at most one</b> label with each of these prefixes:<br> |
| 22 | <input type="text" size="75" name="excl_prefixes" |
| 23 | value="[for config.excl_prefixes][config.excl_prefixes][if-index config.excl_prefixes last][else], [end][end]"> |
| 24 | </div> |
| 25 | </td> |
| 26 | <td style="padding-left:.7em"> |
| 27 | <div class="tip"> |
| 28 | <b>Instructions:</b><br> List one label per line in desired sort-order.<br><br> |
| 29 | Optionally, use an equals-sign to document the meaning of each label. |
| 30 | </div> |
| 31 | </td> |
| 32 | </tr> |
| 33 | </table> |
| 34 | [else] |
| 35 | <table cellspacing="0" cellpadding="2" border="0" class="results striped" width="100%"> |
| 36 | <tr> |
| 37 | <th style="min-width:14em">Label</th> |
| 38 | <th width="100%">Meaning</th> |
| 39 | </tr> |
| 40 | [for config.issue_labels] |
| 41 | <tr> |
| 42 | <td style="white-space:nowrap; padding-right:2em; color:#363">[config.issue_labels.name]</td> |
| 43 | <td>[config.issue_labels.docstring]</td> |
| 44 | </tr> |
| 45 | [end] |
| 46 | </table> |
| 47 | [end] |
| 48 | </div> |
| 49 | |
| 50 | [if-any perms.EditProject] |
| 51 | <input type="submit" id="savechanges" name="btn" value="Save changes" class="submit"> |
| 52 | [end] |
| 53 | |
| 54 | <br> |
| 55 | <br> |
| 56 | |
| 57 | <h4>Custom fields</h4> |
| 58 | <div class="section"> |
| 59 | <table cellspacing="0" cellpadding="2" border="0" class="results striped vt" id="resultstable" width="100%"> |
| 60 | <tbody> |
| 61 | <tr> |
| 62 | <th>ID</th> |
| 63 | <th>Name</th> |
| 64 | <th>Type</th> |
| 65 | <th>Required</th> |
| 66 | <th>Multivalued</th> |
| 67 | <th>Applicable to</th> |
| 68 | <th>Description</th> |
| 69 | </tr> |
| 70 | [if-any field_defs][else] |
| 71 | <tr> |
| 72 | <td colspan="40"> |
| 73 | <div style="padding: 3em; text-align: center"> |
| 74 | This project has not defined any custom fields. |
| 75 | </div> |
| 76 | </td> |
| 77 | </tr> |
| 78 | [end] |
| 79 | [for field_defs] |
| 80 | [define detail_url]/p/[projectname]/fields/detail?field=[field_defs.field_name][end] |
| 81 | [is field_defs.type_name "INT_TYPE"][define pretty_type_name]Integer[end][end] |
| 82 | [is field_defs.type_name "ENUM_TYPE"][define pretty_type_name]Enum[end][end] |
| 83 | [is field_defs.type_name "USER_TYPE"][define pretty_type_name]User[end][end] |
| 84 | [is field_defs.type_name "STR_TYPE"][define pretty_type_name]String[end][end] |
| 85 | [is field_defs.type_name "DATE_TYPE"][define pretty_type_name]Date[end][end] |
| 86 | [is field_defs.type_name "URL_TYPE"][define pretty_type_name]Url[end][end] |
| 87 | [is field_defs.type_name "APPROVAL_TYPE"][define pretty_type_name]Approval[end][end] |
| 88 | <tr data-url="[detail_url]"> |
| 89 | <td> |
| 90 | [field_defs.field_def.field_id] |
| 91 | </td> |
| 92 | <td class="id" style="white-space:nowrap"> |
| 93 | <a href="[detail_url]">[field_defs.field_name]</a></td> |
| 94 | <td style="white-space:nowrap"> |
| 95 | [pretty_type_name] |
| 96 | </td> |
| 97 | <td style="white-space:nowrap"> |
| 98 | [if-any field_defs.is_required_bool]Required[else]Optional[end] |
| 99 | </td> |
| 100 | <td style="white-space:nowrap"> |
| 101 | [if-any field_defs.is_multivalued_bool]Multiple[else]Single[end] |
| 102 | </td> |
| 103 | <td style="white-space:nowrap"> |
| 104 | [if-any field_defs.applicable_type][field_defs.applicable_type][else]Any issue[end] |
| 105 | </td> |
| 106 | <td> |
| 107 | [field_defs.docstring_short] |
| 108 | </td> |
| 109 | </tr> |
| 110 | [end] |
| 111 | </tbody> |
| 112 | </table> |
| 113 | <div class="list-foot"></div> |
| 114 | [if-any perms.EditProject] |
| 115 | <p><a href="/p/[projectname]/fields/create" class="buttonify primary">Add field</a></p> |
| 116 | [end] |
| 117 | </div> |
| 118 | |
| 119 | </form> |
| 120 | |
| 121 | [end] |
| 122 | |
| 123 | |
| 124 | <script type="text/javascript" nonce="[nonce]"> |
| 125 | runOnLoad(function() { |
| 126 | function _handleResultsClick(event) { |
| 127 | var target = event.target; |
| 128 | if (target.tagName == "A") |
| 129 | return; |
| 130 | while (target && target.tagName != "TR") target = target.parentNode; |
| 131 | _go(target.attributes[[]"data-url"].value, |
| 132 | (event.metaKey || event.ctrlKey || event.button == 1)); |
| 133 | }; |
| 134 | _addClickListener($("resultstable"), _handleResultsClick); |
| 135 | }); |
| 136 | </script> |
| 137 | |
| 138 | [include "../framework/footer.ezt"] |