argument_form.html
3.41 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<form class="argument-add-form" method="post"> {% csrf_token %}
{% if propositions_form %}
<div class="argument-propositions">
{{propositions_form.as_p}}
</div>
{% endif %}
<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 or sheet.hide_add_arg_button %}
{% elif sheet.add_realization_button %}
<button type="button" id="{{ field.id_for_label }}-add_realization_button">Dodaj rozwinięcie typu 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-realization">Edytuj</button>
<button type="button" id="remove-argument">Usuń</button>
</p>
{% endfor %}
</div>
{% 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 %}
{% 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>
<p class="lexeme-save">
<button type="submit" id="add-argument-submit">
Zapisz
</button>
{% if has_realizations %}
<button type="button" id="show-realizations">
Pokaż rozwinięcia typu frazy
</button>
{% endif %}
<button type="reset" id="add-argument-cancel">
Anuluj
</button>
</p>
</form>
<div id='realizations'>
</div>