diff --git a/app/assets/stylesheets/specific/dmails.css.scss b/app/assets/stylesheets/specific/dmails.css.scss index 3c36e0a46..8010b4be8 100644 --- a/app/assets/stylesheets/specific/dmails.css.scss +++ b/app/assets/stylesheets/specific/dmails.css.scss @@ -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; diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb index 6021cdd11..07191436c 100644 --- a/app/controllers/dmails_controller.rb +++ b/app/controllers/dmails_controller.rb @@ -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 diff --git a/app/models/dmail.rb b/app/models/dmail.rb index edd9e9c0f..09bbce22e 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -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 diff --git a/app/views/dmails/_form.html.erb b/app/views/dmails/_form.html.erb index 7edd51cec..8cf67afec 100644 --- a/app/views/dmails/_form.html.erb +++ b/app/views/dmails/_form.html.erb @@ -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" %> diff --git a/app/views/dmails/index.html.erb b/app/views/dmails/index.html.erb index 146bec896..a53b5b03c 100644 --- a/app/views/dmails/index.html.erb +++ b/app/views/dmails/index.html.erb @@ -13,7 +13,7 @@
<% @dmails.each do |dmail| %> -