-
Notifications
You must be signed in to change notification settings - Fork 1
/
modulenav.html
95 lines (94 loc) · 5.09 KB
/
modulenav.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
{%- if include.module -%}
<div class="modulenav">
<nav class="navbar navbar-expand-md navbar-light">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".modulenav-toggleable" aria-controls="moduleNavBar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse flex-column align-items-start modulenav-toggleable" id="moduleNavBar">
<div class="nav-heading">
<div class="moduletitle">{{ include.module.title }}</div>
{%- if current_module_version -%}
<div class="btn-toolbar justify-content-between">
<div class="btn-group dropleft">
<button type="button" class="btn btn-light dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Versio {{ current_module_version.id }}
</button>
<div class="dropdown-menu">
<span class="dropdown-header">Saatavilla olevat versiot</span>
{%- assign my_ver = '/' | append: current_module_version.path | append: '/' -%}
{%- for version in include.module.versions -%}
{%- assign other_ver = '/' | append: version.path | append: '/' -%}
<a class="dropdown-item" href="{{ site.url }}{{ page.url | replace: my_ver, other_ver }}" title="{{ version.date | date: '%d.%m.%Y' }}">{{ version.id }}: {{ version.title }}</a>
{%- endfor -%}
</div>
</div>
<div class="btn-group">
<button class="btn btn-light" type="button" data-bs-toggle="collapse" data-bs-target="#moduleInfoCard" aria-expanded="false" aria-controls="moduleInfoCard">Lisätietoja</button>
</div>
</div>
<div class="collapse" id="moduleInfoCard">
<div class="card">
<div class="card-body">
Omistajuus: {{ current_module.ownership | default: 'Tuntematon' }}<br/>
{%- if current_module.github -%}
GitHub-repo: <a href="https://github.com/{{ current_module.github.owner_name }}/{{ current_module.github.repository_name }}{%- if current_module_version.git-branch -%}/tree/{{current_module_version.git-branch}}{%- endif -%}/">{{ current_module.github.owner_name }}/{{ current_module.github.repository_name }}</a> {%- if current_module_version.git-branch -%}({{current_module_version.git-branch}}){%- endif -%}<br/>
{%- endif -%}
{%- if current_module_version.dependencies -%}
{%- assign traversed = "" | split: "," -%}
Riippuvuudet:
{%- include common/moduleVersionDependencies.html moduleVersion=current_module_version traversed=traversed -%}
{%- endif -%}
</div>
</div>
</div>
{%- assign basepath = include.module.basepath | append: "/" | append: current_module_version.path -%}
{%- else -%}
{%- assign basepath = include.module.basepath -%}
{%- endif -%}
</div>
<ul class="nav flex-column align-items-start">
{%- for item in include.module.nav_items -%}
{%- capture path %}{%- include common/getNavItemPath.html item=item -%}{%- endcapture -%}
{%- if item.groupId -%}
<li class="nav-item header">
<span>{{ item.title }}</span>
</li>
{%- else -%}
{%- assign to_match = include.module.basepath | append: '-' | append: item.pageId -%}
{%- if pageId == to_match -%}
{%- assign item_class = "active" -%}
{%- else -%}
{%- assign item_class = "" -%}
{%- endif -%}
<li class="nav-item {{item_class}}">
<a class="nav-link" href="{{ site.url }}/{{ basepath }}/{{ path }}">{{ item.title }}</a>
</li>
{%- endif -%}
</li>
{%- for subitem in item.nav_items -%}
{%- assign to_match = include.module.basepath | append: '-' | append: subitem.pageId -%}
{%- if pageId == to_match -%}
{%- assign item_class = "active" -%}
{%- else -%}
{%- assign item_class = "" -%}
{%- endif -%}
{%- capture subpath -%}{%- include common/getNavItemPath.html item=subitem -%}{%- endcapture -%}
<li class="nav-item {{item_class}}">
<a class="nav-link sublevel" href="{{ site.url }}/{{ basepath}}/{{ path }}{{ subpath }}">{{ subitem.title }}</a></li>
</li>
{%- endfor -%}
{%- endfor -%}
</ul>
</div>
<div class="vertical-heading collapse modulenav-toggleable navbar-expand-md show">
<div class="moduletitle">{{ include.module.title }}{%- if current_module_version -%}— {{ current_module_version.id }}{%- endif -%}</div>
</div>
</nav>
{%- if include.module.note -%}
<div class="alert alert-info modulenav-toggleable collapse {% if page.layout != 'ea-frame' -%}show{%- endif %}" role="alert">
<b>Huomatus</b>:<br/>
{{ include.module.note }}
</div>
{%- endif -%}
</div>
{%- endif -%}