Add css classes to journals display to facilitate theming

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4057 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Baptiste Barth 2010-09-03 20:05:51 +00:00
parent 4776a5a427
commit b6d9f2bddf
2 changed files with 8 additions and 1 deletions

View File

@ -39,4 +39,11 @@ module JournalsHelper
onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;"
link_to text, '#', options.merge(:onclick => onclick)
end
def css_journal_classes(journal)
s = 'journal'
s << ' has-notes' unless journal.notes.blank?
s << ' has-details' unless journal.details.blank?
s
end
end

View File

@ -1,6 +1,6 @@
<% reply_links = authorize_for('issues', 'edit') -%>
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="journal">
<div id="change-<%= journal.id %>" class="<%= css_journal_classes(journal) %>">
<h4><div class="journal-link"><%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %></div>
<%= avatar(journal.user, :size => "24") %>
<%= content_tag('a', '', :name => "note-#{journal.indice}")%>