|
|
|
@ -37,11 +37,12 @@
|
|
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
|
|
|
|
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
|
|
|
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
|
|
|
|
|
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
|
|
|
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
|
|
|
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
|
|
|
|
|
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
|
|
|
|
<% if @course.is_public? %>
|
|
|
|
@ -55,14 +56,15 @@
|
|
|
|
|
<%= link_to( '删除资源', attachment_path(file),
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<%else %>
|
|
|
|
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%else%>
|
|
|
|
|
<ul class="resourceSendO">
|
|
|
|
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %></li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|