diff options
Diffstat (limited to 'app/views/discussions')
| -rw-r--r-- | app/views/discussions/_form.html.haml | 8 | ||||
| -rw-r--r-- | app/views/discussions/index.html.haml | 19 | ||||
| -rw-r--r-- | app/views/discussions/new.html.haml | 6 | ||||
| -rw-r--r-- | app/views/discussions/show.html.haml | 34 |
4 files changed, 47 insertions, 20 deletions
diff --git a/app/views/discussions/_form.html.haml b/app/views/discussions/_form.html.haml index 7ceee2b..303f0bb 100644 --- a/app/views/discussions/_form.html.haml +++ b/app/views/discussions/_form.html.haml @@ -1,12 +1,12 @@ = form_for @discussion do |f| - %div + %p = f.label :recipient_tokens %br = select_tag "discussion[recipient_tokens]", options_from_collection_for_select(User.all, :id, Inboxes::config.user_name), :multiple => true, :size => "4" - %div + %p = f.fields_for :messages do |j| = j.label :body %br - = j.text_area :body, :label => "Сообщение" + = j.text_area :body - = f.submit 'Отправить'
\ No newline at end of file + %p= f.submit
\ No newline at end of file diff --git a/app/views/discussions/index.html.haml b/app/views/discussions/index.html.haml index 8f47198..8060254 100644 --- a/app/views/discussions/index.html.haml +++ b/app/views/discussions/index.html.haml @@ -1,7 +1,18 @@ -%h3 Discussions list -- @discussions.each do |discussion| - .discussion - = link_to "Discussion with #{discussion.users.collect{|u| u[Inboxes::config.user_name]}.join(', ')}", discussion +%h1 Discussions list + +%table + %tr + %th Last message + %th Members + %th Unread + - @discussions.each do |discussion| + %tr + %td + = discussion.updated_at + %td + = link_to discussion.users.collect{|u| u[Inboxes::config.user_name]}.join(', '), discussion + %td + = discussion.unread_for?(current_user) ? "Yes" : "No" %p = link_to "Create new", new_discussion_path
\ No newline at end of file diff --git a/app/views/discussions/new.html.haml b/app/views/discussions/new.html.haml index ac6665c..6bcf481 100644 --- a/app/views/discussions/new.html.haml +++ b/app/views/discussions/new.html.haml @@ -1,3 +1,5 @@ -%h3 New discussion +%h1 New discussion + = render "form" -= link_to "All discussions", discussions_path
\ No newline at end of file + +%p= link_to "All discussions", discussions_path
\ No newline at end of file diff --git a/app/views/discussions/show.html.haml b/app/views/discussions/show.html.haml index ecad61f..6672c54 100644 --- a/app/views/discussions/show.html.haml +++ b/app/views/discussions/show.html.haml @@ -1,5 +1,7 @@ -%h2 - Members: +%h1 Discussion + +%h3 + Members - @discussion.speakers.each do |speaker| %div = speaker.user[Inboxes::config.user_name] @@ -12,14 +14,26 @@ = f.collection_select :user_id, available_users, :id, :name = f.submit "Add" -%h2 Messages -- @discussion.messages.each do |message| - %div - = "[#{message.user[Inboxes::config.user_name]}]" - = message.body - = "@ #{l(message.created_at)}" + +%h3 Messages + +%table + %tr + %th User + %th Message + %th Posted at + - @discussion.messages.each do |message| + %tr + %td + = message.user[Inboxes::config.user_name] + %td + = message.body + %td + = l(message.created_at) -%h3 Add message +%h3 Add message = render "messages/form" -= link_to "All discussions", discussions_path
\ No newline at end of file +%p + = link_to "Выйти из переписки", leave_discussion_path(@discussion), :method => :post unless @discussion.private? + = link_to "All discussions", discussions_path
\ No newline at end of file |
