-
Notifications
You must be signed in to change notification settings - Fork 42
/
issuelist_embed.html
185 lines (150 loc) · 7.52 KB
/
issuelist_embed.html
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
common-css:
- "/css/main.css"
common-ext-css:
- "//stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
- "//cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css"
- "//cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/css/flag-icon.min.css"
common-googlefonts:
- "Inter:400,700,400italic,700italic"
- "Barlow:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800"
common-ext-js:
- "//code.jquery.com/jquery-3.4.1.min.js"
- "//cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
- "//stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
- "//kit.fontawesome.com/ea542e9ca8.js"
common-js:
- "/js/main.min.js"
layout: bare
---
<div class="container-fluid">
{%- assign openissues = site.data.machgen.issuesjson | where: "state","open" -%}
{%- if page.nome_provincia != blank -%}
{%- assign geofilteredissues = openissues | where_exp: "member", "member.issue.provincia == page.nome_provincia" -%}
{%- else -%}
{%- if page.nome_regione != blank -%}
{%- assign geofilteredissues = openissues | where_exp: "member", "member.issue.regione == page.nome_regione or member.issue.regione == 'tutte'" -%}
{%- else -%}
{%- assign geofilteredissues = openissues -%}
{%- endif -%}
{%- endif -%}
{%- if page.issuecategory != blank -%}
{% assign issuecategories = "" | split: "," %}
{% assign tmpcategory = "" | split: "," %}
{%- assign tmpcategory = tmpcategory | push: page.issuecategory -%}
{%- assign tmpcategory = tmpcategory | push: site.data.cfg.issuecategories[page.issuecategory] -%}
{%- assign issuecategories = issuecategories | push: tmpcategory -%}
{%- elsif page.issuecategories != blank -%}
{% assign issuecategories = "" | split: "," %}
{% for category in page.issuecategories %}
{% assign tmpcategory = "" | split: "," %}
{%- assign tmpcategory = tmpcategory | push: category -%}
{%- assign tmpcategory = tmpcategory | push: site.data.cfg.issuecategories[category] -%}
{%- assign issuecategories = issuecategories | push: tmpcategory -%}
{% endfor %}
{%- elsif page.displayname != blank and page.markericon != blank -%}
{% assign issuecategories = "" | split: "," %}
{% assign tmpcategory = "" | split: "," %}
{%- assign tmpcategory = tmpcategory | push: "page" -%}
{%- assign tmpcategory = tmpcategory | push: page -%}
{%- assign issuecategories = issuecategories | push: tmpcategory -%}
{%- else -%}
{%- assign issuecategories = site.data.cfg.issuecategories -%}
{%- endif -%}
{%- include head.html -%}
{{content}}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css"
crossorigin=""/>
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css"
crossorigin=""/>
<script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"
crossorigin=""></script>
<style>
#map{ height: 600px; }
</style>
<div class="row">
<div class="col-md-12 col-sm-12 col-12"> <div id="map" class="w-100" style="height: 600px;"></div> </div>
{%- assign allcatfilteredissues = '' | split: '' -%}
{%- for categorytuple in issuecategories -%}
{%- assign category = categorytuple[1] -%}
{%- assign filteredissues = '' | split: '' -%}
{% for issuelabel in category["labelnames"] %}
{%- assign tmpfilteredissues = geofilteredissues | where_exp: "member","member.issue.labels contains issuelabel" -%}
{%- assign filteredissues = filteredissues | concat: tmpfilteredissues | uniq -%}
{% endfor %}
{%- assign filteredissues = filteredissues | sort: 'number' | reverse -%}
{%- if filteredissues.size > 0 -%}
<div class="row">
<div class="col-12 col-lg-12 col-md-12">
{%- assign allcatfilteredissues = allcatfilteredissues | concat: filteredissues | uniq -%}
<div class="row">
<div class="col-12 col-lg-12 col-md-12">
<h2 id="{{category['permalink']}}">{{category["displayname"]}}
{% if page.justLatestIssues %}<a href="{{category['permalink']}}" title="Vedi tutte le segnalazioni della categoria {{category['displayname']}}">{% endif %}
<span class="badge badge-pill badge-primary">
{{filteredissues.size}}
</span>
{% if page.justLatestIssues %}</a>{% endif %}
</h2>
<div class="row d-flex shuffleissues">
<div class="col-12">
{%- if page.justLatestIssues -%}
{%- assign filteredissues = filteredissues | sort: 'number' | reverse | slice: 0,5 -%}
{%- endif -%}
{% if page.justLatestIssues != true and category["subcategories"] %}
{% assign filteredissues_category = filteredissues %}
{% for subcategorytuple in category["subcategories"] %}
{% assign subcategory = subcategorytuple[0] %}
{% assign subcategoryname = subcategorytuple[1]["displayname"] %}
{%- assign filteredissues = filteredissues_category | where_exp: "member","member.issue.labels contains subcategory" -%}
{% if filteredissues.size > 0 %}
<h3 id="{{subcategory | slugify}}">{{subcategoryname}} <span class="badge badge-pill badge-primary">{{filteredissues.size}}</span></h3>
{% include issuelist_cards.html %}
{%- endif -%}
{%- endfor -%}
{% else %}
{% include issuelist_cards.html %}
{%- endif -%}
</div>
</div>
</div>
</div>
{% if category["includefooter"] != blank %}
{% assign includefooter = category["includefooter"] %}
{% include {{includefooter}} %}
{% endif %}
{%- if page.justLatestIssues -%}
<div class="row">
<div class="col-12 col-lg-12 col-md-12"><a href="{{category['permalink']}}" title="Vedi tutte le segnalazioni della categoria {{category['displayname']}}" class="btn btn-primary btn-lg">{{site.data.i18n.translations["see_all"]}} {{category["displayname"]}}</a></div>
<hr class="col-12 col-lg-12 col-md-12">
</div>
{%- endif -%}
</div>
</div>
{%- endif -%}
{%- endfor -%}
{%- if page.categorieMapAll -%}
{%- assign filteredissues = geofilteredissues -%}
{%- else -%}
{%- assign filteredissues = allcatfilteredissues -%}
{%- endif -%}
</div>
{% if page.comments %}
<div class="disqus-comments">
{% include disqus.html %}
</div>
{% endif %}
</div>
</div>
</div>
{%- include issuemap.html -%}
{%- include footer-scripts.html -%}