diff options
Diffstat (limited to 'app/views/discussions')
| -rw-r--r-- | app/views/discussions/_form.html.haml | 6 | ||||
| -rw-r--r-- | app/views/discussions/show.html.haml | 24 | 
2 files changed, 22 insertions, 8 deletions
| diff --git a/app/views/discussions/_form.html.haml b/app/views/discussions/_form.html.haml index eab0db6..7ceee2b 100644 --- a/app/views/discussions/_form.html.haml +++ b/app/views/discussions/_form.html.haml @@ -1,10 +1,12 @@  = form_for @discussion do |f| -  .entry +  %div      = 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" -  .entry +  %div      = f.fields_for :messages do |j|        = j.label :body +      %br        = j.text_area :body, :label => "Сообщение"    = f.submit 'Отправить'
\ No newline at end of file diff --git a/app/views/discussions/show.html.haml b/app/views/discussions/show.html.haml index 903d8fd..ecad61f 100644 --- a/app/views/discussions/show.html.haml +++ b/app/views/discussions/show.html.haml @@ -1,13 +1,25 @@ -%h3 -  Chat with -  = @discussion.users.map { |u| u[Inboxes::config.user_name] }.join(", ") +%h2 +  Members: +- @discussion.speakers.each do |speaker| +  %div +    = speaker.user[Inboxes::config.user_name] +    = link_to '(remove)', discussion_speaker_path(@discussion, speaker), :method => :delete -%h3 Messages +- 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" +     +%h2 Messages  - @discussion.messages.each do |message| -  %p +  %div      = "[#{message.user[Inboxes::config.user_name]}]"      = message.body      = "@ #{l(message.created_at)}" -     + +%h3 Add message      = render "messages/form" +  = link_to "All discussions", discussions_path
\ No newline at end of file | 
