教师列表
This commit is contained in:
parent
a98678e001
commit
fc36e4c01e
|
@ -98,10 +98,16 @@ class OrganizationsController < ApplicationController
|
|||
else
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
# params[:org_subfield_id] 存在即对应的栏目,否则进入组织动态
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
if @org_subfield.field_type == "Comptec" || @org_subfield.field_type == "Compstu"
|
||||
#@org_students = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =1;")
|
||||
@org_teachers = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =0;")
|
||||
else
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
end
|
||||
else
|
||||
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
<% end %>
|
||||
<% else %>
|
||||
<div style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<% if field.field_type == ("Post" || "Complex" || "Compstu" || "Comptec") %> <!--讨论帖子-->
|
||||
<% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %> <!--讨论帖子-->
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>-->
|
||||
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<div class="resources mt10">
|
||||
<div class="function-row">
|
||||
<input type="text" placeholder="搜索" class="teacher-list-search fl" />
|
||||
<a href="javascript:void(0);" class="teacher-search-icon fl"></a>
|
||||
<select class="teacher-search-type fr">
|
||||
<option>课程数</option>
|
||||
<option>学生数</option>
|
||||
<option>资源数</option>
|
||||
</select>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="teacher-list-row">
|
||||
<div>
|
||||
<div class="teacher-avatar"><img src="images/homepageImage.jpg" width="90" height="90" /></div>
|
||||
<div class="fl">
|
||||
<div class="ml25 mb20"><span class="teacher-name">尹刚</span><span class="f12 fontGrey2 mr15">国防科学技术大学</span><span class="f12 fontGrey2">教授</span></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">6000</div>
|
||||
<div class="block-title">课程数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">500</div>
|
||||
<div class="block-title">学生数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">8000</div>
|
||||
<div class="block-title">资源数</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="fr teacher-select">添加</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,45 @@
|
|||
<div class="resources mt10">
|
||||
<div class="function-row">
|
||||
<input type="text" placeholder="搜索" class="teacher-list-search fl" />
|
||||
<a href="javascript:void(0);" class="teacher-search-icon fl"></a>
|
||||
<select class="teacher-search-type fr">
|
||||
<option>课程数</option>
|
||||
<option>学生数</option>
|
||||
<option>资源数</option>
|
||||
</select>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% @org_teachers.each do |org_teacher| %>
|
||||
<% school = School.where("id =?", org_teacher.school_id).first %>
|
||||
<div class="teacher-list-row">
|
||||
<div>
|
||||
<div class="teacher-avatar"><img src="images/homepageImage.jpg" width="90" height="90" /></div>
|
||||
<div class="fl">
|
||||
<div class="ml25 mb20"><span class="teacher-name"><%= org_teacher.try(:realname).nil? ? org_teacher.try(:login) : org_teacher.try(:realname) %></span>
|
||||
<% unless school.nil? %>
|
||||
<span class="f12 fontGrey2 mr15"><%= school.name %></span>
|
||||
<% end %>
|
||||
<% unless org_teacher.nil? %>
|
||||
<span class="f12 fontGrey2"><%= org_teacher.technical_title %></span></div>
|
||||
<% end %>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num"><%= User.current.courses.count %></div>
|
||||
<div class="block-title">课程数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">500</div>
|
||||
<div class="block-title">学生数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">8000</div>
|
||||
<div class="block-title">资源数</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="fr teacher-select">添加</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,69 +1,77 @@
|
|||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||
<% if !params[:org_subfield_id].nil? && @org_subfield.field_type == "Compstu" %>
|
||||
<%= render 'organizations/show_students', :field => @org_subfield %>
|
||||
<% elsif !params[:org_subfield_id].nil? && @org_subfield.field_type == "Comptec" %>
|
||||
<%= render 'organizations/show_teachers', :field => @org_subfield %>
|
||||
<% else %>
|
||||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
|
||||
<% if params[:show_homepage].nil? and User.current.logged? %>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
|
||||
<% if params[:org_subfield_id].nil? %>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
<% if params[:show_homepage].nil? and User.current.logged? %>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
|
||||
<% if params[:org_subfield_id].nil? %>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
|
||||
<script>
|
||||
$(function() {
|
||||
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "100%", 'OrgActivity');
|
||||
});
|
||||
</script>
|
||||
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
|
||||
<script>
|
||||
$(function() {
|
||||
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "100%", 'OrgActivity');
|
||||
});
|
||||
</script>
|
||||
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
||||
<%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
|
||||
<% end %>
|
||||
<% if @org_activities %>
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities => @org_activities,
|
||||
:page=> @page,
|
||||
:org => @organization,
|
||||
:org_act_count=> @org_activities.count} %>
|
||||
<% end %>
|
||||
<% if @org_activities %>
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities => @org_activities,
|
||||
:page=> @page,
|
||||
:org => @organization,
|
||||
:org_act_count=> @org_activities.count} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.ml15{ margin-left:15px;}
|
||||
.ml20{ margin-left:20px;}
|
||||
.ml24{margin-left:24px;}
|
||||
.ml25{margin-left:25px;}
|
||||
.ml36{ margin-left:36px; }
|
||||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
|
|
|
@ -159,4 +159,22 @@ a.blue-btn {
|
|||
background-color: #269ac9;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/*名师榜20160505*/
|
||||
.function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;}
|
||||
.teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;}
|
||||
.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:23px; border:1px solid #ccc; border-left:none;}
|
||||
.teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;}
|
||||
.teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;}
|
||||
.teacher-avatar {float:left;}
|
||||
.teacher-name {font-size:18px; color:#333; margin-right:15px;}
|
||||
.teacher-social-block {width:90px; float:left; text-align:center;}
|
||||
.block-num {font-size:16px; color:#000;}
|
||||
.block-title {font-size:12px; color:#999;}
|
||||
.block-slice {width:1px; height:40px; background-color:#e0e0e0; float:left; margin-top:3px;}
|
||||
.teacher-intro {font-size:13px; color:#999; line-height:24px; height:72px; overflow:hidden;}
|
||||
a.teacher-select {font-size:13px; color:#fff; padding:3px 18px; background-color:#269ac9;}
|
||||
a.teacher-select:hover {background-color:#297fb8;}
|
||||
a.follow-button {font-size:13px; color:#272727; padding:3px 5px; background-color:#f2efef;}
|
||||
a.follow-button:hover {background-color:#c1c1c1;}
|
||||
|
|
Loading…
Reference in New Issue