fixes to dmail ui
This commit is contained in:
@@ -20,8 +20,6 @@ div#c-wiki-pages {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div#a-edit, div#a-new {
|
div#preview {
|
||||||
div#preview {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,11 @@ class DmailsController < ApplicationController
|
|||||||
respond_with(@dmails)
|
respond_with(@dmails)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
@search = Dmail.search(params[:search])
|
||||||
|
respond_with(@dmails)
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@dmail = Dmail.find(params[:id])
|
@dmail = Dmail.find(params[:id])
|
||||||
check_privilege(@dmail)
|
check_privilege(@dmail)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Dmail < ActiveRecord::Base
|
|||||||
belongs_to :from, :class_name => "User"
|
belongs_to :from, :class_name => "User"
|
||||||
after_create :update_recipient
|
after_create :update_recipient
|
||||||
after_create :send_dmail
|
after_create :send_dmail
|
||||||
attr_accessible :title, :body, :is_deleted, :to_id, :to
|
attr_accessible :title, :body, :is_deleted, :to_id, :to, :to_name
|
||||||
scope :for, lambda {|user| where(["owner_id = ?", user])}
|
scope :for, lambda {|user| where(["owner_id = ?", user])}
|
||||||
scope :inbox, where("to_id = owner_id")
|
scope :inbox, where("to_id = owner_id")
|
||||||
scope :sent, where("from_id = owner_id")
|
scope :sent, where("from_id = owner_id")
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
<%= f.input :to_name, :label => "To" %>
|
<%= f.input :to_name, :label => "To" %>
|
||||||
<%= f.input :title %>
|
<%= f.input :title %>
|
||||||
<%= f.input :body, :html_options => {:size => "50x25"} %>
|
<%= f.input :body, :html_options => {:size => "50x25"} %>
|
||||||
<%= f.button :submit %>
|
<%= f.button :submit, "Send" %>
|
||||||
<%= submit_tag "Preview" %>
|
<%= submit_tag "Preview", :id => "preview-button" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<tr>
|
<tr>
|
||||||
|
<td><%= link_to dmail.to_name, user_path(dmail.to) %></td>
|
||||||
<td><%= link_to dmail.from_name, user_path(dmail.from) %></td>
|
<td><%= link_to dmail.from_name, user_path(dmail.from) %></td>
|
||||||
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
||||||
<td><%= compact_time(dmail.created_at) %></td>
|
<td><%= compact_time(dmail.created_at) %></td>
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<div>
|
|
||||||
<%= simple_form_for @search do |f| %>
|
|
||||||
<%= hidden_field_tag :folder, params[:folder] %>
|
|
||||||
<%= f.input :title_contains, :required => false %>
|
|
||||||
<%= f.input :body_contains, :required => false %>
|
|
||||||
<%= f.input :to_name_equals, :required => false %>
|
|
||||||
<%= f.input :from_name_equals, :required => false %>
|
|
||||||
<%= f.button :submit %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
<li><%= link_to "Received", dmails_path(:folder => "received") %></li>
|
<li><%= link_to "Received", dmails_path(:folder => "received") %></li>
|
||||||
<li><%= link_to "Sent", dmails_path(:folder => "sent") %></li>
|
<li><%= link_to "Sent", dmails_path(:folder => "sent") %></li>
|
||||||
<li><%= link_to "New", new_dmail_path %></li>
|
<li><%= link_to "New", new_dmail_path %></li>
|
||||||
|
<li><%= link_to "Search", search_dmails_path %></li>
|
||||||
</menu>
|
</menu>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to dmail.to_name, user_path(dmail.from) %></td>
|
<td><%= link_to dmail.to_name, user_path(dmail.to) %></td>
|
||||||
|
<td><%= link_to dmail.from_name, user_path(dmail.from) %></td>
|
||||||
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
<td><%= link_to dmail.title, dmail_path(dmail) %></td>
|
||||||
<td><%= compact_time(dmail.created_at) %></td>
|
<td><%= compact_time(dmail.created_at) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
@@ -2,9 +2,15 @@
|
|||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<h1>Messages</h1>
|
<h1>Messages</h1>
|
||||||
|
|
||||||
<%= render "search" %>
|
<table class="striped" width="100%">
|
||||||
|
<thead>
|
||||||
<table>
|
<tr>
|
||||||
|
<th>To</th>
|
||||||
|
<th>From</th>
|
||||||
|
<th>Subject</th>
|
||||||
|
<th>Date</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @dmails.each do |dmail| %>
|
<% @dmails.each do |dmail| %>
|
||||||
<% if params[:folder] == "sent" %>
|
<% if params[:folder] == "sent" %>
|
||||||
@@ -17,3 +23,5 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
@@ -5,3 +5,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
<div class="c-dmails">
|
<div class="c-dmails">
|
||||||
<div class="a-show">
|
<div class="a-show">
|
||||||
<div class="dmail">
|
<div class="dmail">
|
||||||
<h1><%= @dmail.title %></h1>
|
<h1>Show Message</h1>
|
||||||
|
<h2><%= @dmail.title %></h2>
|
||||||
<%= format_text(@dmail.body) %>
|
<%= format_text(@dmail.body) %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -11,3 +12,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
@@ -2,9 +2,12 @@
|
|||||||
<menu>
|
<menu>
|
||||||
<li><%= link_to "Listing", users_path %></li>
|
<li><%= link_to "Listing", users_path %></li>
|
||||||
<% unless CurrentUser.is_anonymous? %>
|
<% unless CurrentUser.is_anonymous? %>
|
||||||
|
<% if @user %>
|
||||||
|
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
|
||||||
|
<% end %>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
<li><%= link_to "Settings", edit_user_path(CurrentUser.user) %></li>
|
<li><%= link_to "My settings", edit_user_path(CurrentUser.user) %></li>
|
||||||
<li><%= link_to "Profile", user_path(CurrentUser.user) %></li>
|
<li><%= link_to "My profile", user_path(CurrentUser.user) %></li>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
<li><%= link_to "Sign out", session_path, :method => :delete %></li>
|
<li><%= link_to "Sign out", session_path, :method => :delete %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ Danbooru::Application.routes.draw do
|
|||||||
get :search
|
get :search
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :dmails
|
resources :dmails do
|
||||||
|
collection do
|
||||||
|
get :search
|
||||||
|
end
|
||||||
|
end
|
||||||
resource :dtext_preview, :only => [:create]
|
resource :dtext_preview, :only => [:create]
|
||||||
resources :favorites
|
resources :favorites
|
||||||
resources :forum_topics
|
resources :forum_topics
|
||||||
|
|||||||
Reference in New Issue
Block a user