From 878bcc8cf13008e9638379db127e4bd1c84665f2 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 9 May 2016 14:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E5=88=9B=E5=BB=BA=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=B7=BB=E5=8A=A0=E8=80=81=E5=B8=88=E3=80=81=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 6 ++++++ .../_org_left_subfield_list.html.erb | 1 - app/views/organizations/setting.html.erb | 20 +++++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 917ccc01c..4b6139a6a 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -148,4 +148,10 @@ module OrganizationsHelper org_acts end + def org_subfield_had_created?(org, type) + sub_field = org.org_subfields.select{|subfield| subfield.field_type == type} + result = sub_field.length > 0 ? true : false + result + end + end diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 39837df88..77a2a014b 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -118,7 +118,6 @@ <% end %> - <% else %>
<% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index c989b259c..4c9a9e92e 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -152,10 +152,22 @@ - - - - +
  • + + +
  • + <% unless org_subfield_had_created?(@organization, "Comptec") %> +
  • + + +
  • + <% end %> + <% unless org_subfield_had_created?(@organization, "Compstu") %> +
  • + + +
  • + <% end %>
  • 新增