phrase_expansions.html
5.13 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{% extends "base-margins.html" %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Rozwinięcia fraz" %}{% endblock %}
{% block scripts %}
<script src="{% static 'phrase_expansions/js/expansions.js' %}"></script>
{% endblock %}
{% block content2 %}
<div class="accordion my-3" id="accordion">
{% for phrase_expansions in expansions %}
<div class="card">
<div class="card-header p-3" id="heading-{{ phrase_expansions.phrase_type }}">
<h5 class="mb-0">
<a data-toggle="collapse" href="#{{ phrase_expansions.phrase_type }}" role="button" aria-expanded="false" aria-controls="{{ phrase_expansions.phrase_type }}">
{{ phrase_expansions.title }}<span class="float-right">[<span class="action">+</span>]</span>
</a>
</h5>
</div>
<div id="{{ phrase_expansions.phrase_type }}" class="collapse" aria-labelledby="heading-{{ phrase_expansions.phrase_type }}" data-parent="#accordion">
<div class="card-body">
{% if phrase_expansions.phrase_subtypes|length > 1 and phrase_expansions.phrase_type != 'comprepnp' %}
<div class="accordion" id="accordion-{{ phrase_expansions.phrase_type }}">
{% endif %}
{% for subtype_expansions in phrase_expansions.phrase_subtypes %}
{% if phrase_expansions.phrase_subtypes|length > 1 and phrase_expansions.phrase_type != 'comprepnp' %}
<div class="card">
<div class="card-header p-2" id="heading-{{ phrase_expansions.phrase_type }}-{{ subtype_expansions.phrase_subtype|slugify }}">
<h6 class="mb-0">
<a data-toggle="collapse" href="#{{ phrase_expansions.phrase_type }}-{{ subtype_expansions.phrase_subtype|slugify }}" role="button" aria-expanded="false" aria-controls="{{ phrase_expansions.phrase_type }}-{{ subtype_expansions.phrase_subtype|slugify }}">
{{ subtype_expansions.title }}<span class="float-right">[<span class="action">+</span>]</span>
</a>
</h6>
</div>
<div
id="{{ phrase_expansions.phrase_type }}-{{ subtype_expansions.phrase_subtype|slugify }}"
class="collapse"
aria-labelledby="heading-{{ phrase_expansions.phrase_type }}-{{ subtype_expansions.phrase_subtype|slugify }}"
data-parent="#accordion-{{ phrase_expansions.phrase_type }}"
>
<div class="card-body">
{% endif %}
<table class="table table-sm table-borderless border border-secondary text-dark mb-1">
<tbody>
{% for expansion in subtype_expansions.expansions %}
<tr>
{% if phrase_expansions.phrase_type == 'comprepnp' and forloop.counter == 1 %}
<th class="py-2 px-1" style="width: 13em;" scope="row" rowspan="{{ subtype_expansions.expansions|length }}">
{{ subtype_expansions.phrase_subtype }}
</th>
{% endif %}
<td class="py-2 px-1" style="width: 7em;"><img src="/static/entries/img/{{ expansion.opinion_sym }}.svg" alt="{{ expansion.opinion_str }}" width="12" height="12">
{{ expansion.opinion_str }}
</td>
{% for position in expansion.positions %}
<td class="px-0 py-0 border-top border-left border-secondary text-break">
{% for phrase in position.phrases %}
<div class="phrase px-1 py-2{% if forloop.counter > 1 %} border-top{% endif %}">
{% if phrase.desc %}
<span data-toggle="tooltip" data-placement="bottom" data-html="true" title="{{ phrase.desc }}">
{{ phrase.str }}
</span>
{% else %}
{{ phrase.str }}
{% endif %}
</div>
{% endfor %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% if phrase_expansions.phrase_subtypes|length > 1 and phrase_expansions.phrase_type != 'comprepnp' %}
</div>
</div>
</div>
{% endif %}
{% endfor %}
{% if phrase_expansions.phrase_subtypes|length > 1 and phrase_expansions.phrase_type != 'comprepnp' %}
</div><!-- accordion -->
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock %}