views
This commit is contained in:
12
app/views/dmails/_form.html.erb
Normal file
12
app/views/dmails/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div id="preview">
|
||||
</div>
|
||||
|
||||
<%= simple_form_for(dmail) do |f| %>
|
||||
<%= hidden_field_tag "dmail[parent_id]", dmail.parent_id || dmail.id, :id => "dmail_parent_id" %>
|
||||
|
||||
<%= f.input :to_name, :label => "To" %>
|
||||
<%= f.input :title %>
|
||||
<%= f.input :body, :html_options => {:size => "50x25"} %>
|
||||
<%= f.button :submit %>
|
||||
<%= submit_tag "Preview" %>
|
||||
<% end %>
|
||||
5
app/views/dmails/_received.html.erb
Normal file
5
app/views/dmails/_received.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<tr>
|
||||
<td><%= link_to dmail.from_name, user_path(dmail.from) %></td>
|
||||
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
||||
<td><%= compact_time(dmail.created_at) %></td>
|
||||
</tr>
|
||||
10
app/views/dmails/_search.html.erb
Normal file
10
app/views/dmails/_search.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div>
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= hidden_field_tag :folder, params[:folder] %>
|
||||
<%= f.input :title_contains %>
|
||||
<%= f.input :body_contains %>
|
||||
<%= f.input :to_name_equals %>
|
||||
<%= f.input :from_name_equals %>
|
||||
<%= f.button :submit %>
|
||||
<% end %>
|
||||
</div>
|
||||
7
app/views/dmails/_secondary_links.html.erb
Normal file
7
app/views/dmails/_secondary_links.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Received", dmails_path(:folder => "received") %></li>
|
||||
<li><%= link_to "Sent", dmails_path(:folder => "sent") %></li>
|
||||
<li><%= link_to "New", new_dmail_path %></li>
|
||||
</menu>
|
||||
<% end %>
|
||||
5
app/views/dmails/_sent.html.erb
Normal file
5
app/views/dmails/_sent.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<tr>
|
||||
<td><%= link_to dmail.to_name, user_path(dmail.from) %></td>
|
||||
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
||||
<td><%= compact_time(dmail.created_at) %></td>
|
||||
</tr>
|
||||
2
app/views/dmails/edit.html.erb
Normal file
2
app/views/dmails/edit.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Edit Message</h1>
|
||||
<%= render "form", :locals => {:dmail => @dmail} %>
|
||||
15
app/views/dmails/index.html.erb
Normal file
15
app/views/dmails/index.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<h1>Messages</h1>
|
||||
|
||||
<%= render "search" %>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<% @dmails.each do |dmail| %>
|
||||
<% if params[:folder] == "sent" %>
|
||||
<%= render "sent", :locals => {:dmail => dmail} %>
|
||||
<% else %>
|
||||
<%= render "received", :locals => {:dmail => dmail} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
2
app/views/dmails/new.html.erb
Normal file
2
app/views/dmails/new.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>New Message</h1>
|
||||
<%= render "form", :locals => {:dmail => @dmail} %>
|
||||
Reference in New Issue
Block a user