Skip to content

Commit c6abc80

Browse files
committed
show banner for when no tags are shown
1 parent a5b1fae commit c6abc80

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

app/views/data/tags.html.erb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
<%
2+
showed_any_tags = false
3+
%>
4+
15
<h2 class="grey-text" style="font-size: 2rem">Your Notebook.ai tags</h2>
26
<ul class="collapsible">
37
<% Rails.application.config.content_types[:all].each do |content_type| %>
48
<%
59
grouped_tags = PageTag.where(page_type: content_type.name, user_id: current_user).group_by(&:tag)
610

711
next if grouped_tags.values.length == 0
12+
13+
showed_any_tags = true
814
%>
915

1016
<li>
@@ -39,7 +45,7 @@
3945
slug: PageTagService.slug_for(tag)
4046
), data: {
4147
confirm: "Are you sure? This will delete this tag and remove it from all pages."
42-
}
48+
}, class: 'red-text'
4349
%>
4450
</div>
4551
</div>
@@ -64,4 +70,10 @@
6470
</div>
6571
</li>
6672
<% end %>
67-
</ul>
73+
</ul>
74+
75+
<% if !showed_any_tags %>
76+
<div class="card-panel">
77+
When you create tags for your pages, they'll appear here. Come back later when you've added some!
78+
</div>
79+
<% end %>

0 commit comments

Comments
 (0)