二级目录中设置了隐藏,鼠标经过的时候不显示内容及 框框

This commit is contained in:
huang 2016-05-05 21:23:34 +08:00
parent cd6124895d
commit 231f8f3526
3 changed files with 12 additions and 4 deletions

View File

@ -37,6 +37,12 @@ module ApplicationHelper
container.update_column(:visits, container.visits + 1)
end
def if_hidden_subdomain field
domains = field.sub_domains.map{|domain| domain.hide.to_i == 0}
result = domains.length > 0 ? true : false
return result
end
# Time 2015-03-24 15:27:29
# Author lizanle
# Description 从硬盘上删除对应的资源文件

View File

@ -1,3 +1,5 @@
module SubDomainsHelper
include OrganizationsHelper
end

View File

@ -98,15 +98,15 @@
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'activity' %>
<li class="nav-element-default">
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
</li>
<% when 'course' %>
<li class="nav-element-default">
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
</li>
<% when 'project' %>
<li class="nav-element-default">
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
</li>
<% end %>
@ -117,7 +117,7 @@
</li>
<!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %>
<li><a href="javascript:void(0);" class="sn-link-grey"><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => @org_subfield.id) %></a></li>
<% end %>