dev_local
cxt 6 years ago
parent 4cfc9a6171
commit 885ace98a9

@ -1184,8 +1184,11 @@ end
def partners def partners
@menu_type = 6 @menu_type = 6
@sub_type = 3 @sub_type = 3
@partners = Partner.includes(:school).order("partners.created_at desc") if params[:search].blank?
@partners = @partners.where("concat(schools.name) like ? ", "%#{params[:search]}%") unless 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 @current_partner = nil
if params[:partner] if params[:partner]
@ -1194,8 +1197,9 @@ end
@current_partner = @partners[0] if @partners.size > 0 @current_partner = @partners[0] if @partners.size > 0
end end
@partners.each do |part| respond_to do |format|
part.active = "active" if part.id == @current_partner.id format.js
format.html
end end
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="clearfix mt20">
<div class="with25 fl edu-back-white"> <div class="with25 fl edu-back-white">
<%= link_to "+添加",all_partners_managements_path,remote:true,class:"color-blue addOperation" %> <%= link_to "+添加",all_partners_managements_path,remote:true,class:"color-blue addOperation" %>
<ul class="partnerList"> <ul class="partnerList" id="partner_list">
<% @partners.each_with_index do |partner,index| %> <%= render :partial => "partner_list" %>
<li>
<%= link_to "#{partner.name}", partners_managements_path(:partner => partner), :class => "#{partner.active}" %>
</li>
<% end %>
</ul> </ul>
</div> </div>
<% if @current_partner.present? %>
<div class="with75 fl pl20"> <div id="partner_main_div">
<div class="edu-back-white"> <%= render :partial => "partner_main_div" %>
<div> </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> </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