名师默认显示5个,没有则不显示

hjq_resource v20160513_03
huang 9 years ago
parent 41214bd762
commit 467ee60657

@ -183,7 +183,7 @@ module OrganizationsHelper
end end
def excellent_teachers def excellent_teachers
User.where("excellent_teacher =?",true) User.where("excellent_teacher =?",true).first(5)
end end
end end

@ -1,3 +1,4 @@
<% unless excellent_teachers.count == 0 %>
<div class="sn-teacher-wrap" style="display:<%= field.hide == 0?'block':'none' %>;"> <div class="sn-teacher-wrap" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title sn-mb5"><%= field.name %> <h2 class="h2-title sn-mb5"><%= field.name %>
<%= link_to "更多", teachers_organization_path(@organization, :type => "famous"), :target => "_blank", :class => "more" %> <%= link_to "更多", teachers_organization_path(@organization, :type => "famous"), :target => "_blank", :class => "more" %>
@ -28,3 +29,5 @@
<script> <script>
$(".sn-teacher-list:last").addClass("sn-border-none"); $(".sn-teacher-list:last").addClass("sn-border-none");
</script> </script>
<% end %>

Loading…
Cancel
Save