列表优化
This commit is contained in:
parent
411ae6f89e
commit
9dc92fe817
|
@ -2858,8 +2858,7 @@ class UsersController < ApplicationController
|
|||
sort_name = "updated_at"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*").order("#{sort_name} #{sort_type}")
|
||||
|
||||
@courses = @user.courses.visible.where("is_delete =?", 0).order("#{sort_name} #{sort_type}")
|
||||
# @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a #{sort_type}")
|
||||
|
||||
#根据 作业+资源数排序
|
||||
|
@ -2904,7 +2903,7 @@ class UsersController < ApplicationController
|
|||
sort_name = "updated_on"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
@projects = @user.projects.visible.select("projects.*").order("#{sort_name} #{sort_type}")
|
||||
@projects = @user.projects.visible.order("#{sort_name} #{sort_type}")
|
||||
# @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a #{sort_type}")
|
||||
|
||||
#根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num
|
||||
|
|
|
@ -16,51 +16,55 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<ul class="list-file">
|
||||
<li><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
|
||||
<% end %>
|
||||
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<span class="c_red ml10 fr">[已设为首页]</span>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt">
|
||||
<span><%= count>0 ? "#{count}" :"0" %></span>
|
||||
<span>回复</span>
|
||||
<span>|</span>
|
||||
<span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" :"0" %></span>
|
||||
<span>赞</span>
|
||||
</p>
|
||||
</li>
|
||||
<% if topics.any? %>
|
||||
<% topics.each do |activity| %>
|
||||
<ul class="list-file">
|
||||
<li><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
|
||||
<% end %>
|
||||
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<span class="c_red ml10 fr">[已设为首页]</span>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt">
|
||||
<span><%= count>0 ? "#{count}" :"0" %></span>
|
||||
<span>回复</span>
|
||||
<span>|</span>
|
||||
<span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" :"0" %></span>
|
||||
<span>赞</span>
|
||||
</p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -75,10 +75,10 @@
|
|||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var coursecount = <%= @user.courses.visible.where("is_delete =?", 0).select("courses.* FROM `course_activities` WHERE course_activities.course_id = courses.id) ").count %>;
|
||||
var coursecount = <%= @user.courses.visible.where("is_delete =?", 0).count %>;
|
||||
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
|
||||
|
||||
if((coursecount == courseshowcount)&&(coursecount > 5) ){
|
||||
if((coursecount <= courseshowcount)&&(coursecount > 5) ){
|
||||
$("#user_show_more_course").hide();
|
||||
$('#user_hide_course').show();
|
||||
}
|
||||
|
|
|
@ -56,10 +56,10 @@
|
|||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var projectcount = <%= @user.projects.visible.select("projects.* FROM `forge_activities` WHERE forge_activities.project_id = projects.id) ").count %>;
|
||||
var projectcount = <%= @user.projects.visible.count %>;
|
||||
var projectshowcount = document.getElementsByClassName("projectsLineGrey").length;
|
||||
|
||||
if((projectcount == projectshowcount)&&(projectcount > 5)){
|
||||
if((projectcount <= projectshowcount)&&(projectcount > 5)){
|
||||
$("#user_show_more_project").hide();
|
||||
$('#user_hide_project').show();
|
||||
}
|
||||
|
|
|
@ -15,54 +15,58 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<% if topics.any? %>
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,38 +15,42 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发布时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% count=activity.comments.count %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<% if topics.any? %>
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发布时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% count=activity.comments.count %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,54 +15,58 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54 } %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<% if topics.any? %>
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54 } %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -14,42 +14,46 @@
|
|||
</div>
|
||||
|
||||
<div class="bloglistbox">
|
||||
<% @courses.each do |course|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<% if @courses.any? %>
|
||||
<% @courses.each do |course|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">
|
||||
创建时间:<%= format_time(course.created_at) %>
|
||||
</span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(course.updated_at) %></span>
|
||||
<span class="grayTxt">
|
||||
开课学期: <span><%= current_time_and_term course %></span>
|
||||
</span>
|
||||
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<% homework_num = course.homework_commons.count %>
|
||||
<% else %>
|
||||
<% homework_num = course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= homework_num %></span><span>作业</span><span>|</span><span> <%= visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">
|
||||
创建时间:<%= format_time(course.created_at) %>
|
||||
</span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(course.updated_at) %></span>
|
||||
<span class="grayTxt">
|
||||
开课学期: <span><%= current_time_and_term course %></span>
|
||||
</span>
|
||||
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<% homework_num = course.homework_commons.count %>
|
||||
<% else %>
|
||||
<% homework_num = course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= homework_num %></span><span>作业</span><span>|</span><span> <%= visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,31 +14,35 @@
|
|||
</div>
|
||||
|
||||
<div class="bloglistbox">
|
||||
<% @projects.each do |project|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<% projectUser = User.where("id=?",project.user_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<% if @projects.any? %>
|
||||
<% @projects.each do |project|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<% projectUser = User.where("id=?",project.user_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">创建时间:<%= format_time(project.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(project.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">创建时间:<%= format_time(project.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(project.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue