arg_realization_form.html
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<form class="argument-add-form" method="post"> {% csrf_token %}
<div class="argument-type">
{{type_form.as_p}}
{% for sheet in attr_sheets %}
<div id="subform">
{% for field in sheet.form %}
{% if "value_positions" == field.html_name %}
{{ field.label_tag }}: {{ field }}
{% if sheet.is_empty_selection_mode %}
{% else %}
<button type="button" id="{{ field.id_for_label }}-add_position_button">Dodaj pozycję</button>
<div id="{{ field.id_for_label }}-positions">
{% for position in sheet.positions %}
<p id="position">
{{ position.text_rep }}
<input id="id_value" type="hidden" name="value" value="{{ position.id }}"/>
<button type="button" id="edit-position">Edytuj</button>
<button type="button" id="remove-position">Usuń</button>
</p>
{% endfor %}
</div>
{% endif %}
{% elif "value_arguments" == field.html_name %}
{{ field.label_tag }}: {{ field }}
{% if sheet.is_empty_selection_mode %}
{% else %}
{% if main_argument or sheet.hide_add_arg_button %}
{% else %}
<button type="button" id="{{ field.id_for_label }}-add_argument_button">Dodaj typ frazy</button>
<div id="{{ field.id_for_label }}-arguments">
{% for argument in sheet.arguments %}
<p id="argument">
{{ argument.text_rep }}
<input id="id_value" type="hidden" name="value" value="{{ argument.id }}"/>
<button type="button" id="edit-argument">Edytuj</button>
<button type="button" id="remove-argument">Usuń</button>
</p>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% elif "argument" == field.html_name %}
{{ field.label_tag }}: <strong id="{{ field.id_for_label }}-argument">{{ sheet.arguments.0.text_rep }}<input id='id_value' type='hidden' name='value' value='{{ sheet.arguments.0.id }}'/></strong>
<button type="button" id="{{ field.id_for_label }}-select_argument_button">Wybierz typ frazy</button>
{% else %}
{{ field.label_tag }}: {{ field }}
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
{% if main_argument %}
{% else %}
<div class="opinion">
{{opinion_form.as_p}}
</div>
{% endif %}
<p class="lexeme-save">
{% if main_argument %}
{% else %}
<button type="submit" id="add-realization">
Zapisz
</button>
{% endif %}
</p>
</form>