From 231f8f3526ed7a1db35f98ffa8618ddd5f9802e4 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 5 May 2016 21:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95=E4=B8=AD?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=86=E9=9A=90=E8=97=8F=EF=BC=8C=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=BB=8F=E8=BF=87=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9=E5=8F=8A=20=E6=A1=86?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 6 ++++++ app/helpers/sub_domains_helper.rb | 2 ++ app/views/layouts/base_sub_domain.html.erb | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 03bbcad3c..07738fc9c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 从硬盘上删除对应的资源文件 diff --git a/app/helpers/sub_domains_helper.rb b/app/helpers/sub_domains_helper.rb index 1a711b5e4..ee1c18e71 100644 --- a/app/helpers/sub_domains_helper.rb +++ b/app/helpers/sub_domains_helper.rb @@ -1,3 +1,5 @@ module SubDomainsHelper include OrganizationsHelper + + end diff --git a/app/views/layouts/base_sub_domain.html.erb b/app/views/layouts/base_sub_domain.html.erb index 8bc6b736f..bcb2424e7 100644 --- a/app/views/layouts/base_sub_domain.html.erb +++ b/app/views/layouts/base_sub_domain.html.erb @@ -98,15 +98,15 @@ <% if is_default_field?(field) %> <% case field.name %> <% when 'activity' %> - <% when 'course' %> - <% when 'project' %> - <% end %> @@ -117,7 +117,7 @@