forked from DIVD-NL/web-csirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cases.html
134 lines (119 loc) · 3.91 KB
/
cases.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
---
title: Cases
---
{%- assign team = site.team | map: "name" -%}
{%- assign open_cases = site.cases | where : "status", "Open" |reverse -%}
{%- assign closed_cases = site.cases | where: "status", "Closed" | reverse -%}
{%- assign cases = site.cases | reverse -%}
{%- assign years = '' | split: "," -%}
{%- comment -%}Get all years{%- endcomment -%}
{%- assign current_year = 3000 -%}
{%- for c in cases -%}
{%- assign case_arr = c.divd | split: "-" -%}
{%- capture year -%}{{ case_arr[1] }}{%- endcapture -%}
{%- assign year = year | to_integer -%}
{%- if year != current_year -%}
{%- assign years = years | push: year -%}
{%- assign current_year = year -%}
{%- endif -%}
{%- endfor -%}
<div class="sidebar">
<button class="yearBtn active">Timeline</button>
{% for y in years -%}
<button class="yearBtn">{{ y }}</button>
{% endfor -%}
</div>
{%- for selected_year in years -%}
<div id="div{{ selected_year }}" class="hidden yearDiv">
<h2>Open cases</h2>
{%- for p in open_cases -%}
{%- assign case_arr = p.divd | split: "-" -%}
{%- capture year -%}{{ case_arr[1] }}{%- endcapture -%}
{%- assign year = year | to_integer -%}
{%- if year == selected_year -%}
<div class="caseitem">
<h3><a href="{{ p.url }}">{{ p.title }}</a><em>
{%- if p.author[0] -%}
{%- assign first = true -%}
{%- for case_author in p.author -%}
{%- if first -%}
{%- assign first = false -%}
{%- else -%}
,
{%- endif -%}
{%- if team contains case_author -%}
<a href='https://www.divd.nl/people/{{ case_author | uri_escape }}'>{{ case_author }}</a>
{%- else -%}
{{ case_author }}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- assign case_author = p.author | default: "anonymous" -%}
{%- if team contains case_author -%}
<a href='https://www.divd.nl/people/{{ case_author | uri_escape }}'>{{ case_author }}</a>
{%- else -%}
{{ case_author }}
{%- endif -%}
{%- endif -%}
</em>
</h3>
<div>
{%- assign checkExcerpt = p.excerpt | strip_html | split: "SUMMARY" -%}
{%- if checkExcerpt[0] -%}
{{ p.excerpt | strip_html | escape }}
{%- endif -%}
</div>
<a href="{{ p.url }}">More</a>
</div>
<hr>
{%- endif -%}
{%- endfor -%}
<h2>Closed cases</h2>
{%- for p in closed_cases -%}
{%- assign case_arr = p.divd | split: "-" -%}
{%- capture year -%}{{ case_arr[1] }}{%- endcapture -%}
{%- assign year = year | to_integer -%}
{%- if year == selected_year -%}
<div class="caseitem">
<h3><a href="{{ p.url }}">{{ p.title }}</a><em>
{%- if p.author[0] -%}
{%- assign first = true -%}
{%- for case_author in p.author -%}
{%- if first -%}
{%- assign first = false -%}
{%- else -%}
,
{%- endif -%}
{%- if team contains case_author -%}
<a href='https://www.divd.nl/people/{{ case_author | uri_escape }}'>{{ case_author }}</a>
{%- else -%}
{{ case_author }}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- assign case_author = p.author | default: "anonymous" -%}
{%- if team contains case_author -%}
<a href='https://www.divd.nl/people/{{ case_author | uri_escape }}'>{{ case_author }}</a>
{%- else -%}
{{ case_author }}
{%- endif -%}
{%- endif -%}
</em>
</h3>
<div>
{%- assign checkExcerpt = p.excerpt | strip_html | split: "SUMMARY" -%}
{%- if checkExcerpt[0] -%}
{{ p.excerpt | strip_html | escape }}
{%- endif -%}
</div>
<a href="{{ p.url }}">More</a>
</div>
<hr>
{%- endif -%}
{%- endfor -%}
</div>
{%- endfor -%}
<div id="divTimeline" class="yearDiv">
{%- include timeline_cases.html -%}
</div>
<script type="text/javascript" src="{{ "/assets/js/cases.js" | relative_url }}"></script>