summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-28 00:17:44 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-28 00:17:44 -0400
commite5f603c8c463e09fee5931d7e00e94e14b819347 (patch)
treeb4a15936a3fc51586448585162e4070d7bb82fc8 /app/views
parentee238dbbca6ee979aa886a4f4cebad41e6f79cce (diff)
parent1fb957aeb5c6eb8ec57ecf28b18479bb47093243 (diff)
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views')
-rw-r--r--app/views/common/_show_tournament.html.erb6
-rw-r--r--app/views/pms/index.html.erb69
-rw-r--r--app/views/pms/show.html.erb1
3 files changed, 64 insertions, 12 deletions
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 %>
<p style="margin-top:10px;"> You've signed up for this tournament! </p>
<% 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 %>
</div>
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 %>
<tr>
+ <% if conversation.subject == "Pay Attention!" %>
+ <% conversation.mark_as_read(current_user) %>
+ <% end %>
<td>
<% 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 %>
<tr>
- <td>
- <% people = conversation.participants %>
- <% people.each do |person| %>
- <% unless person == current_user %>
- <%= truncate(person.user_name, length: 20) %>
+ <% if conversation.subject != "Pay Attention!" %>
+ <td>
+ <% people = conversation.participants %>
+ <% people.each do |person| %>
+ <% unless person == current_user %>
+ <%= truncate(person.user_name, length: 20) %>
+ <% end %>
<% end %>
- <% end %>
- </td>
- <td><%= truncate(conversation.subject, length: 30) %></td>
- <td><%= truncate(message.body, length: 42) %></td>
- <td><%= link_to 'View', @pms.find_by(conversation: conversation) %></td>
+ </td>
+ <td><%= truncate(conversation.subject, length: 30) %></td>
+ <td><%= truncate(message.body, length: 42) %></td>
+ <td><%= link_to 'View', @pms.find_by(conversation: conversation) %></td>
+ <% end %>
+ </tr>
+ <% end %>
+ <% end %>
+ </tr>
+ <% #else %>
+
+ <% #end %>
+ </tbody>
+</table>
+
+<br>
+<h3>Alerts</h3>
+<% conversations = current_user.mailbox.conversations %>
+
+<table>
+ <col width="150">
+ <col width="250">
+ <col width="300">
+ <tbody>
+ <%# if conversations.reject { |c| c.is_read?(current_user) || (c.receipts_for current_user).last.message.sender == current_user }.empty? %>
+ <tr>
+ <tr>
+ <td><b>With</b></td>
+ <td><b>Subject</b></td>
+ <td><b>Body</b></td>
+ </tr>
+ <% 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 %>
+ <tr>
+ <% if conversation.subject == "Pay Attention!" %>
+ <td>
+ <% people = conversation.participants %>
+ <% people.each do |person| %>
+ <% unless person == current_user %>
+ <%= truncate(person.user_name, length: 20) %>
+ <% end %>
+ <% end %>
+ </td>
+ <td><%= truncate(conversation.subject, length: 30) %></td>
+ <td><%= truncate(message.body, length: 42) %></td>
+ <td><%= link_to 'View', @pms.find_by(conversation: conversation) %></td>
+ <% end %>
</tr>
<% 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 @@
<p> ________________________________________________ </p>
<p>
+ <% @pm.message = "" %>
<%= form_for(@pm) do |f| %>
<div class="field">
<%= f.text_area :message %>