From 919ba959bbc782315b0a8b171aa96e2118a43067 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 28 Apr 2014 00:00:47 -0400 Subject: fixed the db seeds. They can now be started --- app/views/common/_show_tournament.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb index 151e5d2..12a7fea 100644 --- a/app/views/common/_show_tournament.html.erb +++ b/app/views/common/_show_tournament.html.erb @@ -33,8 +33,10 @@ <% else %>

You've signed up for this tournament!

<% end %> - <%= form_tag(tournament_brackets_path(target), method: "post") do %> - <%= submit_tag("Make Bracket") %> + <% if target.status == 1 %> + <%= form_tag(tournament_brackets_path(target), method: "post") do %> + <%= submit_tag("Make Bracket") %> + <% end %> <% end %> <% end %> -- cgit v1.2.3 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(-) (limited to 'app/views') 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
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) %>