From 2cb9f0cd05002ae53f050b2b1c4bea248cf5d1df Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 28 Apr 2016 14:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/helpers/organizations_helper.rb | 81 ++++--------------- .../organizations/_subfield_list.html.erb | 30 +++---- 3 files changed, 30 insertions(+), 83 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 2dd6ce474..75ca3e1ab 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -113,7 +113,7 @@ class OrganizationsController < ApplicationController #@project_acts_issues = get_project_activities_org @organization #@course_acts = get_course_activities_org @organization - render :layout => 'base_org2' + render :layout => 'base_org_newstyle' else render_403 end diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 3fdfc3aa0..b3b014de1 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -5,17 +5,17 @@ module OrganizationsHelper def find_user_not_in_current_org_by_name org - if params[:q] && params[:q].lstrip.rstrip != "" - scope = Principal.active.sorted.not_member_of_org(org).like(params[:q]) - else - scope = [] - end - principals = paginateHelper scope,10 - s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') - links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| - link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true - } - s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" ) + if params[:q] && params[:q].lstrip.rstrip != "" + scope = Principal.active.sorted.not_member_of_org(org).like(params[:q]) + else + scope = [] + end + principals = paginateHelper scope,10 + s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') + links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| + link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true + } + s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" ) end def get_default_name field @@ -63,67 +63,14 @@ module OrganizationsHelper def subfield_status_option type = [] option1 = [] - option1 << "左上" + option1 << "列表" option1 << "1" type << option1 option2 = [] - option2 << "中一" - option2 << "2" + option2 << "图片" + option2 << "0" type << option2 - option3 = [] - option3 << "中二" - option3 << "3" - type << option3 - option4 = [] - option4 << "中下" - option4 << "4" - type << option4 - option5 = [] - option5 << "左下" - option5 << "5" - type << option5 - option6 = [] - option6 << "右上" - option6 << "6" - type << option6 - option7 = [] - option7 << "右中" - option7 << "7" - type << option7 - option8 = [] - option8 << "右下" - option8 << "8" - type << option8 type end - def subfield_list_type subfield - case subfield.to_i - when 1 - resulet = "左上" - when 2 - resulet = "中一" - when 3 - resulet = "中二" - when 4 - resulet = "中下" - when 5 - resulet = "左下" - when 6 - resulet = "右上" - when 7 - resulet = "右中" - when 8 - resulet = "右下" - end - end - - - def get_subfield_acts field - org_subfield = OrgSubfield.find(field.id) - org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 - org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') - org_acts - end - end diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 7db41cba5..5f605f6d9 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -24,10 +24,10 @@