贴吧吧主增加删除帖子。删除回复功能
This commit is contained in:
parent
eaa22b3662
commit
62a7d6f76e
|
@ -203,7 +203,7 @@ class Memo < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroyable_by? user
|
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?
|
#self.author == user || user.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
:class => 'fr mr20 undis',
|
:class => 'fr mr20 undis',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:title => l(:button_delete)
|
: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 %>
|
||||||
</span>
|
</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,15 +6,15 @@
|
||||||
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
||||||
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
|
||||||
<% @flag = @is_valuate.first.praise_or_tread %>
|
<% @flag = @is_valuate.first.praise_or_tread %>
|
||||||
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
|
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
|
||||||
<a href="javascript:void(0);" class="<%= obj.author.id == User.current.id ? 'linkGrey2 postLikeIcon mr30':'linkGrey2 postLikeIcon' %>" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
<a href="javascript:void(0);" class="<%= (obj.author.id == User.current.id || obj.forum.creator == User.current || User.current.admin?) ? 'linkGrey2 postLikeIcon mr30':'linkGrey2 postLikeIcon' %>" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if user_id == obj.author_id %>
|
<% if user_id == obj.author_id %>
|
||||||
|
|
||||||
<!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>-->
|
<!--<%#= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>-->
|
||||||
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon mr30" title="<%= l(:label_issue_not_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
<a href="javascript:void(0);" class="linkGrey2 postLikeIcon mr30" title="<%= l(:label_issue_not_praise_over)%>" > <%= get_praise_num(obj)%></a>
|
||||||
|
<% elsif user_id == obj.forum.creator_id || User.current.admin? %>
|
||||||
|
<a href="<%= praise_tread_praise_plus_path({:obj_id => obj.id,:obj_type => obj.class, :horizontal => horizontal })%>" data-remote="true" class="linkGrey2 postLikeIcon mr30" title="<%= l(:label_issue_praise)%>" > <%= get_praise_num(obj) %></a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<!-- 积分少于2分不能踩帖 -->
|
<!-- 积分少于2分不能踩帖 -->
|
||||||
<%# if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
<%# if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
|
||||||
|
|
|
@ -26,19 +26,21 @@
|
||||||
<%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
|
<%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="postThemeWrap">
|
<div class="postThemeWrap">
|
||||||
<% if @memo.author.id == User.current.id || User.current.admin? %>
|
<% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
|
||||||
<div class="homepagePostSetting">
|
<div class="homepagePostSetting">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
|
<% if @memo.author.id == User.current.id || User.current.admin? %>
|
||||||
|
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
|
||||||
|
<% end %>
|
||||||
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
|
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
|
||||||
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_memo_link" ></a></li>
|
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum, @memo) %>" data-method="delete" id="del_memo_link" ></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<%end%>
|
<% end %>
|
||||||
<div class="postDetailTitle fl">
|
<div class="postDetailTitle fl">
|
||||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @memo.subject%></a>
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @memo.subject%></a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
<div class="homepagePostReplyBannerCount">回复(<%= @reply_count %>)</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @memo.id %>">
|
<div class="" id="reply_div_<%= @memo.id %>">
|
||||||
|
@ -85,7 +87,7 @@
|
||||||
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
||||||
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
||||||
<div nhname='toolbar_container_<%= @memo.id%>'></div>
|
<div nhname='toolbar_container_<%= @memo.id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id%>' name="memo[content]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id %>' name="memo[content]"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p nhname='contentmsg_<%= @memo.id%>'></p>
|
<p nhname='contentmsg_<%= @memo.id%>'></p>
|
||||||
|
|
Loading…
Reference in New Issue