科大名师,和名师列表添加标题

This commit is contained in:
huang 2016-05-13 16:30:45 +08:00
parent afbe5317cb
commit 39d014355b
3 changed files with 10 additions and 3 deletions

View File

@ -164,6 +164,7 @@ class OrganizationsController < ApplicationController
return return
end end
q = params[:search].nil? ? "" : "#{params[:search].strip}" q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = OrgSubfield.find(params[:org_subfield_id])
@type = params[:type] @type = params[:type]
if @type == "courses" || @type.nil? if @type == "courses" || @type.nil?
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count

View File

@ -102,7 +102,7 @@
<% end %> <% end %>
<% else %> <% else %>
<% if field.field_type == "Comptec" %> <% if field.field_type == "Comptec" %>
<%= link_to "#{field.name}", teachers_organization_path(organization), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% else %> <% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %> <% end %>

View File

@ -1,5 +1,11 @@
<div class="homepageRightBanner"> <div class="homepageRightBanner">
<div class="f16 fontGrey3">名师榜</div> <div class="f16 fontGrey3">
<% if @type == "famous" %>
名师列表
<% else %>
<%= @field.name %>
<% end %>
</div>
</div> </div>
<div class="resources mt10"> <div class="resources mt10">
<div class="function-row" id="org_teacher_search"> <div class="function-row" id="org_teacher_search">
@ -18,7 +24,7 @@
<!--<option value="3">资源数</option>--> <!--<option value="3">资源数</option>-->
<!--</select>--> <!--</select>-->
<div class="sn-font-grey fr"> <div class="sn-font-grey fr">
<%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous"), :class => "fontGrey" %> <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey" %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>