-
Notifications
You must be signed in to change notification settings - Fork 10
/
_navbar.html.erb
120 lines (107 loc) · 4.08 KB
/
_navbar.html.erb
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
<% I18n.with_locale(current_user.try(:locale)) do %>
<%= stylesheet_link_tag 'navbar' %>
<%= render partial: 'feedbacks/feedback' %>
<div class="navbars-container">
<nav class="navbar navbar-expand" id="firstnav">
<%= link_to image_tag('MaMpf-Logo.svg',
class: 'me-2',
id: 'mampf-logo'),
home_path %>
<%= link_to t('mampf'),
home_path,
class: 'navbar-brand',
style: "text-decoration: none;",
id: 'mampfbrand' %>
<ul class="navbar-nav">
<li class="nav-item">
<% is_home_active = !get_class_for_any_path_startswith([start_path(), lectures_path()]).empty?\
|| !get_class_for_path(root_path()).empty? %>
<a href="<%= start_path %>"
class="nav-link bi bi-house-fill <%= is_home_active ? ApplicationHelper::ACTIVE_CSS_CLASS : '' %>"
data-bs-toggle="tooltip"
title="<%= t('navbar.home') %>">
</a>
</li>
<li class="nav-item">
<a href="<%= edit_profile_path %>"
class="nav-link bi bi-person-circle <%= get_class_for_path(edit_profile_path()) %>"
data-bs-toggle="tooltip"
title="<%= t('navbar.profile') %>">
</a>
</li>
<% if current_user.admin || current_user.editor? || current_user.teacher? %>
<li class="nav-item">
<a href="<%= administration_path %>"
class="nav-link bi bi-tools"
data-bs-toggle="tooltip"
title="<%= t('navbar.administration') %>">
</a>
</li>
<% end %>
<li class="nav-item">
<a href="<%= watchlists_path %>"
id="watchlistsIcon"
class="nav-link bi bi-tv-fill <%= get_class_for_path_startswith(watchlists_path()) %>"
data-bs-toggle="tooltip"
title="<%= t('navbar.watchlist') %>">
</a>
</li>
<li class="nav-item">
<a href="<%= comments_path %>"
id="commentsIcon"
class="nav-link bi bi-chat-quote-fill
<%= current_user.unread_comments ? 'new-comment' : '' %>
<%= get_class_for_path(comments_path()) %>"
data-bs-toggle="tooltip"
title="<%= t('navbar.comments') %>">
</a>
</li>
<li class="nav-item">
<a href="<%= news_path %>"
class="nav-link bi bi-megaphone-fill <%= get_class_for_path(news_path()) %>"
data-bs-toggle="tooltip"
title="<%= t('navbar.news') %>">
</a>
</li>
<li class="nav-item">
<a href="<%= DefaultSetting::BLOG_LINK %>"
class="nav-link bi bi-newspaper"
data-bs-toggle="tooltip"
title="<%= t('navbar.blog') %>">
</a>
</li>
<li class="nav-item">
<a href="<%= destroy_user_session_path(params: { locale: current_user.locale }) %>"
class="nav-link bi bi-box-arrow-right"
data-bs-toggle="tooltip"
data-method="delete"
title="<%= t('navbar.logout') %>">
</a>
</li>
</ul>
<ul class="navbar-nav ms-auto me-auto" id="lecturesDropdown">
<%= render partial: 'shared/dropdown_lectures',
locals: { lecture: @lecture || current_lecture } %>
</ul>
<%= render partial: 'shared/dropdown_notifications' %>
<%= render partial: 'feedbacks/feedback_button' %>
<%= form_tag(search_index_path,
method: 'get',
class: 'form-inline mt-2 mt-md-0',
id: 'searchField') do %>
<%= search_field_tag 'search',
nil,
class: 'form-control me-sm-2',
placeholder: t('navbar.search') %>
<% end %>
</nav>
<nav class="navbar navbar-expand" id="secondnav"
style="display: none;">
</nav>
</div>
</nav>
<nav class="navbar navbar-expand" id="secondnav"
style="display: none;">
</nav>
</div>
<% end %>