When javascript disabled, add category links to topic list and topic page

This commit is contained in:
Neil Lalonde 2014-06-05 11:14:06 -04:00
parent 06965a999e
commit bd92291b26
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,10 @@
<div class="topic-list">
<% @list.topics.each do |t| %>
<a href="<%= t.relative_url %>"><%= t.title %></a> <span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span><br/>
<a href="<%= t.relative_url %>"><%= t.title %></a>
<% if !@category && t.category %>
[<a href="/category/<%= t.category.slug.blank? ? t.category.id : t.category.slug %>"><%= t.category.name %></a>]
<% end %>
<span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span><br/>
<% end %>
</div>

View File

@ -1,6 +1,9 @@
<h2>
<%= render_topic_title(@topic_view.topic) %>
</h2>
<% if c = @topic_view.topic.category %>
<a href="/category/<%= c.slug.blank? ? c.id : c.slug %>"><%= c.name %></a>
<% end %>
<hr/>
<% @topic_view.posts.each do |post| %>