This commit is contained in:
Toks
2013-05-20 10:40:19 -04:00
parent ce798d0f7d
commit 5aeab8247c
3 changed files with 6 additions and 2 deletions

View File

@@ -32,4 +32,8 @@ class WikiPageVersion < ActiveRecord::Base
def pretty_title
title.tr("_", " ")
end
def category_name
Tag.category_for(title)
end
end

View File

@@ -48,7 +48,7 @@
<% end %>
</td>
<% end %>
<td><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td>
<td class="category-<%= wiki_page_version.category_name %>"><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td>
<td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
<% if CurrentUser.is_admin? %>
<td>

View File

@@ -15,7 +15,7 @@
<tbody>
<% @wiki_pages.each do |wiki_page| %>
<tr>
<td class="tag-category-<%= wiki_page.category_name %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %></td>
<td class="category-<%= wiki_page.category_name %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %></td>
<td><%= wiki_page.updated_at.strftime("%Y-%m-%d %I:%M") %> by <%= h link_to_user wiki_page.updater %></td>
</tr>
<% end %>