aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorKir2011-10-31 21:43:34 +0400
committerKir2011-10-31 21:43:34 +0400
commit48c144ed34e2d5977bb8e5af8a9c7e8dfc253361 (patch)
treea672937fb96b955f3c2d4364195926b3b14d01cb /app/views
parent3ddd221f5f235e34afb9d4bbc7a4fc05228f73a4 (diff)
downloadinboxes-48c144ed34e2d5977bb8e5af8a9c7e8dfc253361.tar.bz2
Small changed
Diffstat (limited to 'app/views')
-rw-r--r--app/views/discussions/_form.html.haml2
-rw-r--r--app/views/discussions/index.html.haml8
-rw-r--r--app/views/discussions/new.html.haml3
-rw-r--r--app/views/discussions/show.html.haml14
-rw-r--r--app/views/messages/_form.html.haml6
5 files changed, 25 insertions, 8 deletions
diff --git a/app/views/discussions/_form.html.haml b/app/views/discussions/_form.html.haml
index 52da4a6..eab0db6 100644
--- a/app/views/discussions/_form.html.haml
+++ b/app/views/discussions/_form.html.haml
@@ -1,7 +1,7 @@
= form_for @discussion do |f|
.entry
= f.label :recipient_tokens
- = f.collection_select :recipient_tokens, User.all, :id, :name, :prompt => true, :html_options => { :multiple => true }
+ = select_tag "discussion[recipient_tokens]", options_from_collection_for_select(User.all, :id, Inboxes::config.user_name), :multiple => true, :size => "4"
.entry
= f.fields_for :messages do |j|
= j.label :body
diff --git a/app/views/discussions/index.html.haml b/app/views/discussions/index.html.haml
index 669c01b..8f47198 100644
--- a/app/views/discussions/index.html.haml
+++ b/app/views/discussions/index.html.haml
@@ -1,5 +1,7 @@
-%h3 Discussions
+%h3 Discussions list
- @discussions.each do |discussion|
- = discussion.id
+ .discussion
+ = link_to "Discussion with #{discussion.users.collect{|u| u[Inboxes::config.user_name]}.join(', ')}", discussion
-= link_to "Create new", new_discussion_path \ No newline at end of file
+%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 3f68ec9..ac6665c 100644
--- a/app/views/discussions/new.html.haml
+++ b/app/views/discussions/new.html.haml
@@ -1,2 +1,3 @@
%h3 New discussion
-= render "form" \ No newline at end of file
+= render "form"
+= 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 8c13728..903d8fd 100644
--- a/app/views/discussions/show.html.haml
+++ b/app/views/discussions/show.html.haml
@@ -1,5 +1,13 @@
-= @discussion.users.map { |u| u.name }.join(", ")
-= debug @discussion.speakers
+%h3
+ Chat with
+ = @discussion.users.map { |u| u[Inboxes::config.user_name] }.join(", ")
+%h3 Messages
- @discussion.messages.each do |message|
- = message.body \ No newline at end of file
+ %p
+ = "[#{message.user[Inboxes::config.user_name]}]"
+ = message.body
+ = "@ #{l(message.created_at)}"
+
+= render "messages/form"
+= link_to "All discussions", discussions_path \ No newline at end of file
diff --git a/app/views/messages/_form.html.haml b/app/views/messages/_form.html.haml
new file mode 100644
index 0000000..78ccaa0
--- /dev/null
+++ b/app/views/messages/_form.html.haml
@@ -0,0 +1,6 @@
+.message_form
+ = form_for Message.new, :url => discussion_messages_path(@discussion.id), :method => :post do |f|
+ = f.text_area :body
+ = f.submit "Отправить"
+
+= link_to "Выйти из переписки", leave_discussion_path(@discussion), :method => :post unless @discussion.private? \ No newline at end of file