diff --git a/app/models/memo.rb b/app/models/memo.rb index a580f02a8..3c36875d1 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -203,7 +203,7 @@ class Memo < ActiveRecord::Base end def destroyable_by? user - (user && self.author == user) || user.admin? + (user && self.author == user) || user.admin? || self.forum.creator == user #self.author == user || user.admin? end diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index c30b1629a..9d6726ef1 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -56,7 +56,7 @@ :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) - ) if @memo.author.id == User.current.id || User.current.admin? %> + ) if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
diff --git a/app/views/memos/_praise_tread.html.erb b/app/views/memos/_praise_tread.html.erb index 31d24af17..3c879e474 100644 --- a/app/views/memos/_praise_tread.html.erb +++ b/app/views/memos/_praise_tread.html.erb @@ -6,15 +6,15 @@ <% @is_valuate = is_praise_or_tread(obj,user_id)%> <% if @is_valuate.size > 0 %> <% @flag = @is_valuate.first.praise_or_tread %> - <% if @flag == 1 %> - <%= get_praise_num(obj)%> + <% if @flag == 1 %> + <%= get_praise_num(obj)%> <% end %> <% else %> <% if user_id == obj.author_id %> - <%= get_praise_num(obj)%> - + <% elsif user_id == obj.forum.creator_id || User.current.admin? %> + <%= get_praise_num(obj) %> <% else %> <%# if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index e17692b00..61c06d040 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -26,19 +26,21 @@ <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
- <% if @memo.author.id == User.current.id || User.current.admin? %> + <% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
- <%end%> + <% end %>
主题: <%= @memo.subject%>
@@ -67,7 +69,7 @@
-
回复(<%=@reply_count %>)
+
回复(<%= @reply_count %>)
@@ -85,7 +87,7 @@ <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
- +