Refactored messages modul, but refactoring is still neccessary.
This commit is contained in:
parent
6ac04d5e19
commit
d5552059ce
13 changed files with 81 additions and 146 deletions
|
|
@ -1,16 +1,4 @@
|
|||
module MessagesHelper
|
||||
def groups_for_select
|
||||
groups = [[" -- Arbeitsgruppen -- ", ""]]
|
||||
groups += Workgroup.find(:all, :order => 'name', :include => :memberships).reject{ |g| g.memberships.empty? }.collect do |g|
|
||||
[g.name, g.id]
|
||||
end
|
||||
groups += [[" -- Bestellgruppen -- ", ""]]
|
||||
groups += Ordergroup.without_deleted(:order => 'name', :include => :memberships).reject{ |g| g.memberships.empty? }.collect do |g|
|
||||
[g.name, g.id]
|
||||
end
|
||||
groups
|
||||
end
|
||||
|
||||
def format_subject(message, length)
|
||||
if message.subject.length > length
|
||||
subject = truncate(message.subject, :length => length)
|
||||
|
|
@ -19,6 +7,6 @@ module MessagesHelper
|
|||
subject = message.subject
|
||||
body = truncate(message.body, :length => length - subject.length)
|
||||
end
|
||||
"<b>#{link_to(h(subject), message)}</b> <span style='color:grey'>#{h(body)}</span>"
|
||||
"<b>#{link_to(h(subject), message)}</b> <span style='color:grey'>#{h(body)}</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue