From 952387be24043e76dfd9b7a461ee31d1246fa58e Mon Sep 17 00:00:00 2001 From: nfoy Date: Mon, 28 Apr 2014 00:07:57 -0400 Subject: Messages and alerts play together more nicely now. --- app/views/pms/index.html.erb | 69 +++++++++++++++++++++++++++++++++++++------- app/views/pms/show.html.erb | 1 + 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb index 056b371..fec6db2 100644 --- a/app/views/pms/index.html.erb +++ b/app/views/pms/index.html.erb @@ -23,6 +23,9 @@ <% if conversation.is_unread?(current_user) && receipts.last.message.sender != current_user %> <% message = receipts.last.message %> + <% if conversation.subject == "Pay Attention!" %> + <% conversation.mark_as_read(current_user) %> + <% end %> <% people = conversation.participants %> <% people.each do |person| %> @@ -65,17 +68,63 @@ <% if conversation.is_read?(current_user) || receipts.last.message.sender == current_user %> <% message = receipts.last.message %> - - <% people = conversation.participants %> - <% people.each do |person| %> - <% unless person == current_user %> - <%= truncate(person.user_name, length: 20) %> + <% if conversation.subject != "Pay Attention!" %> + + <% people = conversation.participants %> + <% people.each do |person| %> + <% unless person == current_user %> + <%= truncate(person.user_name, length: 20) %> + <% end %> <% end %> - <% end %> - - <%= truncate(conversation.subject, length: 30) %> - <%= truncate(message.body, length: 42) %> - <%= link_to 'View', @pms.find_by(conversation: conversation) %> + + <%= truncate(conversation.subject, length: 30) %> + <%= truncate(message.body, length: 42) %> + <%= link_to 'View', @pms.find_by(conversation: conversation) %> + <% end %> + + <% end %> + <% end %> + + <% #else %> + + <% #end %> + + + +
+

Alerts

+<% conversations = current_user.mailbox.conversations %> + + + + + + + <%# if conversations.reject { |c| c.is_read?(current_user) || (c.receipts_for current_user).last.message.sender == current_user }.empty? %> + + + + + + + <% conversations.each do |conversation| %> + <% receipts = conversation.receipts_for current_user %> + <% if conversation.is_read?(current_user) || receipts.last.message.sender == current_user %> + <% message = receipts.last.message %> + + <% if conversation.subject == "Pay Attention!" %> + + + + + <% end %> <% end %> <% end %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index ca8d9bf..2c93102 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -31,6 +31,7 @@

________________________________________________

+ <% @pm.message = "" %> <%= form_for(@pm) do |f| %>

<%= f.text_area :message %> -- cgit v1.2.3 From ee238dbbca6ee979aa886a4f4cebad41e6f79cce Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 28 Apr 2014 00:17:33 -0400 Subject: 30 minutes to add a single line --- app/views/tournaments/_form.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 2a871ea..a5eba7a 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -17,6 +17,7 @@ <% else %> <%= form_for(@tournament, url: tournaments_path, method: "post") do |f| %> + <%= f.hidden_field(:game_id) %>

<%= f.label :name %> <%= f.text_field :name %> -- cgit v1.2.3

WithSubjectBody
+ <% people = conversation.participants %> + <% people.each do |person| %> + <% unless person == current_user %> + <%= truncate(person.user_name, length: 20) %> + <% end %> + <% end %> + <%= truncate(conversation.subject, length: 30) %><%= truncate(message.body, length: 42) %><%= link_to 'View', @pms.find_by(conversation: conversation) %>