8ac1471a89
This new view sorts the messages by threads based on the reply_to. Now we store only the message which started a new thread in the reply_to field to avoid recursive queries.
16 lines
530 B
Text
16 lines
530 B
Text
- if @messages.first.group
|
|
- title @messages.first.subject + ' (' + @messages.first.group.name + ')'
|
|
- else
|
|
- title @messages.first.subject
|
|
|
|
- for message in @messages
|
|
.panel.panel-default{:style => "width:40em"}
|
|
.panel-heading
|
|
%b= h(message.sender_name)
|
|
= format_time(message.created_at)
|
|
.panel-body= simple_format(h(message.body))
|
|
|
|
%p
|
|
= link_to t('.reply'), new_message_path(:message => {:reply_to => @messages.first.id}), class: 'btn'
|
|
|
|
|
= link_to t('.all_message_threads'), message_threads_path
|