个人主页
This commit is contained in:
parent
75f2b013a6
commit
1ff1ed3c54
|
@ -35,10 +35,10 @@ class UsersController < ApplicationController
|
|||
|
||||
#
|
||||
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
|
||||
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list,
|
||||
:user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
|
||||
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
|
||||
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list,
|
||||
:unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
|
||||
:anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
|
||||
:unapproval_applied_list, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
|
@ -72,7 +72,7 @@ class UsersController < ApplicationController
|
|||
helper :user_score
|
||||
helper :journals
|
||||
|
||||
# added by liuping 关注
|
||||
# added by liuping 关注
|
||||
|
||||
helper :watchers
|
||||
helper :activities
|
||||
|
@ -90,53 +90,54 @@ class UsersController < ApplicationController
|
|||
# order 排序条件
|
||||
# subject 主题:搜索用(注意:搜索和列表调用同一方法,通过参数或者remote区分)
|
||||
def user_issues
|
||||
@subject = params[:subject]
|
||||
# author_id = params[:author_id]
|
||||
params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
|
||||
params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
|
||||
params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
|
||||
if @project_id.nil?
|
||||
if @assigned_to.nil?
|
||||
if author_id.nil?
|
||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?",
|
||||
@user.id , @user.id, "%#{@subject}%").order('updated_on desc')
|
||||
else
|
||||
@issues = Issue.where("author_id =? and subject like ?",
|
||||
author_id , "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
@type = params[:type] unless params[:type].nil?
|
||||
@subject = params[:subject]
|
||||
# author_id = params[:author_id]
|
||||
params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
|
||||
params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
|
||||
params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
|
||||
if @project_id.nil?
|
||||
if @assigned_to.nil?
|
||||
if author_id.nil?
|
||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?",
|
||||
@user.id , @user.id, "%#{@subject}%").order('updated_on desc')
|
||||
else
|
||||
@issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc')
|
||||
@issues = Issue.where("author_id =? and subject like ?",
|
||||
author_id , "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
|
||||
else
|
||||
if @assigned_to.nil?
|
||||
if author_id.nil?
|
||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?",
|
||||
(author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
else
|
||||
@issues = Issue.where("author_id =? and project_id=? and subject like ?",
|
||||
author_id , @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
else
|
||||
@issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?",
|
||||
@assigned_to, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
@issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
@issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc')
|
||||
@issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
||||
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
||||
|
||||
# 导出excel的issues
|
||||
@excel_issues = @issues
|
||||
else
|
||||
if @assigned_to.nil?
|
||||
if author_id.nil?
|
||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?",
|
||||
(author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
else
|
||||
@issues = Issue.where("author_id =? and project_id=? and subject like ?",
|
||||
author_id , @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
else
|
||||
@issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?",
|
||||
@assigned_to, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||
end
|
||||
end
|
||||
@issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc')
|
||||
@issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
||||
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
||||
|
||||
@issue_count = @issues.count
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||
@offset ||= @issue_pages.offset
|
||||
@issues = paginateHelper @issues, @limit
|
||||
# 导出excel的issues
|
||||
@excel_issues = @issues
|
||||
|
||||
@issue_count = @issues.count
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||
@offset ||= @issue_pages.offset
|
||||
@issues = paginateHelper @issues, @limit
|
||||
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'static_base'}
|
||||
|
@ -536,7 +537,7 @@ class UsersController < ApplicationController
|
|||
#将角色改为老师或者教辅
|
||||
member = Course.find(@msg.course_id).members.where(:user_id=>apply_user.id).all[0]
|
||||
member.role_ids = integer_ids
|
||||
#删除为学生的记录
|
||||
#删除为学生的记录
|
||||
unless member.role_ids.include?(10)
|
||||
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@msg.course_id)
|
||||
joined.each do |join|
|
||||
|
@ -957,15 +958,15 @@ class UsersController < ApplicationController
|
|||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
# elsif params[:type] == "3" #申请题库
|
||||
# none_visible_course = Course.where("is_delete = 1")
|
||||
# none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
|
||||
# #apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
|
||||
# #homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
# #@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
|
||||
#
|
||||
# sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
|
||||
# @homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
# elsif params[:type] == "3" #申请题库
|
||||
# none_visible_course = Course.where("is_delete = 1")
|
||||
# none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
|
||||
# #apply_homeworks = ApplyHomework.where("user_id = ?",@user.id).order('created_at desc')
|
||||
# #homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
# #@homeworks = HomeworkCommon.where("id in #{homework_ids} and course_id not in #{none_visible_course_ids}")
|
||||
#
|
||||
# sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} and homework_commons.course_id not in #{none_visible_course_ids} order by ah.created_at desc"
|
||||
# @homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
end
|
||||
if params[:property]
|
||||
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
|
||||
|
@ -1860,7 +1861,7 @@ class UsersController < ApplicationController
|
|||
# 待评阅的作业 暂不做
|
||||
@unreview_homework = 1
|
||||
# 待审批的作业
|
||||
@unapproval_homework = 1
|
||||
@unapproval_homework = AppliedMessage.where(:user_id => @user.id, :status => 0 ).count
|
||||
else
|
||||
# 看别人的主页显示动态
|
||||
#更新用户申请成为课程老师或教辅消息的状态
|
||||
|
@ -1968,27 +1969,95 @@ class UsersController < ApplicationController
|
|||
|
||||
# 待完成的作业
|
||||
def unfinished_homework_list
|
||||
my_course_ids = StudentsForCourse.where(:student_id => @user.id).blank? ? "(-1)" : "(" + StudentsForCourse.where(:student_id => @user.id).map{|sc| sc.course_id}.join(",") + ")"
|
||||
homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Date.today}'")
|
||||
homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")"
|
||||
student_works = StudentWork.where("user_id = #{@user.id} and homework_common_id in #{homework_ids} and work_status != 0")
|
||||
finished_works_id = student_works.blank? ? "(-1)" : "(" + student_works.map{ |sw| sw.homework_common_id.to_i }.join(",") + ")"
|
||||
@unfinished_homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Date.today}' and id not in #{finished_works_id}").order("updated_at desc")
|
||||
@unfinished_homeworks_count = @unfinished_homeworks.count
|
||||
@limit = 20
|
||||
@unfinished_homework_pages = Paginator.new @unfinished_homeworks_count, @limit, params['page'] || 1
|
||||
@offset ||= @unfinished_homework_pages.offset
|
||||
@unfinished_homeworks = paginateHelper @unfinished_homeworks, @limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 待完成的测验
|
||||
def unfinished_test_list
|
||||
|
||||
my_course_ids = StudentsForCourse.where(:student_id => @user.id).blank? ? "(-1)" : "(" + StudentsForCourse.where(:student_id => @user.id).map{|sc| sc.course_id}.join(",") + ")"
|
||||
exercises = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2")
|
||||
exercise_ids = exercises.blank? ? "(-1)" : "(" + exercises.map{|ex| ex.id}.join(",") + ")"
|
||||
exercise_users = ExerciseUser.where("user_id = #{@user.id} and exercise_id in #{exercise_ids}")
|
||||
finished_test_ids = exercise_users.blank? ? "(-1)" : "(" + exercise_users.map{|eu| eu.exercise_id }.join(",") + ")"
|
||||
@unfinished_test = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2 and id not in #{finished_test_ids}")
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 待完成的问卷
|
||||
def unfinished_poll_list
|
||||
|
||||
my_course_ids = StudentsForCourse.where(:student_id => @user.id).blank? ? "(-1)" : "(" + StudentsForCourse.where(:student_id => @user.id).map{|sc| sc.course_id}.join(",") + ")"
|
||||
polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2")
|
||||
poll_ids = polls.blank? ? "(-1)" : "(" + polls.map{|poll| poll.id}.join(",") + ")"
|
||||
poll_users = PollUser.where("user_id = #{@user.id} and poll_id in #{poll_ids}")
|
||||
finished_poll_ids = poll_users.blank? ? "(-1)" : "(" + poll_users.map{|pu| pu.poll_id }.join(",") + ")"
|
||||
@unfinished_poll = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2 and id not in #{finished_poll_ids}").order("updated_at desc")
|
||||
@unfinished_poll_count = @unfinished_poll.count
|
||||
@limit = 20
|
||||
@unfinished_poll_pages = Paginator.new @unfinished_poll_count, @limit, params['page'] || 1
|
||||
@offset ||= @unfinished_poll_pages.offset
|
||||
@unfinished_poll = paginateHelper @unfinished_poll, @limit
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 待匿评的作业
|
||||
def anonymous_evaluation_list
|
||||
student_work_evaluations = @user.student_works_evaluation_distributions
|
||||
student_work_ids = student_work_evaluations.blank? ? "(-1)" : "(" + student_work_evaluations.map{|st| st.student_work_id}.join(",") + ")"
|
||||
student_work_scores = @user.student_works_scores.where("student_work_id in #{student_work_ids} and reviewer_role = 3")
|
||||
anonymous_evaluation_ids = student_work_scores.blank? ? "(-1)" : "(" + student_work_scores.map{|st| st.student_work_id}.join(",") + ")"
|
||||
@anonymous_evaluation = @user.student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}")
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 待审批的申请
|
||||
def unapproval_homework_list
|
||||
|
||||
def unapproval_applied_list
|
||||
@message_alls = []
|
||||
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
|
||||
messages.each do |message_all|
|
||||
mess = message_all.message
|
||||
if !mess.nil?
|
||||
if (message_all.message_type == "OrgMessage")
|
||||
if mess.message_type == "ApplySubdomain" && OrgMessage.where(:organization_id => mess.organization_id, :message_type => "AgreeApplySubdomain").count == 0
|
||||
@message_alls << mess
|
||||
end
|
||||
elsif (message_all.message_type == "AppliedMessage" )
|
||||
if (mess.applied_type == "AppliedProject" && mess.status == 1) || (mess.applied_type == "ApplyAddSchools" && mess.status == 0)
|
||||
@message_alls << mess
|
||||
end
|
||||
elsif message_all.message_type == "CourseMessage"
|
||||
if (mess.course_message_type == "JoinCourse" && mess.status == 0)
|
||||
@message_alls << mess
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@message_count = @message_alls.count
|
||||
@message_alls = paginateHelper @message_alls, 20
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 课程社区
|
||||
|
@ -2750,7 +2819,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@ori = ori
|
||||
end
|
||||
# 发送多个资源
|
||||
# 发送多个资源
|
||||
elsif params[:send_ids].present?
|
||||
send_ids = params[:send_ids].split(",")
|
||||
project_ids = params[:projects_ids]
|
||||
|
@ -3026,7 +3095,7 @@ class UsersController < ApplicationController
|
|||
project_ids.each do |project_id|
|
||||
project = Project.find(project_id)
|
||||
if project.news.map(&:id).exclude?(news.id)
|
||||
# message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
|
||||
# message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
|
||||
message = News.create(:project_id => project.id, :title => news.title, :summary => news.summary, :description => news.description, :author_id => User.current.id, :created_on => Time.now )
|
||||
# record forward to table forwards if new record is valid
|
||||
if message.valid?
|
||||
|
@ -3912,7 +3981,7 @@ class UsersController < ApplicationController
|
|||
#limit = 5
|
||||
|
||||
# 用户的所有项目
|
||||
# @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
# @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects = @user.projects.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects_count = @my_projects.count
|
||||
|
||||
|
|
|
@ -78,6 +78,20 @@ module UsersHelper
|
|||
end
|
||||
end
|
||||
|
||||
# 作业类型提示
|
||||
def homework_type_tip homework_type
|
||||
case homework_type
|
||||
when 0
|
||||
"普通作业"
|
||||
when 1
|
||||
"匿评作业"
|
||||
when 2
|
||||
"编程作业"
|
||||
when 3
|
||||
"分组作业"
|
||||
end
|
||||
end
|
||||
|
||||
# 获取消息角色
|
||||
def applied_project_message_type role
|
||||
case role
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#encoding: utf-8
|
||||
#老师布置的作业表
|
||||
#homework_type: 0:普通作业;1:匿评作业;2:编程作业
|
||||
#homework_type: 0:普通作业;1:匿评作业;2:编程作业;3:分组作业;
|
||||
class HomeworkCommon < ActiveRecord::Base
|
||||
# attr_accessible :name, :user_id, :description, :publish_time, :end_time, :homework_type, :late_penalty, :course_id,:simi_time
|
||||
require 'net/http'
|
||||
|
|
|
@ -230,11 +230,11 @@
|
|||
</li>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag mr10 fr'style='line-height:18px;margin-top: 9px;'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
|
||||
user_issues_user_path(@user) %>
|
||||
user_issues_user_path(@user, :type => "author" ) %>
|
||||
</li>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
|
||||
user_issues_user_path(@user) %>
|
||||
user_issues_user_path(@user, :type => "assigned") %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<div class="resources" >
|
||||
<div class="clear" >
|
||||
<table class="sy_new_table clear" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>作业标题</th>
|
||||
<th style="width:160px">来源</th>
|
||||
<th style="width:80px">类型</th>
|
||||
<th style="width:160px">截止剩余时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%# @anonymous_evaluation.student_common.each do |ae| %>
|
||||
<tr>
|
||||
<th>
|
||||
<li class="homepageTabTitle">
|
||||
1 <%#= link_to ae.name.to_s, "", :target => "_blank", :class => "homepageTabTitle fl ml5" %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabProjectName ml5">
|
||||
1 <%#= link_to uh.course.try(:name),"", :target => "_blank", :class => "homepageTabTitle ml5"%>
|
||||
<li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabAuthor ml5" >
|
||||
<%= 1111 %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabTime ml5" >
|
||||
1
|
||||
<!-- <%# if uh.end_time > Time.now.to_i %>
|
||||
<span class="c_red"><%#= (uh.end_time - Time.now.to_i) / (24*60*60) %></span> 天
|
||||
<span class="c_red"><%#= ((uh.end_time - Time.now.to_i) % (24*60*60)) / (60*60)%></span> 小时
|
||||
<span class="c_red"><%#= (((uh.end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span> 分
|
||||
<%# else %>
|
||||
<span class="c_red">已截止</span>
|
||||
<%# end %>-->
|
||||
</li>
|
||||
</th>
|
||||
</tr>
|
||||
<%# end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
||||
<%#= pagination_links_full @unfinished_homework_pages, @unfinished_homeworks_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -23,5 +23,5 @@
|
|||
<% end %>
|
||||
|
||||
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
|
@ -0,0 +1,8 @@
|
|||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
申请内容
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources">
|
||||
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
|
||||
</div>
|
|
@ -0,0 +1,49 @@
|
|||
<div class="resources" >
|
||||
<div class="clear" >
|
||||
<table class="sy_new_table clear" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>作业标题</th>
|
||||
<th style="width:160px">来源</th>
|
||||
<th style="width:80px">类型</th>
|
||||
<th style="width:160px">截止剩余时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @unfinished_homeworks.each do |uh| %>
|
||||
<tr>
|
||||
<th>
|
||||
<li class="homepageTabTitle">
|
||||
<%= link_to uh.name.to_s, student_work_index_path( :homework => uh.id), :target => "_blank", :class => "homepageTabTitle fl ml5" %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabProjectName ml5">
|
||||
<%= link_to uh.course.try(:name), course_path(uh.course_id), :target => "_blank", :class => "homepageTabTitle ml5"%>
|
||||
<li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabAuthor ml5" >
|
||||
<%= homework_type_tip(uh.homework_type) %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabTime ml5" >
|
||||
<% if uh.end_time > Time.now %>
|
||||
<span class="c_red"><%= (uh.end_time.to_i - Time.now.to_i) / (24*60*60) %></span> 天
|
||||
<span class="c_red"><%= ((uh.end_time.to_i - Time.now.to_i) % (24*60*60)) / (60*60)%></span> 小时
|
||||
<span class="c_red"><%= (((uh.end_time.to_i - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span> 分
|
||||
<% else %>
|
||||
<span class="c_red">已截止</span>
|
||||
<% end %>
|
||||
</li>
|
||||
</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
||||
<%= pagination_links_full @unfinished_homework_pages, @unfinished_homeworks_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,33 @@
|
|||
<div class="resources" >
|
||||
<div class="clear" >
|
||||
<table class="sy_new_table clear" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><li class="fl ml5">问卷标题</li></th>
|
||||
<th style="width:160px">来源</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @unfinished_poll.each do |up| %>
|
||||
<tr>
|
||||
<th>
|
||||
<li class="homepageTabPollTitle">
|
||||
<%= link_to up.polls_name.to_s, poll_path(up.id), :target => "_blank", :class => "homepageTabPollTitle fl ml5" %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabProjectName ml5">
|
||||
<% if up.polls_type == "Course" %>
|
||||
<%= Course.find(up.polls_group_id).name %>
|
||||
<% end %>
|
||||
<li>
|
||||
</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
||||
<%= pagination_links_full @unfinished_poll_pages, @unfinished_poll_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,49 @@
|
|||
<div class="resources" >
|
||||
<div class="clear" >
|
||||
<table class="sy_new_table clear" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>作业标题</th>
|
||||
<th style="width:160px">来源</th>
|
||||
<th style="width:80px">测验时长</th>
|
||||
<th style="width:160px">截止剩余时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @unfinished_test.each do |ut| %>
|
||||
<tr>
|
||||
<th>
|
||||
<li class="homepageTabTitle">
|
||||
<%= link_to ut.exercise_name.to_s, "", :target => "_blank", :class => "homepageTabTitle fl ml5" %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabProjectName ml5">
|
||||
<%= link_to ut.course.try(:name), course_path(ut.course_id), :target => "_blank", :class => "homepageTabTitle ml5"%>
|
||||
<li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabAuthor ml5" >
|
||||
<%= ut.time %>
|
||||
</li>
|
||||
</th>
|
||||
<th>
|
||||
<li class="homepageTabTime ml5" >
|
||||
<% if ut.end_time > Time.now %>
|
||||
<span class="c_red"><%= (ut.end_time.to_i - Time.now.to_i) / (24*60*60) %></span> 天
|
||||
<span class="c_red"><%= ((ut.end_time.to_i - Time.now.to_i) % (24*60*60)) / (60*60)%></span> 小时
|
||||
<span class="c_red"><%= (((ut.end_time.to_i - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span> 分
|
||||
<% else %>
|
||||
<span class="c_red">已截止</span>
|
||||
<% end %>
|
||||
</li>
|
||||
</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
||||
<%#= pagination_links_full @unfinished_homework_pages, @unfinished_homeworks_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
消息动态
|
||||
</div>
|
||||
<span class="fr" style="margin-top:5px;">
|
||||
共 <span style="color: red;"><%= @message_count %></span> 个消息
|
||||
</span>
|
||||
</div>
|
||||
<div class="resources">
|
||||
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
|
||||
</div>
|
|
@ -0,0 +1 @@
|
|||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/anonymous_evaluation_list') %>");
|
|
@ -40,7 +40,7 @@
|
|||
<% end %>
|
||||
<% if @unfinished_homework_count > 0 %>
|
||||
<div class="flex-cell_homepage" id="user_homepage_tab_2" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0)">
|
||||
<a href="<%= unfinished_homework_list_user_path(@user) %>" data-remote = "true">
|
||||
<div class="homepage_tab_div" style="">
|
||||
<span style="margin: 5px auto; vertical-align: middle; display: inline-block;">
|
||||
<li class="homepage_work_tab mb5 fl"></li>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<% end %>
|
||||
<% if @unfinished_test_count > 0 %>
|
||||
<div class="flex-cell_homepage" id="user_homepage_tab_3" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0)">
|
||||
<a href="<%= unfinished_test_list_user_path(@user) %>" data-remote = "true">
|
||||
<div class="homepage_tab_div" style="">
|
||||
<span style="margin: 5px auto; vertical-align: middle; display: inline-block;">
|
||||
<li class="homepage_test_tab mb5 fl"></li>
|
||||
|
@ -68,7 +68,7 @@
|
|||
<% end %>
|
||||
<% if @unfinished_poll_count > 0 %>
|
||||
<div class="flex-cell_homepage" id="user_homepage_tab_4" onclick="HoverLi(4);">
|
||||
<a href="javascript:void(0)">
|
||||
<a href="<%= unfinished_poll_list_user_path(@user) %>" data-remote = "true">
|
||||
<div class="homepage_tab_div" style="">
|
||||
<span style="margin: 5px auto; vertical-align: middle; display: inline-block;">
|
||||
<li class="homepage_poll_tab mb5 fl"></li>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<% end %>
|
||||
<% if @anonymous_evaluation_count > 0 %>
|
||||
<div class="flex-cell_homepage" id="user_homepage_tab_5" onclick="HoverLi(5);">
|
||||
<a href="javascript:void(0)">
|
||||
<a href="<%= anonymous_evaluation_list_user_path(@user) %>" data-remote = "true">
|
||||
<div class="homepage_tab_div" id="user_homepage_tab_05" style="">
|
||||
<span style="margin: 5px auto; vertical-align: middle; display: inline-block;">
|
||||
<li class="homepage_anonymity_tab mb5 fl"></li>
|
||||
|
@ -106,7 +106,7 @@
|
|||
<!--</div>-->
|
||||
<% if @unapproval_homework > 0 %>
|
||||
<div class="flex-cell_homepage" id="user_homepage_tab_6" onclick="HoverLi(6);">
|
||||
<a href="javascript:void(0)">
|
||||
<a href="<%= unapproval_applied_list_user_path(@user) %>" data-remote="true">
|
||||
<div class="homepage_tab_div" style="">
|
||||
<span style="margin: 5px auto; vertical-align: middle; display: inline-block;">
|
||||
<li class="homepage_apply_tab mb5 fl"></li>
|
||||
|
@ -121,17 +121,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="user_homepage_message_list">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
消息动态
|
||||
</div>
|
||||
<span class="fr" style="margin-top:5px;">
|
||||
共 <span style="color: red;"><%= @message_count %></span> 个消息
|
||||
</span>
|
||||
</div>
|
||||
<div class="resources">
|
||||
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
|
||||
</div>
|
||||
<%= render :partial => 'users/user_message_list'%>
|
||||
</div>
|
||||
<!-- <div class="resources" >
|
||||
<%#= render :partial => 'users/homepage_tab_list' %>
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} )%>");
|
||||
|
||||
<% if is_current_user %>
|
||||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/user_message_list') %>");
|
||||
<% else %>
|
||||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} )%>");
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/unapproval_applied_list') %>");
|
|
@ -0,0 +1 @@
|
|||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/unfinished_homework_list') %>");
|
|
@ -0,0 +1 @@
|
|||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/unfinished_poll_list') %>");
|
|
@ -0,0 +1 @@
|
|||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/unfinished_test_list') %>");
|
|
@ -171,6 +171,15 @@
|
|||
$("#test").removeClass('issues_filter_active');
|
||||
remote_function();
|
||||
}
|
||||
$(function(){
|
||||
<% if @type %>
|
||||
<% if @type == "assigned" %>
|
||||
HoverLi(2);
|
||||
<% else %>
|
||||
HoverLi(3);
|
||||
<% end %>
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--缺陷列表开始-->
|
||||
|
|
|
@ -692,6 +692,11 @@ RedmineApp::Application.routes.draw do
|
|||
get 'cancel_or_collect'
|
||||
get 'homepage'
|
||||
get 'unsolved_issues_list'
|
||||
get 'unfinished_homework_list'
|
||||
get 'unfinished_poll_list'
|
||||
get 'unfinished_test_list'
|
||||
get 'anonymous_evaluation_list'
|
||||
get 'unapproval_applied_list'
|
||||
# end
|
||||
end
|
||||
#resources :blogs
|
||||
|
|
|
@ -173,4 +173,6 @@ a.user_navmorebox .user_icons_closeclass{display:block;position: absolute;top:5p
|
|||
#messageTabList li { float:left; padding:10px 15px; text-align:center; }
|
||||
.homepageTabTitle { max-width:330px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
|
||||
.homepageTabProjectName{ max-width:160px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; }
|
||||
.homepageTabAuthor { max-width:80px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; }
|
||||
.homepageTabAuthor { max-width:80px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; }
|
||||
.homepageTabTime { max-width:160px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; }
|
||||
.homepageTabPollTitle { max-width:490px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
|
Loading…
Reference in New Issue