|
|
@@ -29,25 +29,6 @@ class UsersController < ApplicationController |
|
|
@user = current_user
|
|
|
@user = current_user
|
|
|
# TODO 等消息上线再打开注释
|
|
|
# TODO 等消息上线再打开注释
|
|
|
#@tidding_count = unviewed_tiddings(current_user) if current_user.present?
|
|
|
#@tidding_count = unviewed_tiddings(current_user) if current_user.present?
|
|
|
@course =
|
|
|
|
|
|
if params[:course_id]
|
|
|
|
|
|
Course.find params[:course_id]
|
|
|
|
|
|
elsif params[:board_id]
|
|
|
|
|
|
Board.find(params[:board_id]).course
|
|
|
|
|
|
elsif params[:graduation_topic_id]
|
|
|
|
|
|
GraduationTopic.find(params[:graduation_topic_id]).course
|
|
|
|
|
|
elsif params[:graduation_group_id]
|
|
|
|
|
|
GraduationGroup.find(params[:graduation_group_id]).course
|
|
|
|
|
|
elsif params[:graduation_work_id]
|
|
|
|
|
|
GraduationWork.find(params[:graduation_work_id]).course
|
|
|
|
|
|
elsif params[:graduation_task_id]
|
|
|
|
|
|
GraduationTask.find(params[:graduation_task_id]).course
|
|
|
|
|
|
elsif params[:poll_id]
|
|
|
|
|
|
Poll.find(params[:poll_id]).course
|
|
|
|
|
|
elsif params[:attachment_id]
|
|
|
|
|
|
Attachment.find(params[:attachment_id]).course
|
|
|
|
|
|
end
|
|
|
|
|
|
@course_identity = current_user.course_identity(@course) if @course
|
|
|
|
|
|
rescue Exception => e
|
|
|
rescue Exception => e
|
|
|
uid_logger_error(e.message)
|
|
|
uid_logger_error(e.message)
|
|
|
missing_template
|
|
|
missing_template
|
|
|
@@ -72,14 +53,14 @@ class UsersController < ApplicationController |
|
|
|
|
|
|
|
|
# Redo: 消息总数缓存
|
|
|
# Redo: 消息总数缓存
|
|
|
def get_navigation_info
|
|
|
def get_navigation_info
|
|
|
@old_domain = edu_setting('old_edu_host')
|
|
|
|
|
|
@user = current_user
|
|
|
|
|
|
# 新消息数
|
|
|
|
|
|
@new_message = @user.tidings.where("created_at > '#{@user.click_time}'").count > 0 || @user.private_messages.where("created_at > '#{@user.click_time}'").count > 0
|
|
|
|
|
|
|
|
|
|
|
|
@user_url = "/users/#{@user.login}"
|
|
|
|
|
|
@career = Career.where(status: true).order("created_at asc").pluck(:id, :name)
|
|
|
|
|
|
@auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil
|
|
|
|
|
|
|
|
|
# @old_domain = edu_setting('old_edu_host')
|
|
|
|
|
|
# @user = current_user
|
|
|
|
|
|
# # 新消息数
|
|
|
|
|
|
# @new_message = @user.tidings.where("created_at > '#{@user.click_time}'").count > 0 || @user.private_messages.where("created_at > '#{@user.click_time}'").count > 0
|
|
|
|
|
|
#
|
|
|
|
|
|
# @user_url = "/users/#{@user.login}"
|
|
|
|
|
|
# @career = Career.where(status: true).order("created_at asc").pluck(:id, :name)
|
|
|
|
|
|
# @auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil
|
|
|
end
|
|
|
end
|
|
|
|
|
|
|
|
|
# 用户回复功能
|
|
|
# 用户回复功能
|
|
|
|