实训课程首页权限控制

dev_shixuns
daiao 6 years ago
parent 68301f5d4e
commit 3f09af9dbb

@ -1,19 +1,18 @@
<% result = User.current.is_certification_teacher || User.current.member_of_subject?(subject) %>
<% subjects.each do |subject| %>
<div class="square-Item">
<% if subject.repertoire.present? %>
<div class="tag-green"><span class="tag-name"><%= subject.repertoire.name %></span><img src="/images/educoder/tag2.png"></div>
<% end %>
<% if subject.status < 2 && !result %>
<% if params[:controller] != "welcome" && subject.status < 2 && !User.current.member_of_subject?(subject) %>
<div class="closeSquare">
<img src="/images/educoder/icon/lockclose.svg" class="mt80 mb25"/>
<p class="font-14 color-white">暂未开发</p>
</div>
<% end %>
<a href="<%= result || subject.status >= 2 ? subject_path(subject) : "javascript:void(0);" %>" class="square-img" target="_blank"><%= image_tag(url_to_avatar(subject)) %></a>
<a href="<%= subject_path(subject) %>" class="square-img" target="_blank"><%= image_tag(url_to_avatar(subject)) %></a>
<div class="square-main">
<p class="task-hide">
<%= link_to subject.name, "#{ result || subject.status >= 2 ? subject_path(subject) : "javascript:void(0);"}", :class => "justify color-grey-name", :target => "_blank" %>
<%= link_to subject.name, subject_path(subject), :class => "justify color-grey-name", :target => "_blank" %>
</p>
<p class="clearfix mt8 font-12 color-grey-B4">
<% if subject.stages_count > 0 %>

Loading…
Cancel
Save