From a98678e001ab0d61b0effd06d81ec3d164775611 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 9 May 2016 15:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=96=B9=E6=B3=95=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 15 +++++++++++++++ .../_org_left_subfield_list.html.erb | 2 +- app/views/organizations/_subfield_list.html.erb | 13 +++++-------- app/views/organizations/setting.html.erb | 6 +++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4b6139a6a..981921d0b 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -154,4 +154,19 @@ module OrganizationsHelper result end + def org_subfield_type(field) + case field.field_type + when "Post" + result = "帖子" + when "Resource" + result = "资源" + when "Compstu" + result = "学生" + when "Comptec" + result = "教师" + when "Complex" + result = "综合" + end + 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 77a2a014b..6e01e9c50 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -91,7 +91,7 @@ <% end %> <% else %>
- <% if field.field_type == "Post" %> + <% if field.field_type == ("Post" || "Complex" || "Compstu" || "Comptec") %>
<% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 4619ed337..0d6b5aac2 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -8,7 +8,6 @@
  • 操作
  • - <% subfields.each do |field| %> <% if is_default_field?(field) %> <% name = get_default_name(field) %> @@ -32,10 +31,9 @@
    <%= select( :name,:group_id, subfield_status_option_default, { :include_blank => false,:selected => field.status}, - { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> + { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> <% end %> <% end %> -
  • 默认
  • <%= field.hide==0?"隐藏":"可见" %> @@ -60,20 +58,19 @@
  • 新增
  • <% if field.field_type == "Resource" %> - 列表 + 默认 <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
    <%= select( :name,:group_id, subfield_status_option, - { :include_blank => false,:selected => field.status}, - {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> + { :include_blank => false,:selected => field.status}, + { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> <% end %> - <% end %>
  • -
  • <%= field.field_type == "Post" ? "帖子" : "资源" %>
  • +
  • <%= org_subfield_type field %>
  • - +
  • <% unless org_subfield_had_created?(@organization, "Comptec") %>
  • - +
  • <% end %> <% unless org_subfield_had_created?(@organization, "Compstu") %>
  • - +
  • <% end %>
  • 新增