fixes #250
This commit is contained in:
@@ -5,6 +5,10 @@ div#c-dmails {
|
||||
max-width: 50em;
|
||||
}
|
||||
|
||||
tr.read-false {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#preview {
|
||||
margin: 1em 0;
|
||||
border: 1px solid #CCC;
|
||||
|
||||
@@ -27,6 +27,7 @@ class DmailsController < ApplicationController
|
||||
def show
|
||||
@dmail = Dmail.find(params[:id])
|
||||
check_privilege(@dmail)
|
||||
@dmail.mark_as_read!
|
||||
respond_with(@dmail)
|
||||
end
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ class Dmail < ActiveRecord::Base
|
||||
Dmail.transaction do
|
||||
copy = Dmail.new(params)
|
||||
copy.owner_id = copy.to_id
|
||||
copy.save!
|
||||
unless copy.to_id == CurrentUser.id
|
||||
copy.save!
|
||||
end
|
||||
|
||||
copy = Dmail.new(params)
|
||||
copy.owner_id = CurrentUser.id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= simple_form_for(dmail) do |f| %>
|
||||
<%= f.input :to_name, :label => "To" %>
|
||||
<%= f.input :title %>
|
||||
<%= f.input :title, :as => :string %>
|
||||
<%= dtext_field "dmail", "body" %>
|
||||
<%= f.button :submit, "Send" %>
|
||||
<%= dtext_preview_button "dmail", "body" %>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dmails.each do |dmail| %>
|
||||
<tr>
|
||||
<tr class="read-<%= dmail.is_read? %>">
|
||||
<td><%= compact_time(dmail.created_at) %></td>
|
||||
<td><%= link_to dmail.from_name, user_path(dmail.from) %></td>
|
||||
<td><%= link_to dmail.to_name, user_path(dmail.to) %></td>
|
||||
|
||||
Reference in New Issue
Block a user