forked from ElixirTeSS/TeSS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_header.html.erb
More file actions
101 lines (92 loc) · 3.68 KB
/
Copy path_header.html.erb
File metadata and controls
101 lines (92 loc) · 3.68 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
98
99
100
101
<header class="unified-header">
<%# header notice -%>
<% if TeSS::Config.header_notice&.strip.present? %>
<nav class="header-notice">
<div class="container">
<div class="text-center">
<%== TeSS::Config.header_notice %>
</div>
</div>
</nav>
<% end %>
<nav class="navbar navbar-default">
<div class="container-fluid" id="header-container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar-collapse" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<% if current_space.image? %>
<%= image_tag(current_space.image.url, alt: current_space.logo_alt) %>
<% else %>
<%= current_space.title %>
<% end %>
</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<%# User Options -%>
<ul class="user-options nav navbar-nav navbar-right">
<% if user_signed_in? %>
<%= render partial: 'layouts/user_menu' %>
<% else %>
<%= render partial: 'layouts/login_menu' %>
<% end %>
</ul>
<%# Menu -%>
<%
tabs = [
{ feature: 'about', link: about_path },
{ feature: 'events', link: events_path },
{ feature: 'materials', link: materials_path },
{ feature: 'elearning_materials', link: elearning_materials_path },
{ feature: 'learning_paths', link: learning_paths_path },
{ feature: 'workflows', link: workflows_path },
{ feature: 'collections', link: collections_path },
{ feature: 'trainers', link: trainers_path },
{ feature: 'content_providers', link: content_providers_path },
{ feature: 'nodes', link: nodes_path }
].select do |t|
t[:feature] == 'about' || TeSS::Config.feature[t[:feature]]
end.sort_by do |t|
TeSS::Config.site['tab_order'].index(t[:feature]) || 99
end
directory_tabs, main_tabs = tabs.partition { |t| TeSS::Config.site['directory_tabs']&.include?(t[:feature]) }
%>
<%= menu_group(pull: 'right') do %>
<% main_tabs.each do |t| %>
<%= menu_item t("features.#{t[:feature]}.short"), t[:link] %>
<% end %>
<% if directory_tabs.present? %>
<li class="dropdown directory-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
Directory <span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<% directory_tabs.each do |t| %>
<%= menu_item t("features.#{t[:feature]}.short"), t[:link] %>
<% end %>
</ul>
</li>
<% end %>
<% end %>
</div>
</div>
</nav>
<% if TeSS::Config.announcement_message&.strip.present? %>
<div class="container">
<div class="alert alert-info fade in" id="front-page-announcement">
<button class="close" data-dismiss="alert" aria-label="close">×</button>
<%== TeSS::Config.announcement_message %>
</div>
</div>
<% end %>
<div id="flash-container" class="container-fluid">
<%= flash_messages %>
</div>
</header>
<%= render(partial: 'layouts/cookie_banner') if cookie_consent.show_banner? %>