blob: 225a3d2fc7b39b1f311e997def874953e20099bc [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001<table id="launch-gates-table" class="hidden">
2 <tr>
3 <th>Approval</th>
4 <th style="color:grey">gate-less</th>
5 <th><input name="phase_0" placeholder="Gate Name" size="7" [if-any allow_edit][else]disabled[end]></th>
6 <th><input name="phase_1" size="7" [if-any allow_edit][else]disabled[end]></th>
7 <th><input name="phase_2" size="7" [if-any allow_edit][else]disabled[end]></th>
8 <th><input name="phase_3" size="7" [if-any allow_edit][else]disabled[end]></th>
9 <th><input name="phase_4" size="7" [if-any allow_edit][else]disabled[end]></th>
10 <th><input name="phase_5" size="7" [if-any allow_edit][else]disabled[end]></th>
11 <th style="color:grey">omit</th>
12 </tr>
13 [for approvals]
14 <tr>
15 <td nowrap><b>[approvals.field_name]</b>
16 <br>
17 <span><input id="[approvals.field_id]_required" name="approval_[approvals.field_id]_required" type="checkbox" [if-any allow_edit][else]disabled[end]>
18 <label for="[approvals.field_id]_required">Require review</label></span>
19 </td>
20 <td><input id="[approvals.field_id]" name="approval_[approvals.field_id]" value="no_phase" type="radio" [if-any allow_edit][else]disabled[end]></td>
21 <td><input id="[approvals.field_id]_phase_0" name="approval_[approvals.field_id]" value="phase_0" type="radio" [if-any allow_edit][else]disabled[end]></td>
22 <td><input id="[approvals.field_id]_phase_1" name="approval_[approvals.field_id]" value="phase_1" type="radio" [if-any allow_edit][else]disabled[end]></td>
23 <td><input id="[approvals.field_id]_phase_2" name="approval_[approvals.field_id]" value="phase_2" type="radio" [if-any allow_edit][else]disabled[end]></td>
24 <td><input id="[approvals.field_id]_phase_3" name="approval_[approvals.field_id]" value="phase_3" type="radio" [if-any allow_edit][else]disabled[end]></td>
25 <td><input id="[approvals.field_id]_phase_4" name="approval_[approvals.field_id]" value="phase_4" type="radio" [if-any allow_edit][else]disabled[end]></td>
26 <td><input id="[approvals.field_id]_phase_5" name="approval_[approvals.field_id]" value="phase_5" type="radio" [if-any allow_edit][else]disabled[end]></td>
27 <td><input name="approval_[approvals.field_id]" value="omit" type="radio" checked="checked" [if-any allow_edit][else]disabled[end]></td>
28 </tr>
29 [end]
30</table>
31
32
33<script type="text/javascript" nonce="[nonce]">
34runOnLoad(function() {
35 let phaseNum = 0;
36 [for initial_phases]
37 document.getElementsByName(`phase_${phaseNum++}`)[0].value = '[format "js"][initial_phases.name][end]';
38 [end]
39
40 [for prechecked_approvals]
41 document.getElementById("[prechecked_approvals]").checked = "checked"
42 [end]
43
44 [for required_approval_ids]
45 document.getElementById("[required_approval_ids]_required").checked = "checked"
46 [end]
47
48});
49
50</script>