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

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) container.update_column(:visits, container.visits + 1)
end 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 # Time 2015-03-24 15:27:29
# Author lizanle # Author lizanle
# Description 从硬盘上删除对应的资源文件 # Description 从硬盘上删除对应的资源文件

View File

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

View File

@ -98,15 +98,15 @@
<% if is_default_field?(field) %> <% if is_default_field?(field) %>
<% case field.name %> <% case field.name %>
<% when 'activity' %> <% 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" %> <%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
</li> </li>
<% when 'course' %> <% 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> <a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
</li> </li>
<% when 'project' %> <% 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> <a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
</li> </li>
<% end %> <% end %>
@ -117,7 +117,7 @@
</li> </li>
<!--二级目录--> <!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;"> <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| %> <% 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> <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 %> <% end %>