From 9823642115ef52f0a21b9466cef412098a124f3d Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 24 Apr 2014 19:03:36 -0400 Subject: Mailboxer progress without generate changes. --- app/views/pms/_form.html.erb | 4 ++ app/views/pms/index.html.erb | 117 +++++++++++++++++++++++++------------------ app/views/pms/show.html.erb | 2 +- 3 files changed, 73 insertions(+), 50 deletions(-) (limited to 'app/views') diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb index e9a7c08..b329e24 100644 --- a/app/views/pms/_form.html.erb +++ b/app/views/pms/_form.html.erb @@ -14,6 +14,10 @@
<%= f.label :recipient_id %>
<%= f.text_field :recipient_id %> +
+
+ <%= f.label :subject %>
+ <%= f.text_field :subject %>
<%= f.label :message %>
diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb index 1175cb2..ee31e08 100644 --- a/app/views/pms/index.html.erb +++ b/app/views/pms/index.html.erb @@ -1,66 +1,85 @@ -

Listing pms

+

Conversations

- - - - - - - - - - - - - + + + <% conversations = current_user.mailbox.inbox %> + <% if !conversations.empty? %> + <%# require 'pp' %> + <%= conversations.class %> + + + + + + <% conversations.each do |conversation| %> + <% receipts = conversation.receipts_for current_user %> + <% receipts.each do |receipt| %> + <% message = receipt.message %> + + + + + + + <% end %> + <% end %> - <% message = @pms.where(recipient: current_user) %> - <% unless message.empty? then message.each do |pm| %> - - - - - - - - + <% else %> + <% end %> - <% else %> - - <% end %> + - - + + - - <% message = @pms.where(author: current_user) %> - <% unless message.empty? then message.each do |pm| %> - - - - - - - - + + <% conversations = current_user.mailbox.sentbox %> + <% if !conversations.empty? %> + + + + + + <% conversations.each do |conversation| %> + <% receipts = conversation.receipts_for current_user %> + <% receipts.each do |receipt| %> + <% message = receipt.message %> + + + + + + + <% end %> + <% end %> + + <% else %> + <% end %> - <% else %> - - <% end %> + - - - + +
AuthorRecipientMessage

Inbox

Inbox

FromSubjectBody
<%= conversation.last_sender.user_name %><%= message.subject %><%= message.body %><%# link_to 'Show', @pms.where(conversation: conversation) %>
<%= pm.author.user_name %><%= pm.recipient.user_name %><%= pm.message %><%= link_to 'Show', pm %><%# link_to 'Edit', edit_pm_path(pm) %><%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the author\'s copy)?' } %>

No Messages

No New Messages

Outbox

Outbox

<%= pm.author.user_name %><%= pm.recipient.user_name %><%= pm.message %><%= link_to 'Show', pm %><%# link_to 'Edit', edit_pm_path(pm) %><%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the recipient\'s copy)?'} %>
ToSubjectBody
Doesn't work<%= message.subject %><%= message.body %><%# link_to 'Show', @pms.where(conversation: conversation) %>

No Messages

No New Messages

Conversations

+ +
+ +<%= link_to 'New Pm', new_pm_path %> +

Conversations

+ + + <% conversations = current_user.mailbox.inbox %> - <% if !conversations.nil? %> + <% if !conversations.empty? %> + <%# require 'pp' %> + <%= conversations.class %> @@ -74,7 +93,7 @@ - + <% end %> <% end %> @@ -89,7 +108,7 @@ <% conversations = current_user.mailbox.sentbox %> - <% if !conversations.nil? %> + <% if !conversations.empty? %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index cfaf00d..aec160f 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -1,6 +1,6 @@

Author: - <%= @conversation.last_sender.user_name %> + <%# @conversation.last_sender.user_name %>

-- cgit v1.2.3-2-g168b From c909eb46740a1daeaf8fac1d60d0e4539f01e342 Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 19:06:34 -0400 Subject: more fixes to the SVG --- app/views/tournaments/show.html.erb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/views') diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index a5eb46c..f79b975 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -113,3 +113,4 @@ <%end %> + -- cgit v1.2.3-2-g168b From 67d95e5b92e3d19765c7ccaf5460737ffe2173f4 Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 24 Apr 2014 19:07:40 -0400 Subject: run ./generate.sh --- app/views/pms/_form.html.erb | 8 ++++++++ app/views/pms/index.html.erb | 4 ++++ app/views/pms/index.json.jbuilder | 2 +- app/views/pms/show.html.erb | 10 ++++++++++ app/views/pms/show.json.jbuilder | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb index 480e308..80781a5 100644 --- a/app/views/pms/_form.html.erb +++ b/app/views/pms/_form.html.erb @@ -23,6 +23,14 @@ <%= f.label :message %>
<%= f.text_area :message %> +

+ <%= f.label :subject %>
+ <%= f.text_area :subject %> +
+
+ <%= f.label :conversation_id %>
+ <%= f.text_field :conversation_id %> +
<%= f.submit %>
diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb index cb7fe4b..b5169f5 100644 --- a/app/views/pms/index.html.erb +++ b/app/views/pms/index.html.erb @@ -6,6 +6,8 @@ + + @@ -18,6 +20,8 @@ + + diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder index fcfca84..3dc1abb 100644 --- a/app/views/pms/index.json.jbuilder +++ b/app/views/pms/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@pms) do |pm| - json.extract! pm, :id, :author_id, :recipient_id, :message + json.extract! pm, :id, :author_id, :recipient_id, :message, :subject, :conversation_id json.url pm_url(pm, format: :json) end diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index 5ee483f..2f3b944 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -15,5 +15,15 @@ <%= @pm.message %>

+

+ Subject: + <%= @pm.subject %> +

+ +

+ Conversation: + <%= @pm.conversation %> +

+ <%= link_to 'Edit', edit_pm_path(@pm) %> | <%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder index 94252e9..4e69026 100644 --- a/app/views/pms/show.json.jbuilder +++ b/app/views/pms/show.json.jbuilder @@ -1 +1 @@ -json.extract! @pm, :id, :author_id, :recipient_id, :message, :created_at, :updated_at +json.extract! @pm, :id, :author_id, :recipient_id, :message, :subject, :conversation_id, :created_at, :updated_at -- cgit v1.2.3-2-g168b

Inbox

From Subject<%= conversation.last_sender.user_name %> <%= message.subject %> <%= message.body %><%# link_to 'Show', pm %><%# link_to 'Show', @pm.where(conversation: conversation) %>
To Subject Author Recipient MessageSubjectConversation <%= pm.author %> <%= pm.recipient %> <%= pm.message %><%= pm.subject %><%= pm.conversation %> <%= link_to 'Show', pm %> <%= link_to 'Edit', edit_pm_path(pm) %> <%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %>