Merge branch 'hjq_beidou' into develop

Conflicts:
	app/helpers/organizations_helper.rb
	app/views/organizations/_org_subfield_rightM2.html.erb
This commit is contained in:
huang 2016-05-13 16:56:02 +08:00
commit e8afcf9157
6 changed files with 18 additions and 6 deletions

View File

@ -164,6 +164,7 @@ class OrganizationsController < ApplicationController
return
end
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
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

View File

@ -183,7 +183,8 @@ module OrganizationsHelper
end
def excellent_teachers
User.where("excellent_teacher =?",true).first(5)
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
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 order by course_count desc")
end
end

View File

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

View File

@ -5,7 +5,7 @@
</h2>
<% excellent_teachers.each do |teacher| %>
<div class="sn-teacher-list">
<%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %>
<%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl sn-avatar-circle", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %>
<!--<a href="javascript:void(0);" target="_blank"><img src="images/avatar_default.png" width="60" height="60" style="display:block;" class="sn-fl" /></a>-->
<div class="sn-teacher-info">
<%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %></a>

View File

@ -1,3 +1,12 @@
<div class="homepageRightBanner">
<div class="f16 fontGrey3">
<% if @type == "famous" %>
名师列表
<% else %>
<%= @field.name %>
<% end %>
</div>
</div>
<div class="resources mt10">
<div class="function-row" id="org_teacher_search">
<%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :type => @type),
@ -15,7 +24,7 @@
<!--<option value="3">资源数</option>-->
<!--</select>-->
<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 => "fontGrey2" %>
</div>
<div class="cl"></div>
</div>

View File

@ -241,8 +241,8 @@ ul.sn-inner-pages li a:hover{ background-color:#24366e; color:#fff; text-decorat
/*名师榜*/
.sn-teacher-list {margin:0 20px; padding:15px 0; border-bottom:1px solid #e9e9e9;}
a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;}
.sn-teacher-unit {width:154px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;}
a.sn-teacher-name {width:60px; font-size:18px; color:#777; float:left;}
.sn-teacher-unit {width:169px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;}
.sn-teacher-info {height:30px; line-height:30px; vertical-align:middle; float:left; margin-left:15px;}
.sn-teacher-social {height:30px; line-height:30px; vertical-align:middle; float:left; color:#999; font-size:12px; margin-left:15px;}
.sn-border-none {border:none;}
@ -250,6 +250,7 @@ a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;}
.sn-teacher-avatar2 {margin:0 18px; padding:18px 0;}
.sn-teacher-info2 {color:#666; text-align:center; font-size:16px;}
.sn-info2-hidden {width:153px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0 auto;}
.sn-avatar-circle {border-radius:50%;}
/*弹框*/
.upload_con h2 {