diff --git a/app/models/memo.rb b/app/models/memo.rb index 847795b4f..cfc509923 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -88,7 +88,7 @@ class Memo < ActiveRecord::Base def editable_by? user # user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)) - (user && self.author == user) || user.admin? + user.admin? || self.author == user end def destroyable_by? user diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index e3346ee32..938952c32 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -1,5 +1,5 @@ <%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %> - <%= f.hidden_field :subject, :required => true, value: "RE: "+@memo.subject %> + <%= f.hidden_field :subject, :required => true, value: @memo.subject %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
@@ -7,11 +7,12 @@ <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= label_tag(l(:label_reply_plural)) %>: - <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %> - + <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %> -<%= l(:label_attachment_plural) %>
- <%= render :partial => 'attachments/form' %>
+
+ <%= l(:label_attachment_plural) %>
+
+ <%= render :partial => 'attachments/form' %>
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> | -
- <%=h sanitize(reply.content.html_safe) %>
+ |
+
+ <%=h sanitize(reply.content.html_safe) %>
+
<% if reply.attachments.any?%> - <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> - <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> + <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> + <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> <% end %> |
<%= authoring reply.created_at, reply.author %> | ++ <%= authoring reply.created_at, reply.author %> + |