dev_local
cxt 6 years ago
parent 4cfc9a6171
commit 885ace98a9

@ -1184,8 +1184,11 @@ end
def partners
@menu_type = 6
@sub_type = 3
@partners = Partner.includes(:school).order("partners.created_at desc")
@partners = @partners.where("concat(schools.name) like ? ", "%#{params[:search]}%") unless params[:search].blank?
if params[:search].blank?
@partners = Partner.includes(:school).order("partners.created_at desc")
else
@partners = Partner.where("name like ? ", "%#{params[:search]}%").includes(:school).order("partners.created_at desc")
end
@current_partner = nil
if params[:partner]
@ -1194,8 +1197,9 @@ end
@current_partner = @partners[0] if @partners.size > 0
end
@partners.each do |part|
part.active = "active" if part.id == @current_partner.id
respond_to do |format|
format.js
format.html
end
end

@ -0,0 +1,5 @@
<% @partners.each_with_index do |partner,index| %>
<li>
<%= link_to "#{partner.name}", partners_managements_path(:partner => partner), :class => "#{partner.id == @current_partner.id ? 'active' : ''}" %>
</li>
<% end %>

@ -0,0 +1,25 @@
<% if @current_partner.present? %>
<div class="with75 fl pl20">
<div class="edu-back-white">
<div>
<div class="padding10-20">
<p class="mb20"><span class="mr30 color-grey-9">添加时间</span><span class="color-grey-6"><%= format_time @current_partner.try(:created_at) %></span></p>
<div class="clearfix">
<span class="mr45 color-grey-9 fl">管理员</span>
<ul class="manageList">
<li>
<%= link_to '+', add_partner_member_box_managements_path(:partner => @current_partner.try(:id)), :remote => true, :class => "addManage" %>
</li>
<div id="partner_member_list" class="fl">
<%= render :partial => "partner_member_list", :locals => {partner: @current_partner} %>
</div>
</ul>
</div>
</div>
<div class="tableList" id="partner_customer_list">
<%= render :partial => "partner_customer_list" %>
</div>
</div>
</div>
</div>
<% end %>

@ -7,39 +7,14 @@
<div class="clearfix mt20">
<div class="with25 fl edu-back-white">
<%= link_to "+添加",all_partners_managements_path,remote:true,class:"color-blue addOperation" %>
<ul class="partnerList">
<% @partners.each_with_index do |partner,index| %>
<li>
<%= link_to "#{partner.name}", partners_managements_path(:partner => partner), :class => "#{partner.active}" %>
</li>
<% end %>
<ul class="partnerList" id="partner_list">
<%= render :partial => "partner_list" %>
</ul>
</div>
<% if @current_partner.present? %>
<div class="with75 fl pl20">
<div class="edu-back-white">
<div>
<div class="padding10-20">
<p class="mb20"><span class="mr30 color-grey-9">添加时间</span><span class="color-grey-6"><%= format_time @current_partner.try(:created_at) %></span></p>
<div class="clearfix">
<span class="mr45 color-grey-9 fl">管理员</span>
<ul class="manageList">
<li>
<%= link_to '+', add_partner_member_box_managements_path(:partner => @current_partner.try(:id)), :remote => true, :class => "addManage" %>
</li>
<div id="partner_member_list" class="fl">
<%= render :partial => "partner_member_list", :locals => {partner: @current_partner} %>
</div>
</ul>
</div>
</div>
<div class="tableList" id="partner_customer_list">
<%= render :partial => "partner_customer_list" %>
</div>
</div>
</div>
</div>
<% end %>
<div id="partner_main_div">
<%= render :partial => "partner_main_div" %>
</div>
</div>
</div>

@ -0,0 +1,2 @@
$("#partner_list").html("<%= j(render :partial => "partner_list") %>");
$("#partner_main_div").html("<%= j(render :partial => "partner_main_div") %>");
Loading…
Cancel
Save