forked from ASKtraining/Training
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
259 lines (252 loc) · 13.5 KB
/
index.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
---
layout: default
title: 'Create your own training plan'
description: 'Browse modules, assemble your training sequence, and easily adjust settings. Print your plan. Ready for a successful training!'
permalink: /
---
<section class="section container">
<div class="row row-cols-2 row-cols-sm-1">
<div class="col-lg-9 col-sm-12 mt-4">
<h2 class="title pt-3">#ASKtraining</h2>
<h3>Create your custom training plan effortlessly.</h3>
<p class="introduction">Browse modules, assemble your training sequence, and easily adjust settings.<br />Print your plan. Ready for a successful training!</p>
<div class="row row-cols-2 row-cols-sm-1">
<div class="col-lg-5 col-sm-12 p-2 m-3 rounded counter">
<div class="row">
<div class="col-6">
<span class="title"><strong>Modules</strong></span>
</div>
<div class="col-6 icon text-end">
<span><i class="fas fa-cubes"></i></span>
</div>
</div>
<span class="integer">{{ site.modules | size }}</span>
</div>
<div class="col-lg-5 col-sm-12 p-2 m-3 rounded counter">
<div class="row">
<div class="col-6">
<span class="title"><strong>Resources</strong></span>
</div>
<div class="col-6 icon text-end">
<span><i class="fas fa-cube"></i>
</div>
</div>
<span class="integer">{{ site.resources | size }}</span>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-12 mt-5">
<div class="text-center px-5 pb-5"><a class="brand" href="{{ site.baseurl }}/"><img src="{{ base.url }}/assets/img/asknet-logo_transp.png" alt="#ASKnet Logo" width="100%"></a></div>
<div class="text-center"><img class="" src="{{ base.url }}/assets/img/screenshot.png" width="100%"></div>
<main class="progressbar-button">
<div class="button btn-secondary" name="submit_button" onclick="redirectCustom();"><span class="text mx-3">Plan your training →</span></div>
<div class="progress-bar"></div>
<svg x="0px" y="0px" viewBox="0 0 25 30" style="enable-background:new 0 0 25 30;">
<path class="check" class="st0" d="M2,19.2C5.9,23.6,9.4,28,9.4,28L23,2"/>
</svg>
</main>
</div>
</div>
</section>
<section class="section bg-secondary p-2" id="filters">
<div class="container">
<div class="row">
<div class="col-lg-12">
{% assign difficulty-array = "" | split: ',' %}
{% assign participant-array = "" | split: ',' %}
{% assign tag-array = "" | split: ',' %}
{% for module in site.modules %}
{% unless difficulty-array contains module.module.difficulty %}
{% if module.module.difficulty == nil %}
{% assign difficulty-array = difficulty-array | push: "Unknown" %}
{% else %}
{% assign difficulty-array = difficulty-array | push: module.module.difficulty %}
{% endif %}
{% endunless %}
{% unless participant-array contains module.module.max-participants %}
{% if module.module.max-participants == nil %}
{% assign participant-array = participant-array | push: "Unknown" %}
{% else %}
{% assign participant-array = participant-array | push: module.module.max-participants %}
{% endif %}
{% endunless %}
{% unless tag-array contains module.module.tag %}
{% if module.module.tag == nil %}
{% assign tag-array = tag-array | push: "Unknown" %}
{% else %}
{% assign module_tags = module.module.tag | split: ',' %}
{% for tag in module_tags %}
{%- assign striped_tag = tag | strip -%}
{% assign tag-array = tag-array | push: striped_tag %}
{% endfor %}
{% endif %}
{% endunless %}
{% endfor %}
{% assign difficulty-array = difficulty-array | sort | uniq %}
{% comment %} {% if difficulty-array contains "Unknown" %}
{% assign difficulty-array = difficulty-array | join: "|" | replace: "|Unknown|","|" | split: "|" | reverse | unshift: "Unknown" | reverse %}
{% endif %} {% endcomment %}
{% assign participant-array = participant-array | sort | uniq %}
{% comment %} {% if participant-array contains "Unknown" %}
{% assign participant-array = participant-array | join: "|" | replace: "|Unknown|","|" | split: "|" | reverse | unshift: "Unknown" | reverse %}
{% endif %} {% endcomment %}
{% assign tag-array = tag-array | sort | uniq %}
{% comment %} {% if tag-array contains "Unknown" %}
{% assign tag-array = tag-array | join: "|" | replace: "|Unknown|","|" | split: "|" | reverse | unshift: "Unknown" | reverse %}
{% endif %} {% endcomment %}
<div class="d-flex align-items-center bd-highlight">
<div class="dropdown bd-highlight p-2">
<button class="btn btn-sm btn-primary dropdown-toggle" data-flip="false" type="button" id="dropdownMenu2" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Difficulty-Level</button>
<div class="dropdown-menu sm mr-2 mb-2 filter-difficulty">
<button class="dropdown-item all" type="button" data-difficulty="All">All</button>
<div class="dropdown-divider"></div>
{% for difficulty in difficulty-array %}
{% case difficulty %}
{% when 1 %}
{% assign module_diff_text = 'easy' %}
{% when 2 %}
{% assign module_diff_text = 'medium' %}
{% when 3 %}
{% assign module_diff_text = 'advanced' %}
{% else %}
{% assign module_diff_text = difficulty %}
{% endcase %}
<button class="dropdown-item" type="button" data-difficulty="{{ difficulty }}">{{ module_diff_text }}</button>
{% endfor %}
</div>
</div>
<div class="dropdown p-2">
<button class="btn btn-sm btn-primary dropdown-toggle" data-flip="false" type="button" id="dropdownMenu3" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Max. Participants</button>
<div class="dropdown-menu mr-2 mb-2 filter-participant">
<button class="dropdown-item all" type="button" data-participant="All">All</button>
<div class="dropdown-divider"></div>
{% for participant in participant-array %}
<button class="dropdown-item" type="button" data-participant="{{ participant }}">{{ participant }}</button>
{% endfor %}
</div>
</div>
<div class="dropdown p-2">
<button class="btn btn-sm btn-primary dropdown-toggle" data-flip="false" type="button" id="dropdownMenu3" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Tags</button>
<div class="dropdown-menu mr-2 mb-2 filter-tag">
<button class="dropdown-item all" type="button" data-tag="All">All</button>
<div class="dropdown-divider"></div>
{% for tag in tag-array %}
<button class="dropdown-item" type="button" data-tag="{{ tag }}">{{ tag }}</button>
{% endfor %}
</div>
</div>
<div class="p-2 flex-grow-1">
<input type="search" class="form-control col-6 js-shuffle-search" id="filters-search-input" placeholder="search by module title">
</div>
<a id="reset-search" class="cursor-pointer" data-tooltip="Clear search" data-tooltip-location="top"><i class="fas fa-sync-alt"></i></a>
</div>
</div>
</div>
</div>
</section>
<section class="section album py-5 bg-light" id="module-list">
<div class="container">
<div class="row row-cols-3 row-cols-sm-2 g-3 my-shuffle-container">
{% for module in site.modules %}
{% assign tag-list = "" | split: ',' %}
{% if module.module.difficulty == nil or module.module.difficulty == "Unknown" %}
{% assign difficulty = "Unknown" %}
{% else %}
{% assign difficulty = module.module.difficulty %}
{% endif %}
{% if module.module.max-participants == nil or module.module.max-participants == "Unknown" %}
{% assign participant = "Unknown" %}
{% else %}
{% assign participant = module.module.max-participants %}
{% endif %}
{% if module.module.tag == nil or module.module.tag == "Unknown" %}
{% assign tag = "Unknown" %}
{% else %}
{% assign module_tags = module.module.tag | split: ',' %}
{% for tag in module_tags %}
{%- assign striped_tag = tag | strip -%}
{% assign tag-list = tag-list | push: striped_tag %}
{% endfor %}
{% endif %}
{% case module.module.difficulty %}
{% when 1 %}
{% assign module_diff_text2 = 'easy' %}
{% when 2 %}
{% assign module_diff_text2 = 'medium' %}
{% when 3 %}
{% assign module_diff_text2 = 'advanced' %}
{% else %}
{% assign module_diff_text2 = difficulty %}
{% endcase %}
<div id="{{ module.module.id }}" class="module-item col-lg-4 col-md-6 p-2" data-difficulties="["{{ difficulty }}"]" data-participants="["{{ participant }}"]" data-id="{{ module.module.id }}" data-tags="{{ module.module.tag }}" data-name="{{ module.module.name }}" data-description="{{ module.module.description }}">
<div class="col-12 card shadow-sm">
<div class="module-img">
<a href="{{ module.url }}" onclick='event.stopPropagation();'><img src="{{ site.baseurl }}/assets/img/modules/{{ module.module.pic-url }}" class="img-fluid d-block mx-auto"></a>
</div>
<div class="card-body module-content">
<h3 class="card-title module-item__name"><a class="card-link" href="{{ module.url }}">{{ module.module.name }}</a><a class="select-check" data-tooltip="select" data-tooltip-location="right"><i class="far fa-circle"></i></a></h3>
{% if module.module.description %}
<p class="card-text">{{ module.module.description | truncatewords: 20 | markdownify }}</p>
{% endif %}
{% if module.module.res %}
{%- assign resource_list = module.module.res | split: ',' -%}
<div class="resources">
<h4>Resources</h4>
<ul class="list-group list-group-flush">
{% for actual_res in resource_list %}
{%- assign striped_res = actual_res | strip -%}
{% for res in site.resources %}
{% if res.resource.id == striped_res %}
<li class="list-group-item"><a href="{{ res.resource.url }}" target="_blank">{{ res.resource.name }}</a></li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>
{% endif %}
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<div class="filter-participant">
<button type="button" class="btn btn-sm btn-outline-secondary" data-tooltip="Max. Participants" data-tooltip-location="top" data-participant="{{ participant }}"><i class="fas fa-users-viewfinder"></i> {{ participant }}</button>
</div>
<div class="filter-difficulty">
<button type="button" class="btn btn-sm btn-outline-secondary" data-tooltip="Difficulty-Level" data-tooltip-location="top" data-difficulty="{{ difficulty }}"><i class="fas fa-tachometer-alt"></i> {{ module_diff_text2 }}</button>
</div>
</div>
<small class="text-muted text-end mt-2">{{ module.module.license | markdownify }}</small>
</div>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<div class="filter-tag">
{%- for tag in tag-list -%}
<button type="button" class="btn btn-sm btn-primary m-1 px-2 py-1" data-tooltip="{{ tag }}" data-tooltip-location="top" data-tag="{{ tag }}">{{ tag }}</button>
{%- endfor -%}
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="col-1@sm col-1@xs my-sizer-element"></div>
</div>
</section>
<!-- Progressbar to load traininsplan-->
<script>
function toPage() {
window.location.href = sessionStorage.getItem('trainingUrl') ?? new URL('/training', window.location.href).href;
}
function redirectCustom(){
sessionStorage.removeItem(TRAINING_DATA);
sessionStorage.removeItem(SUMMARY_DATA);
sessionStorage.removeItem(ID_TRAINING_TITLE);
sessionStorage.removeItem(ID_TRAINING_DESCRIPTION);
//redirect after 5 seconds for i min pass 60000
setTimeout('toPage()', 5000);
}
</script>
<script src="{{ site.baseurl }}/assets/js/progressbar.js"></script>
<script src="{{ site.baseurl }}/assets/js/counter.js"></script>
<script src="{{ site.baseurl }}/assets/js/modules.js"></script>
<script src="{{ site.baseurl }}/assets/js/dynamicLinks.js"></script>