Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame^] | 1 | [define title]Add a Component[end] |
| 2 | [define category_css]css/ph_detail.css[end] |
| 3 | [include "../framework/header.ezt" "showtabs"] |
| 4 | |
| 5 | <a href="/p/[projectname]/adminComponents">‹ Back to component list</a><br><br> |
| 6 | |
| 7 | |
| 8 | <h4>Add a component</h4> |
| 9 | |
| 10 | <form action="create.do" method="POST"> |
| 11 | <input type="hidden" name="token" value="[form_token]"> |
| 12 | |
| 13 | <table cellspacing="8" class="rowmajor vt"> |
| 14 | |
| 15 | <tr> |
| 16 | <th width="1%">Parent:</th> |
| 17 | <td> |
| 18 | <select name="parent_path" id="parent_path"> |
| 19 | <option value="">Top level</option> |
| 20 | [for component_defs] |
| 21 | <option value="[component_defs.path]" [if-any component_defs.selected]selected=true[end]>[component_defs.path]</option> |
| 22 | [end] |
| 23 | </select> |
| 24 | </td> |
| 25 | <td rowspan="10"> |
| 26 | <div class="tip"> |
| 27 | <p>Components should describe the structure of the software being |
| 28 | built so that issues can be related to the correct parts.</p> |
| 29 | |
| 30 | <p>Please use labels instead for releases, |
| 31 | milestones, task forces, types of issues, etc.</p> |
| 32 | |
| 33 | <p>Deprecated components won't be shown in autocomplete.</p> |
| 34 | </div> |
| 35 | </td> |
| 36 | </tr> |
| 37 | |
| 38 | <tr> |
| 39 | <th width="1%">Name:</th> |
| 40 | <td> |
| 41 | <input id="leaf_name" name="leaf_name" size="30" value="[initial_leaf_name]" |
| 42 | class="acob"> |
| 43 | <span id="leafnamefeedback" class="fielderror" style="margin-left:1em"> |
| 44 | [if-any errors.leaf_name][errors.leaf_name][end] |
| 45 | </span> |
| 46 | </td> |
| 47 | </tr> |
| 48 | |
| 49 | <tr> |
| 50 | <th>Description:</th> |
| 51 | <td> |
| 52 | <textarea name="docstring" rows="4" cols="75">[initial_docstring]</textarea> |
| 53 | </td> |
| 54 | </tr> |
| 55 | |
| 56 | <tr> |
| 57 | <th>Admins:</th> |
| 58 | <td> |
| 59 | <textarea id="member_admins" name="admins" rows="3" cols="75">[for initial_admins][initial_admins], [end]</textarea> |
| 60 | <span id="memberadminsfeedback" class="fielderror" style="margin-left:1em"> |
| 61 | [if-any errors.member_admins][errors.member_admins][end] |
| 62 | </span> |
| 63 | </td> |
| 64 | </tr> |
| 65 | |
| 66 | <tr> |
| 67 | <th>Auto Cc:</th> |
| 68 | <td> |
| 69 | <textarea id="member_cc" name="cc" rows="3" cols="75">[for initial_cc][initial_cc], [end]</textarea> |
| 70 | <span id="memberccfeedback" class="fielderror" style="margin-left:1em"> |
| 71 | [if-any errors.member_cc][errors.member_cc][end] |
| 72 | </span> |
| 73 | </td> |
| 74 | </tr> |
| 75 | |
| 76 | <tr> |
| 77 | <th>Add Labels:</th> |
| 78 | <td> |
| 79 | <textarea id="labels" name="labels" rows="3" cols="75">[for initial_labels][initial_labels], [end]</textarea> |
| 80 | <span id="labelsfeedback" class="fielderror" style="margin-left:1em"> |
| 81 | [if-any errors.labels][errors.labels][end] |
| 82 | </span> |
| 83 | </td> |
| 84 | </tr> |
| 85 | |
| 86 | <tr> |
| 87 | <th>Deprecated:</th> |
| 88 | <td> |
| 89 | <input type="checkbox" id="deprecated" name="deprecated"> |
| 90 | </td> |
| 91 | </tr> |
| 92 | |
| 93 | <tr> |
| 94 | <td></td> |
| 95 | <td> |
| 96 | <input id="submit_btn" type="submit" name="submit" value="Create component"> |
| 97 | </td> |
| 98 | </tr> |
| 99 | |
| 100 | </table> |
| 101 | </form> |
| 102 | |
| 103 | <script type="text/javascript" nonce="[nonce]"> |
| 104 | runOnLoad(function() { |
| 105 | document.getElementById('submit_btn').disabled = 'disabled'; |
| 106 | document.getElementById('leaf_name').focus(); |
| 107 | |
| 108 | function checkSubmit() { |
| 109 | _checkLeafName( |
| 110 | '[projectname]', |
| 111 | document.getElementById('parent_path').value, |
| 112 | '', CS_env.token); |
| 113 | } |
| 114 | setInterval(checkSubmit, 700); |
| 115 | |
| 116 | var acobElements = document.getElementsByClassName("acob"); |
| 117 | for (var i = 0; i < acobElements.length; ++i) { |
| 118 | var el = acobElements[[]i]; |
| 119 | el.addEventListener("focus", function(event) { |
| 120 | _acrob(null); |
| 121 | _acof(event); |
| 122 | }); |
| 123 | } |
| 124 | }); |
| 125 | </script> |
| 126 | |
| 127 | |
| 128 | |
| 129 | [include "../framework/footer.ezt"] |