@@ -39,11 +39,4 module JournalsHelper | |||||
39 | onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;" |
|
39 | onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;" | |
40 | link_to text, '#', options.merge(:onclick => onclick) |
|
40 | link_to text, '#', options.merge(:onclick => onclick) | |
41 | end |
|
41 | end | |
42 |
|
||||
43 | def css_journal_classes(journal) |
|
|||
44 | s = 'journal' |
|
|||
45 | s << ' has-notes' unless journal.notes.blank? |
|
|||
46 | s << ' has-details' unless journal.details.blank? |
|
|||
47 | s |
|
|||
48 | end |
|
|||
49 | end |
|
42 | end |
@@ -65,4 +65,12 class Journal < ActiveRecord::Base | |||||
65 | def attachments |
|
65 | def attachments | |
66 | journalized.respond_to?(:attachments) ? journalized.attachments : nil |
|
66 | journalized.respond_to?(:attachments) ? journalized.attachments : nil | |
67 | end |
|
67 | end | |
|
68 | ||||
|
69 | # Returns a string of css classes | |||
|
70 | def css_classes | |||
|
71 | s = 'journal' | |||
|
72 | s << ' has-notes' unless notes.blank? | |||
|
73 | s << ' has-details' unless details.blank? | |||
|
74 | s | |||
|
75 | end | |||
68 | end |
|
76 | end |
@@ -1,6 +1,6 | |||||
1 | <% reply_links = authorize_for('issues', 'edit') -%> |
|
1 | <% reply_links = authorize_for('issues', 'edit') -%> | |
2 | <% for journal in journals %> |
|
2 | <% for journal in journals %> | |
3 |
<div id="change-<%= journal.id %>" class="<%= |
|
3 | <div id="change-<%= journal.id %>" class="<%= journal.css_classes %>"> | |
4 | <h4><div class="journal-link"><%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %></div> |
|
4 | <h4><div class="journal-link"><%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %></div> | |
5 | <%= avatar(journal.user, :size => "24") %> |
|
5 | <%= avatar(journal.user, :size => "24") %> | |
6 | <%= content_tag('a', '', :name => "note-#{journal.indice}")%> |
|
6 | <%= content_tag('a', '', :name => "note-#{journal.indice}")%> |
General Comments 0
You need to be logged in to leave comments.
Login now