blob: 944ba8b299fae3f26fa55dc4befde229800bb715 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001[# Even though this field definition says it is single-valued, the issue might have
2 multiple values if the field definition was previously multi-valued. In such a situation
3 values other than the first value are shown read-only and must be explicitly removed
4 before the comment can be submitted. ]
5
6[# If the field has no explicit values, then show an empty form element.]
7[if-any fields.values][else]
8 <input type="number" name="custom_[fields.field_id][is arg2 ""][else]_[arg2][end]" id="[arg0]_custom_[fields.field_id]" value=""
9 [is arg0 "hidden"][else]
10 [if-any arg1] required="required"[end]
11 [end]
12 [if-any fields.field_def.min_value]min="[fields.field_def.min_value]"[end]
13 [if-any fields.field_def.max_value]max="[fields.field_def.max_value]"[end]
14 style="text-align:right; width:12em" class="multivalued customfield"
15 aria-labelledby="[fields.field_id]_label">
16[end]
17
18
19[for fields.values]
20 [if-index fields.values first]
21 <input type="number" name="custom_[fields.field_id][is arg2 ""][else]_[arg2][end]" value="[fields.values.val]"
22 [is arg0 "hidden"][else]
23 [if-any arg1]required="required"[end]
24 [end]
25 [if-any fields.field_def.min_value]min="[fields.field_def.min_value]"[end]
26 [if-any fields.field_def.max_value]max="[fields.field_def.max_value]"[end]
27 style="text-align:right; width:12em" class="multivalued customfield"
28 aria-labelledby="[fields.field_id]_label">
29 [else]
30 <span>
31 <input type="number" disabled="disabled" value="[fields.values.val]"
32 style="text-align:right; width: 12em" class="multivalued customfield"
33 aria-labelledby="[fields.field_id]_label">
34 <u class="removeMultiFieldValueWidget">X</u>
35 </span>
36 [end]
37[end]
38
39[for fields.derived_values]
40 <input type="number" disabled="disabled" value="[fields.derived_values.val]"
41 style="font-style:italic; text-align:right; width:12em" class="multivalued"
42 aria-labelledby="[fields.field_id]_label">
43[end]