summaryrefslogtreecommitdiff
path: root/app/views/pms
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-23 20:40:56 -0400
committernfoy <nfoy@purdue.edu>2014-04-23 20:40:56 -0400
commit422a7b39a06e2fe54415f2be08548021a981e8a8 (patch)
tree7e76d1383848caa999a954192cb48f86c209db7e /app/views/pms
parentd0a0f806a4bb8072c532ea7b35ad8b7643ac8645 (diff)
Beginnings of actual messageboxer api
Diffstat (limited to 'app/views/pms')
-rw-r--r--app/views/pms/index.html.erb51
1 files changed, 47 insertions, 4 deletions
diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb
index ceb1a40..73c7a87 100644
--- a/app/views/pms/index.html.erb
+++ b/app/views/pms/index.html.erb
@@ -25,8 +25,8 @@
<td><%= pm.recipient.user_name %></td>
<td><%= pm.message %></td>
<td><%= link_to 'Show', pm %></td>
- <td><%= link_to 'Edit', edit_pm_path(pm) %></td>
- <td><%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+ <td><%# link_to 'Edit', edit_pm_path(pm) %></td>
+ <td><%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the author\'s copy)?' } %></td>
</tr>
<% end %>
<% else %>
@@ -44,13 +44,56 @@
<td><%= pm.recipient.user_name %></td>
<td><%= pm.message %></td>
<td><%= link_to 'Show', pm %></td>
- <td><%= link_to 'Edit', edit_pm_path(pm) %></td>
- <td><%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+ <td><%# link_to 'Edit', edit_pm_path(pm) %></td>
+ <td><%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the recipient\'s copy)?'} %></td>
</tr>
<% end %>
<% else %>
<td><h3>No New Messages</h3></td>
<% end %>
+
+ <tr>
+ <td><h2>Conversations<h2></td>
+ </tr>
+ <tr>
+ <td><h3>Inbox<h3></td>
+ </tr>
+ <tr>
+ <% conversation1 = current_user.mailbox.inbox.first %>
+ <% if !conversation1.nil? %>
+ <% receipts1 = conversation1.receipts_for current_user %>
+ <% receipts1.each do |receipt1| %>
+ <% message1 = receipt1.message %>
+ <td><%= message1.subject %></td>
+ <td><%= message1.body %></td>
+ <% end %>
+ <% else %>
+ <td><p> No Messages </p></td>
+ <% end %>
+ </tr>
+
+ <tr>
+ <td><h3>Outbox<h3></td>
+ </tr>
+ <tr>
+ <% conversation1 = current_user.mailbox.sentbox.first %>
+ <% if !conversation1.nil? %>
+ <tr>
+ <td><b>From</b></td>
+ <td><b>Subject</b></td>
+ <td><b>Body</b></td>
+ </tr>
+ <% receipts1 = conversation1.receipts_for current_user %>
+ <% receipts1.each do |receipt1| %>
+ <% message1 = receipt1.message %>
+ <td><%= message1.subject %></td>
+ <td><%= message1.body %></td>
+ <% end %>
+ <% else %>
+ <td><p> No Messages </p></td>
+ <% end %>
+ </tr>
+
</tbody>
</table>