Merge branch 'cxt_course' into develop
Conflicts: app/views/users/_reply_to.html.erb
This commit is contained in:
commit
76e7c50bf4
|
@ -34,3 +34,4 @@ vendor/cache
|
||||||
/config/initializers/gitlab_config.rb
|
/config/initializers/gitlab_config.rb
|
||||||
1234567
|
1234567
|
||||||
public/javascripts/wechat/node_modules/
|
public/javascripts/wechat/node_modules/
|
||||||
|
.ruby-version
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -81,7 +81,7 @@ group :assets do
|
||||||
gem 'coffee-rails', '~> 3.2.1'
|
gem 'coffee-rails', '~> 3.2.1'
|
||||||
|
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
gem 'therubyracer', :platforms => :ruby
|
# gem 'therubyracer', :platforms => :ruby
|
||||||
|
|
||||||
gem 'uglifier', '>= 1.0.3'
|
gem 'uglifier', '>= 1.0.3'
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,6 +23,7 @@ module Mobile
|
||||||
version 'v1', using: :path
|
version 'v1', using: :path
|
||||||
format :json
|
format :json
|
||||||
content_type :json, "application/json;charset=UTF-8"
|
content_type :json, "application/json;charset=UTF-8"
|
||||||
|
use ActionDispatch::Session::CookieStore
|
||||||
use Mobile::Middleware::ErrorHandler
|
use Mobile::Middleware::ErrorHandler
|
||||||
|
|
||||||
helpers do
|
helpers do
|
||||||
|
@ -34,6 +35,10 @@ module Mobile
|
||||||
raise('Unauthorized. 用户认证失败.') unless current_user
|
raise('Unauthorized. 用户认证失败.') unless current_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def session
|
||||||
|
env['rack.session']
|
||||||
|
end
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
openid = params[:openid]
|
openid = params[:openid]
|
||||||
if openid
|
if openid
|
||||||
|
@ -67,8 +72,7 @@ module Mobile
|
||||||
mount Apis::NewComment
|
mount Apis::NewComment
|
||||||
mount Apis::Praise
|
mount Apis::Praise
|
||||||
|
|
||||||
#add_swagger_documentation ({api_version: 'v1', base_path: 'http://u06.shellinfo.cn/trustie/api'})
|
add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?
|
||||||
#add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Mobile
|
||||||
|
|
||||||
params do
|
params do
|
||||||
requires :page, type: Integer
|
requires :page, type: Integer
|
||||||
requires :openid, type: String
|
requires :token, type: String
|
||||||
end
|
end
|
||||||
post do
|
post do
|
||||||
authenticate!
|
authenticate!
|
||||||
|
|
|
@ -97,25 +97,20 @@ module Mobile
|
||||||
|
|
||||||
desc "加入课程"
|
desc "加入课程"
|
||||||
params do
|
params do
|
||||||
requires :course_password, type: String
|
requires :token, type: String
|
||||||
|
requires :invite_code, type: String, desc: '邀请码'
|
||||||
end
|
end
|
||||||
post ":id" do
|
post "join" do
|
||||||
authenticate!
|
authenticate!
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
status = cs.join_course({:object_id => params[:id],:course_password => params[:course_password]},current_user)
|
status = cs.join_course({openid: params[:openid], invite_code: params[:invite_code]}, current_user)
|
||||||
out = {status: status[:state]}
|
{
|
||||||
message = case status[:state]
|
status: status[:state],
|
||||||
when 0; "加入成功"
|
messsge:CoursesService::JoinCourseError.message(status[:state])
|
||||||
when 1; "密码错误"
|
}
|
||||||
when 2; "课程已过期 请联系课程管理员重启课程。(在配置课程处)"
|
|
||||||
when 3; "您已经加入了课程"
|
|
||||||
when 4; "您加入的课程不存在"
|
|
||||||
when 5; "您还未登录"
|
|
||||||
else; "未知错误,请稍后再试"
|
|
||||||
end
|
|
||||||
out.merge(message: message)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
desc "退出课程"
|
desc "退出课程"
|
||||||
params do
|
params do
|
||||||
requires :token, type: String
|
requires :token, type: String
|
||||||
|
@ -201,6 +196,7 @@ module Mobile
|
||||||
end
|
end
|
||||||
route_param :id do
|
route_param :id do
|
||||||
get do
|
get do
|
||||||
|
authenticate!
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
course = cs.show_course(params,(current_user.nil? ? User.find(2):current_user))
|
course = cs.show_course(params,(current_user.nil? ? User.find(2):current_user))
|
||||||
#course = Course.find(params[:id])
|
#course = Course.find(params[:id])
|
||||||
|
|
|
@ -8,7 +8,8 @@ module Mobile
|
||||||
|
|
||||||
desc "get special issuse"
|
desc "get special issuse"
|
||||||
get ':id' do
|
get ':id' do
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
authenticate!
|
||||||
|
user = current_user
|
||||||
issue = Issue.find params[:id]
|
issue = Issue.find params[:id]
|
||||||
present :data, issue, with: Mobile::Entities::Issue,user: user
|
present :data, issue, with: Mobile::Entities::Issue,user: user
|
||||||
present :status, 0
|
present :status, 0
|
||||||
|
|
|
@ -7,7 +7,8 @@ module Mobile
|
||||||
|
|
||||||
desc "get special journal"
|
desc "get special journal"
|
||||||
get ':id' do
|
get ':id' do
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
authenticate!
|
||||||
|
user = current_user
|
||||||
jour = JournalsForMessage.find params[:id]
|
jour = JournalsForMessage.find params[:id]
|
||||||
present :data, jour, with: Mobile::Entities::Jours,user: user
|
present :data, jour, with: Mobile::Entities::Jours,user: user
|
||||||
present :status, 0
|
present :status, 0
|
||||||
|
|
|
@ -7,7 +7,8 @@ module Mobile
|
||||||
|
|
||||||
desc "get special topic"
|
desc "get special topic"
|
||||||
get ':id' do
|
get ':id' do
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
authenticate!
|
||||||
|
user = current_user
|
||||||
message = Message.find params[:id]
|
message = Message.find params[:id]
|
||||||
present :data, message, with: Mobile::Entities::Message,user: user
|
present :data, message, with: Mobile::Entities::Message,user: user
|
||||||
present :status, 0
|
present :status, 0
|
||||||
|
|
|
@ -11,12 +11,12 @@ module Mobile
|
||||||
params do
|
params do
|
||||||
requires :type, type: String
|
requires :type, type: String
|
||||||
requires :content, type: String
|
requires :content, type: String
|
||||||
requires :openid, type: String
|
requires :token, type: String
|
||||||
end
|
end
|
||||||
post ':id' do
|
post ':id' do
|
||||||
|
authenticate!
|
||||||
type = params[:type]
|
type = params[:type]
|
||||||
result = 1
|
result = 1
|
||||||
current_user = UserWechat.find_by_openid(params[:openid]).user
|
|
||||||
if params[:content]!="" && current_user
|
if params[:content]!="" && current_user
|
||||||
case type
|
case type
|
||||||
when "HomeworkCommon"
|
when "HomeworkCommon"
|
||||||
|
|
|
@ -7,7 +7,8 @@ module Mobile
|
||||||
|
|
||||||
desc "get special news"
|
desc "get special news"
|
||||||
get ':id' do
|
get ':id' do
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
authenticate!
|
||||||
|
user = current_user
|
||||||
news = News.find params[:id]
|
news = News.find params[:id]
|
||||||
present :data, news, with: Mobile::Entities::News,user: user
|
present :data, news, with: Mobile::Entities::News,user: user
|
||||||
present :status, 0
|
present :status, 0
|
||||||
|
|
|
@ -9,12 +9,13 @@ module Mobile
|
||||||
|
|
||||||
params do
|
params do
|
||||||
requires :type, type: String
|
requires :type, type: String
|
||||||
requires :openid, type: String
|
requires :token, type: String
|
||||||
end
|
end
|
||||||
post ':id' do
|
post ':id' do
|
||||||
|
authenticate!
|
||||||
obj_id = params[:id]
|
obj_id = params[:id]
|
||||||
obj_type = params[:type]
|
obj_type = params[:type]
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
user = current_user
|
||||||
pts = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",obj_id,obj_type.to_s,user.id).first
|
pts = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",obj_id,obj_type.to_s,user.id).first
|
||||||
if pts.blank?
|
if pts.blank?
|
||||||
praise_or_cancel(obj_type,obj_id,user,1)
|
praise_or_cancel(obj_type,obj_id,user,1)
|
||||||
|
|
|
@ -4,6 +4,48 @@ module Mobile
|
||||||
class Users < Grape::API
|
class Users < Grape::API
|
||||||
resource :users do
|
resource :users do
|
||||||
|
|
||||||
|
desc "查询是否已绑定"
|
||||||
|
params do
|
||||||
|
requires :openid, type: String, desc: 'wechat openid'
|
||||||
|
end
|
||||||
|
post 'isbind' do
|
||||||
|
openid = params[:openid]
|
||||||
|
uw = UserWechat.where(openid: openid).first
|
||||||
|
raise "还未绑定trustie帐户" unless uw
|
||||||
|
|
||||||
|
user = uw.user
|
||||||
|
::ApiKey.delete_all(user_id: user.id)
|
||||||
|
key = ::ApiKey.create!(user_id: user.id)
|
||||||
|
present status: 0, token: key.access_token
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "绑定微信用户"
|
||||||
|
params do
|
||||||
|
requires :login, type: String, desc: 'username'
|
||||||
|
requires :password, type: String, desc: 'password'
|
||||||
|
end
|
||||||
|
post 'wxbind' do
|
||||||
|
openid = session[:wechat_openid]
|
||||||
|
logger.debug "openid ============== #{openid}"
|
||||||
|
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||||
|
uw = UserWechat.where(openid: openid).first
|
||||||
|
raise "此微信号已绑定用户(#{uw.user.login}), 不能重复绑定" if uw
|
||||||
|
|
||||||
|
user, last_login_on = User.try_to_login(params[:login], params[:password])
|
||||||
|
raise "用户名或密码错误,请重新输入" unless user
|
||||||
|
#补全用户信息
|
||||||
|
|
||||||
|
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat
|
||||||
|
|
||||||
|
UserWechat.create!(
|
||||||
|
openid: openid,
|
||||||
|
user: user
|
||||||
|
)
|
||||||
|
# ws = WechatService.new
|
||||||
|
# ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
|
||||||
|
present status: 0, message: '您已成功绑定Trustie平台'
|
||||||
|
end
|
||||||
|
|
||||||
desc "注册用户"
|
desc "注册用户"
|
||||||
params do
|
params do
|
||||||
requires :login, type: String, desc: 'username'
|
requires :login, type: String, desc: 'username'
|
||||||
|
|
|
@ -7,7 +7,8 @@ module Mobile
|
||||||
|
|
||||||
desc "get one homework"
|
desc "get one homework"
|
||||||
get ':id' do
|
get ':id' do
|
||||||
user = UserWechat.find_by_openid(params[:openid]).user
|
authenticate!
|
||||||
|
user = current_user
|
||||||
homework = HomeworkCommon.find params[:id]
|
homework = HomeworkCommon.find params[:id]
|
||||||
present :data, homework, with: Mobile::Entities::Whomework,user: user
|
present :data, homework, with: Mobile::Entities::Whomework,user: user
|
||||||
present :status, 0
|
present :status, 0
|
||||||
|
|
|
@ -45,6 +45,8 @@ module Mobile
|
||||||
course_expose :tea_id
|
course_expose :tea_id
|
||||||
course_expose :term
|
course_expose :term
|
||||||
course_expose :time
|
course_expose :time
|
||||||
|
course_expose :invite_code
|
||||||
|
course_expose :qrcode
|
||||||
course_expose :updated_at
|
course_expose :updated_at
|
||||||
course_expose :course_student_num
|
course_expose :course_student_num
|
||||||
expose :teacher, using: Mobile::Entities::User do |c, opt|
|
expose :teacher, using: Mobile::Entities::User do |c, opt|
|
||||||
|
|
|
@ -26,6 +26,8 @@ module Mobile
|
||||||
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.student_id
|
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.student_id
|
||||||
when :realname
|
when :realname
|
||||||
u.nil? ? "" : get_user_realname(u)
|
u.nil? ? "" : get_user_realname(u)
|
||||||
|
when :name
|
||||||
|
u.nil? ? "" : u.show_name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,6 +59,11 @@ module Mobile
|
||||||
user_expose :student_num
|
user_expose :student_num
|
||||||
# 活跃值
|
# 活跃值
|
||||||
user_expose :active_count
|
user_expose :active_count
|
||||||
|
|
||||||
|
user_expose :role_name
|
||||||
|
|
||||||
|
user_expose :name
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class CoursesController < ApplicationController
|
||||||
else
|
else
|
||||||
@state = 5 #未登录
|
@state = 5 #未登录
|
||||||
end
|
end
|
||||||
@object_id = params[:object_id]
|
@object_id = @course.id if @course
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js #{ render :partial => 'set_join', :locals => {:user => @user, :course => @course, :object_id => params[:object_id]} }
|
format.js #{ render :partial => 'set_join', :locals => {:user => @user, :course => @course, :object_id => params[:object_id]} }
|
||||||
end
|
end
|
||||||
|
@ -1224,7 +1224,7 @@ class CoursesController < ApplicationController
|
||||||
def member_to_xls homeworks, course, members,groups
|
def member_to_xls homeworks, course, members,groups
|
||||||
xls_report = StringIO.new
|
xls_report = StringIO.new
|
||||||
book = Spreadsheet::Workbook.new
|
book = Spreadsheet::Workbook.new
|
||||||
sheet1 = book.create_worksheet :name => "student"
|
sheet1 = book.create_worksheet :name => "总成绩"
|
||||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||||
#sheet1.row(0).default_format = blue
|
#sheet1.row(0).default_format = blue
|
||||||
#sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_class),l(:excel_f_score),l(:excel_commit_time)])
|
#sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_class),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
@ -1268,6 +1268,121 @@ class CoursesController < ApplicationController
|
||||||
count_row += 1
|
count_row += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
homeworks.each_with_index do |home, i|
|
||||||
|
sheet = book.create_worksheet :name => "第#{i+1}次作业"
|
||||||
|
sheet[0,0] = "课程编号"
|
||||||
|
sheet[0,1] = course.id
|
||||||
|
sheet[1,0] = "课程学期"
|
||||||
|
sheet[1,1] = course.time.to_s+"年"+course.term
|
||||||
|
sheet[2,0] = "课程名称"
|
||||||
|
sheet[2,1] = course.name
|
||||||
|
sheet[3,0] = "教师团队"
|
||||||
|
sheet[3,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、')
|
||||||
|
sheet[4,0] = "主讲教师"
|
||||||
|
sheet[4,1] = course.teacher.show_name
|
||||||
|
sheet[4,0] = "作业批次"
|
||||||
|
sheet[4,1] = "第#{i+1}次作业"
|
||||||
|
sheet[4,0] = "作业名称"
|
||||||
|
sheet[4,1] = home.name
|
||||||
|
if home.homework_type == 1 #普通作业
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
|
count_row = 6
|
||||||
|
items = home.student_works.order("work_score desc")
|
||||||
|
items.each_with_index do |stu, j|
|
||||||
|
sheet[count_row,0]= j + 1
|
||||||
|
sheet[count_row,1] = stu.user.show_name
|
||||||
|
sheet[count_row,2] = stu.user.login
|
||||||
|
sheet[count_row,3] = stu.user.user_extensions.student_id
|
||||||
|
sheet[count_row,4] = stu.name
|
||||||
|
sheet[count_row,5] = strip_html stu.description
|
||||||
|
sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2)
|
||||||
|
sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2)
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
|
||||||
|
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
|
||||||
|
sheet[count_row,10] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,12] = format_time(stu.created_at)
|
||||||
|
else
|
||||||
|
sheet[count_row,8] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,10] = format_time(stu.created_at)
|
||||||
|
end
|
||||||
|
count_row += 1
|
||||||
|
end
|
||||||
|
elsif home.homework_type == 2 #编程作业
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
|
count_row = 6
|
||||||
|
items = home.student_works.order("work_score desc")
|
||||||
|
items.each_with_index do |stu, j|
|
||||||
|
sheet[count_row,0]= j + 1
|
||||||
|
sheet[count_row,1] = stu.user.show_name
|
||||||
|
sheet[count_row,2] = stu.user.login
|
||||||
|
sheet[count_row,3] = stu.user.user_extensions.student_id
|
||||||
|
sheet[count_row,4] = stu.name
|
||||||
|
sheet[count_row,5] = stu.description
|
||||||
|
sheet[count_row,6] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2)
|
||||||
|
sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2)
|
||||||
|
sheet[count_row,8] = stu.system_score.nil? ? l(:label_without_score) : stu.system_score.round(2)
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet[count_row,9] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
|
||||||
|
sheet[count_row,10] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
|
||||||
|
sheet[count_row,11] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,12] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,13] = format_time(stu.created_at)
|
||||||
|
else
|
||||||
|
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,11] = format_time(stu.created_at)
|
||||||
|
end
|
||||||
|
count_row += 1
|
||||||
|
end
|
||||||
|
elsif home.homework_type == 3 #分组作业
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet.row(5).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
|
count_row = 6
|
||||||
|
items = home.student_works.order("work_score desc")
|
||||||
|
items.each_with_index do |stu, j|
|
||||||
|
sheet[count_row,0] = j + 1
|
||||||
|
sheet[count_row,1] = get_group_member_names stu
|
||||||
|
sheet[count_row,2] = stu.name
|
||||||
|
sheet[count_row,3] = (stu.project_id == 0 || stu.project_id.nil?) ? l(:excel_no_project) : stu.project.name
|
||||||
|
sheet[count_row,4] = strip_html stu.description
|
||||||
|
sheet[count_row,5] = stu.teacher_score.nil? ? l(:label_without_score) : stu.teacher_score.round(2)
|
||||||
|
sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2)
|
||||||
|
if home.anonymous_comment ==0
|
||||||
|
sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
|
||||||
|
sheet[count_row,8] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
|
||||||
|
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,11] = format_time(stu.created_at)
|
||||||
|
else
|
||||||
|
sheet[count_row,7] = home.teacher_priority == 1 ? 0 : stu.late_penalty
|
||||||
|
sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
|
||||||
|
sheet[count_row,9] = format_time(stu.created_at)
|
||||||
|
end
|
||||||
|
count_row += 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
group0 = CourseGroup.new();
|
group0 = CourseGroup.new();
|
||||||
group0.id = 0;
|
group0.id = 0;
|
||||||
|
|
|
@ -1209,13 +1209,18 @@ class StudentWorkController < ApplicationController
|
||||||
sheet1 = book.create_worksheet :name => "homework"
|
sheet1 = book.create_worksheet :name => "homework"
|
||||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||||
sheet1.row(0).default_format = blue
|
sheet1.row(0).default_format = blue
|
||||||
if @homework.homework_type == 1 #匿评作业
|
if @homework.homework_type == 1 #普通作业
|
||||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
if @homework.anonymous_comment ==0
|
||||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
count_row = 1
|
count_row = 1
|
||||||
items.each do |homework|
|
items.each do |homework|
|
||||||
sheet1[count_row,0]=homework.user.id
|
sheet1[count_row,0]=homework.user.id
|
||||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
sheet1[count_row,1] = homework.user.show_name
|
||||||
sheet1[count_row,2] = homework.user.login
|
sheet1[count_row,2] = homework.user.login
|
||||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||||
sheet1[count_row,4] = homework.user.mail
|
sheet1[count_row,4] = homework.user.mail
|
||||||
|
@ -1223,18 +1228,31 @@ class StudentWorkController < ApplicationController
|
||||||
sheet1[count_row,6] = strip_html homework.description
|
sheet1[count_row,6] = strip_html homework.description
|
||||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||||
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
if @homework.anonymous_comment ==0
|
||||||
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
||||||
sheet1[count_row,11] = format_time(homework.created_at)
|
sheet1[count_row,10] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
|
||||||
|
sheet1[count_row,11] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,12] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,13] = format_time(homework.created_at)
|
||||||
|
else
|
||||||
|
sheet1[count_row,9] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,11] = format_time(homework.created_at)
|
||||||
|
end
|
||||||
count_row += 1
|
count_row += 1
|
||||||
end
|
end
|
||||||
elsif @homework.homework_type == 2 #编程作业
|
elsif @homework.homework_type == 2 #编程作业
|
||||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
if @homework.anonymous_comment ==0
|
||||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
count_row = 1
|
count_row = 1
|
||||||
items.each do |homework|
|
items.each do |homework|
|
||||||
sheet1[count_row,0]=homework.user.id
|
sheet1[count_row,0]=homework.user.id
|
||||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
sheet1[count_row,1] = homework.user.show_name
|
||||||
sheet1[count_row,2] = homework.user.login
|
sheet1[count_row,2] = homework.user.login
|
||||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||||
sheet1[count_row,4] = homework.user.mail
|
sheet1[count_row,4] = homework.user.mail
|
||||||
|
@ -1243,11 +1261,48 @@ class StudentWorkController < ApplicationController
|
||||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||||
sheet1[count_row,9] = homework.system_score.nil? ? l(:label_without_score) : homework.system_score.round(2)
|
sheet1[count_row,9] = homework.system_score.nil? ? l(:label_without_score) : homework.system_score.round(2)
|
||||||
sheet1[count_row,10] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
if @homework.anonymous_comment ==0
|
||||||
sheet1[count_row,11] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
sheet1[count_row,10] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
||||||
sheet1[count_row,12] = format_time(homework.created_at)
|
sheet1[count_row,11] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
|
||||||
|
sheet1[count_row,12] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,13] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,14] = format_time(homework.created_at)
|
||||||
|
else
|
||||||
|
sheet1[count_row,10] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,11] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,12] = format_time(homework.created_at)
|
||||||
|
end
|
||||||
count_row += 1
|
count_row += 1
|
||||||
end
|
end
|
||||||
|
elsif @homework.homework_type == 3 #分组作业
|
||||||
|
if @homework.anonymous_comment ==0
|
||||||
|
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
else
|
||||||
|
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||||
|
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||||
|
end
|
||||||
|
count_row = 1
|
||||||
|
items.each do |homework|
|
||||||
|
sheet1[count_row,0] = get_group_member_names homework
|
||||||
|
sheet1[count_row,1] = homework.name
|
||||||
|
sheet1[count_row,2] = (homework.project_id == 0 || homework.project_id.nil?) ? l(:excel_no_project) : homework.project.name
|
||||||
|
sheet1[count_row,3] = strip_html homework.description
|
||||||
|
sheet1[count_row,4] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||||
|
sheet1[count_row,5] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||||
|
if @homework.anonymous_comment ==0
|
||||||
|
sheet1[count_row,6] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
||||||
|
sheet1[count_row,7] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
|
||||||
|
sheet1[count_row,8] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,10] = format_time(homework.created_at)
|
||||||
|
else
|
||||||
|
sheet1[count_row,6] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
|
||||||
|
sheet1[count_row,7] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||||
|
sheet1[count_row,8] = format_time(homework.created_at)
|
||||||
|
end
|
||||||
|
count_row += 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
book.write xls_report
|
book.write xls_report
|
||||||
xls_report.string
|
xls_report.string
|
||||||
|
|
|
@ -87,7 +87,10 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
#展开所有回复
|
#展开所有回复
|
||||||
def show_all_replies
|
def show_all_replies
|
||||||
@comment = JournalsForMessage.find params[:comment].to_i
|
case params[:type]
|
||||||
|
when 'JournalsForMessage'
|
||||||
|
@comment = JournalsForMessage.find params[:comment].to_i
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#二级回复
|
#二级回复
|
||||||
|
@ -95,6 +98,7 @@ class UsersController < ApplicationController
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when 'HomeworkCommon'
|
when 'HomeworkCommon'
|
||||||
@reply = JournalsForMessage.find params[:reply_id]
|
@reply = JournalsForMessage.find params[:reply_id]
|
||||||
|
@type = 'HomeworkCommon'
|
||||||
if params[:user_activity_id]
|
if params[:user_activity_id]
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id]
|
||||||
else
|
else
|
||||||
|
@ -102,6 +106,11 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
@is_in_course = params[:is_in_course].to_i
|
@is_in_course = params[:is_in_course].to_i
|
||||||
@course_activity = params[:course_activity].to_i
|
@course_activity = params[:course_activity].to_i
|
||||||
|
when 'JournalsForMessage'
|
||||||
|
@reply = JournalsForMessage.find params[:reply_id]
|
||||||
|
@user_activity_id = params[:user_activity_id]
|
||||||
|
@activity_id = params[:activity_id]
|
||||||
|
@type = 'JournalsForMessage'
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
@ -3261,7 +3270,11 @@ class UsersController < ApplicationController
|
||||||
@journals = obj.comments.reorder("created_on desc")
|
@journals = obj.comments.reorder("created_on desc")
|
||||||
when 'JournalsForMessage'
|
when 'JournalsForMessage'
|
||||||
obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
|
obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
|
||||||
@journals = obj.children.reorder("created_on desc")
|
journals = []
|
||||||
|
@journals = get_all_children(journals, obj)
|
||||||
|
@type = 'JournalsForMessage'
|
||||||
|
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||||
|
@allow_delete = params[:allow_delete]
|
||||||
when 'Issue'
|
when 'Issue'
|
||||||
obj = Issue.where('id = ?', params[:id].to_i).first
|
obj = Issue.where('id = ?', params[:id].to_i).first
|
||||||
@journals = obj.journals.reorder("created_on desc")
|
@journals = obj.journals.reorder("created_on desc")
|
||||||
|
|
|
@ -3,10 +3,23 @@ class WechatsController < ActionController::Base
|
||||||
wechat_responder
|
wechat_responder
|
||||||
|
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
# ROOT_URL = "#{Setting.protocol}://#{Setting.host_name}/"
|
||||||
|
ROOT_URL = "http://wechat.trustie.net"
|
||||||
# default text responder when no other match
|
# default text responder when no other match
|
||||||
on :text do |request, content|
|
on :text do |request, content|
|
||||||
request.reply.text "您的意见已收到,感谢您的反馈!" # Just echo
|
#邀请码
|
||||||
|
begin
|
||||||
|
uw = user_binded?(request[:FromUserName])
|
||||||
|
if !uw
|
||||||
|
return sendBind()
|
||||||
|
else
|
||||||
|
return join_class({invite_code: content}, uw.user)
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
logger.error e.inspect
|
||||||
|
logger.error e.backtrace.join("\n")
|
||||||
|
return request.reply.text e
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# When receive 'help', will trigger this responder
|
# When receive 'help', will trigger this responder
|
||||||
|
@ -35,7 +48,18 @@ class WechatsController < ActionController::Base
|
||||||
|
|
||||||
# When subscribe user scan scene_id in public account
|
# When subscribe user scan scene_id in public account
|
||||||
on :scan, with: 'scene_id' do |request, ticket|
|
on :scan, with: 'scene_id' do |request, ticket|
|
||||||
request.reply.text "Subscribe user #{request[:FromUserName]} Ticket #{ticket}"
|
begin
|
||||||
|
uw = user_binded?(request[:FromUserName])
|
||||||
|
if !uw
|
||||||
|
return sendBind()
|
||||||
|
else
|
||||||
|
return join_class({ticket: ticket}, uw.user)
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
logger.error e.inspect
|
||||||
|
logger.error e.backtrace.join("\n")
|
||||||
|
return request.reply.text e
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# When no any on :scan responder can match subscribe user scaned scene_id
|
# When no any on :scan responder can match subscribe user scaned scene_id
|
||||||
|
@ -128,6 +152,15 @@ class WechatsController < ActionController::Base
|
||||||
default_msg(request)
|
default_msg(request)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
on :click, with: 'JOIN_CLASS' do |request, key|
|
||||||
|
uw = user_binded?(request[:FromUserName])
|
||||||
|
unless uw
|
||||||
|
sendBind(request)
|
||||||
|
else
|
||||||
|
request.reply.text "请直接回复6位班级邀请码\n(不区分大小写):"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def default_msg(request)
|
def default_msg(request)
|
||||||
uw = user_binded?(request[:FromUserName])
|
uw = user_binded?(request[:FromUserName])
|
||||||
if uw && uw.user
|
if uw && uw.user
|
||||||
|
@ -145,8 +178,8 @@ class WechatsController < ActionController::Base
|
||||||
|
|
||||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||||
request.reply.news(news) do |article, n, index| # article is return object
|
request.reply.news(news) do |article, n, index| # article is return object
|
||||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{login_wechat_url}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login#wechat_redirect"
|
||||||
pic_url = "#{Setting.protocol}://#{Setting.host_name}/images/weixin_pic.jpg"
|
pic_url = "#{ROOT_URL}/images/weixin_pic.jpg"
|
||||||
article.item title: "#{n[:title]}",
|
article.item title: "#{n[:title]}",
|
||||||
description: n[:content],
|
description: n[:content],
|
||||||
pic_url: pic_url,
|
pic_url: pic_url,
|
||||||
|
@ -154,18 +187,53 @@ class WechatsController < ActionController::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def join_class(params, user)
|
||||||
|
course = nil
|
||||||
|
course = Course.where(qrcode: params[:ticket]) if params[:ticket]
|
||||||
|
course = Course.where(invite_code: params[:invite_code]) if params[:invite_code]
|
||||||
|
raise "课程不存在" if course.blank?
|
||||||
|
|
||||||
|
cs = CoursesService.new
|
||||||
|
status = cs.join_course(course.invite_code, user)
|
||||||
|
logger.info status
|
||||||
|
if status[:state] != 0
|
||||||
|
raise CoursesService::JoinCourseError.message(status[:state])
|
||||||
|
end
|
||||||
|
|
||||||
|
course = status[:course]
|
||||||
|
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||||
|
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||||
|
return request.reply.news(news) do |article, n, index| # article is return object
|
||||||
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities?id='+course.id.to_s}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||||
|
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
|
||||||
|
article.item title: "#{n[:title]}",
|
||||||
|
description: n[:content],
|
||||||
|
pic_url: pic_url,
|
||||||
|
url: url
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
### controller method
|
### controller method
|
||||||
module Controllers
|
module Controllers
|
||||||
def get_open_id
|
def get_bind
|
||||||
begin
|
begin
|
||||||
|
|
||||||
code = params[:code] || session[:wechat_code]
|
code = params[:code] || session[:wechat_code]
|
||||||
openid = get_openid_from_code(code)
|
openid = get_openid_from_code(code)
|
||||||
|
|
||||||
raise "无法获取到微信openid" unless openid
|
raise "无法获取到微信openid" unless openid
|
||||||
render :json => {status:0, openid: openid}
|
|
||||||
|
uw = UserWechat.where(openid: openid).first
|
||||||
|
raise "还未绑定trustie帐户" unless uw
|
||||||
|
logger.debug "get_bind ============= #{uw}"
|
||||||
|
|
||||||
|
user = uw.user
|
||||||
|
::ApiKey.delete_all(user_id: user.id)
|
||||||
|
key = ::ApiKey.create!(user_id: user.id)
|
||||||
|
|
||||||
|
render :json =>{status: 0, token: key.access_token}
|
||||||
rescue Exception=>e
|
rescue Exception=>e
|
||||||
render :json => {status: -1, msg: e.message}
|
render :json => {status: -1, message: e.message}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -175,7 +243,7 @@ class WechatsController < ActionController::Base
|
||||||
code = params[:code] || session[:wechat_code]
|
code = params[:code] || session[:wechat_code]
|
||||||
openid = get_openid_from_code(code)
|
openid = get_openid_from_code(code)
|
||||||
|
|
||||||
raise "无法获取到openid" unless openid
|
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||||
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
|
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
|
||||||
|
|
||||||
user, last_login_on = User.try_to_login(params[:username], params[:password])
|
user, last_login_on = User.try_to_login(params[:username], params[:password])
|
||||||
|
@ -206,19 +274,26 @@ class WechatsController < ActionController::Base
|
||||||
|
|
||||||
def user_activities
|
def user_activities
|
||||||
session[:wechat_code] = params[:code] if params[:code]
|
session[:wechat_code] = params[:code] if params[:code]
|
||||||
code = params[:code] || session[:wechat_code]
|
@path = '/'+(params[:state] || '')
|
||||||
openid = get_openid_from_code(code)
|
open_id = get_openid_from_code(params[:code]) rescue
|
||||||
@wechat_user = user_binded?(openid)
|
unless open_id
|
||||||
unless @wechat_user
|
render 'wechats/open_wechat', layout: nil and return
|
||||||
redirect_to login_wechat_path
|
end
|
||||||
return
|
if params[:state] == 'myclass'
|
||||||
|
@course_id = params[:id];
|
||||||
end
|
end
|
||||||
|
|
||||||
|
session[:wechat_openid] = open_id
|
||||||
|
if params[:code]
|
||||||
|
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||||
|
end
|
||||||
render 'wechats/user_activities', layout: nil
|
render 'wechats/user_activities', layout: nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def get_openid_from_code(code)
|
def get_openid_from_code(code)
|
||||||
|
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
|
||||||
openid = session[:wechat_openid]
|
openid = session[:wechat_openid]
|
||||||
|
|
||||||
unless openid
|
unless openid
|
||||||
|
|
|
@ -54,15 +54,16 @@ class WordsController < ApplicationController
|
||||||
:reply_id => reply_user_id,
|
:reply_id => reply_user_id,
|
||||||
:notes => content,
|
:notes => content,
|
||||||
:is_readed => false}
|
:is_readed => false}
|
||||||
@jfm = add_reply_adapter options
|
@activity = params[:activity_id].nil? ? JournalsForMessage.find(parent_id) : JournalsForMessage.find(params[:activity_id].to_i)
|
||||||
|
@jfm = add_reply_adapter(@activity, options)
|
||||||
@save_succ = true if @jfm.errors.empty?
|
@save_succ = true if @jfm.errors.empty?
|
||||||
if @save_succ
|
if @save_succ
|
||||||
update_course_activity('JournalsForMessage',parent_id)
|
update_course_activity('JournalsForMessage',@activity.id)
|
||||||
update_user_activity('JournalsForMessage',parent_id)
|
update_user_activity('JournalsForMessage',@activity.id)
|
||||||
update_forge_activity('JournalsForMessage',parent_id)
|
update_forge_activity('JournalsForMessage',@activity.id)
|
||||||
update_org_activity('JournalsForMessage',parent_id)
|
update_org_activity('JournalsForMessage',@activity.id)
|
||||||
update_principal_activity('JournalsForMessage',parent_id)
|
update_principal_activity('JournalsForMessage',@activity.id)
|
||||||
(JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now)
|
@activity.update_attribute(:updated_on,Time.now)
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# format.html {
|
# format.html {
|
||||||
|
@ -76,8 +77,6 @@ class WordsController < ApplicationController
|
||||||
format.js {
|
format.js {
|
||||||
#@reply_type = params[:reply_type]
|
#@reply_type = params[:reply_type]
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id]
|
||||||
@activity = JournalsForMessage.find(parent_id)
|
|
||||||
@is_activity = params[:is_activity] if params[:is_activity]
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -92,13 +91,14 @@ class WordsController < ApplicationController
|
||||||
elsif @journal_destroyed.jour_type == "Course"
|
elsif @journal_destroyed.jour_type == "Course"
|
||||||
@course = Course.find @journal_destroyed.jour_id
|
@course = Course.find @journal_destroyed.jour_id
|
||||||
@jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count
|
@jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count
|
||||||
|
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||||
|
@activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id]
|
||||||
elsif @journal_destroyed.jour_type == "Principal"
|
elsif @journal_destroyed.jour_type == "Principal"
|
||||||
@user = User.find(@journal_destroyed.jour_id)
|
@user = User.find(@journal_destroyed.jour_id)
|
||||||
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
||||||
@is_user = true
|
@is_user = true
|
||||||
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||||
@is_activity = params[:is_activity].to_i if params[:is_activity]
|
@activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id]
|
||||||
@activity = @journal_destroyed.parent if @journal_destroyed.parent
|
|
||||||
unless @activity
|
unless @activity
|
||||||
redirect_to feedback_path(@user)
|
redirect_to feedback_path(@user)
|
||||||
return
|
return
|
||||||
|
@ -374,28 +374,44 @@ class WordsController < ApplicationController
|
||||||
obj
|
obj
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_reply_adapter options
|
def add_reply_adapter obj, options
|
||||||
#modify by nwb
|
#modify by nwb
|
||||||
#添加对课程留言的支持
|
#添加对课程留言的支持
|
||||||
#留言回复应该不关系其所属的Class,而关心的是其所属的父留言
|
#留言回复应该不关系其所属的Class,而关心的是其所属的父留言
|
||||||
obj = obj_distinguish_url_origin || User.find_by_id(2)
|
case obj.jour_type
|
||||||
if obj.kind_of? User
|
when 'Principal'
|
||||||
obj.add_jour(nil, nil, nil, options)
|
obj.jour.add_jour(nil, nil, nil, options)
|
||||||
elsif obj.kind_of? Project
|
when 'Project'
|
||||||
Project.add_new_jour(nil, nil, obj.id, options)
|
Project.add_new_jour(nil, nil, obj.jour_id, options)
|
||||||
elsif obj.kind_of? Course
|
when 'Course'
|
||||||
Course.add_new_jour(nil, nil, obj.id, options)
|
Course.add_new_jour(nil, nil, obj.jour_id, options)
|
||||||
elsif obj.kind_of? Bid
|
when 'Bid'
|
||||||
obj.add_jour(nil, nil, nil, options)
|
obj.jour.add_jour(nil, nil, nil, options)
|
||||||
elsif obj.kind_of? Contest
|
when 'Contest'
|
||||||
obj.add_jour(nil, nil, obj.id, options) #new added
|
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||||
elsif obj.kind_of? Softapplication
|
when 'Softapplication'
|
||||||
obj.add_jour(nil, nil, obj.id, options) #new added
|
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||||
elsif obj.kind_of? HomeworkAttach
|
when 'HomeworkAttach'
|
||||||
obj.add_jour(nil, nil, obj.id, options) #new added
|
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||||
else
|
|
||||||
raise "create reply obj unknow type.#{obj.class}"
|
|
||||||
end
|
end
|
||||||
|
# obj = obj_distinguish_url_origin || User.find_by_id(2)
|
||||||
|
# if obj.kind_of? User
|
||||||
|
# obj.add_jour(nil, nil, nil, options)
|
||||||
|
# elsif obj.kind_of? Project
|
||||||
|
# Project.add_new_jour(nil, nil, obj.id, options)
|
||||||
|
# elsif obj.kind_of? Course
|
||||||
|
# Course.add_new_jour(nil, nil, obj.id, options)
|
||||||
|
# elsif obj.kind_of? Bid
|
||||||
|
# obj.add_jour(nil, nil, nil, options)
|
||||||
|
# elsif obj.kind_of? Contest
|
||||||
|
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||||
|
# elsif obj.kind_of? Softapplication
|
||||||
|
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||||
|
# elsif obj.kind_of? HomeworkAttach
|
||||||
|
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||||
|
# else
|
||||||
|
# raise "create reply obj unknow type.#{obj.class}"
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
#######end of message
|
#######end of message
|
||||||
end
|
end
|
||||||
|
|
|
@ -489,4 +489,26 @@ module ApiHelper
|
||||||
self.update_attribute(:praise_num, self.praise_num.to_i - num)
|
self.update_attribute(:praise_num, self.praise_num.to_i - num)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
class Errors
|
||||||
|
def self.define_error(arr)
|
||||||
|
@errors = {}
|
||||||
|
arr.each_with_index { |item, index|
|
||||||
|
if index %2 == 1
|
||||||
|
@errors[arr[index-1]] = item
|
||||||
|
end
|
||||||
|
}
|
||||||
|
if arr.count % 2== 1
|
||||||
|
@default_error = arr.last
|
||||||
|
else
|
||||||
|
@default_error = "未知错误"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.message(msg_id)
|
||||||
|
@errors[msg_id] || @default_error
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -3127,6 +3127,26 @@ def get_reply_parents parents_rely, comment
|
||||||
parents_rely
|
parents_rely
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#获取回复的所有父节点(不包括根节点)
|
||||||
|
def get_reply_parents_no_root parents_rely, comment
|
||||||
|
if !comment.parent.nil? && !comment.parent.parent.nil?
|
||||||
|
parents_rely << comment.parent
|
||||||
|
get_reply_parents_no_root parents_rely, comment.parent
|
||||||
|
end
|
||||||
|
parents_rely
|
||||||
|
end
|
||||||
|
|
||||||
|
#获取留言的所有子节点
|
||||||
|
def get_all_children result, jour
|
||||||
|
if jour.kind_of? JournalsForMessage
|
||||||
|
jour.children.each do |jour_child|
|
||||||
|
result << jour_child
|
||||||
|
get_all_children result, jour_child
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result.sort! { |a,b| b.created_on <=> a.created_on }
|
||||||
|
end
|
||||||
|
|
||||||
#将有置顶属性的提到数组前面
|
#将有置顶属性的提到数组前面
|
||||||
def sort_by_sticky topics
|
def sort_by_sticky topics
|
||||||
tmpTopics = []
|
tmpTopics = []
|
||||||
|
@ -3283,3 +3303,20 @@ def get_hw_index(hw,is_teacher)
|
||||||
index = hw_ids.index(hw.id)
|
index = hw_ids.index(hw.id)
|
||||||
return index
|
return index
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_group_member_names work
|
||||||
|
result = ""
|
||||||
|
unless work.nil?
|
||||||
|
work.student_work_projects.each do |member|
|
||||||
|
user = User.where(:id => member.user_id).first
|
||||||
|
unless user.nil?
|
||||||
|
if result != ""
|
||||||
|
result += "、#{user.show_name}"
|
||||||
|
else
|
||||||
|
result += user.show_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
|
@ -270,13 +270,22 @@ module CoursesHelper
|
||||||
|
|
||||||
# =====================================================================================
|
# =====================================================================================
|
||||||
# return people list
|
# return people list
|
||||||
|
def searchPeopleByName(course, role_name)
|
||||||
|
course.members.select{|m|
|
||||||
|
m.roles.any?{|r|r.name == role_name}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def searchTeacherAndAssistant project
|
def searchTeacherAndAssistant project
|
||||||
#searchPeopleByRoles(project, TeacherRoles)
|
searchPeopleByName(project, 'Manager').concat(
|
||||||
members = []
|
searchPeopleByName(project, 'Teacher')
|
||||||
project.members.includes(:user).each do |m|
|
).concat(
|
||||||
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
|
searchPeopleByName(project, 'TeachingAsistant')
|
||||||
end
|
)
|
||||||
members
|
end
|
||||||
|
|
||||||
|
def searchStudent project
|
||||||
|
searchPeopleByName(project, 'Student')
|
||||||
end
|
end
|
||||||
|
|
||||||
def TeacherAndAssistantCount course
|
def TeacherAndAssistantCount course
|
||||||
|
@ -293,19 +302,6 @@ module CoursesHelper
|
||||||
members
|
members
|
||||||
end
|
end
|
||||||
|
|
||||||
def searchStudent project
|
|
||||||
#searchPeopleByRoles(project, StudentRoles)
|
|
||||||
members = []
|
|
||||||
project.members.each do |m|
|
|
||||||
if m && m.user && m.user.allowed_to?(:as_student,project)
|
|
||||||
members << m
|
|
||||||
end
|
|
||||||
end
|
|
||||||
members
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def searchStudent_by_name project, name
|
def searchStudent_by_name project, name
|
||||||
#searchPeopleByRoles(project, StudentRoles)
|
#searchPeopleByRoles(project, StudentRoles)
|
||||||
members = []
|
members = []
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#coding=utf-8
|
||||||
|
|
||||||
require 'elasticsearch/model'
|
require 'elasticsearch/model'
|
||||||
class Course < ActiveRecord::Base
|
class Course < ActiveRecord::Base
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
|
@ -65,7 +67,7 @@ class Course < ActiveRecord::Base
|
||||||
acts_as_attachable :view_permission => :view_course_files,
|
acts_as_attachable :view_permission => :view_course_files,
|
||||||
:delete_permission => :manage_files
|
:delete_permission => :manage_files
|
||||||
|
|
||||||
validates_presence_of :password, :term,:name
|
validates_presence_of :term,:name
|
||||||
validates_format_of :class_period, :with =>/^[1-9]\d*$/
|
validates_format_of :class_period, :with =>/^[1-9]\d*$/
|
||||||
validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/
|
validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/
|
||||||
validates_length_of :description, :maximum => 10000
|
validates_length_of :description, :maximum => 10000
|
||||||
|
@ -405,6 +407,7 @@ class Course < ActiveRecord::Base
|
||||||
self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false)
|
self.course_messages << CourseMessage.new(:user_id => self.tea_id, :course_id => self.id, :viewed => false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
|
#项目与课程分离后,很多课程的名称等信息为空,这些数据信息存储在项目表中!!就是数据兼容的问题
|
||||||
#def name
|
#def name
|
||||||
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
# read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
|
||||||
|
@ -422,12 +425,14 @@ class Course < ActiveRecord::Base
|
||||||
# __elasticsearch__.delete_document
|
# __elasticsearch__.delete_document
|
||||||
# end
|
# end
|
||||||
def create_course_ealasticsearch_index
|
def create_course_ealasticsearch_index
|
||||||
|
return if Rails.env.development?
|
||||||
if self.is_public == 1 and self.is_delete == 0 #公开 和 没有被删除的课程才被索引
|
if self.is_public == 1 and self.is_delete == 0 #公开 和 没有被删除的课程才被索引
|
||||||
self.__elasticsearch__.index_document
|
self.__elasticsearch__.index_document
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_course_ealasticsearch_index
|
def update_course_ealasticsearch_index
|
||||||
|
return if Rails.env.development?
|
||||||
if self.is_public == 1 and self.is_delete == 0 #如果是初次更新成为公开或者恢复被删除的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
|
if self.is_public == 1 and self.is_delete == 0 #如果是初次更新成为公开或者恢复被删除的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
|
||||||
begin
|
begin
|
||||||
self.__elasticsearch__.update_document
|
self.__elasticsearch__.update_document
|
||||||
|
@ -444,6 +449,7 @@ class Course < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_course_ealasticsearch_index
|
def delete_course_ealasticsearch_index
|
||||||
|
return if Rails.env.development?
|
||||||
begin
|
begin
|
||||||
self.__elasticsearch__.delete_document
|
self.__elasticsearch__.delete_document
|
||||||
rescue => e
|
rescue => e
|
||||||
|
@ -451,6 +457,31 @@ class Course < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 生成邀请码
|
||||||
|
CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z)
|
||||||
|
def generate_invite_code
|
||||||
|
code = invite_code
|
||||||
|
if !invite_code || invite_code.size <5
|
||||||
|
self.invite_code = CODES.sample(5).join
|
||||||
|
return generate_invite_code if Course.where(invite_code: invite_code).present?
|
||||||
|
save! && reload
|
||||||
|
code = invite_code
|
||||||
|
end
|
||||||
|
code
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def generate_qrcode
|
||||||
|
ticket = self.qrcode
|
||||||
|
if !ticket || ticket.size < 10
|
||||||
|
response = Wechat.api.qrcode_create_scene(invite_code)
|
||||||
|
logger.debug "response = #{response}"
|
||||||
|
self.qrcode = response['ticket']
|
||||||
|
save! && reload
|
||||||
|
ticket = qrcode
|
||||||
|
end
|
||||||
|
ticket
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ class CoursesService
|
||||||
if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
|
if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
|
||||||
raise '403'
|
raise '403'
|
||||||
end
|
end
|
||||||
@teachers= searchTeacherAndAssistant(c)
|
|
||||||
#@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1'
|
#@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1'
|
||||||
case params[:role]
|
case params[:role]
|
||||||
when '1'
|
when '1'
|
||||||
|
@ -87,7 +86,11 @@ class CoursesService
|
||||||
gender = m.user.user_extensions.gender.nil? ? 0 : m.user.user_extensions.gender
|
gender = m.user.user_extensions.gender.nil? ? 0 : m.user.user_extensions.gender
|
||||||
work_unit = get_user_work_unit m.user
|
work_unit = get_user_work_unit m.user
|
||||||
location = get_user_location m.user
|
location = get_user_location m.user
|
||||||
users << {:id => m.user.id, :img_url => img_url, :nickname => m.user.login, :gender => gender, :work_unit => work_unit, :mail => m.user.mail, :location => location, :brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname}
|
users << {:id => m.user.id, :img_url => img_url, :nickname => m.user.login, :gender => gender,
|
||||||
|
:work_unit => work_unit, :mail => m.user.mail, :location => location,
|
||||||
|
role_name: m.roles.first.name,
|
||||||
|
name: m.user.show_name,
|
||||||
|
:brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname}
|
||||||
end
|
end
|
||||||
users
|
users
|
||||||
end
|
end
|
||||||
|
@ -162,6 +165,9 @@ class CoursesService
|
||||||
#显示课程
|
#显示课程
|
||||||
def show_course(params,current_user)
|
def show_course(params,current_user)
|
||||||
course = Course.find(params[:id])
|
course = Course.find(params[:id])
|
||||||
|
course.generate_invite_code
|
||||||
|
course.generate_qrcode
|
||||||
|
|
||||||
if course.school
|
if course.school
|
||||||
work_unit = course.school.name
|
work_unit = course.school.name
|
||||||
else
|
else
|
||||||
|
@ -193,7 +199,7 @@ class CoursesService
|
||||||
@course.extra = 'course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
|
@course.extra = 'course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
|
||||||
@course.send(:safe_attributes=, params[:course], current_user)
|
@course.send(:safe_attributes=, params[:course], current_user)
|
||||||
#@course.safe_attributes(current_user,params[:course])
|
#@course.safe_attributes(current_user,params[:course])
|
||||||
@course.password = params[:course][:password]
|
#@course.password = params[:course][:password]
|
||||||
@course.tea_id = current_user.id
|
@course.tea_id = current_user.id
|
||||||
@course.term = params[:term]
|
@course.term = params[:term]
|
||||||
@course.time = params[:time]
|
@course.time = params[:time]
|
||||||
|
@ -252,7 +258,7 @@ class CoursesService
|
||||||
def edit_course(params,course,current_user)
|
def edit_course(params,course,current_user)
|
||||||
course.send(:safe_attributes=, params[:course], current_user)
|
course.send(:safe_attributes=, params[:course], current_user)
|
||||||
#course.safe_attributes = params[:course]
|
#course.safe_attributes = params[:course]
|
||||||
course.password = params[:course][:password]
|
#course.password = params[:course][:password]
|
||||||
course.time = params[:time]
|
course.time = params[:time]
|
||||||
course.term = params[:term]
|
course.term = params[:term]
|
||||||
course.end_time = params[:end_time]
|
course.end_time = params[:end_time]
|
||||||
|
@ -300,23 +306,27 @@ class CoursesService
|
||||||
@state
|
@state
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class JoinCourseError < Errors
|
||||||
|
define_error [
|
||||||
|
0, '加入成功',
|
||||||
|
1, '密码错误',
|
||||||
|
2, '课程已过期 请联系课程管理员重启课程。',
|
||||||
|
3, '您已经加入了课程',
|
||||||
|
4, '您加入的课程不存在',
|
||||||
|
5, '您还未登录',
|
||||||
|
6, '申请成功,请等待审核完毕',
|
||||||
|
7, '您已经发送过申请了,请耐心等待',
|
||||||
|
8, '您已经是该课程的教师了',
|
||||||
|
9, '您已经是该课程的教辅了',
|
||||||
|
10, '您已经是该课程的管理员了',
|
||||||
|
'未知错误,请稍后再试'
|
||||||
|
]
|
||||||
|
end
|
||||||
#加入课程
|
#加入课程
|
||||||
#object_id:课程id
|
#object_id:课程id
|
||||||
#course_password :加入课程的密码
|
#course_password :加入课程的密码
|
||||||
#@state == 0 加入成功
|
|
||||||
#@state == 1 密码错误
|
|
||||||
#@state == 2 课程已过期 请联系课程管理员重启课程。(在配置课程处)
|
|
||||||
#@state == 3 您已经加入了课程
|
|
||||||
#@state == 4 您加入的课程不存在
|
|
||||||
#@state == 5 您还未登录
|
|
||||||
#@state == 6 申请成功,请等待审核完毕
|
|
||||||
#@state == 7 您已经发送过申请了,请耐心等待
|
|
||||||
#@state == 8 您已经是该课程的教师了
|
|
||||||
#@state == 9 您已经是该课程的教辅了
|
|
||||||
#@state == 10 您已经是该课程的管理员了
|
|
||||||
#@state 其他 未知错误,请稍后再试
|
|
||||||
def join_course params,current_user
|
def join_course params,current_user
|
||||||
course = Course.find_by_id params[:object_id]
|
course = Course.find_by_invite_code(params[:invite_code]) if params[:invite_code]
|
||||||
|
|
||||||
@state = 10
|
@state = 10
|
||||||
if course
|
if course
|
||||||
|
@ -326,7 +336,7 @@ class CoursesService
|
||||||
if current_user.member_of_course?(course) #如果已经是成员
|
if current_user.member_of_course?(course) #如果已经是成员
|
||||||
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
|
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
|
||||||
roleName = member.roles[0].name if member
|
roleName = member.roles[0].name if member
|
||||||
if params[:course_password] == course.password
|
if params[:invite_code].present?
|
||||||
#如果加入角色为学生 并且当前是学生
|
#如果加入角色为学生 并且当前是学生
|
||||||
if params[:role] == "10" && roleName == "Student"
|
if params[:role] == "10" && roleName == "Student"
|
||||||
@state = 3
|
@state = 3
|
||||||
|
@ -352,19 +362,19 @@ class CoursesService
|
||||||
elsif params[:role] == "10" && roleName != "Student"
|
elsif params[:role] == "10" && roleName != "Student"
|
||||||
member.role_ids = [params[:role]]
|
member.role_ids = [params[:role]]
|
||||||
member.save
|
member.save
|
||||||
StudentsForCourse.create(:student_id => current_user.id, :course_id => params[:object_id])
|
StudentsForCourse.create(:student_id => current_user.id, :course_id => course.id)
|
||||||
@state = 0
|
@state = 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@state = 1
|
@state = 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if params[:course_password] == course.password
|
if params[:invite_code].present?
|
||||||
if params[:role] == "10" || params[:role] == nil
|
if params[:role] == "10" || params[:role] == nil
|
||||||
members = []
|
members = []
|
||||||
members << Member.new(:role_ids => [10], :user_id => current_user.id)
|
members << Member.new(:role_ids => [10], :user_id => current_user.id)
|
||||||
course.members << members
|
course.members << members
|
||||||
StudentsForCourse.create(:student_id => current_user.id, :course_id => params[:object_id])
|
StudentsForCourse.create(:student_id => current_user.id, :course_id => course.id)
|
||||||
@state = 0
|
@state = 0
|
||||||
else
|
else
|
||||||
#如果已经发送过消息了,那么就要给个提示
|
#如果已经发送过消息了,那么就要给个提示
|
||||||
|
|
|
@ -87,11 +87,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<div class="postDetailCreater">
|
<div class="postDetailCreater">
|
||||||
<% if @article.try(:author).try(:realname) == ' ' %>
|
<%= link_to @article.author.show_name, user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||||
<%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -126,11 +122,6 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<!-- <div class="homepagePostReplyBannerMore">
|
|
||||||
<%# if @reply_count > 2%>
|
|
||||||
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
|
||||||
<%# end %>
|
|
||||||
</div>-->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @article.id %>">
|
<div class="" id="reply_div_<%= @article.id %>">
|
||||||
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
|
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
|
||||||
|
@ -146,11 +137,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function submit_copy_course() {
|
function submit_copy_course() {
|
||||||
if(regex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new')&®ex_course_password('new'))
|
if(regex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new'))
|
||||||
{
|
{
|
||||||
$("#new_course").submit();
|
$("#new_course").submit();
|
||||||
document.getElementById("submit_copy_course").onclick = "";
|
document.getElementById("submit_copy_course").onclick = "";
|
||||||
|
@ -79,15 +79,15 @@
|
||||||
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml45 mb10">
|
<!--<li class="ml45 mb10">
|
||||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
<label><span class="c_red">*</span> <%#= l(:label_new_course_password)%> :</label>
|
||||||
<input type="text" style="display: none;">
|
<input type="text" style="display: none;">
|
||||||
<input type="text" name="course[password]" id="new_course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password('new');" value="<%=@course.password %>">
|
<input type="text" name="course[password]" id="new_course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password('new');" value="<%#=@course.password %>">
|
||||||
<!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
|
<!–<a id="psw_btn" href="javascript:void(0)">显示明码</a>–>
|
||||||
<span class="c_red" id="new_course_course_password_notice"></span>
|
<span class="c_red" id="new_course_course_password_notice"></span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||||
</li>
|
</li>-->
|
||||||
<li class="ml50">
|
<li class="ml50">
|
||||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
|
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<div class="C" >
|
<div class="C" >
|
||||||
<div class="C_top">
|
<div class="C_top">
|
||||||
<h2>快速进入课程通道</h2>
|
<h2>快速进入课程通道</h2>
|
||||||
<p>只要持有课程ID和密码,就可快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p>
|
<p>只要持有课程邀请码,就可以快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="C_form">
|
<div class="C_form">
|
||||||
<%= form_tag({:controller => 'courses',
|
<%= form_tag({:controller => 'courses',
|
||||||
|
@ -62,16 +62,12 @@
|
||||||
<li>
|
<li>
|
||||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||||
<span class="tips" style="width: 68px; display: inline-block;">课 程 ID:</span>
|
<span class="tips" style="width: 90px; display: inline-block;">课程邀请码:</span>
|
||||||
<input class=" width190" name="object_id" id="object_id" type="text" value="" >
|
<input class="width190" style="margin-left: 0px;" name="invite_code" id="object_id" type="text" value="" >
|
||||||
<input type="text" style="display: none"/>
|
<input type="text" style="display: none"/>
|
||||||
</li>
|
</li>
|
||||||
<li class="mB5">课程ID是所在课程网址中显示的序号</li>
|
<li class="mB5">课程邀请码是所在课程页面中显示的邀请码</li>
|
||||||
<li>
|
<li style="margin-top: 15px;">
|
||||||
<span class="tips" style="width: 68px; display: inline-block;">密 码:</span>
|
|
||||||
<input class=" width190" type="password" name="course_password" id="course_password" value="" >
|
|
||||||
</li>
|
|
||||||
<li style="margin-top: 30px;">
|
|
||||||
<span style="margin-right: 20px;">身 份:</span>
|
<span style="margin-right: 20px;">身 份:</span>
|
||||||
<% if User.current.logged? && User.current.extensions && User.current.extensions.identity == 0%>
|
<% if User.current.logged? && User.current.extensions && User.current.extensions.identity == 0%>
|
||||||
<select name="role" class="IDType">
|
<select name="role" class="IDType">
|
||||||
|
|
|
@ -6,4 +6,5 @@ $('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before(' <a href="javascript:void(0);" onclick="hideModal()" class="resourceClose" style="margin-left: 285px"></a>');
|
$('#ajax-modal').before(' <a href="javascript:void(0);" onclick="hideModal()" class="resourceClose" style="margin-left: 285px"></a>');
|
||||||
$('#ajax-modal').parent().css("top","30%").css("left","50%");
|
$('#ajax-modal').parent().css("top","30%").css("left","50%");
|
||||||
$('#ajax-modal').parent().addClass("courseOutlinePopup");
|
$('#ajax-modal').parent().addClass("courseOutlinePopup");
|
||||||
|
$('#ajax-modal').parent().removeClass("copyCoursePopup");
|
||||||
$('#ajax-modal').css("padding-left","16px")//.css("padding-bottom","16px");
|
$('#ajax-modal').css("padding-left","16px")//.css("padding-bottom","16px");
|
||||||
|
|
|
@ -32,15 +32,15 @@
|
||||||
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml45 mb10">
|
<!--<li class="ml45 mb10">
|
||||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
<label><span class="c_red">*</span> <%#= l(:label_new_course_password)%> :</label>
|
||||||
<input type="text" style="display: none;">
|
<input type="text" style="display: none;">
|
||||||
<input type="password" name="course[password]" id="new_course_course_password" class="hwork_input02" onkeyup="regex_course_password('new');">
|
<input type="password" name="course[password]" id="new_course_course_password" class="hwork_input02" onkeyup="regex_course_password('new');">
|
||||||
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
|
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
|
||||||
<span class="c_red" id="new_course_course_password_notice"></span>
|
<span class="c_red" id="new_course_course_password_notice"></span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||||
</li>
|
</li>-->
|
||||||
<li class="ml45">
|
<li class="ml45">
|
||||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
|
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
|
||||||
|
|
|
@ -57,14 +57,14 @@
|
||||||
<span class="c_red" id="edit_course_time_term_notice"></span>
|
<span class="c_red" id="edit_course_time_term_notice"></span>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li class="ml45 mb10">
|
<!--<li class="ml45 mb10">
|
||||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
<label><span class="c_red">*</span> <%#= l(:label_new_course_password)%> :</label>
|
||||||
<input type="password" name="course[password]" id="edit_course_course_password" class="hwork_input02" value="<%= @course.password%>" onkeyup="regex_course_password('edit');">
|
<input type="password" name="course[password]" id="edit_course_course_password" class="hwork_input02" value="<%#= @course.password%>" onkeyup="regex_course_password('edit');">
|
||||||
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
|
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
|
||||||
<span class="c_red" id="edit_course_course_password_notice"></span>
|
<span class="c_red" id="edit_course_course_password_notice"></span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||||
</li>
|
</li>-->
|
||||||
<li class="ml45">
|
<li class="ml45">
|
||||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%= @course.description%></textarea>
|
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%= @course.description%></textarea>
|
||||||
|
|
|
@ -75,11 +75,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<div class="postDetailCreater">
|
<div class="postDetailCreater">
|
||||||
<% if @article.try(:author).try(:realname) == ' ' %>
|
<%= link_to @article.author.show_name, user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||||
<%= link_to @article.try(:author), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to @article.try(:author).try(:realname), user_path(@article.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -109,11 +105,6 @@
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复(<%=count %>)</div>
|
<div class="homepagePostReplyBannerCount">回复(<%=count %>)</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<!-- <div class="homepagePostReplyBannerMore">
|
|
||||||
<%# if @reply_count > 2%>
|
|
||||||
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
|
||||||
<%# end %>
|
|
||||||
</div>-->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @article.id %>">
|
<div class="" id="reply_div_<%= @article.id %>">
|
||||||
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
|
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
|
||||||
|
@ -129,11 +120,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
|
|
|
@ -1,23 +1,22 @@
|
||||||
<table class="hwork-table-wrap">
|
<table class="hwork-table-wrap" style="border-bottom:1px solid #eaeaea;">
|
||||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
<tr class="b_grey hworkH30">
|
||||||
<th class="hworkList340 width530" colspan="6">
|
<th class="hworkList30 pl5 pr5"><span class="c_dark f14 fb">序号</span></th>
|
||||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
<th class="hworkList50"> </th>
|
||||||
<span class="c_dark f14 fb fl mr55"> </span>
|
<th class="hworkList60"><span class="c_dark f14 fb">姓名</span></th>
|
||||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
<th class="hworkList80"><span class="c_dark f14 fb">学号</span></th>
|
||||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
<th class="hworkList80"><span class="c_dark f14 fb">班级</span></th>
|
||||||
<span class="c_dark f14 fb fl">班级</span>
|
<th width="230"> </th>
|
||||||
</th>
|
|
||||||
<th class="hworkList130">
|
<th class="hworkList130">
|
||||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
<%= link_to "时间",'',:class => "c_dark f14 fb" ,:remote => true%>
|
||||||
</th>
|
</th>
|
||||||
<th class="hworkList50">
|
<th class="hworkList50">
|
||||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
<%= link_to "成绩",'',:class => "c_dark f14 fb",:remote => true%>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% @exercise_users_list.each_with_index do |exercise, index|%>
|
<% @exercise_users_list.each_with_index do |exercise, index|%>
|
||||||
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
|
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||||
<td class="pl5 pr5" style="width:28px; text-align:center;"><%=index + 1 %></td>
|
<td class="pl5 pr5" style="text-align:center;"><%=index + 1 %></td>
|
||||||
<td class="hworkPortrait pr10 float-none">
|
<td class="hworkPortrait pr10 float-none">
|
||||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
|
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
|
||||||
</td>
|
</td>
|
||||||
|
@ -30,7 +29,7 @@
|
||||||
<td class="hworkStID student_work_<%= exercise.id%> float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
<td class="hworkStID student_work_<%= exercise.id%> float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||||
--
|
--
|
||||||
</td>
|
</td>
|
||||||
<td width="200"> </td>
|
<td width="230"> </td>
|
||||||
<td class="hworkList130 c_grey">
|
<td class="hworkList130 c_grey">
|
||||||
<% if exercise.created_at%>
|
<% if exercise.created_at%>
|
||||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||||
|
|
|
@ -45,11 +45,15 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0);" class="menu_arrow" style="font-size:16px; color:#4b4b4b; font-weight: normal; padding-left: 0px;">作业</a>
|
<a href="javascript:void(0);" class="menu_arrow" style="font-size:16px; color:#4b4b4b; font-weight: normal; padding-left: 0px;">作业</a>
|
||||||
<ul style="max-height:240px; overflow-y:auto; overflow-x:hidden;">
|
<ul style="max-height:240px; overflow-y:auto; overflow-x:hidden;">
|
||||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
<% if @homework_commons.empty? %>
|
||||||
<li class="pr10">
|
<li class="pr10" style="font-weight: normal; color: #888888; width: 120px; padding-left: 15px; padding-bottom: 5px;">目前尚未发布作业</li>
|
||||||
<%= link_to "作业#{@homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id),:target=>"_blank"%>
|
<% else %>
|
||||||
</li>
|
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||||
<% end%>
|
<li class="pr10">
|
||||||
|
<%= link_to "作业#{@homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id),:target=>"_blank"%>
|
||||||
|
</li>
|
||||||
|
<% end%>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -57,6 +57,12 @@
|
||||||
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
|
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
|
||||||
<%=render :partial=>'layouts/project_info' %>
|
<%=render :partial=>'layouts/project_info' %>
|
||||||
</div><!--课程信息 end-->
|
</div><!--课程信息 end-->
|
||||||
|
<% if (User.current.logged? && User.current.member_of_course?(@course)) || is_teacher %>
|
||||||
|
<div class="info_box mb10">
|
||||||
|
<p class="f14">邀请码</p>
|
||||||
|
<p class="f14 fontBlue2"><%=@course.generate_invite_code %></p>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<div class="info_box">
|
<div class="info_box">
|
||||||
<ul>
|
<ul>
|
||||||
<li><%= l(:label_main_teacher)%> : <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
|
<li><%= l(:label_main_teacher)%> : <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
|
||||||
|
|
|
@ -81,11 +81,6 @@
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<!--<div class="homepagePostReplyBannerMore">-->
|
|
||||||
<!--<%# if @reply_count > 2%>-->
|
|
||||||
<!--<a# href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @memo.id%>" onclick="expand_reply('#reply_div_<%#= @memo.id %>','#reply_btn_<%#= @memo.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>-->
|
|
||||||
<!--<%# end %>-->
|
|
||||||
<!--</div>-->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @memo.id %>">
|
<div class="" id="reply_div_<%= @memo.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% @replies.each_with_index do |reply,i| %>
|
||||||
|
|
|
@ -71,11 +71,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="postDetailCreater">
|
<div class="postDetailCreater">
|
||||||
<% if @topic.try(:author).try(:realname) == ' ' %>
|
<%= link_to @topic.author.show_name, user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||||
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -114,11 +110,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
|
|
|
@ -103,11 +103,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<div class="postDetailCreater">
|
<div class="postDetailCreater">
|
||||||
<% if @topic.try(:author).try(:realname) == ' ' %>
|
<%= link_to @topic.author.show_name, user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||||
<%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -127,11 +123,6 @@
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<!-- <div class="homepagePostReplyBannerMore">
|
|
||||||
<%# if @reply_count > 2%>
|
|
||||||
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @topic.id%>" onclick="expand_reply('#reply_div_<%#= @topic.id %>','#reply_btn_<%#= @topic.id%>')" data-count="<%#= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
|
||||||
<%# end %>
|
|
||||||
</div>-->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @topic.id %>">
|
<div class="" id="reply_div_<%= @topic.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% @replies.each_with_index do |reply,i| %>
|
||||||
|
@ -147,11 +138,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %>
|
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
|
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,17 +76,7 @@
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
TO <!--+"(课程名称)"-->
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO <!--+"(课程名称)"-->
|
|
||||||
<%= link_to activity.org_subfield.name.to_s+" | 帖子栏目通知", organization_path(activity.org_subfield.organization, :org_subfield_id => activity.org_subfield.id), :class => "newsBlue ml15" %>
|
<%= link_to activity.org_subfield.name.to_s+" | 帖子栏目通知", organization_path(activity.org_subfield.organization, :org_subfield_id => activity.org_subfield.id), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
|
@ -60,22 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% count=activity.comments.count %>
|
<% count=activity.comments.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%= user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
|
|
|
@ -71,21 +71,8 @@
|
||||||
<% count = document.children.count() %>
|
<% count = document.children.count() %>
|
||||||
|
|
||||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => document, :user_activity_id => document.id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=document.id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<% if count > 3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>',<%= document.id %>,'OrgDocumentComment',<%= document.id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments_for_doc}%>
|
<%= render :partial => 'users/all_replies', :locals => {:comments => comments_for_doc}%>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
TO
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO
|
|
||||||
<%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
<%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
|
@ -40,22 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% count=activity.comments.count %>
|
<% count=activity.comments.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
<!--
|
|
||||||
<table class="hwork-table-wrap" id="homework_table" onmouseenter="<%#= @homework.homework_type == 3 ? '' : 'resizeable_table(2,4,1,1)' %>">
|
|
||||||
-->
|
|
||||||
|
|
||||||
<table class="hwork-table-wrap" id="homework_table">
|
<table class="hwork-table-wrap" id="homework_table">
|
||||||
<tr class="b_grey hworkH30">
|
<tr class="b_grey hworkH30">
|
||||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
<!--
|
|
||||||
<table class="hwork-table-wrap" id="homework_table" onmouseenter="<%#= @homework.homework_type == 3 ? '' : 'resizeable_table(2,4,11,11)' %>">
|
|
||||||
-->
|
|
||||||
|
|
||||||
<table class="hwork-table-wrap" id="homework_table">
|
<table class="hwork-table-wrap" id="homework_table">
|
||||||
<tr class="b_grey hworkH30">
|
<tr class="b_grey hworkH30">
|
||||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<li class="fl" >
|
<li class="fl" >
|
||||||
<span class="tit_fb">上交时间:</span>
|
<span class="tit_fb">上交时间:</span>
|
||||||
<%=format_time work.created_at %>
|
<%=format_time work.created_at %>
|
||||||
|
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:165px; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||||
|
|
|
@ -118,12 +118,14 @@
|
||||||
remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %>
|
remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<% if @homework.anonymous_comment == 0 %>
|
||||||
<%= link_to("导出缺评情况", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
<li>
|
||||||
</li>
|
<%= link_to("导出缺评情况", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
<li>
|
||||||
</li>
|
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
|
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,4 +1,2 @@
|
||||||
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
|
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
|
||||||
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
|
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
|
||||||
/*
|
|
||||||
$("th").each(function(){$(this).css("width",$(this).width()-1);});*/
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
<%= format_activity_day(comment.created_time) %> <%= format_time(comment.created_time, false) %>
|
<%= time_from_now(comment.created_time) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,20 +1,9 @@
|
||||||
<!--<span id="reply_praise_count_<%#=comment.id %>" class="orig_index">
|
|
||||||
<%# if comment.user == User.current %>
|
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%#= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<%# else %>
|
|
||||||
<%#=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<%# end %>
|
|
||||||
</span>-->
|
|
||||||
<div class="orig_user fl">
|
<div class="orig_user fl">
|
||||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="orig_right fl">
|
<div class="orig_right fl">
|
||||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
<%= link_to comment.user.show_name, user_path(comment.user_id), :class => "content-username" %>
|
||||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "content-username" %>
|
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
||||||
<% else %>
|
<div class="orig_content "><%= comment.notes.html_safe %></div>
|
||||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "content-username" %>
|
|
||||||
<% end %>
|
|
||||||
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
|
||||||
<div class="orig_content "><%= comment.notes.html_safe %></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
|
@ -7,11 +7,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<%= link_to activity.user.show_name, user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
TO <!--+"(课程名称)" -->
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO <!--+"(课程名称)" -->
|
|
||||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->
|
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
TO
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO
|
|
||||||
<% course=Course.find(activity.jour_id) %>
|
<% course=Course.find(activity.jour_id) %>
|
||||||
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
|
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,29 +38,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count = fetch_user_leaveWord_reply(activity).count %>
|
<% all_comments = []%>
|
||||||
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
|
<% allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||||
|
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/journal_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :allow_delete => allow_delete} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'JournalsForMessage',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% all_comments = []%>
|
||||||
|
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
<%= render :partial => 'users/journal_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :allow_delete => allow_delete, :activity_id =>activity.id}%>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
|
||||||
<% end %>
|
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||||
</div>
|
</div>
|
||||||
|
@ -89,22 +85,7 @@
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
|
||||||
<%if count > 3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% activity= activity.parent ? activity.parent : activity%>
|
<% activity= activity.parent ? activity.parent : activity%>
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
TO <!--+"(课程名称)"-->
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO <!--+"(课程名称)"-->
|
|
||||||
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
|
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
|
@ -67,22 +64,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% count=activity.comments.count %>
|
<% count=activity.comments.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
|
|
|
@ -12,11 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
<%= link_to comment.user.show_name, user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
<%= time_from_now(comment.created_on) %>
|
<%= time_from_now(comment.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
<% unless comment.m_parent_id.nil? %>
|
<% unless comment.m_parent_id.nil? %>
|
||||||
|
@ -37,7 +33,7 @@
|
||||||
<div class="orig_cont_hide clearfix">
|
<div class="orig_cont_hide clearfix">
|
||||||
<span class="orig_icon" >↓ </span>
|
<span class="orig_icon" >↓ </span>
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span>
|
<span class="orig_icon" style="display:none;" > ↑</span>
|
||||||
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %>
|
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
||||||
</div>
|
</div>
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +41,8 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth t_txt" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth t_txt" id="reply_content_<%= comment.id %>">
|
||||||
<%= comment.notes.html_safe %></div>
|
<%= comment.notes.html_safe %>
|
||||||
|
</div>
|
||||||
<div class="orig_reply mb10 mt-10">
|
<div class="orig_reply mb10 mt-10">
|
||||||
<div class="reply">
|
<div class="reply">
|
||||||
<span class="reply-right">
|
<span class="reply-right">
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="orig_cont clearfix">
|
||||||
|
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||||
|
<div>
|
||||||
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment} %>
|
||||||
|
</div>
|
|
@ -0,0 +1,85 @@
|
||||||
|
<ul>
|
||||||
|
<% comments.each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher">
|
||||||
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<%= time_from_now(comment.created_on) %>
|
||||||
|
</div>
|
||||||
|
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||||
|
<% parents_rely = [] %>
|
||||||
|
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
||||||
|
<% length = parents_rely.length %>
|
||||||
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
|
<% if length <= 3 %>
|
||||||
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||||
|
<% else %>
|
||||||
|
<div class="orig_cont clearfix">
|
||||||
|
<div class="orig_cont clearfix">
|
||||||
|
<div>
|
||||||
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_cont_hide clearfix">
|
||||||
|
<span class="orig_icon" >↓ </span>
|
||||||
|
<span class="orig_icon" style="display:none;" > ↑</span>
|
||||||
|
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if !comment.content_detail.blank? || comment.class == Journal %>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
<% if comment.class == Journal %>
|
||||||
|
<% if comment.details.any? %>
|
||||||
|
<% details_to_strings(comment.details).each do |string| %>
|
||||||
|
<p><%= string %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<P><%= comment.notes.html_safe %></P>
|
||||||
|
<% else %>
|
||||||
|
<%= comment.content_detail.html_safe %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_reply mb10 mt-10">
|
||||||
|
<div class="reply">
|
||||||
|
<span class="reply-right">
|
||||||
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_reply),
|
||||||
|
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||||
|
:remote => true,
|
||||||
|
:method => 'get',
|
||||||
|
:title => l(:button_reply)) %>
|
||||||
|
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
|
<% if allow_delete %>
|
||||||
|
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||||
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="reply_message_<%= comment.id%>"></p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="homepagePostReplyBanner">
|
||||||
|
<div class="homepagePostReplyBannerCount">
|
||||||
|
<span>回复</span>
|
||||||
|
<span class="reply_iconup" > ︿</span>
|
||||||
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
<%if count>3 %>
|
||||||
|
<div class="homepagePostReplyBannerMore">
|
||||||
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_journal_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>,<%=allow_delete %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
|
展开更多
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -1,21 +1,6 @@
|
||||||
<% count = activity.journals.count %>
|
<% count = activity.journals.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<% if count > 3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Issue',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
|
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %>
|
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
|
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
|
||||||
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
||||||
|
@ -88,18 +84,7 @@
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
TO <!--+"(名称)"-->
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO <!--+"(名称)"-->
|
|
||||||
<%= link_to activity.project.name.to_s+" | 新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
<%= link_to activity.project.name.to_s+" | 新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
|
@ -64,23 +61,8 @@
|
||||||
</div>
|
</div>
|
||||||
<% count=activity.comments.count %>
|
<% count=activity.comments.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="homepagePostReplyBanner">
|
||||||
|
<div class="homepagePostReplyBannerCount">
|
||||||
|
<span>回复</span>
|
||||||
|
<span class="reply_iconup" > ︿</span>
|
||||||
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
<%if count>3 %>
|
||||||
|
<div class="homepagePostReplyBannerMore">
|
||||||
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
|
展开更多
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -3,17 +3,32 @@
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||||
<div class="orig_textarea mb10 fl">
|
<div class="orig_textarea mb10 fl">
|
||||||
<div nhname='new_message_<%= reply.id%>'>
|
<div nhname='new_message_<%= reply.id%>'>
|
||||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
|
<% if @type == 'HomeworkCommon' %>
|
||||||
<input type="hidden" name="is_in_course" value=<%=@is_in_course %>>
|
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
|
||||||
<input type="hidden" name="user_activity_id" value=<%=@user_activity_id %>>
|
<input type="hidden" name="is_in_course" value=<%=@is_in_course %>>
|
||||||
<input type="hidden" name="course_activity" value=<%=@course_activity %>>
|
<input type="hidden" name="user_activity_id" value=<%=@user_activity_id %>>
|
||||||
<input type="hidden" name="reply[subject]" id="reply_subject">
|
<input type="hidden" name="course_activity" value=<%=@course_activity %>>
|
||||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
<input type="hidden" name="reply[subject]" id="reply_subject">
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply_message"></textarea>
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply_message"></textarea>
|
||||||
<div class="cl"></div>
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
<div class="cl"></div>
|
||||||
<% end%>
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
|
<% end%>
|
||||||
|
<% elsif @type == 'JournalsForMessage' %>
|
||||||
|
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => reply.id}, :method => "post", :remote => true) do |f|%>
|
||||||
|
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => reply.id %>
|
||||||
|
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => reply.user.id %>
|
||||||
|
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => reply.id %>
|
||||||
|
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
||||||
|
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||||
|
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %>
|
||||||
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="user_notes"></textarea>
|
||||||
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end%>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render :partial => "users/show_unlogged_reply" %>
|
<%= render :partial => "users/show_unlogged_reply" %>
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
<% case user_activity.act_type.to_s %>
|
<% case user_activity.act_type.to_s %>
|
||||||
<% when 'JournalsForMessage' %>
|
<% when 'JournalsForMessage' %>
|
||||||
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
||||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %>
|
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% when 'Blog'%>
|
<% when 'Blog'%>
|
||||||
|
|
|
@ -6,11 +6,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
TO <!--+"(课程名称)"-->
|
||||||
<% else %>
|
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
|
||||||
<% end %> TO <!--+"(课程名称)"-->
|
|
||||||
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %>
|
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
|
||||||
|
@ -46,22 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% count=activity.children.count %>
|
<% count=activity.children.count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'BlogComment',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(l(:label_bid_respond_delete),
|
<%= link_to(l(:label_bid_respond_delete),
|
||||||
{:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
|
{:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id, :activity_id => activity.id},
|
||||||
:confirm => l(:text_are_you_sure), :method => 'delete',
|
:confirm => l(:text_are_you_sure), :method => 'delete',
|
||||||
:class => "postOptionLink", :title => l(:button_delete)) %>
|
:class => "postOptionLink", :title => l(:button_delete)) %>
|
||||||
</li>
|
</li>
|
||||||
|
@ -62,29 +62,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count=fetch_user_leaveWord_reply(activity).count %>
|
<% all_comments = []%>
|
||||||
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
|
<% allow_delete = (activity.user == User.current || User.current.admin?) %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<%= render :partial => 'users/journal_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :allow_delete => allow_delete} %>
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
|
||||||
<%if count>3 %>
|
|
||||||
<div class="homepagePostReplyBannerMore">
|
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'JournalsForMessage',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
|
||||||
展开更多
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% all_comments = []%>
|
||||||
|
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
<%= render :partial => 'users/journal_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :allow_delete => allow_delete, :activity_id =>activity.id}%>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -99,7 +87,6 @@
|
||||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
|
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
|
||||||
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
||||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||||
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
|
|
||||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");
|
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>0} %>
|
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %>
|
||||||
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<% if params[:type] == 'HomeworkCommon' %>
|
<% if params[:type] == 'HomeworkCommon' %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
||||||
|
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||||
|
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :activity_id =>params[:id].to_i}) %>');
|
||||||
<% else %>
|
<% else %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
<% unless @comment.parent.nil? %>
|
<% unless @comment.parent.nil? %>
|
||||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
<% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %>
|
||||||
|
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||||
|
<% else %>
|
||||||
|
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var ua = navigator.userAgent.toLowerCase();
|
||||||
|
var isWeixin = ua.indexOf('micromessenger') != -1;
|
||||||
|
var isAndroid = ua.indexOf('android') != -1;
|
||||||
|
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
|
||||||
|
if (!isWeixin) {
|
||||||
|
document.head.innerHTML = '<title>抱歉,出错了</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/connect/zh_CN/htmledition/style/wap_err1a9853.css">';
|
||||||
|
document.body.innerHTML = '<div class="page_msg"><div class="inner"><span class="msg_icon_wrp"><i class="icon80_smile"></i></span><div class="msg_content"><h4>请在微信客户端打开链接</h4></div></div></div>';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -9,10 +9,16 @@
|
||||||
<meta name="apple-mobile-web-app-capable" content="no" />
|
<meta name="apple-mobile-web-app-capable" content="no" />
|
||||||
<meta content='True' name='HandheldFriendly' />
|
<meta content='True' name='HandheldFriendly' />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
|
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weui.min.css" />
|
||||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.g_openid = '<%= @wechat_user.openid %>';
|
window.g_debug = false; //调试标志,如果在本地请置为true
|
||||||
|
window.apiUrl = '/api/v1/';
|
||||||
|
window.g_redirect_path = '<%= @path %>';
|
||||||
|
<% if @course_id %>
|
||||||
|
window.g_courseid = <%= @course_id %>;
|
||||||
|
<% end %>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -20,8 +26,29 @@
|
||||||
<div ng-view>
|
<div ng-view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/javascripts/wechat/build/angular.all.min.js"></script>
|
<script src="https://dn-demotest.qbox.me/angular.all.min.js"></script>
|
||||||
|
<!--<script src="/javascripts/wechat/build/angular.all.min.js"></script>-->
|
||||||
|
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
|
||||||
<script src="/javascripts/wechat/app.js"></script>
|
<script src="/javascripts/wechat/app.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/factory.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/filter.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/alert.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/form_validate.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/input_auto.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/reg.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/invite_code.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/login.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/activity.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/add_class.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/blog.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/discussion.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/homework.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/issue.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/journals.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/myclass.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/routes.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -1,8 +1,8 @@
|
||||||
<% if @save_succ %>
|
<% if @save_succ %>
|
||||||
<% if @user_activity_id %>
|
<% if @user_activity_id %>
|
||||||
<% if @is_activity %>
|
<% if @activity.jour_type == 'Principal' %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||||
<% else %>
|
<% elsif @activity.jour_type == 'Course' %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||||
<% end %>
|
<% end %>
|
||||||
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
|
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon'].include? @journal_destroyed.jour_type)%>
|
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon'].include? @journal_destroyed.jour_type)%>
|
||||||
<% if @is_user%>
|
<% if @is_user%>
|
||||||
<% if @activity %>
|
<% if @activity %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||||
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
|
|
||||||
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").hide();
|
$("#user_activity_<%= @user_activity_id%>").hide();
|
||||||
|
@ -20,7 +19,12 @@
|
||||||
<% if @bid && @jours_count %>
|
<% if @bid && @jours_count %>
|
||||||
$('#jours_count').html("<%= @jours_count %>");
|
$('#jours_count').html("<%= @jours_count %>");
|
||||||
<% elsif @course && @jours_count%>
|
<% elsif @course && @jours_count%>
|
||||||
$('#course_jour_count').html("(<%= @jours_count %>)");
|
<% if @user_activity_id %>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||||
|
<% else %>
|
||||||
|
$('#course_jour_count').html("(<%= @jours_count %>)");
|
||||||
|
<% end %>
|
||||||
<% elsif @user && @jours_count%>
|
<% elsif @user && @jours_count%>
|
||||||
$('#jour_count').html("<%= @jours_count %>");
|
$('#jour_count').html("<%= @jours_count %>");
|
||||||
<% elsif @homework%>
|
<% elsif @homework%>
|
||||||
|
|
|
@ -1864,12 +1864,18 @@ zh:
|
||||||
excel_nickname: 登录名
|
excel_nickname: 登录名
|
||||||
excel_student_id: 学号
|
excel_student_id: 学号
|
||||||
excel_mail: 电子邮箱
|
excel_mail: 电子邮箱
|
||||||
|
excel_rank: 排名
|
||||||
excel_homework_name: 作品名
|
excel_homework_name: 作品名
|
||||||
excel_homework_des: 作品描述
|
excel_homework_des: 作品描述
|
||||||
|
excel_homework_project: 关联项目
|
||||||
|
excel_no_project: 无关联项目
|
||||||
|
excel_group_member: 组员
|
||||||
excel_t_score: 教师评分
|
excel_t_score: 教师评分
|
||||||
excel_ta_score: 教辅评分
|
excel_ta_score: 教辅评分
|
||||||
excel_n_score: 匿名评分
|
excel_n_score: 匿名评分
|
||||||
excel_s_score: 系统评分
|
excel_s_score: 系统评分
|
||||||
|
excel_a_penalty: 缺评扣分
|
||||||
|
excel_l_penalty: 迟交扣分
|
||||||
excel_f_score: 成绩
|
excel_f_score: 成绩
|
||||||
excel_commit_time: 提交时间
|
excel_commit_time: 提交时间
|
||||||
excel_homework_score: 作业积分
|
excel_homework_score: 作业积分
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get :login
|
get :login
|
||||||
get :user_activities
|
get :user_activities
|
||||||
post :bind
|
post :bind
|
||||||
post :get_open_id
|
post :get_bind
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@ default: &default
|
||||||
# Or if using public account, only need above two line
|
# Or if using public account, only need above two line
|
||||||
|
|
||||||
# guange test
|
# guange test
|
||||||
#appid: "wxf694495398c7d470"
|
appid: "wxf694495398c7d470"
|
||||||
#secret: "743e038392f1d89540e95f8f7645849a"
|
secret: "743e038392f1d89540e95f8f7645849a"
|
||||||
|
|
||||||
appid: "wx8e1ab05163a28e37"
|
# appid: "wx8e1ab05163a28e37"
|
||||||
secret: "beb4d3bc4b32b3557811680835357841"
|
# secret: "beb4d3bc4b32b3557811680835357841"
|
||||||
|
|
||||||
token: "123456"
|
token: "123456"
|
||||||
access_token: "1234567"
|
access_token: "1234567"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddInviteCodeToCourse < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :courses, :invite_code, :string
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddIndexToInviteCode < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :courses, :qrcode, :string
|
||||||
|
add_index :courses, :invite_code, unique: true
|
||||||
|
end
|
||||||
|
end
|
35
db/schema.rb
35
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20160612043259) do
|
ActiveRecord::Schema.define(:version => 20160624032138) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -550,8 +550,14 @@ ActiveRecord::Schema.define(:version => 20160612043259) do
|
||||||
t.integer "excellent_option", :default => 0
|
t.integer "excellent_option", :default => 0
|
||||||
t.integer "is_copy", :default => 0
|
t.integer "is_copy", :default => 0
|
||||||
t.integer "visits", :default => 0
|
t.integer "visits", :default => 0
|
||||||
|
t.integer "syllabus_id"
|
||||||
|
t.string "invite_code"
|
||||||
|
t.string "qrcode"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
|
||||||
|
add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
|
||||||
|
|
||||||
create_table "custom_fields", :force => true do |t|
|
create_table "custom_fields", :force => true do |t|
|
||||||
t.string "type", :limit => 30, :default => "", :null => false
|
t.string "type", :limit => 30, :default => "", :null => false
|
||||||
t.string "name", :limit => 30, :default => "", :null => false
|
t.string "name", :limit => 30, :default => "", :null => false
|
||||||
|
@ -1119,6 +1125,23 @@ ActiveRecord::Schema.define(:version => 20160612043259) do
|
||||||
t.integer "viewed_count", :default => 0
|
t.integer "viewed_count", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "mess", :id => false, :force => true do |t|
|
||||||
|
t.string "课程名"
|
||||||
|
t.integer "课程ID", :default => 0, :null => false
|
||||||
|
t.string "教师姓", :default => "", :null => false
|
||||||
|
t.string "教师名", :limit => 30, :default => "", :null => false
|
||||||
|
t.string "主贴名", :default => "", :null => false
|
||||||
|
t.integer "主贴或回帖ID", :default => 0, :null => false
|
||||||
|
t.integer "回帖对应主贴ID"
|
||||||
|
t.integer "帖子点赞数"
|
||||||
|
t.integer "主贴回复数", :default => 0, :null => false
|
||||||
|
t.text "主贴或回帖内容"
|
||||||
|
t.datetime "发帖时间", :null => false
|
||||||
|
t.integer "发帖或回帖用户ID", :default => 0, :null => false
|
||||||
|
t.string "发帖或回帖用户姓", :default => "", :null => false
|
||||||
|
t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "message_alls", :force => true do |t|
|
create_table "message_alls", :force => true do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "message_id"
|
t.integer "message_id"
|
||||||
|
@ -1826,6 +1849,16 @@ ActiveRecord::Schema.define(:version => 20160612043259) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "syllabuses", :force => true do |t|
|
||||||
|
t.string "title"
|
||||||
|
t.text "description"
|
||||||
|
t.integer "user_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id"
|
||||||
|
|
||||||
create_table "system_messages", :force => true do |t|
|
create_table "system_messages", :force => true do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.string "content"
|
t.string "content"
|
||||||
|
|
|
@ -20,23 +20,25 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="post-title mt5 mb5 hidden"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
|
<div class="post-title mt5 mb5 hidden"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
|
||||||
<div class="post-content c-grey3">
|
<div class="post-content c-grey3">
|
||||||
<div class="post-all-content mb5" ng-bind-html="act.description|safeHtml"></div>
|
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||||
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
|
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
|
||||||
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
|
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
|
||||||
</div>
|
</div>
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span ng-if="act.homework_common_detail.homework_type == 1" class="c-grey f12 fl mr15 mt2">普通作业</span>
|
<div class="post-op-banner">
|
||||||
<span ng-if="act.homework_common_detail.homework_type == 2" class="c-grey f12 fl mr15 mt2">编程作业</span>
|
<span ng-if="act.homework_common_detail.homework_type == 1" class="c-grey f12 fl mr15">普通作业</span>
|
||||||
<span ng-if="act.homework_common_detail.homework_type == 3" class="c-grey f12 fl mr15 mt2">分组作业</span>
|
<span ng-if="act.homework_common_detail.homework_type == 2" class="c-grey f12 fl mr15">编程作业</span>
|
||||||
<span class="c-grey f12 fl mt2">{{act.latest_update}}</span>
|
<span ng-if="act.homework_common_detail.homework_type == 3" class="c-grey f12 fl mr15">分组作业</span>
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,14 +60,16 @@
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
|
<div class="post-op-banner">
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,14 +91,16 @@
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
|
<div class="post-op-banner">
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -127,21 +133,23 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
|
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
|
||||||
<div class="post-content c-grey3">
|
<div class="post-content c-grey3">
|
||||||
<div class="post-all-content mb5" ng-bind-html="act.description|safeHtml"></div>
|
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||||
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
|
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
|
||||||
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
|
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
|
||||||
</div>
|
</div>
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
|
<div class="post-op-banner">
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -164,14 +172,16 @@
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
|
<div class="post-op-banner">
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -208,13 +218,15 @@
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<div class="post-op-banner">
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -237,13 +249,15 @@
|
||||||
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
|
<div class="post-op-banner">
|
||||||
<a ng-if="!act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
<span class="c-grey f12 fl">{{act.latest_update}}</span>
|
||||||
<a ng-if="act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
<a ng-if="!act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">赞</span></div>
|
<a ng-if="act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">赞</span></div>
|
||||||
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
<div class="cl"></div>
|
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -254,6 +268,7 @@
|
||||||
<div ng-if="has_more">
|
<div ng-if="has_more">
|
||||||
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
|
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
|
||||||
</div>
|
</div>
|
||||||
|
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible"></my-alert>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<div class="post-container">
|
||||||
|
<div class="add-class-box">
|
||||||
|
<p class="tac add-class-tip">输入班级邀请码,即刻加入班级!</p>
|
||||||
|
<form class="mb20">
|
||||||
|
<input type="text" class="class-number-input" />
|
||||||
|
</form>
|
||||||
|
<a href="javascript:void(0);" class="c-grey4 fl cancel-btn">取消</a>
|
||||||
|
<div class="slice fl">
|
||||||
|
<div class="slice-line"></div>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" class="c-blue fl submit-btn">确定</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -2,7 +2,7 @@
|
||||||
<html ng-app="wechat">
|
<html ng-app="wechat">
|
||||||
<head>
|
<head>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<title>我的动态</title>
|
<title>仅供本地调试使用</title>
|
||||||
<meta charset='utf-8' />
|
<meta charset='utf-8' />
|
||||||
<meta name="keywords" content="" />
|
<meta name="keywords" content="" />
|
||||||
<meta name="description" content="" />
|
<meta name="description" content="" />
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
<meta content='True' name='HandheldFriendly' />
|
<meta content='True' name='HandheldFriendly' />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
|
|
||||||
|
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weui.min.css" />
|
||||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -17,8 +18,38 @@
|
||||||
<div ng-view>
|
<div ng-view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.g_openid = 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg';
|
||||||
|
window.g_debug = true; //调试标志,如果在本地请置为true
|
||||||
|
window.apiUrl = 'http://localhost:3000/api/v1/';
|
||||||
|
</script>
|
||||||
|
|
||||||
<script src="/javascripts/wechat/build/angular.all.min.js"></script>
|
<script src="/javascripts/wechat/build/angular.all.min.js"></script>
|
||||||
|
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
|
||||||
|
|
||||||
|
|
||||||
<script src="/javascripts/wechat/app.js"></script>
|
<script src="/javascripts/wechat/app.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/factory.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/filter.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/alert.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/form_validate.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/input_auto.js"></script>
|
||||||
|
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/reg.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/login.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/activity.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/add_class.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/blog.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/discussion.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/homework.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/issue.js"></script>
|
||||||
|
<script src="/javascripts/wechat/controllers/journals.js"></script>
|
||||||
|
<script src="/javascripts/wechat/others/routes.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -39,7 +39,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addBlogReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<td class="text-nowrap v-top">来 源:</td>
|
<td class="text-nowrap v-top">来 源:</td>
|
||||||
<td>{{discussion.course_project_name}} | 课程问答区</td>
|
<td>{{discussion.course_project_name}} | 课程问答区</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="discussion.content|safeHtml"></div>
|
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
|
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<td class="text-nowrap v-top">来 源:</td>
|
<td class="text-nowrap v-top">来 源:</td>
|
||||||
<td>{{news.course_name}} | 课程通知</td>
|
<td>{{news.course_name}} | 课程通知</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="news.description|safeHtml"></div>
|
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="c-grey f13 mt10 fl">{{news.created_on}}</span>
|
<span class="c-grey f13 mt10 fl">{{news.created_on}}</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addNoticeReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-nowrap v-top">类 别:</td>
|
<td class="text-nowrap v-top">类 别:</td>
|
||||||
<td><span ng-if="homework.homework_type == 1" class="c-grey f12 fl mr15 mt2">普通作业</span>
|
<td><span ng-if="homework.homework_type == 1">普通作业</span>
|
||||||
<span ng-if="homework.homework_type == 2" class="c-grey f12 fl mr15 mt2">编程作业</span>
|
<span ng-if="homework.homework_type == 2">编程作业</span>
|
||||||
<span ng-if="homework.homework_type == 3" class="c-grey f12 fl mr15 mt2">分组作业</span>
|
<span ng-if="homework.homework_type == 3">分组作业</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="f13 c-grey3 mt10 mb10 text-control" ng-bind-html="homework.description|safeHtml"></div>
|
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div>
|
||||||
<span class="c-grey f13">迟交扣分:{{homework.late_penalty}}分</span><br/>
|
<span class="c-grey f13">迟交扣分:{{homework.late_penalty}}分</span><br/>
|
||||||
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span>
|
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span>
|
||||||
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评开启时间:{{homework.evaluation_start}}<br /></span>
|
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评开启时间:{{homework.evaluation_start}}<br /></span>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment"></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addHomeworkReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<div class="post-container">
|
||||||
|
<div class="qr-code-wrap">
|
||||||
|
<div class="qr-code-box">
|
||||||
|
<div class="share-class-name">{{course.name}}</div>
|
||||||
|
<div class="qr-img-wrap"><img ng-src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket={{course.qrcode}}" width="152" class="qr-code-img" /></div>
|
||||||
|
<div class="invitation-code-wrap">邀请码:{{course.invite_code}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="share-code-wrap">
|
||||||
|
<a ng-click="share()" href="javascript:void(0);" class="share-code-btn">分享邀请码</a>
|
||||||
|
<div class="share-code-instruction"> 1.将此页面分享给好友,邀请好友加入班级<br />
|
||||||
|
2.通过微信扫一扫加入班级<br />
|
||||||
|
3.输入邀请码加入班级</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,50 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>react js</title>
|
|
||||||
<meta charset='utf-8' />
|
|
||||||
<meta name="keywords" content="" />
|
|
||||||
<meta name="description" content="" />
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="no">
|
|
||||||
<meta content='True' name='HandheldFriendly' />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
||||||
|
|
||||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="container"></div>
|
|
||||||
|
|
||||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
|
||||||
<script id="t:result-list" type="text/html">
|
|
||||||
|
|
||||||
<! for(var i =0; i < issues.length; ++i){ !>
|
|
||||||
<div class="post-container">
|
|
||||||
<div class="post-wrapper">
|
|
||||||
<div class="post-main">
|
|
||||||
<div class="post-avatar fl"><img src="<!=issues[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
|
|
||||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=issues[i].subject!></span></div>
|
|
||||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=issues[i].author.nickname!></a>项目问题</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<div class="post-content c-grey2 mt10">
|
|
||||||
<div class="post-all-content"><!=issues[i].description!></div>
|
|
||||||
</div>
|
|
||||||
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more " style="text-decoration:underline">点击展开</a>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<span class="c-grey f13 mt10 fl"><!=issues[i].created_on!></span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<! } !>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
|
||||||
<script src="/javascripts/baiduTemplate.js"></script>
|
|
||||||
<script src="/javascripts/wechat/auth.js"></script>
|
|
||||||
<script src="/javascripts/wechat/wechat-dev.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -14,7 +14,7 @@
|
||||||
<td class="text-nowrap v-top">来 源:</td>
|
<td class="text-nowrap v-top">来 源:</td>
|
||||||
<td>{{issue.project_name}} | 项目问题</td>
|
<td>{{issue.project_name}} | 项目问题</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<div class="f13 c-grey3 mt10 mb10 text-control" ng-bind-html="issue.description|safeHtml"></div>
|
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div>
|
||||||
<span class="c-grey f13">状 态:{{issue.issue_status}}<br>
|
<span class="c-grey f13">状 态:{{issue.issue_status}}<br>
|
||||||
优先级:{{issue.issue_priority}}<br />
|
优先级:{{issue.issue_priority}}<br />
|
||||||
指派给:{{issue.issue_assigned_to}}<br />
|
指派给:{{issue.issue_assigned_to}}<br />
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addIssueReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addJournalReply(formData)" ng-hide="formData.disabled" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-hide="formData.disabled" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<div class="post-container">
|
||||||
|
<div loading-spinner></div>
|
||||||
|
|
||||||
|
<form name="loginFrm" novalidate>
|
||||||
|
<div class="blue-title">绑定<span class="f13 blue-title-sub" ng-click="goReg()">注册</span></div>
|
||||||
|
<div class="input-box-wrap login-wrap mt30">
|
||||||
|
<input name="login" ng-model="user.login" required class="input-box f12" placeholder="请输入电子邮箱地址或登录名" />
|
||||||
|
<div ng-show="loginFrm.$submitted || loginFrm.login.$touched">
|
||||||
|
<span ng-show="loginFrm.login.$error.required" class="c-red fl f12">电子邮箱地址或登录名不能为空</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-box-wrap login-wrap mt10 mb20">
|
||||||
|
<input class="input-box f12" placeholder="请输入密码" name="password" type="password" ng-model="user.password" required />
|
||||||
|
<div ng-show="loginFrm.$submitted || loginFrm.password.$touched">
|
||||||
|
<span ng-show="loginFrm.password.$error.required" class="c-red fl f12">密码不能为空</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="login-wrap mt5"><a href="javascript:void(0);" ng-class="['btn1', 'bg-blue', 'f18', {'btn-disabled':!loginFrm.$valid} ]" ng-click="login(loginFrm, user)">确定绑定</a></div>
|
||||||
|
<div class="forget-psw-wrap"><a href="javascript:void(0);" class="f12 forget-psw" ng-click="showBox()">忘记密码?</a></div>
|
||||||
|
<my-alert message="findPwdDialog.message" title="findPwdDialog.title" visible="findPwdDialog.visible"></my-alert>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<div class="post-container">
|
||||||
|
<div loading-spinner></div>
|
||||||
|
<div class="class-detail-name">{{course.name}}<span ng-click="invite()" class="f13 blue-title-sub">邀请码</span></div>
|
||||||
|
<div class="slice3 fl"></div>
|
||||||
|
<div id="class_tab_1" ng-class="['class-detail-tab3',{'class-tab-active':currentTab==1}]" ng-click="tab(1);"><a herf="javascript:void(0);">课堂资源</a></div>
|
||||||
|
<div class="slice2 fl">
|
||||||
|
<div class="slice-line2"></div>
|
||||||
|
</div>
|
||||||
|
<div id="class_tab_2" ng-class="['class-detail-tab3',{'class-tab-active':currentTab==2}]" ng-click="tab(2);"><a herf="javascript:void(0);">我的同学</a></div>
|
||||||
|
<div class="slice3 fl"></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="class-search-wrap">
|
||||||
|
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
|
||||||
|
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-class="{'undis': currentTab!=1}">
|
||||||
|
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span></div>
|
||||||
|
</div>
|
||||||
|
<div ng-class="{'undis': currentTab!=2}">
|
||||||
|
<div class="member-banner f13 c-grey3">授课老师</div>
|
||||||
|
|
||||||
|
<div class="class-detail-row f13 c-grey3" ng-repeat="teacher in teachers|filter:searchText">
|
||||||
|
<img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl ml10">{{teacher.name}}</span><span class="fr mr10 c-grey2">{{teacher.role_name|identify}}</span><img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" />
|
||||||
|
</div>
|
||||||
|
<div class="member-banner f13 mt10 c-grey3">我的同学</div>
|
||||||
|
<div class="class-detail-row f13 c-grey3" ng-repeat="student in students|filter:searchText">
|
||||||
|
<img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl ml10">{{student.name}}</span><img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -14,7 +14,7 @@
|
||||||
<td class="text-nowrap v-top">来 源:</td>
|
<td class="text-nowrap v-top">来 源:</td>
|
||||||
<td>{{discussion.course_project_name}} | 项目讨论区</td>
|
<td>{{discussion.course_project_name}} | 项目讨论区</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="discussion.content|safeHtml"></div>
|
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
|
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<textarea class="copy-input"></textarea>
|
<textarea class="copy-input"></textarea>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
|
||||||
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
<div class="post-container">
|
||||||
|
<form name="regFrm" novalidate>
|
||||||
|
<div class="blue-title">注册<span class="f13 blue-title-sub" ng-click="goLogin()">登录</span></div>
|
||||||
|
<img src="/images/wechat/male.jpg" width="60" class="img-circle mt15 block-center"/>
|
||||||
|
<div class="input-box-wrap login-wrap mt10 mb20">
|
||||||
|
<input class="input-box f12" type="email" ng-model="user.email" name="email" required placeholder="请输入电子邮箱地址"/>
|
||||||
|
<div ng-show="regFrm.$submitted || regFrm.email.$touched">
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.email.$error.required">电子邮箱地址不能为空</span>
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-box-wrap login-wrap mb20">
|
||||||
|
<input class="input-box f12" type="password" ng-model="user.password" name="password" ng-maxlength="20" ng-minlength="8" required placeholder="请输入密码"/>
|
||||||
|
<div ng-show="regFrm.$submitted || regFrm.password.$touched">
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.password.$error.required">密码不能为空</span>
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.password.$error.minlength">密码长度为8-20位</span>
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.password.$error.maxlength">密码长度为8-20位</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-box-wrap login-wrap mb20">
|
||||||
|
<input class="input-box f12" type="password" ng-model="user.password_confirm" name="password_confirm" required placeholder="请再次输入密码" pwdconfirm/>
|
||||||
|
<div ng-show="regFrm.$submitted || regFrm.password_confirm.$touched">
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.password_confirm.$error.pwdconfirm">两次密码不一致</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-box-wrap login-wrap mb20">
|
||||||
|
<input class="input-box f12" required ng-model="user.username" name="username" placeholder="输入用户登录名"/>
|
||||||
|
<div ng-show="regFrm.$submitted || regFrm.username.$touched">
|
||||||
|
<span class="f12 c-red fl" ng-show="regFrm.username.$error.required">用户名不能为空</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="login-op-wrap login-wrap f12 c-grey3">
|
||||||
|
<span ng-class="['login-box', 'mr5',{'checked': isagreed}]"
|
||||||
|
ng-click="agreed(isagreed)"></span>我已阅读并接受<a
|
||||||
|
href="javascript:void(0);" class="link-blue2">Trustie服务协议</a>条款
|
||||||
|
</div>
|
||||||
|
<div class="login-wrap mt5"><a href="javascript:void(0);" ng-class="['btn1', 'bg-blue', 'f18', {'btn-disabled':!regFrm.$valid} ]" ng-click="reg(regFrm, user)">确定注册</a></div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<my-alert message="errDialog.message" title="errDialog.title" visible="errDialog.visible"></my-alert>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!--BEGIN dialog2-->
|
||||||
|
<div class="weui_dialog_alert" id="dialog2" ng-show="visible">
|
||||||
|
<div class="weui_mask"></div>
|
||||||
|
<div class="weui_dialog">
|
||||||
|
<div class="weui_dialog_hd"><strong class="weui_dialog_title">{{title}}</strong></div>
|
||||||
|
<div class="weui_dialog_bd"><span class="weui_dialog_info">{{message}}</span></div>
|
||||||
|
<div class="weui_dialog_ft">
|
||||||
|
<a href="javascript:;" class="weui_btn_dialog primary" ng-click="dismiss()">确定</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--END dialog2-->
|
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue