_sidebar.html.erb 3.15 KB
Newer Older
Alexandre Friquet's avatar
Alexandre Friquet committed
1
2
3
4
<%
# OLIGAA - Stands for "Outil en Ligne d'Information et de Gestion des Activités
# des Associations" which is an online tool for associations to manage news,
# actors and activities.
5
# Copyright (C) 2010-2019 Comité Départemental du Sport Adapté de la Gironde (CDSA
Alexandre Friquet's avatar
Alexandre Friquet committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 33) <contact@cdsa33.org>
#
# This file is part of OLIGAA.
#
# OLIGAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OLIGAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA.  If not, see <http://www.gnu.org/licenses/>.
%>
<nav id="main-nav" role="navigation">
	<ul id="menus">
		<% Menu.sanitized.each do |menu| %>
26
27
28
29
30
31
			<% case menu.uid %>
			<% when "home" %>
				<%= menu_to menu.title, root_path, class: 'menu_item' %>
			<% when "calendar" %>
				<%= menu_to menu.title, calendar_path(year: Time.now.year, month: Time.now.month), class: 'menu_item' %>
			<% when "newsletters" %>
32
				<%- newsletters = Newsletter.for_nav %>
Alexandre Friquet's avatar
Alexandre Friquet committed
33
				<%- if newsletters.any? %>
34
				<li class="menu_item">
35
					<span class="menu_title"><%= textilize_without_paragraph(menu.title) %></span>
36
					<ul>
37
						<% newsletters.each do |newsletter| %>
38
39
40
41
42
						<%= menu_to newsletter.title, newsletter %>
						<% end %>
						<%= menu_to "Archives", newsletters_path %>
					</ul>
				</li>
43
				<%- end %>
44
45
			<% when "activity_categories" %>
				<li class="menu_item">
46
					<span class="menu_title"><%= textilize_without_paragraph(menu.title) %></span>
47
48
49
50
51
52
53
					<ul>
						<% ActivityCategory.all.each do |cat| %>
						<%= menu_to cat.title, activity_category_path(cat) %>
						<% end %>
					</ul>
				</li>
			<% when "member_groups" %>
54
				<% unless settings.map_member_groups.empty? %>
55
				<li class="menu_item">
56
					<span class="menu_title"><%= textilize_without_paragraph(menu.title) %></span>
57
					<ul>
58
						<% settings.map_member_groups.each do |group| %>
59
60
61
62
63
							<%= menu_to group.title, member_group_path(group) %>
						<% end %>
					</ul>
				</li>
				<% end %>
64
65
			<% when "club_novels" %>
				<%= menu_to menu.title, club_novels_path, class: 'menu_item' %>
66
67
			<% when "member_zone" %>
				<li class="menu_item">
68
					<span class="menu_title"><%= textilize_without_paragraph(menu.title) %></span>
69
70
71
72
73
74
75
76
77
78
79
					<ul>
						<% if logged_in? %>
						<%= menu_to "Ma fiche", current_member %>
						<%= menu_to "Se déconnecter", logout_path %>
						<% else %>
						<%= menu_to "Se connecter", login_path %>
						<% end -%>
					</ul>
				</li>
			<% else %>
				<% if menu.should_be_displayed? %>
Alexandre Friquet's avatar
Alexandre Friquet committed
80
					<li class="menu_item">
81
						<span class="menu_title"><%= textilize_without_paragraph(menu.title) %></span>
Alexandre Friquet's avatar
Alexandre Friquet committed
82
83
84
85
86
87
88
						<ul>
							<% menu.public_pages.each do |page| %>
							<%= menu_to page.title, page %>
							<% end %>
						</ul>
					</li>
				<% end %>
89
			<% end %>
Alexandre Friquet's avatar
Alexandre Friquet committed
90
91
92
		<% end %>
	</ul>
</nav>