项目/课程讨论区的动态增加设置菜单

This commit is contained in:
cxt 2015-12-31 15:36:42 +08:00
parent 2c5a4f8a13
commit 7e76a32480
3 changed files with 58 additions and 14 deletions

View File

@ -1,4 +1,4 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
@ -43,17 +43,34 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul> <% if activity.author.id == User.current.id%>
<li class="homepagePostSettingIcon"> <div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
<ul class="homepagePostSettiongText"> <ul>
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li> <li class="homepagePostSettingIcon">
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li> <ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li> <li>
<%= link_to(
l(:button_edit),
edit_board_message_path(activity.id,:board_id=>activity.board_id),
:class => 'postOptionLink'
) if activity.course_editable_by?(User.current) %>
</li>
<li>
<%= link_to(
l(:button_delete),
delete_board_message_path(activity.id,:board_id=>activity.board_id),
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if activity.course_destroyable_by?(User.current) %>
<%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
</li>
</ul>
</li>
</ul> </ul>
</li> </div>
</ul> <% end %>
</div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,4 +1,4 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
@ -44,6 +44,33 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div> <div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<% if activity.author.id == User.current.id%>
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to(
l(:button_edit),
edit_board_message_path(activity.id,:board_id=>activity.board_id),
:class => 'postOptionLink'
) if activity.editable_by?(User.current) %>
</li>
<li>
<%= link_to(
l(:button_delete),
delete_board_message_path(activity.id,:board_id=>activity.board_id),
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if activity.destroyable_by?(User.current) %>
<%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
</li>
</ul>
</li>
</ul>
</div>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -413,12 +413,12 @@ RedmineApp::Application.routes.draw do
match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields' match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields'
get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message' get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit',:as=>'edit_board_message'
post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message' post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy' post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy',:as=>'delete_board_message'
match 'messages/join_org_subfield', :to => 'messages#join_org_subfield' match 'messages/join_org_subfield', :to => 'messages#join_org_subfield'
match 'messages/get_subfield_on_click_org', :to => 'messages#get_subfield_on_click_org' match 'messages/get_subfield_on_click_org', :to => 'messages#get_subfield_on_click_org'
match 'messages/join_org_subfields', :to => 'messages#join_org_subfields' match 'messages/join_org_subfields', :to => 'messages#join_org_subfields'