aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/discussions/show.html.haml
blob: 6672c54b18c152c7cd5039acbccb9defc3cb53b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%h1 Discussion

%h3
  Members
- @discussion.speakers.each do |speaker|
  %div
    = speaker.user[Inboxes::config.user_name]
    = link_to '(remove)', discussion_speaker_path(@discussion, speaker), :method => :delete

- available_users = User.all.map { |u| u unless @discussion.users.include?(u) }.delete_if { |w| w.nil? }
- if available_users.any?
  = form_for Speaker.new, :url => discussion_speakers_path(@discussion) do |f|
    = f.label :user_id, "Add speaker"
    = f.collection_select :user_id, available_users, :id, :name
    = f.submit "Add"
    
  
%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
= render "messages/form"

%p
  = link_to "Выйти из переписки", leave_discussion_path(@discussion), :method => :post unless @discussion.private?
  = link_to "All discussions", discussions_path