From dc480ecd443b79ab3fa36a8c8a56c5a526f91483 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 20 Nov 2014 17:24:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=85=B1=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=E5=BC=95=E7=94=A8=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/memos/_reply_box.html.erb | 11 ++++++----- app/views/memos/show.html.erb | 20 +++++++++++++------- 3 files changed, 20 insertions(+), 13 deletions(-) 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' %>

<%= f.submit value: l(:label_reply_plural), class: "replies" %> <% end %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index b7e5e2749..5222b466f 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -117,28 +117,34 @@
- +
- - +
<%= 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 %> +
<% end %> - + <% if User.current.login? %>