组织还原

This commit is contained in:
yuanke 2016-04-28 14:31:40 +08:00
parent 54a8e6871c
commit 2cb9f0cd05
3 changed files with 30 additions and 83 deletions

View File

@ -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

View File

@ -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

View File

@ -24,10 +24,10 @@
<li class="orgListStatus">默认</li>
<li class="orgListStatusList">
<% if field.name == "activity" %>
默认
默认
<% 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 %>
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
</div>
<%= select( :name,:group_id, subfield_status_option,
@ -60,18 +60,18 @@
<li class="orgListStatus">新增</li>
<li class="orgListStatusList">
<% 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 %>
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
</div>
<%= 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;"}) %>
<% end %>
<%= 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 %>
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
</div>
<%= 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;"}) %>
<% end %>
<% end %>
<% end %>
</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">
@ -158,9 +158,9 @@
$(edit_id).toggle();
$(edit_id).find('input').focus();
$(edit_id).find('input').on('keypress', function(e){
if (e.keyCode == 13){
this.blur();
}
if (e.keyCode == 13){
this.blur();
}
});
}