课程/项目帖子中,用户在登陆情况下即可发送帖子

This commit is contained in:
ouyangxuhua 2015-12-31 14:00:33 +08:00
parent f0111ad79d
commit 22be66f85c
2 changed files with 32 additions and 28 deletions

View File

@ -37,28 +37,30 @@
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
</div>
<div class="postThemeWrap">
<% if @topic.author.id == User.current.id%>
<% if User.current.logged? %>
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to(
l(:button_edit),
{:action => 'edit', :id => @topic},
:class => 'postOptionLink'
) if @message.course_editable_by?(User.current) %>
</li>
<li>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => @topic},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.course_destroyable_by?(User.current) %>
<%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
</li>
<% if @topic.author.id == User.current.id %>
<li>
<%= link_to(
l(:button_edit),
{:action => 'edit', :id => @topic},
:class => 'postOptionLink'
) if @message.course_editable_by?(User.current) %>
</li>
<li>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => @topic},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.course_destroyable_by?(User.current) %>
</li>
<% end %>
<li> <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>
</ul>
</li>
</ul>

View File

@ -99,20 +99,22 @@
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
</div>
<div class="postThemeWrap">
<% if @topic.author.id == User.current.id%>
<% if User.current.logged? %>
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
</li>
<li>
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.destroyable_by?(User.current) %>
</li>
<% if @topic.author.id == User.current.id %>
<li>
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
</li>
<li>
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.destroyable_by?(User.current) %>
</li>
<% end %>
<li> <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>
</ul>
</li>