Skip to content

Commit 1157c28

Browse files
committed
Add recent content quickswitch menu to navbar
1 parent d2bc7b8 commit 1157c28

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

app/views/layouts/_navbar.html.erb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@
2626
</li>
2727
</ul>
2828

29+
<ul id="recent-content-dropdown" class="dropdown-content">
30+
<% if user_signed_in? %>
31+
<% current_user.content.values.flatten.compact.sort_by(&:updated_at).last(10).reverse.each do |content| %>
32+
<% content_class = content.class %>
33+
<li>
34+
<%= link_to content, class: "#{content_class.color}-text" do %>
35+
<i class="material-icons left"><%= content_class.icon %></i>
36+
<%= content.name %>
37+
<% end %>
38+
</li>
39+
<% end %>
40+
<% if current_user.content_count > 0 %>
41+
<li class="divider"></li>
42+
<li>
43+
<%= link_to 'More...', recent_content_path, class: 'blue-text' %>
44+
</li>
45+
<% end %>
46+
<% end %>
47+
</ul>
48+
2949
<ul id="desktop-user-dropdown" class="dropdown-content">
3050
<% if current_user %>
3151
<li>
@@ -109,6 +129,11 @@
109129

110130
<ul class="right">
111131
<% if user_signed_in? %>
132+
<li>
133+
<a class="dropdown-button tooltipped" href="#!" data-activates="recent-content-dropdown" data-position="bottom" data-delay="100" data-tooltip="Your recently-edited pages">
134+
<i class="material-icons">recent_actors</i>
135+
</a>
136+
</li>
112137
<li>
113138
<a class="dropdown-button tooltipped" href="#!" data-activates="help-dropdown" data-position="bottom" data-delay="100" data-tooltip="Need help?">
114139
<i class="material-icons">help</i>

0 commit comments

Comments
 (0)