/
_topmenu_contents.html.erb
85 lines (78 loc) · 3.74 KB
/
_topmenu_contents.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
<% # Important note on linking from the topmenu:
#
# The application layout and this topmenu will be included into
# view for plugins, where the Concerto controller's routing
# helpers will not be in scope. Therefore, we refer to these links
# using the "main_app" object.
#
# For example: main_app.feeds_path yields the path to the normal
# feeds controller, and works both from Concerto and plugins.
%>
<nav id="top-menu">
<% if not user_signed_in? %>
<%= link_to "Concerto", main_app.root_url, :id => "top-menu-logobutton" %>
<p id="top-menu-logintext">
<%= link_to t(:sign_in), main_app.new_user_session_path, :id => "login-dropdown" %> <%=t(:signin_login_spiel) %>
<% if can? :create, User %>
<%= t(:no_account) %> <%= link_to t(:sign_up), main_app.new_user_registration_path %> <%= t(:now) %>
<% end %>
</p>
<% else %>
<%= link_to main_app.root_url, :id => "top-menu-logobutton", :class => "full" do %>
<i class="icon-logobutton"></i>
<% end %>
<!-- Begin Menu for CONTENT -->
<section>
<div class="top-menu-sectop">
<%= link_to t(:browse), main_app.feeds_path, :class => "btn #{ current_page?(main_app.feeds_path) || current_page?(main_app.root_path) ? 'selected' : '' }" %>
<%= link_to t(:add), main_app.new_content_path, :class => "btn #{ current_page?(main_app.new_content_path) ? 'selected' : '' }" if can? :create, Content %>
<% if @pending_submissions_count %>
<%= link_to main_app.moderate_path, :class => "tooltip-basic btn #{ current_page?(main_app.moderate_path) ? 'selected' : '' }", 'data-tooltip-text' => "You have #{ @pending_submissions_count } submissions to moderate" do %>
<%= t(:moderate) %> <span class="badge<% if @pending_submissions_count > 0 %> action<% end %>"><%= @pending_submissions_count %></span>
<% end %>
<% end %>
</div>
<div class="top-menu-secbot">
<h1><%= t(:content) %></h1>
</div>
</section>
<!-- End Menu for CONTENT -->
<!-- Begin Menu for NETWORK -->
<section>
<div class="top-menu-sectop">
<%= link_to t(:screens), main_app.screens_path, :class => "btn #{ controller.controller_name == 'screens' ? 'selected' : '' }" %>
<%= link_to t(:users_and_groups), main_app.groups_path, :class => "btn #{ controller.controller_name == 'groups' ? 'selected' : '' }" %>
</div>
<div class="top-menu-secbot">
<h1><%= t(:network) %></h1>
</div>
</section>
<!-- End Menu for NETWORK -->
<!-- Begin Menu for ADMIN -->
<section>
<div class="top-menu-sectop">
<%= link_to t(:dashboard), main_app.dashboard_path, :class => "btn #{ controller.controller_name == 'dashboard' ? 'selected' : '' }" %>
</div>
<div class="top-menu-secbot">
<h1><%= t(:admin) %></h1>
</div>
</section>
<!-- End Menu for ADMIN -->
<!-- Begin User Login Area -->
<section class="right">
<div id="top-menu-user" class="top-menu-sectop">
<div class="pull-left">
<% if current_user.is_admin? %><i class="icon-user-admin tooltip-basic" data-tooltip-text="<%= t(:system_admin) %>"></i><% end %>
<% if can? :update, Group %><i class="icon-user-leader tooltip-basic" data-tooltip-text="<%= t(:leader) %>"></i><% end %>
</div>
<div class="pull-right">
<h2><%= link_to current_user.name, [main_app, current_user] %></h2>
<p><%= link_to t(:settings), main_app.edit_user_path(current_user) %> <%= link_to t(:log_out), main_app.destroy_user_session_path %></p>
</div>
</div>
<div class="top-menu-secbot">
</div>
</section>
<!-- End User Login Area -->
<% end %>
</nav>