Merge branch 'develop' into cxt_course
This commit is contained in:
commit
45fb2d0a3e
|
@ -6,10 +6,17 @@ module Mobile
|
|||
resources :blog_comments do
|
||||
|
||||
desc "get special topic"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
|
||||
blog = BlogComment.find params[:id]
|
||||
present :data, blog, with: Mobile::Entities::BlogComment,user: user
|
||||
present :data, blog, with: Mobile::Entities::BlogComment,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -200,8 +200,13 @@ module Mobile
|
|||
# course = Course.find(params[:id])
|
||||
cs = CoursesService.new
|
||||
course = cs.show_course(params,current_user)
|
||||
|
||||
if course[:course][:is_delete] == 1
|
||||
{status:-1, message: '该班级不存在或已被删除啦' }
|
||||
else
|
||||
present :data, course, with: Mobile::Entities::Course,user: current_user
|
||||
{ status: 0}
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -212,7 +217,7 @@ module Mobile
|
|||
get "homeworks/:id" do
|
||||
cs = CoursesService.new
|
||||
homeworks = cs.homework_list params,current_user
|
||||
present :data, homeworks, with: Mobile::Entities::Homework
|
||||
present :data, homeworks, with: Mobile::Entities::Homework,user: current_user
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
|
@ -259,7 +264,7 @@ module Mobile
|
|||
post ":course_id/attachments" do
|
||||
cs = CoursesService.new
|
||||
count = cs.course_attachments params
|
||||
present :data, count, with: Mobile::Entities::Attachment
|
||||
present :data, count, with: Mobile::Entities::Attachment,user: current_user
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
|
@ -392,8 +397,8 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
course = Course.find(params[:course_id])
|
||||
exercises = course.exercises.where("exercise_status <> 1").order("created_at desc")
|
||||
present :data,exercises,with:Mobile::Entities::Exercise
|
||||
exercises = course.exercises.where("exercise_status <> 1").reorder("created_at desc")
|
||||
present :data,exercises,with:Mobile::Entities::Exercise,user: current_user
|
||||
present :status,0
|
||||
end
|
||||
|
||||
|
|
|
@ -7,11 +7,17 @@ module Mobile
|
|||
include IssuesHelper
|
||||
|
||||
desc "get special issuse"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
issue = Issue.find params[:id]
|
||||
present :data, issue, with: Mobile::Entities::Issue,user: user
|
||||
present :data, issue, with: Mobile::Entities::Issue,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,18 @@ module Mobile
|
|||
resources :journal_for_messages do
|
||||
|
||||
desc "get special journal"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
|
||||
jour = JournalsForMessage.find params[:id]
|
||||
present :data, jour, with: Mobile::Entities::Jours,user: user
|
||||
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :messages do
|
||||
|
||||
desc "get special topic"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
message = Message.find params[:id]
|
||||
present :data, message, with: Mobile::Entities::Message,user: user
|
||||
present :data, message, with: Mobile::Entities::Message,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :newss do
|
||||
|
||||
desc "get special news"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
news = News.find params[:id]
|
||||
present :data, news, with: Mobile::Entities::News,user: user
|
||||
present :data, news, with: Mobile::Entities::News,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -85,12 +85,26 @@ module Mobile
|
|||
requires :token, type: String
|
||||
requires :course_ids, type: Array[Integer]
|
||||
requires :send_id, type: Integer
|
||||
requires :send_type, type: Integer
|
||||
end
|
||||
post 'send' do
|
||||
authenticate!
|
||||
|
||||
rs = ResourcesService.new
|
||||
|
||||
ori = nil
|
||||
flag = false
|
||||
save_message = nil
|
||||
|
||||
case params[:send_type]
|
||||
when 1
|
||||
ori, flag, save_message = rs.send_resource_to_course(current_user,params)
|
||||
when 2
|
||||
ori, flag, save_message = rs.send_homework_to_course(current_user,params)
|
||||
when 3
|
||||
ori, flag, save_message = rs.send_exercise_to_course(current_user,params)
|
||||
end
|
||||
|
||||
if flag
|
||||
present :status, 0
|
||||
else
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :whomeworks do
|
||||
|
||||
desc "get one homework"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
homework = HomeworkCommon.find params[:id]
|
||||
present :data, homework, with: Mobile::Entities::Whomework,user: user
|
||||
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,10 +25,12 @@ module Mobile
|
|||
elsif ac.act_type == "News"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.comments.count
|
||||
elsif ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.children.count
|
||||
all_comments = []
|
||||
ac.nil? || ac.act.nil? ? 0 : get_all_children(all_comments, ac.act).count
|
||||
elsif ac.act_type == "Issue"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count
|
||||
end
|
||||
|
||||
when :subject
|
||||
if ac.act_type == "HomeworkCommon"
|
||||
ac.act.name unless ac.nil? || ac.act.nil?
|
||||
|
|
|
@ -3,6 +3,7 @@ module Mobile
|
|||
class Attachment < Grape::Entity
|
||||
include Redmine::I18n
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include ApplicationHelper
|
||||
def self.attachment_expose(field)
|
||||
expose field do |f,opt|
|
||||
if f.is_a?(Hash) && f.key?(field)
|
||||
|
@ -22,6 +23,7 @@ module Mobile
|
|||
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
|
||||
when :coursename
|
||||
f.course.nil? ? "" : f.course.name
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -36,6 +38,12 @@ module Mobile
|
|||
attachment_expose :file_dir
|
||||
attachment_expose :attafile_size
|
||||
attachment_expose :coursename #所属班级名
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -25,7 +25,9 @@ module Mobile
|
|||
when :act_id
|
||||
u.id
|
||||
when :comment_count
|
||||
u.children.count
|
||||
# u.children.count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, u).count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -51,7 +53,18 @@ module Mobile
|
|||
blog_comment_expose :praise_count
|
||||
expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
c.children.reverse
|
||||
##自己的父回复为空 才有子回复
|
||||
if !opt[:children]
|
||||
if c.parent.nil? && opt[:type] == 0
|
||||
opt[:children] = true
|
||||
all_comments = []
|
||||
tStart = opt[:page]*5
|
||||
tEnd = (opt[:page]+1)*5 - 1
|
||||
|
||||
all_comments = get_all_children(all_comments, c)[tStart..tEnd]
|
||||
all_comments
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
expose :has_praise, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
|
@ -61,6 +74,63 @@ module Mobile
|
|||
has_praise = obj.empty? ? false : true
|
||||
has_praise
|
||||
end
|
||||
|
||||
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, instance)
|
||||
parents_reply.count
|
||||
end
|
||||
|
||||
expose :parents_reply_bottom, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
#取二级回复的底楼层
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||
if parents_reply.count > 0 && !opt[:bottom]
|
||||
if opt[:type] == 1
|
||||
# opt[:bottom] = true
|
||||
# parents_reply[opt[:page]..opt[:page]]
|
||||
else
|
||||
opt[:bottom] = true
|
||||
parents_reply[0..0]
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
expose :parents_reply_top, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
#取二级回复的顶楼层
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||
if parents_reply.count > 0 && !opt[:top]
|
||||
if opt[:type] == 1
|
||||
opt[:bottom] = true
|
||||
tStart = (opt[:page]-1)*5+2
|
||||
tEnd = (opt[:page])*5+2 - 1
|
||||
|
||||
if tEnd >= parents_reply.count - 1
|
||||
tEnd = parents_reply.count - 2
|
||||
end
|
||||
|
||||
if tStart <= parents_reply.count - 2
|
||||
parents_reply = parents_reply.reverse[tStart..tEnd]
|
||||
parents_reply.reverse
|
||||
else
|
||||
[]
|
||||
end
|
||||
else
|
||||
opt[:top] = true
|
||||
parents_reply = parents_reply.reverse[0..1]
|
||||
parents_reply.reverse
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -27,6 +27,14 @@ module Mobile
|
|||
expose :exercise_name
|
||||
expose :exercise_description
|
||||
exercise_expose :coursename #所属班级名
|
||||
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -98,6 +98,14 @@ module Mobile
|
|||
|
||||
homework_expose :coursename #所属班级名
|
||||
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
if instance[:current_user_is_teacher].nil?
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -23,7 +23,9 @@ module Mobile
|
|||
when :issue_status
|
||||
IssueStatus.find(issue.status_id).name
|
||||
when :journals_count
|
||||
issue.journals.where("notes is not null and notes != ''").count
|
||||
# issue.journals.where("notes is not null and notes != ''").count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
when :project_name
|
||||
issue.project.name
|
||||
when :praise_count
|
||||
|
|
|
@ -18,7 +18,9 @@ module Mobile
|
|||
when :lasted_comment
|
||||
time_from_now f.created_on
|
||||
when :reply_count
|
||||
f.children.count
|
||||
# f.children.count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
when :praise_count
|
||||
get_activity_praise_num(f)
|
||||
when :act_type
|
||||
|
|
|
@ -30,6 +30,9 @@ module Mobile
|
|||
'Message'
|
||||
when :act_id
|
||||
u.id
|
||||
when :replies_count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, u).count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,9 @@ module Mobile
|
|||
'News'
|
||||
when :act_id
|
||||
f.id
|
||||
when :comments_count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
end
|
||||
end
|
||||
elsif f.is_a?(Hash) && !f.key?(field)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class OrgDocumentCommentsController < ApplicationController
|
||||
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply, :add_reply_in_doc]
|
||||
helper :attachments,:organizations
|
||||
layout 'base_org'
|
||||
|
||||
|
|
|
@ -300,15 +300,13 @@ class ProjectsController < ApplicationController
|
|||
return
|
||||
end
|
||||
|
||||
logger.debug "111111111"*100
|
||||
# over
|
||||
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
# 根据私密性,取出符合条件的所有数据
|
||||
if User.current.member_of?(@project) || User.current.admin?
|
||||
case params[:type]
|
||||
when nil
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment','Commit')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'issue'
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'news'
|
||||
|
@ -321,8 +319,8 @@ class ProjectsController < ApplicationController
|
|||
else
|
||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
|
||||
end
|
||||
logger.debug "2"*100
|
||||
# g = Gitlab.client
|
||||
|
||||
# 版本库统计图
|
||||
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
|
||||
# rep_statics_commit = @project.rep_statics.order("commits_num desc")
|
||||
rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10")
|
||||
|
@ -335,20 +333,14 @@ class ProjectsController < ApplicationController
|
|||
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
|
||||
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
|
||||
g = Gitlab.client
|
||||
logger.debug "3"*100
|
||||
begin
|
||||
gid = @project.gpid
|
||||
logger.debug "31"*100
|
||||
g_branch = g.project(gid)
|
||||
logger.debug "4"*100
|
||||
g_branch = g_branch.default_branch.to_s
|
||||
logger.debug "5"*100
|
||||
g_project = g.project(gid)
|
||||
g_branch = g_project.default_branch.to_s
|
||||
rescue =>e
|
||||
logger.error("get gitlab project failed: " + e)
|
||||
logger.error("get default branch failed: " + e)
|
||||
end
|
||||
logger.debug "6"*100
|
||||
@rev = g_branch.nil? ? "master" : g_branch
|
||||
logger.debug "7"*100
|
||||
end
|
||||
# 根据对应的请求,返回对应的数据
|
||||
respond_to do |format|
|
||||
|
|
|
@ -165,7 +165,7 @@ class QualityAnalysisController < ApplicationController
|
|||
logger.info("result: delete job ###################==>#{d_job}")
|
||||
qa.delete
|
||||
respond_to do |format|
|
||||
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)}
|
||||
format.html{redirect_to :controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
|
@ -199,9 +199,6 @@ class QualityAnalysisController < ApplicationController
|
|||
|
||||
# update成功则返回 ‘200’
|
||||
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
|
||||
get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280")
|
||||
logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200'
|
||||
|
||||
# 数据更新到Trustie数据
|
||||
if jenkins_job == '200'
|
||||
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
|
||||
|
|
|
@ -48,7 +48,7 @@ class RepositoriesController < ApplicationController
|
|||
include RepositoriesHelper
|
||||
helper :project_score
|
||||
#@root_path = RepositoriesHelper::ROOT_PATH
|
||||
require 'net/ssh'
|
||||
# require 'net/ssh'
|
||||
|
||||
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
|
||||
def new
|
||||
|
|
|
@ -78,13 +78,8 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
# When user view URL in the menu button
|
||||
on :view, with: 'http://wechat.somewhere.com/view_url' do |request, view|
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
unless uw
|
||||
sendBind(request)
|
||||
else
|
||||
request.reply.text "#{request[:FromUserName]} view #{view}"
|
||||
end
|
||||
end
|
||||
|
||||
# When user sent the imsage
|
||||
on :image do |request|
|
||||
|
@ -147,6 +142,14 @@ class WechatsController < ActionController::Base
|
|||
default_msg(request)
|
||||
end
|
||||
|
||||
on :click, with: 'PROJECT' do |request, key|
|
||||
request.reply.text "此功能正在开发中,很快就会上线,谢谢!"
|
||||
end
|
||||
|
||||
on :click, with: 'JOIN_PROJECT' do |request, key|
|
||||
request.reply.text "此功能正在开发中,很快就会上线,谢谢!"
|
||||
end
|
||||
|
||||
on :click, with: 'JOIN_CLASS' do |request, key|
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
unless uw
|
||||
|
@ -218,8 +221,8 @@ class WechatsController < ActionController::Base
|
|||
raise CoursesService::JoinCourseError.message(status[:state])
|
||||
end
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
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#/class?id='+course.id.to_s}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
|
||||
|
@ -274,7 +277,7 @@ class WechatsController < ActionController::Base
|
|||
user: user
|
||||
)
|
||||
ws = WechatService.new
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台!", user.login, format_time(Time.now))
|
||||
render :json => {status:0, msg: "绑定成功"}
|
||||
rescue Exception=>e
|
||||
render :json => {status: -1, msg: e.message}
|
||||
|
|
|
@ -38,6 +38,24 @@ module ApplicationHelper
|
|||
# super
|
||||
# end
|
||||
|
||||
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
|
||||
def get_user_by_mail mail
|
||||
user = User.find_by_mail(mail)
|
||||
user.nil? ? User.find(2) : user
|
||||
end
|
||||
|
||||
# 历史数据(老版本库数据)处理完则可以修改该放放
|
||||
def get_rep_identifier_by_project project
|
||||
identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier)
|
||||
result = identifier.nil? ? Repository.where(:project_id => project.id).first.try(:identifier) : identifier
|
||||
result
|
||||
end
|
||||
|
||||
# 获取用户单位
|
||||
# 优先获取高校信息,如果改信息不存在则获取occupation
|
||||
def get_occupation_from_user user
|
||||
School.where("id=?",user.user_extensions.school_id).first.try(:name).nil? ? user.user_extensions.occupation : School.where("id=?",user.user_extensions.school_id).first.try(:name)
|
||||
end
|
||||
|
||||
def update_visiti_count container
|
||||
container.update_column(:visits, container.visits + 1)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#coding=utf-8
|
||||
#
|
||||
|
||||
module WechatsHelper
|
||||
def include_wechat_jsfile
|
||||
if Rails.env.production?
|
||||
javascript_include_tag '/javascripts/wechat/build/app.min.js'
|
||||
else
|
||||
wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")
|
||||
srcs = Rails.application.config.wechat_srcs
|
||||
paths = []
|
||||
srcs.each do |src|
|
||||
Dir.glob(wechat_path+ "/#{src}" ) do |path|
|
||||
paths << path[File.join(Rails.root, "public").to_s.size, path.size]
|
||||
end
|
||||
end
|
||||
javascript_include_tag *paths
|
||||
end
|
||||
end
|
||||
end
|
|
@ -22,9 +22,7 @@ class Changeset < ActiveRecord::Base
|
|||
#after_save :be_user_score # user_score
|
||||
|
||||
has_many :filechanges, :class_name => 'Change', :dependent => :delete_all
|
||||
# fq
|
||||
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||
# end
|
||||
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
|
||||
|
||||
#Added by nie
|
||||
has_one :project_status, :dependent => :destroy
|
||||
|
@ -59,7 +57,6 @@ class Changeset < ActiveRecord::Base
|
|||
validates :committed_on, presence: true
|
||||
validates :commit_date, presence: true
|
||||
validates :scmid, uniqueness: {scope: :repository_id, allow_nil: true}
|
||||
|
||||
scope :visible, lambda {|*args|
|
||||
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
|
||||
}
|
||||
|
@ -68,7 +65,7 @@ class Changeset < ActiveRecord::Base
|
|||
# after_update :be_user_score
|
||||
after_destroy :down_user_score
|
||||
# before_create :before_create_cs
|
||||
after_create :act_as_forge_activity
|
||||
# after_create :act_as_forge_activity
|
||||
|
||||
|
||||
def revision=(r)
|
||||
|
@ -118,7 +115,7 @@ class Changeset < ActiveRecord::Base
|
|||
# 项目中提交动态,类型Changeset
|
||||
# type:0 为老版本即Trsutie数据 1为gitlab中获取的动态
|
||||
def act_as_forge_activity
|
||||
self.acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
|
||||
self.forge_acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
|
||||
end
|
||||
|
||||
def scan_for_issues
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
class Commit < ActiveRecord::Base
|
||||
attr_accessible :comments, :committed_on, :committer, :project_id, :repository_id, :version
|
||||
validates :repository_id, presence: true
|
||||
validates :version, presence: true, uniqueness: {scope: :repository_id}
|
||||
validates :committed_on, presence: true
|
||||
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
|
||||
after_create :act_as_forge_activity
|
||||
|
||||
# 项目中提交动态
|
||||
def act_as_forge_activity
|
||||
self.forge_acts << ForgeActivity.new(:user_id => 2, :project_id => self.project_id)
|
||||
end
|
||||
end
|
|
@ -25,8 +25,11 @@ class ForgeActivity < ActiveRecord::Base
|
|||
|
||||
# 在个人动态里面增加当前动态
|
||||
# 版本库提交动态不显示在用户动态中
|
||||
# Commit为版本库提交类型,因为是从gitlab获取,不能实时更新
|
||||
def add_user_activity
|
||||
if self.forge_act_type != "Changeset"
|
||||
if self.forge_act_type == "Commit"
|
||||
self.update_column(:updated_at, self.forge_act.committed_on)
|
||||
else
|
||||
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'").first
|
||||
if user_activity
|
||||
user_activity.save
|
||||
|
@ -50,7 +53,9 @@ class ForgeActivity < ActiveRecord::Base
|
|||
|
||||
# 项目提交动态不显示在组织动态中
|
||||
def add_org_activity
|
||||
if self.forge_act_type != "Changeset"
|
||||
if self.forge_act_type == "Commit"
|
||||
self.update_column(:updated_at, self.forge_act.committed_on)
|
||||
else
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
|
||||
if org_activity
|
||||
org_activity.updated_at = self.updated_at
|
||||
|
|
|
@ -335,6 +335,7 @@ class CoursesService
|
|||
8, '您已经是该班级的教师了',
|
||||
9, '您已经是该班级的教辅了',
|
||||
10, '您已经是该班级的管理员了',
|
||||
11, '该班级不存在或已被删除啦',
|
||||
'未知错误,请稍后再试'
|
||||
]
|
||||
end
|
||||
|
@ -348,6 +349,8 @@ class CoursesService
|
|||
if course
|
||||
if course_endTime_timeout? course
|
||||
@state = 2
|
||||
elsif course[:is_delete] == 1
|
||||
@state = 11
|
||||
else
|
||||
if current_user.member_of_course?(course) #如果已经是成员
|
||||
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
|
||||
|
@ -392,7 +395,7 @@ class CoursesService
|
|||
def homework_list params,current_user
|
||||
course = Course.find(params[:id])
|
||||
if course.is_public != 0 || current_user.member_of_course?(course)
|
||||
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).order('created_at DESC')
|
||||
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).reorder('created_at DESC')
|
||||
bids = bids.like(params[:name]) if params[:name].present?
|
||||
homeworks = []
|
||||
bids.each do |bid|
|
||||
|
@ -495,7 +498,7 @@ class CoursesService
|
|||
def course_attachments params
|
||||
result = []
|
||||
course = Course.find(params[:course_id])
|
||||
attachments = course.attachments.where("is_publish = 1").order("created_on desc")
|
||||
attachments = course.attachments.where("is_publish = 1").reorder("created_on desc")
|
||||
if !params[:name].nil? && params[:name] != ""
|
||||
attachments.each do |atta|
|
||||
result << atta if atta.filename.include?(params[:name])
|
||||
|
@ -632,7 +635,7 @@ class CoursesService
|
|||
:homework_submit_num => bid.student_works.count,
|
||||
:homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
|
||||
:student_evaluation_part => get_evaluation_part( bid ,3),
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?,:current_user_is_teacher => is_course_teacher}
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -49,6 +49,125 @@ class ResourcesService
|
|||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
def send_homework_to_course user,params
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
@ori = homework
|
||||
course_ids = params[:course_ids]
|
||||
@flag = false
|
||||
unless course_ids.nil?
|
||||
course_ids.each do |course_id|
|
||||
course = Course.find course_id.to_i
|
||||
new_homework = HomeworkCommon.new
|
||||
new_homework.name = homework.name
|
||||
new_homework.user_id = user.id
|
||||
new_homework.description = homework.description
|
||||
new_homework.homework_type = homework.homework_type
|
||||
new_homework.late_penalty = homework.late_penalty
|
||||
new_homework.course_id = course.id
|
||||
new_homework.teacher_priority = homework.teacher_priority
|
||||
new_homework.anonymous_comment = homework.anonymous_comment
|
||||
new_homework.quotes = 0
|
||||
new_homework.is_open = homework.is_open
|
||||
homework.attachments.each do |attachment|
|
||||
att = attachment.copy
|
||||
att.container_id = nil
|
||||
att.container_type = nil
|
||||
att.copy_from = attachment.id
|
||||
att.save
|
||||
new_homework.attachments << att
|
||||
end
|
||||
homework_detail_manual = homework.homework_detail_manual
|
||||
homework_detail_programing = homework.homework_detail_programing
|
||||
homework_detail_group = homework.homework_detail_group
|
||||
if homework_detail_manual
|
||||
new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||
new_homework_detail_manual = new_homework.homework_detail_manual
|
||||
new_homework_detail_manual.ta_proportion = homework_detail_manual.ta_proportion
|
||||
new_homework_detail_manual.comment_status = 0
|
||||
new_homework_detail_manual.evaluation_num = homework_detail_manual.evaluation_num
|
||||
new_homework_detail_manual.absence_penalty = homework_detail_manual.absence_penalty
|
||||
end
|
||||
if homework_detail_programing
|
||||
new_homework.homework_detail_programing = HomeworkDetailPrograming.new
|
||||
new_homework.homework_detail_programing.ta_proportion = homework_detail_programing.ta_proportion
|
||||
new_homework.homework_detail_programing.language = homework_detail_programing.language
|
||||
homework.homework_tests.each_with_index do |homework_test|
|
||||
new_homework.homework_tests << HomeworkTest.new(
|
||||
input: homework_test.input,
|
||||
output: homework_test.output
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
if homework_detail_group
|
||||
new_homework.homework_detail_group = HomeworkDetailGroup.new
|
||||
new_homework.homework_detail_group.min_num = homework_detail_group.min_num
|
||||
new_homework.homework_detail_group.max_num = homework_detail_group.max_num
|
||||
new_homework.homework_detail_group.base_on_project = homework_detail_group.base_on_project
|
||||
end
|
||||
if new_homework.save
|
||||
new_homework_detail_manual.save if new_homework_detail_manual
|
||||
new_homework.homework_detail_programing.save if new_homework.homework_detail_programing
|
||||
new_homework.homework_detail_group.save if new_homework.homework_detail_group
|
||||
@flag = true
|
||||
else
|
||||
@flag = false
|
||||
@save_message = new_homework.errors.full_messages
|
||||
break
|
||||
end
|
||||
homework.update_column(:quotes, homework.quotes+1)
|
||||
end
|
||||
end
|
||||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
def send_exercise_to_course user,params
|
||||
# send_id = params[:send_id]
|
||||
# @ori = Attachment.find_by_id(send_id)
|
||||
# course_ids = params[:course_ids]
|
||||
# @flag = false
|
||||
# unless course_ids.nil?
|
||||
# course_ids.each do |id|
|
||||
# next if @ori.blank?
|
||||
# @exist = false
|
||||
# Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
||||
# if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from
|
||||
# att.created_on = Time.now
|
||||
# att.save
|
||||
# @exist = true
|
||||
# @flag = true
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
# next if @exist
|
||||
# attach_copied_obj = @ori.copy
|
||||
# attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
|
||||
# attach_copied_obj.container = Course.find(id)
|
||||
# attach_copied_obj.created_on = Time.now
|
||||
# attach_copied_obj.author_id = user.id
|
||||
# attach_copied_obj.is_public = 0
|
||||
# attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
|
||||
# if attach_copied_obj.attachtype == nil
|
||||
# attach_copied_obj.attachtype = 4
|
||||
# end
|
||||
# if attach_copied_obj.save
|
||||
# # 更新引用次数
|
||||
# quotes = @ori.quotes.to_i + 1
|
||||
# @ori.update_attribute(:quotes, quotes) unless @ori.nil?
|
||||
# @ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
# @flag = true
|
||||
# else
|
||||
# @flag = false
|
||||
# @save_message = attach_copied_obj.errors.full_messages
|
||||
# break
|
||||
# end
|
||||
#
|
||||
# end
|
||||
# end
|
||||
|
||||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
# 我的资源-课件 已发布的
|
||||
def all_course_attachments user
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ class SyllabusesService
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
title = "恭喜您创建班级成功"
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情"
|
||||
title = "恭喜您创建班级成功。"
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情。"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ class WechatService
|
|||
color:"#707070"
|
||||
},
|
||||
remark:{
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态",
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态。",
|
||||
color:"#707070"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,8 +56,7 @@
|
|||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center"><%= checked_image user.admin? %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||
<% occupation = user.user_extensions.identity == 0 ? School.where("id=?",user.user_extensions.school_id).first.try(:name) : user.user_extensions.occupation %>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center" title="<%= occupation %>"> <%= truncate( occupation, :length => 12 ) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center" title="<%= get_occupation_from_user(user) %>"> <%= truncate(get_occupation_from_user(user), :length => 12 ) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="buttons" align="center" title='<%=user.id %>'> <%= change_status_link(user) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="buttons" align="center" title='<%=user.id %>'> <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %></td>
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<div class="cl"></div>
|
||||
</div><!--sy_content end-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
|
@ -127,6 +127,23 @@
|
|||
window.location.href = '<%=syllabus_courselist_syllabus_path(@syllabus) %>';
|
||||
}
|
||||
}
|
||||
//侧导航栏配置设置
|
||||
$(".homepageLeftMenuCoursesLine").mouseover(function(){
|
||||
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
|
||||
$(this).children().css("color","#ffffff");
|
||||
});
|
||||
$(".homepageLeftMenuCoursesLine").mouseout(function(){
|
||||
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
|
||||
$(this).children().css("color","#808080");
|
||||
});
|
||||
$(".subNavRow").mouseover(function(){
|
||||
$(this).css("background-color","#269ac9");
|
||||
$(this).children().css("color","#ffffff");
|
||||
});
|
||||
$(".subNavRow").mouseout(function(){
|
||||
$(this).css("background-color","#ffffff");
|
||||
$(this).children().css("color","#888888");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -72,23 +72,8 @@
|
|||
<!--Attachment -->
|
||||
<% when "Attachment" %>
|
||||
<%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
|
||||
<!--<div class="problem_main">-->
|
||||
<!--<a class="problem_pic fl"><%#= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %></a>-->
|
||||
|
||||
<!--<div class="problem_txt fl mt5 break_word">-->
|
||||
<!--<a class="problem_name fl ">-->
|
||||
<!--<%#= h(e.project) if @project.nil? || @project.id != e.project_id %>-->
|
||||
<!--<%#= link_to h(activity.user), user_path(activity.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%#= l(:label_new_activity) %>-->
|
||||
<!--:</span>-->
|
||||
<%#= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %>
|
||||
<!--<br/>-->
|
||||
|
||||
<!--<p class="mt5 break_word"><#%= textAreailizable act, :description %><br/>-->
|
||||
<!--<%#= l :label_create_time %>-->
|
||||
<!--:<%#= format_activity_day(act.created_on) %> <%#= format_time(act.created_on, false) %></p>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<% when "Commit" %>
|
||||
<%= render :partial => 'projects/project_commit', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :identifier => get_rep_identifier_by_project(@project) } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<% project = Project.find(activity.project_id) %>
|
||||
<% user = get_user_by_mail(activity.committer) %>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to project.to_s+" | 项目代码提交", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.comments, {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :repository_id => identifier, :changeset => activity.version}, :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
提交时间:<%= format_time(activity.committed_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -34,7 +34,7 @@
|
|||
<p class="fontGrey3">代码重复度</p>
|
||||
<p class="fontBlue2 pr"><%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %>
|
||||
<span class="f10 c_white analysis-genral-icon <%= duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[1] %> borderRadius">
|
||||
<%= @ha["duplicated_lines_density"].nil? ? 0 : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>
|
||||
<%= @ha["duplicated_lines_density"].nil? ? "良好" : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<p class="fontGrey3">注释率</p>
|
||||
<p class="fontBlue2 pr"><%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %>
|
||||
<span class="f10 c_white analysis-genral-icon <%= comment_lines_density_status(@ha["comment_lines_density"].to_i)[1] %> borderRadius">
|
||||
<%= @ha["comment_lines_density"].nil? ? 0 : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>
|
||||
<%= @ha["comment_lines_density"].nil? ? "较低" : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<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/weui.min.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
<%= stylesheet_link_tag '/stylesheets/weui/weixin.css' %>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.g_debug = false; //调试标志,如果在本地请置为true
|
||||
|
@ -28,31 +28,7 @@
|
|||
|
||||
<!--<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?version=20160715-1953"></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/new_class.js"></script> -->
|
||||
<!-- <script src="/javascripts/wechat/controllers/edit_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/class.js"></script> -->
|
||||
<!-- <script src="/javascripts/wechat/controllers/class_list.js"></script> -->
|
||||
<!-- <script src="/javascripts/wechat/controllers/myresource.js?version=20160715-1737"></script> -->
|
||||
<!-- <script src="/javascripts/wechat/controllers/send_class_list.js"></script> -->
|
||||
<!-- <script src="/javascripts/wechat/others/routes.js"></script> -->
|
||||
<%= include_wechat_jsfile %>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -66,6 +66,7 @@ module RedmineApp
|
|||
|
||||
# Version of your assets, change this if you want to expire all your assets
|
||||
config.assets.version = '1.0'
|
||||
config.assets.digest = true
|
||||
|
||||
config.action_mailer.perform_deliveries = false
|
||||
|
||||
|
@ -82,6 +83,8 @@ module RedmineApp
|
|||
end
|
||||
end
|
||||
|
||||
config.wechat_srcs = ['app.js','others/factory.js','others/filter.js', 'controllers/*.js', 'directives/*.js', 'others/routes.js']
|
||||
|
||||
config.before_initialize do
|
||||
end
|
||||
|
||||
|
|
|
@ -2,18 +2,22 @@ button:
|
|||
-
|
||||
type: "view"
|
||||
name: "我的动态"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
|
||||
-
|
||||
name: "我的课程"
|
||||
name: "我的群组"
|
||||
sub_button:
|
||||
-
|
||||
type: "click"
|
||||
name: "课程"
|
||||
key: "DEV"
|
||||
type: "view"
|
||||
name: "我的课程"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
|
||||
-
|
||||
type: "click"
|
||||
name: "资源"
|
||||
key: "DEV"
|
||||
name: "我的项目"
|
||||
key: "PROJECT"
|
||||
-
|
||||
type: "view"
|
||||
name: "我的宝库"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
|
||||
|
||||
-
|
||||
name: "更多"
|
||||
|
@ -22,6 +26,10 @@ button:
|
|||
type: "click"
|
||||
name: "加入班级"
|
||||
key: "JOIN_CLASS"
|
||||
-
|
||||
type: "click"
|
||||
name: "加入项目"
|
||||
key: "JOIN_PROJECT"
|
||||
-
|
||||
type: "click"
|
||||
name: "反馈"
|
||||
|
|
|
@ -2,18 +2,22 @@ button:
|
|||
-
|
||||
type: "view"
|
||||
name: "我的动态"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://ucloudtest.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
|
||||
-
|
||||
name: "我的课程"
|
||||
name: "我的群组"
|
||||
sub_button:
|
||||
-
|
||||
type: "view"
|
||||
name: "课程"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://ucloudtest.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
|
||||
name: "我的课程"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
|
||||
-
|
||||
type: "click"
|
||||
name: "我的项目"
|
||||
key: "PROJECT"
|
||||
-
|
||||
type: "view"
|
||||
name: "资源"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://ucloudtest.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
|
||||
name: "我的宝库"
|
||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
|
||||
|
||||
-
|
||||
name: "更多"
|
||||
|
@ -22,6 +26,10 @@ button:
|
|||
type: "click"
|
||||
name: "加入班级"
|
||||
key: "JOIN_CLASS"
|
||||
-
|
||||
type: "click"
|
||||
name: "加入项目"
|
||||
key: "JOIN_PROJECT"
|
||||
-
|
||||
type: "click"
|
||||
name: "反馈"
|
||||
|
|
|
@ -22,8 +22,8 @@ default: &default
|
|||
#production
|
||||
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
|
||||
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
|
||||
|
||||
#template
|
||||
#
|
||||
# #template
|
||||
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
|
||||
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
|
||||
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
class AddTypeToChangeset < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :changesets, :project_id, :integer
|
||||
add_column :changesets, :type, :integer, :default => false
|
||||
end
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
class CreateCommits < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :commits do |t|
|
||||
t.integer :repository_id
|
||||
t.string :version
|
||||
t.string :committer
|
||||
t.text :comments
|
||||
t.datetime :committed_on
|
||||
t.integer :project_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
class DeleteOrgAnonymous < ActiveRecord::Migration
|
||||
def up
|
||||
anonymous_replys = OrgDocumentComment.where("organization_id = 23 AND creator_id = 2")
|
||||
if anonymous_replys
|
||||
anonymous_replys.destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -10,7 +10,11 @@ module Redmine
|
|||
def acts_as_watchable(options = {})
|
||||
return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods)
|
||||
class_eval do
|
||||
if self.name == 'User'
|
||||
has_many :watchers, :dependent => :delete_all
|
||||
else
|
||||
has_many :watchers, :as => :watchable, :dependent => :delete_all
|
||||
end
|
||||
has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
|
||||
|
||||
scope :watched_by, lambda { |user_id|
|
||||
|
|
|
@ -1,25 +1,32 @@
|
|||
namespace :gitlab do
|
||||
desc "sync gitlab's commit acts to trustie"
|
||||
task :forge_acts => :environment do
|
||||
begin
|
||||
g = Gitlab.client
|
||||
projects = Project.find_by_sql("select * from projects where gpid is not null")
|
||||
projects = Project.find_by_sql("select * from projects where gpid is not null and id not in (2,847,931,942)")
|
||||
projects.each do |project|
|
||||
begin
|
||||
g_project = g.project(project.gpid)
|
||||
# 获取默认分支
|
||||
g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
||||
# 总的提交次数
|
||||
commit_count = g.user_static(project.gpid, :rev => g_default_branch).count
|
||||
pages = commit_count / 20 + 1
|
||||
pages.each do |page|
|
||||
commits = g.commits(g_project.gpid, :ref_name => g_default_branch, :page => page)
|
||||
puts "#{pages}"
|
||||
puts "project id is #{project.id}"
|
||||
# api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态
|
||||
(0..pages).each do |page|
|
||||
commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page)
|
||||
commits.each do |commit|
|
||||
Changeset.create(:project_id => project.id, :repository_id => project.gpid, :revision => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
end
|
||||
Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
# puts "Some wrong with project #{project.id}"
|
||||
# Project.where(:id => project.id).first.update_column(:gpid, nil)
|
||||
# Repository.where(:project_id => project.id).first.destroy
|
||||
# try
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
namespace :gitlab do
|
||||
desc "sync gitlab's commit acts to trustie"
|
||||
task :forge_acts_update => :environment do
|
||||
g = Gitlab.client
|
||||
ids = [2,847,931,942]
|
||||
projects = Project.find(ids)
|
||||
projects.each do |project|
|
||||
# c = Commit.where(:project_id => project.id)
|
||||
# if c.blank?
|
||||
begin
|
||||
g_project = g.project(project.gpid)
|
||||
# 获取默认分支
|
||||
g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
||||
# 总的提交次数
|
||||
commit_count = g.user_static(project.gpid, :rev => g_default_branch).count
|
||||
pages = commit_count / 20 + 1
|
||||
puts "#{pages}"
|
||||
puts "project id is #{project.id}"
|
||||
# api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态
|
||||
(0..pages).each do |page|
|
||||
commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page)
|
||||
commits.each do |commit|
|
||||
Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,41 @@
|
|||
namespace :gitlab do
|
||||
desc "sync gitlab's commit acts to trustie"
|
||||
task :acts_to_trustie => :environment do
|
||||
begin
|
||||
projects = Project.where(:status => 1)
|
||||
projects.each do |project|
|
||||
c = Commit.find_by_sql("SELECT * FROM `commits` where project_id = #{project.id} order by committed_on limit 1;")
|
||||
g_project = g.project(project.gpid)
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
g = Gitlab.client
|
||||
ids = [2,847,931,942]
|
||||
projects = Project.find(ids)
|
||||
projects.each do |project|
|
||||
c = Commit.where(:project_id => project.id)
|
||||
if c.blank?
|
||||
begin
|
||||
g_project = g.project(project.gpid)
|
||||
# 获取默认分支
|
||||
g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
||||
# 总的提交次数
|
||||
commit_count = g.user_static(project.gpid, :rev => g_default_branch).count
|
||||
pages = commit_count / 20 + 1
|
||||
puts "#{pages}"
|
||||
puts "project id is #{project.id}"
|
||||
# api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态
|
||||
(0..pages).each do |page|
|
||||
commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page)
|
||||
commits.each do |commit|
|
||||
Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
namespace :gitlab do
|
||||
desc "sync gitlab's commit acts to trustie"
|
||||
task :unused => :environment do
|
||||
begin
|
||||
Project.where("id in (161,236,266)").update_all(:gpid => nil)
|
||||
repositories = Repository.find_by_sql("select * from repositories where project_id in (select project_id from repositories group by project_id having count(project_id) > 1);")
|
||||
repositories.each do |rep|
|
||||
puts "#{rep.id}"
|
||||
if rep.type == "Repository::Git"
|
||||
rep.destroy
|
||||
end
|
||||
end
|
||||
# Repository.where("project_id in (161,236,266)").destroy_all
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,31 @@
|
|||
#coding=utf-8
|
||||
#
|
||||
|
||||
def compress(srcs, outfile)
|
||||
wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")
|
||||
out_buffer = ''
|
||||
|
||||
srcs.each do |src|
|
||||
Dir.glob("#{wechat_path}/#{src}").each do |path|
|
||||
puts "assets #{path}"
|
||||
out_buffer = out_buffer + "\n//#{File.basename(path)}\n" + Uglifier.compile(File.read(path))
|
||||
end
|
||||
end
|
||||
|
||||
File.open(File.join(wechat_path, "build/#{outfile}"), 'w+') {|f| f.write(out_buffer)}
|
||||
end
|
||||
|
||||
|
||||
namespace :wechat do
|
||||
desc "assets javascript file"
|
||||
task :assets => :environment do
|
||||
srcs = Rails.application.config.wechat_srcs
|
||||
compress(srcs, 'app.min.js')
|
||||
end
|
||||
|
||||
desc "minify angularjs"
|
||||
task :minify => :environment do
|
||||
srcs = ['../jquery-1.3.2.js','angular.js', 'angular-route.js', 'angular-sanitize.min.js']
|
||||
compress(srcs, 'angular.all.min.js')
|
||||
end
|
||||
end
|
|
@ -160,7 +160,7 @@
|
|||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【问题】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
|
||||
<span class="mr15 f12 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f12 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
|
||||
|
@ -467,7 +467,7 @@
|
|||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【问题】{{act.subject|safeHtml}}</div>
|
||||
<div class="post-content c-grey3 mt10 mb10">
|
||||
<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 />
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<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, minimum-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" />
|
||||
|
|
|
@ -42,11 +42,61 @@
|
|||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{journal.lasted_comment}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>
|
||||
<!--<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>-->
|
||||
<div ng-show="journal.parents_count > 0" class="mult-reply-container mt10">
|
||||
<!--<div ng-repeat="reply_top in journal.parents_reply_top" >-->
|
||||
<div class="mult-reply-container mt2">
|
||||
<ul ng-if="journal.parents_reply_top[1]" ng-include="'comment_reply'" ng-init="i=1;journal=journal"></ul>
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{journal.parents_reply_top[0].user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
|
||||
<div class="post-dynamic-author hidden fl ng-binding">
|
||||
{{journal.parents_reply_top[0].user.realname}}
|
||||
<img ng-if="journal.parents_reply_top[0].user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="journal.parents_reply_top[0].user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{journal.parents_reply_top[0].lasted_comment}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="journal.parents_reply_top[0].content|safeHtml"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
|
||||
<!--['weixin-tab', {'class-tab-active': currentTab == $index+1}]-->
|
||||
<!--一层end-->
|
||||
<!--<div class="mt10">-->
|
||||
<!--<div class="post-avatar fl mr10"><img src="images/pic01.jpg" ng-src="/images/avatars/User/0" class="border-radius img-circle" height="30" width="30"></div>-->
|
||||
<!--<div class="post-dynamic-author hidden fl ng-binding">yixin<img src="images/female.png" class="ml5" width="14"></div>-->
|
||||
<!--<div class="post-dynamic-time fr f13">5分钟前</div>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<div class="post-reply-content c-grey2 mt12 border-bottom-none">烤活牛你见过似的,美国那边吃人你怎么不信?</div>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<!--二层end-->
|
||||
<div ng-click="showMoreReply(1,journal)" ng-show="journal.parents_reply_top.length + journal.parents_reply_bottom.length < journal.parents_count" class="mult-reply-hide"><span class="mult-reply-arrow" >↓ </span><span class="mult-reply-arrow" style="display:none;" > ↑</span>点击展开更多楼层</div>
|
||||
|
||||
<div class="mt10" ng-repeat="reply_bottom in journal.parents_reply_bottom">
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{reply_bottom.user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
|
||||
<div class="post-dynamic-author hidden fl ng-binding">
|
||||
{{reply_bottom.user.realname}}
|
||||
<img ng-if="reply_bottom.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="reply_bottom.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{reply_bottom.lasted_comment}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="post-reply-content">
|
||||
<div class="mult-reply-content">
|
||||
<div class="mt10" ng-bind-html="journal.content|safeHtml"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="has_more">
|
||||
<div id="more_reply" class="more-events mt10" ng-click="showMoreReply(0,blog);">更多</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="!blog.locked" id="post_input_1" class="post-input-wrap post-box-shadow">
|
||||
|
@ -64,3 +114,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script id="comment_reply" type="text/ng-template">
|
||||
<div class="mult-reply-container mt2">
|
||||
<ul ng-if="journal.parents_reply_top[i+1]" ng-include="'comment_reply'" ng-init="i=i+1;journal=journal"></ul>
|
||||
<div class="post-avatar fl mr10"><img ng-src="{{journal.parents_reply_top[i].user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
|
||||
<div class="post-dynamic-author hidden fl ng-binding">
|
||||
{{journal.parents_reply_top[i].user.realname}}
|
||||
<img ng-if="journal.parents_reply_top[i].user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
|
||||
<img ng-if="journal.parents_reply_top[i].user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
|
||||
</div>
|
||||
<div class="post-dynamic-time fr f13">{{journal.parents_reply_top[i].lasted_comment}}</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="journal.parents_reply_top[i].content|safeHtml"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</script>
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
|
||||
<div ng-class="{'undis': !showResources}">
|
||||
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r)">发送</a><div class="cl"></div></div>
|
||||
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r,1)">发送</a><div class="cl"></div></div>
|
||||
<p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传课件。</p>
|
||||
</div>
|
||||
|
@ -42,19 +42,19 @@
|
|||
</div>
|
||||
|
||||
<div ng-class="{'undis': !showHomework}">
|
||||
<div ng-repeat="r in homeworks|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/homework.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.homework_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 undis" ng-click="sendFile(r)">发送</a><div class="cl"></div></div>
|
||||
<div ng-repeat="r in homeworks|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/homework.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.homework_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 " ng-click="sendFile(r,2)">发送</a><div class="cl"></div></div>
|
||||
<p ng-show="homeworks_tag == true && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传作业。</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-class="{'undis': !showTestcase}">
|
||||
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 undis" ng-click="sendFile(r)">发送</a><div class="cl"></div></div>
|
||||
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 undis" ng-click="sendFile(r,3)">发送</a><div class="cl"></div></div>
|
||||
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无小测验,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传小测验。</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<div class="blue-title">课程列表</div>
|
||||
<div>
|
||||
<div class="course-diff-row"><span class="c-blue f13 ml10">我创建的课程</span></div>
|
||||
<div ng-show = "syllabus.can_setting" ng-repeat="syllabus in syllabuses">
|
||||
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span><img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="fr mr10 mt10" ng-click="onSetting(syllabus)" /></div>
|
||||
<div ng-show = "syllabus.can_setting" ng-repeat="syllabus in syllabuses" style="position:relative;">
|
||||
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10 class-list-name hidden">{{syllabus.title}}</span></div>
|
||||
<img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" ng-click="onSetting(syllabus)" />
|
||||
<ul ng-show="syllabus.show_plus" class="class-list f13 c-grey3">
|
||||
<li ng-show="course.id" ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
|
||||
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
|
||||
|
@ -17,8 +18,9 @@
|
|||
</div>
|
||||
<div>
|
||||
<div class="course-diff-row border-top mt10"><span class="c-blue f13 ml10">我参与的课程</span></div>
|
||||
<div ng-show = "!syllabus.can_setting" ng-repeat="syllabus in syllabuses">
|
||||
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span><img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="fr mr10 mt10" ng-click="onSetting(syllabus)" /></div>
|
||||
<div ng-show = "!syllabus.can_setting" ng-repeat="syllabus in syllabuses" style="position:relative;">
|
||||
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10 class-list-name hidden">{{syllabus.title}}</span></div>
|
||||
<img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" ng-click="onSetting(syllabus)" />
|
||||
<ul ng-show="syllabus.show_plus" class="class-list f13 c-grey3">
|
||||
<li ng-show="course.id" ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
|
||||
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
|
||||
|
@ -36,5 +38,6 @@
|
|||
<a ng-click="goResource()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">我的资源</a>
|
||||
</div>
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
<my-alert message="alertService_1.message" title="alertService_1.title" visible="alertService_1.visible" cb="alertService_1.cb"></my-alert>
|
||||
<my-alert3 message="alertService_3.message" title="alertService_3.title" visible="alertService_3.visible" cb="alertService_3.cb" invite="alertService_3.invite" ></my-alert3>
|
||||
</div>
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
<div class="blue-title">管理课程</div>
|
||||
<form novalidate name="classForm">
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input ng-change="fadeText()" ng-class="['new-class-input ml25', {'c-grey':change} ]" ng-model="syllabus.tmptitle" required placeholder="请输入课程名" /></div>
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input ng-change="syllabus.change = true" ng-class="['new-class-input ml25', {'c-grey':syllabus.change} ]" ng-model="syllabus.tmptitle" required placeholder="请输入课程名,如:软件工程" /></div>
|
||||
|
||||
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级</span><input ng-change="fadeText()" required ng-class="['new-class-input ml25', {'c-grey':change} ]" ng-model="course.tmpname" placeholder="请输入班级名" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
|
||||
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级</span><input ng-change="course.change = true" required ng-class="['new-class-input ml25', {'c-grey':course.change} ]" ng-model="course.tmpname" placeholder="请输入班级名,如:计算机学院A班" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
|
||||
<div class="tac"><a ng-click="addClass()" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div>
|
||||
<a ng-click="newClass(classForm, syllabus)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
|
||||
</form>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<div ng-class="{'undis': currentTab!=1}">
|
||||
<div ng-repeat="r in resources|filter:{filename:searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]">
|
||||
<img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <span class="fl ml10 resource-width">{{r.filename}}</span><a ng-click="sendFile(r)" class="fr mr10 link-blue2">发送</a><div class="cl"></div>
|
||||
<img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <span class="fl ml10 resource-width">{{r.filename}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,1)" class="fr mr10 link-blue2">发送</a><div class="cl"></div>
|
||||
<span class="f12 mt5 ml35 c-grey4 fl courseware-from-width hidden">课件来源:{{r.coursename}}</span><span class="f12 ml10 mt5 c-grey4 fl">大小:{{r.attafile_size}}</span><div class="cl"></div>
|
||||
</div>
|
||||
<div ng-if="has_more">
|
||||
|
@ -20,9 +20,10 @@
|
|||
</div>
|
||||
<p ng-show="resources_tag && resources.length<=0" class="class-test-tip">暂无课件,<br />
|
||||
请登录Trustie网站,在PC浏览器中上传课件。</p>
|
||||
|
||||
</div>
|
||||
<div ng-class="{'undis': currentTab!=2}">
|
||||
<div ng-repeat="r in homeworks|filter:{homework_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/homework.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.homework_name}}</span><a ng-click="sendFile(r)" class="fr mr10 link-blue2 undis">发送</a><div class="cl"></div>
|
||||
<div ng-repeat="r in homeworks|filter:{homework_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/homework.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.homework_name}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,2)" class="fr mr10 link-blue2 ">发送</a><div class="cl"></div>
|
||||
<span class="f12 mt5 ml35 c-grey4 fl other-from-width hidden">作业来源:{{r.coursename}}</span><div class="cl"></div>
|
||||
</div>
|
||||
<div ng-if="homework_has_more">
|
||||
|
@ -32,7 +33,7 @@
|
|||
请登录Trustie网站,在PC浏览器中创建作业。</p>
|
||||
</div>
|
||||
<div ng-class="{'undis': currentTab!=3}">
|
||||
<div ng-repeat="r in exercise|filter:{exercise_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-click="sendFile(r)" class="fr mr10 link-blue2 undis">发送</a><div class="cl"></div>
|
||||
<div ng-repeat="r in exercise|filter:{exercise_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,3)" class="fr mr10 link-blue2 undis">发送</a><div class="cl"></div>
|
||||
<span class="f12 mt5 ml35 c-grey4 other-from-width hidden">题目来源:{{r.coursename}}</span><div class="cl"></div>
|
||||
</div>
|
||||
<div ng-if="exercise_has_more">
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
<div class="blue-title">新建课程</div>
|
||||
<form novalidate name="classForm">
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input class="new-class-input ml25" ng-model="syllabus.title" required placeholder="请输入课程名" /></div>
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input class="new-class-input ml25" ng-model="syllabus.title" required placeholder="请输入课程名,如:软件工程" /></div>
|
||||
|
||||
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses"><span class="fl ml15 c-grey3">班级</span><input required class="new-class-input ml25" ng-model="course.name" placeholder="请输入班级名" /><a ng-click="deleteClass($index)" ng-show="!$first" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
|
||||
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses"><span class="fl ml15 c-grey3">班级</span><input required class="new-class-input ml25" ng-model="course.name" placeholder="请输入班级名,如:计算机学院A班" /><a ng-click="deleteClass($index)" ng-show="!$first" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
|
||||
<div class="tac"><a ng-click="addClass()" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div>
|
||||
<a ng-click="newClass(classForm, syllabus)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
|
||||
</form>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="blue-title">请选择要发送的班级</div>
|
||||
|
||||
|
||||
<div ng-show="syllabus.can_setting" ng-repeat="syllabus in syllabuses">
|
||||
<div ng-show="syllabus.can_setting && syllabus.courses.length > 0" ng-repeat="syllabus in syllabuses">
|
||||
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span></div>
|
||||
<ul ng-show="!syllabus.show_plus" class="class-list f13 c-grey3">
|
||||
<li ng-show="course.can_setting" ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in syllabus.courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>
|
||||
|
@ -19,6 +19,6 @@
|
|||
<!--<li ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>-->
|
||||
<!--</ul>-->
|
||||
|
||||
<div class="btn2 bg-blue" ng-click="sendToCourses()">发送</div>
|
||||
<div ng-show="syllabuses.length>0" class="btn2 bg-blue" ng-click="sendToCourses()">发送</div>
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<div class="post-container" ng-show="visible">
|
||||
<div class="weui_mask">
|
||||
<div class="add-class-box">
|
||||
<p class="tac add-class-tip">{{message}}</p>
|
||||
<form class="mb20">
|
||||
<input type="text" class="class-number-input" ng-model="invite" />
|
||||
</form>
|
||||
<a href="javascript:void(0);" class="c-grey3 fl cancel-btn" ng-click="dismiss()" >取消</a>
|
||||
<div class="slice fl">
|
||||
<div class="slice-line"></div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="c-green fl submit-btn" ng-click="confirm()" >确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Binary file not shown.
After Width: | Height: | Size: 281 B |
|
@ -1,24 +1,49 @@
|
|||
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>1&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]);
|
||||
app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,i,e){this.message=i,this.title=t,this.visible=!0,this.cb=e},t.prototype.dismiss=function(){this.message=null,this.title=null,this.visible=!1,this.cb&&this.cb()},{create:function(){return new t}}}),app.factory("auth",["$http","$routeParams","$q","session","config",function(t,i,e,a,c){var s=function(){var c=e.defer(),s=o();if(s&&s.length>10)c.resolve(s);else{window.g_code||i.code||a.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?c.reject(t.data.message):(a.save("token",t.data.token),c.resolve(t.data.token))})["catch"](function(t){c.reject(t)})}return c.promise},o=function(){return a.get("token")};return{get_bind:s,token:o}}]),app.factory("session",function(){return{save:function(t,i){sessionStorage.setItem(t,i)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},i=function(i,e){t[i]=e},e=function(i){return t[i]};return{save:i,get:e}}),app.factory("common",["$http","auth","$routeParams","rms",function(t,i,e,a){var c=function(e,a,c,s){if(c.comment&&!(c.comment.length<=0)){var o=c.comment.replace(/\n/g,"<br/>"),n={type:a,content:o,token:i.token()};c.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+e,data:n}).then(function(t){c.disabled=!1,"function"==typeof s&&s()},function(t){})}},s=function(e,a){return t({method:"GET",url:apiUrl+a+"/"+e+"?token="+i.token()})},o=function(e){t({method:"POST",url:apiUrl+"praise/"+e.act_id,data:{token:i.token(),type:e.act_type}}).then(function(t){console.log(t.data)},function(t){})},n=function(e){t({method:"POST",url:apiUrl+"praise/"+e.act_id,data:{token:i.token(),type:e.act_type}}).then(function(t){console.log(t.data)},function(t){})},r=function(t){t.scope.formData={comment:""};var i=function(i){s(i,t.type).then(function(i){t.loadCallback(i.data)},function(t){})};i(t.id),t.scope.addReply=function(e){console.log(e.comment),c(t.id,t.replyType,e,function(){t.scope.formData={comment:""},i(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=function(t){activities=a.get("activities")||[],course_activities=a.get("course_activities")||[],project_activities=a.get("project_activities")||[];for(var i in activities)if(activities[i].act_id==t.act_id){activities[i].praise_count+=1,activities[i].has_praise=!0;break}for(var i in course_activities)if(course_activities[i].act_id==t.act_id){course_activities[i].praise_count+=1,course_activities[i].has_praise=!0;break}for(var i in project_activities)if(project_activities[i].act_id==t.act_id){project_activities[i].praise_count+=1,project_activities[i].has_praise=!0;break}a.save("activities",activities),a.save("course_activities",course_activities),a.save("project_activities",project_activities),t.praise_count+=1,t.has_praise=!0,o(t)},t.scope.decreasePraise=function(t){activities=a.get("activities")||[],course_activities=a.get("course_activities")||[],project_activities=a.get("project_activities")||[];for(var i in activities)if(activities[i].act_id==t.act_id){activities[i].praise_count-=1,activities[i].has_praise=!1;break}for(var i in course_activities)if(course_activities[i].act_id==t.act_id){course_activities[i].praise_count-=1,course_activities[i].has_praise=!1;break}for(var i in project_activities)if(project_activities[i].act_id==t.act_id){project_activities[i].praise_count-=1,project_activities[i].has_praise=!1;break}a.save("activities",activities),a.save("course_activities",course_activities),a.save("project_activities",project_activities),t.praise_count-=1,t.has_praise=!1,n(t)}};return{init:r,addCommonReply:c,loadCommonData:s,addCommonPraise:o,decreaseCommonPraise:n}}]);
|
||||
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}});
|
||||
app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,e,t,i,c,s,o,r,_){t.replaceUrl=function(a){return a},t.menus=["所有动态","课程动态","项目动态"],t.alertService=_.create(),console.log("ActivityController load"),t.page=o.get("page")||0,t.activities=o.get("activities")||[],t.has_more=o.get("has_more"),t.course_page=o.get("course_page")||0,t.course_activities=o.get("course_activities")||[],t.course_has_more=o.get("course_has_more"),t.project_page=o.get("project_page")||0,t.project_activities=o.get("project_activities")||[],t.project_has_more=o.get("project_has_more"),t.loadActData=function(a,e){switch(container_type="All",a){case 1:container_type="All",t.page=e;break;case 2:container_type="Course",t.course_page=e;break;case 3:container_type="Project",t.project_page=e}i({method:"POST",url:apiUrl+"activities",data:{token:s.token(),page:e,container_type:container_type}}).then(function(a){if(a.data.page>0)switch(a.data.container_type){case"All":t.activities=t.activities.concat(a.data.data);break;case"Course":t.course_activities=t.course_activities.concat(a.data.data);break;case"Project":t.project_activities=t.project_activities.concat(a.data.data);break;case 3:}else switch(a.data.container_type){case"All":t.activities=a.data.data;break;case"Course":t.course_activities=a.data.data;break;case"Project":t.project_activities=a.data.data;break;case 3:}switch(a.data.container_type){case"All":o.save("activities",t.activities),t.has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("has_more",t.has_more),o.save("page",a.data.page);break;case"Course":o.save("course_activities",t.course_activities),t.course_has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("course_has_more",t.course_has_more),o.save("course_page",a.data.page);break;case"Project":o.save("project_activities",t.project_activities),t.project_has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("project_has_more",t.project_has_more),o.save("project_page",a.data.page);break;case 3:}console.log(a.data)},function(a){})},t.tab=function(a){switch(t.currentTab=a,a){case 1:t.activities.length<=0&&t.loadActData(a,0);break;case 2:t.course_activities.length<=0&&t.loadActData(a,0);break;case 3:t.project_activities.length<=0&&t.loadActData(a,0)}},t.currentTab=1,t.activities.length<=0?t.loadActData(1,0):c(function(){window.scrollTo(0,o.get("yoffset"))}),t.goDetail=function(a,i,c){o.save("yoffset",window.document.body.scrollTop),o.save("activities",t.activities),o.save("course_activities",t.course_activities),o.save("project_activities",t.project_activities),e.path("/"+a+"/"+i)},t.addPraise=function(a){for(var e in t.activities)if(t.activities[e].act_id==a.act_id){t.activities[e].praise_count+=1,t.activities[e].has_praise=!0;break}for(var e in t.course_activities)if(t.course_activities[e].act_id==a.act_id){t.course_activities[e].praise_count+=1,t.course_activities[e].has_praise=!0;break}for(var e in t.project_activities)if(t.project_activities[e].act_id==a.act_id){t.project_activities[e].praise_count+=1,t.project_activities[e].has_praise=!0;break}r.addCommonPraise(a)},t.decreasePraise=function(a){for(var e in t.activities)if(t.activities[e].act_id==a.act_id){t.activities[e].praise_count-=1,t.activities[e].has_praise=!1;break}for(var e in t.course_activities)if(t.course_activities[e].act_id==a.act_id){t.course_activities[e].praise_count-=1,t.course_activities[e].has_praise=!1;break}for(var e in t.project_activities)if(t.project_activities[e].act_id==a.act_id){t.project_activities[e].praise_count-=1,t.project_activities[e].has_praise=!1;break}r.decreaseCommonPraise(a)}}]);
|
||||
|
||||
//app.js
|
||||
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e){g_redirect_path&&g_redirect_path.length>1&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(){})}]);
|
||||
//factory.js
|
||||
app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,i,e){this.message=i,this.title=t,this.visible=!0,this.cb=e},t.prototype.dismiss=function(){this.message=null,this.title=null,this.visible=!1,this.cb&&this.cb()},{create:function(){return new t}}}),app.factory("auth",["$http","$routeParams","$q","session","config",function(t,i,e,a){var c=function(){var c=e.defer(),o=s();if(o&&o.length>10)c.resolve(o);else{{window.g_code||i.code||a.get("code")}t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?c.reject(t.data.message):(a.save("token",t.data.token),c.resolve(t.data.token))})["catch"](function(t){c.reject(t)})}return c.promise},s=function(){return a.get("token")};return{get_bind:c,token:s}}]),app.factory("session",function(){return{save:function(t,i){sessionStorage.setItem(t,i)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},i=function(i,e){t[i]=e},e=function(i){return t[i]};return{save:i,get:e}}),app.factory("common",["$http","auth","$routeParams","rms",function(t,i,e,a){var c=function(e,a,c,s){if(c.comment&&!(c.comment.length<=0)){var o=c.comment.replace(/\n/g,"<br/>"),n={type:a,content:o,token:i.token()};c.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+e,data:n}).then(function(){c.disabled=!1,"function"==typeof s&&s()},function(){})}},s=function(e,a){return t({method:"GET",url:apiUrl+a+"/"+e+"?token="+i.token()})},o=function(e){t({method:"POST",url:apiUrl+"praise/"+e.act_id,data:{token:i.token(),type:e.act_type}}).then(function(t){console.log(t.data)},function(){})},n=function(e){t({method:"POST",url:apiUrl+"praise/"+e.act_id,data:{token:i.token(),type:e.act_type}}).then(function(t){console.log(t.data)},function(){})},r=function(t){t.scope.formData={comment:""};var i=function(i){s(i,t.type).then(function(i){t.loadCallback(i.data)},function(){})};i(t.id),t.scope.addReply=function(e){console.log(e.comment),c(t.id,t.replyType,e,function(){t.scope.formData={comment:""},i(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=function(t){activities=a.get("activities")||[],course_activities=a.get("course_activities")||[],project_activities=a.get("project_activities")||[];for(var i in activities)if(activities[i].act_id==t.act_id){activities[i].praise_count+=1,activities[i].has_praise=!0;break}for(var i in course_activities)if(course_activities[i].act_id==t.act_id){course_activities[i].praise_count+=1,course_activities[i].has_praise=!0;break}for(var i in project_activities)if(project_activities[i].act_id==t.act_id){project_activities[i].praise_count+=1,project_activities[i].has_praise=!0;break}a.save("activities",activities),a.save("course_activities",course_activities),a.save("project_activities",project_activities),t.praise_count+=1,t.has_praise=!0,o(t)},t.scope.decreasePraise=function(t){activities=a.get("activities")||[],course_activities=a.get("course_activities")||[],project_activities=a.get("project_activities")||[];for(var i in activities)if(activities[i].act_id==t.act_id){activities[i].praise_count-=1,activities[i].has_praise=!1;break}for(var i in course_activities)if(course_activities[i].act_id==t.act_id){course_activities[i].praise_count-=1,course_activities[i].has_praise=!1;break}for(var i in project_activities)if(project_activities[i].act_id==t.act_id){project_activities[i].praise_count-=1,project_activities[i].has_praise=!1;break}a.save("activities",activities),a.save("course_activities",course_activities),a.save("project_activities",project_activities),t.praise_count-=1,t.has_praise=!1,n(t)}};return{init:r,addCommonReply:c,loadCommonData:s,addCommonPraise:o,decreaseCommonPraise:n}}]);
|
||||
//filter.js
|
||||
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"\u6559\u8f85":""}});
|
||||
//activity.js
|
||||
app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,e,t,i,c,s,o,r,_){t.replaceUrl=function(a){return a},t.menus=["\u6240\u6709\u52a8\u6001","\u8bfe\u7a0b\u52a8\u6001","\u9879\u76ee\u52a8\u6001"],t.alertService=_.create(),console.log("ActivityController load"),t.page=o.get("page")||0,t.activities=o.get("activities")||[],t.has_more=o.get("has_more"),t.course_page=o.get("course_page")||0,t.course_activities=o.get("course_activities")||[],t.course_has_more=o.get("course_has_more"),t.project_page=o.get("project_page")||0,t.project_activities=o.get("project_activities")||[],t.project_has_more=o.get("project_has_more"),t.loadActData=function(a,e){switch(container_type="All",a){case 1:container_type="All",t.page=e;break;case 2:container_type="Course",t.course_page=e;break;case 3:container_type="Project",t.project_page=e}i({method:"POST",url:apiUrl+"activities",data:{token:s.token(),page:e,container_type:container_type}}).then(function(a){if(a.data.page>0)switch(a.data.container_type){case"All":t.activities=t.activities.concat(a.data.data);break;case"Course":t.course_activities=t.course_activities.concat(a.data.data);break;case"Project":t.project_activities=t.project_activities.concat(a.data.data);break;case 3:}else switch(a.data.container_type){case"All":t.activities=a.data.data;break;case"Course":t.course_activities=a.data.data;break;case"Project":t.project_activities=a.data.data;break;case 3:}switch(a.data.container_type){case"All":o.save("activities",t.activities),t.has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("has_more",t.has_more),o.save("page",a.data.page);break;case"Course":o.save("course_activities",t.course_activities),t.course_has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("course_has_more",t.course_has_more),o.save("course_page",a.data.page);break;case"Project":o.save("project_activities",t.project_activities),t.project_has_more=a.data.count+10*a.data.page<a.data.all_count,o.save("project_has_more",t.project_has_more),o.save("project_page",a.data.page);break;case 3:}console.log(a.data)},function(){})},t.tab=function(a){switch(t.currentTab=a,a){case 1:t.activities.length<=0&&t.loadActData(a,0);break;case 2:t.course_activities.length<=0&&t.loadActData(a,0);break;case 3:t.project_activities.length<=0&&t.loadActData(a,0)}},t.currentTab=1,t.activities.length<=0?t.loadActData(1,0):c(function(){window.scrollTo(0,o.get("yoffset"))}),t.goDetail=function(a,i){o.save("yoffset",window.document.body.scrollTop),o.save("activities",t.activities),o.save("course_activities",t.course_activities),o.save("project_activities",t.project_activities),e.path("/"+a+"/"+i)},t.addPraise=function(a){for(var e in t.activities)if(t.activities[e].act_id==a.act_id){t.activities[e].praise_count+=1,t.activities[e].has_praise=!0;break}for(var e in t.course_activities)if(t.course_activities[e].act_id==a.act_id){t.course_activities[e].praise_count+=1,t.course_activities[e].has_praise=!0;break}for(var e in t.project_activities)if(t.project_activities[e].act_id==a.act_id){t.project_activities[e].praise_count+=1,t.project_activities[e].has_praise=!0;break}r.addCommonPraise(a)},t.decreasePraise=function(a){for(var e in t.activities)if(t.activities[e].act_id==a.act_id){t.activities[e].praise_count-=1,t.activities[e].has_praise=!1;break}for(var e in t.course_activities)if(t.course_activities[e].act_id==a.act_id){t.course_activities[e].praise_count-=1,t.course_activities[e].has_praise=!1;break}for(var e in t.project_activities)if(t.project_activities[e].act_id==a.act_id){t.project_activities[e].praise_count-=1,t.project_activities[e].has_praise=!1;break}r.decreaseCommonPraise(a)}}]);
|
||||
//blog.js
|
||||
app.controller("BlogController",["$scope","$http","$routeParams","auth","common",function(o,l,t,n,a){a.init({id:t.id,scope:o,type:"blog_comments",replyType:"BlogComment",loadCallback:function(l){o.blog=l.data},replyCallback:function(){}})}]);
|
||||
app.controller("ClassController",["$scope","config","$http","auth","$location","$routeParams",function(e,s,t,o,a,n){var r=e,c=n.id,u=function(){r.teachers.length<=0&&t.get(s.apiUrl+"courses/teachers?token="+o.token()+"&course_id="+c).then(function(e){console.log(e.data),r.teachers=e.data.data}),r.students.length<=0&&t.get(s.apiUrl+"courses/students?token="+o.token()+"&course_id="+c).then(function(e){console.log(e.data),r.students=e.data.data})},i=function(){r.resources.length<=0&&t.post(s.apiUrl+"courses/"+c+"/attachments",{token:o.token(),name:""}).then(function(e){r.resources=e.data.data,r.resources_tag=!0})},h=function(){r.homeworks.length<=0&&t.get(s.apiUrl+"courses/homeworks/"+c+"?token="+o.token()).then(function(e){r.homeworks=e.data.data,console.log(e.data),r.homeworks_tag=!0})},l=function(){r.exercises.length<=0&&t.get(s.apiUrl+"courses/"+c+"/exercises?token="+o.token()).then(function(e){r.exercises=e.data.data,console.log(e.data),r.exercises_tag=!0})};r.isTeacher=!1,r.currentTab=1,r.tab=function(e){r.currentTab=e,r.searchText="",r.showClassMate=!1,r.showResources=!1,r.showHomework=!1,r.showTestcase=!1,r.resources_tag=!1,r.homeworks_tag=!1,r.exercises_tag=!1,r.isTeacher?1==e?(i(),r.showResources=!0):2==e?(h(),r.showHomework=!0):3==e?(l(),r.showTestcase=!0):4==e&&(u(),r.showClassMate=!0):2==e?(u(),r.showClassMate=!0):1==e&&(i(),r.showResources=!0)},r.course={},r.students=[],r.teachers=[],r.resources=[],r.homeworks=[],r.exercises=[],r.invite=function(){a.path("/invite_code").search({id:c})},r.sendFile=function(e){a.path("/send_class_list").search({id:e.id})},t.get(s.apiUrl+"courses/"+c+"?token="+o.token()).then(function(e){console.log(e.data),r.course=e.data.data,d(r.course.current_user_is_teacher),r.tab(1)});var d=function(e){r.isTeacher=e,e?r.menus=["课件","作业","小测验","学生管理"]:r.menus=["课件","我的同学"]}}]);
|
||||
app.controller("ClassListController",["$scope","config","auth","$http","$location","alertService","rms",function(e,s,a,t,o,l,n){var c=e;c.syllabuses=n.get("syllabuses")||[],c.alertService=l.create();var i=function(){t.get(s.apiUrl+"syllabuses?token="+a.token()).then(function(e){console.log(e.data),c.syllabuses=e.data.data,n.save("syllabuses",c.syllabuses)})};c.syllabuses.length<=0&&i(),c.goClass=function(e){console.log(e),o.path("/class").search({id:e})},c.newClass=function(){t.post(s.apiUrl+"syllabuses/auth",{token:a.token()}).then(function(e){console.log(e.data),0==e.data.auth?c.alertService.showMessage("提示","非教师身份不能创建课程哦~"):o.path("/new_class")})},c.goResource=function(){o.path("/myresource")},c.joinClass=function(){var e=window.prompt("请输入5位班级邀请码(不区分大小写)");e&&5==e.length?t.post(s.apiUrl+"courses/join",{token:a.token(),invite_code:e}).then(function(e){console.log(e.data),0!=e.data.status?c.alertService.showMessage("错误",e.data.message):(c.alertService.showMessage("提示","加入课程成功"),i())}):e&&c.alertService.showMessage("错误","邀请码格式不正确")},c.onSetting=function(e){console.log(e),n.save("current_edit_syllobus",e),o.path("/edit_class").search({id:e.id})}}]);
|
||||
//class.js
|
||||
app.controller("ClassController",["$scope","config","$http","auth","$location","$routeParams",function(e,s,t,o,a,n){var r=e,c=n.id,i=function(){r.teachers.length<=0&&t.get(s.apiUrl+"courses/teachers?token="+o.token()+"&course_id="+c).then(function(e){console.log(e.data),r.teachers=e.data.data}),r.students.length<=0&&t.get(s.apiUrl+"courses/students?token="+o.token()+"&course_id="+c).then(function(e){console.log(e.data),r.students=e.data.data})},u=function(){r.resources.length<=0&&t.post(s.apiUrl+"courses/"+c+"/attachments",{token:o.token(),name:""}).then(function(e){r.resources=e.data.data,r.resources_tag=!0})},h=function(){r.homeworks.length<=0&&t.get(s.apiUrl+"courses/homeworks/"+c+"?token="+o.token()).then(function(e){r.homeworks=e.data.data,console.log(e.data),r.homeworks_tag=!0})},l=function(){r.exercises.length<=0&&t.get(s.apiUrl+"courses/"+c+"/exercises?token="+o.token()).then(function(e){r.exercises=e.data.data,console.log(e.data),r.exercises_tag=!0})};r.isTeacher=!1,r.currentTab=1,r.tab=function(e){r.currentTab=e,r.searchText="",r.showClassMate=!1,r.showResources=!1,r.showHomework=!1,r.showTestcase=!1,r.resources_tag=!1,r.homeworks_tag=!1,r.exercises_tag=!1,r.isTeacher?1==e?(u(),r.showResources=!0):2==e?(h(),r.showHomework=!0):3==e?(l(),r.showTestcase=!0):4==e&&(i(),r.showClassMate=!0):2==e?(i(),r.showClassMate=!0):1==e&&(u(),r.showResources=!0)},r.course={},r.students=[],r.teachers=[],r.resources=[],r.homeworks=[],r.exercises=[],r.invite=function(){a.path("/invite_code").search({id:c})},r.sendFile=function(e){a.path("/send_class_list").search({id:e.id})},t.get(s.apiUrl+"courses/"+c+"?token="+o.token()).then(function(e){console.log(e.data),r.course=e.data.data,d(r.course.current_user_is_teacher),r.tab(1)});var d=function(e){r.isTeacher=e,r.menus=e?["\u8bfe\u4ef6","\u4f5c\u4e1a","\u5c0f\u6d4b\u9a8c","\u5b66\u751f\u7ba1\u7406"]:["\u8bfe\u4ef6","\u6211\u7684\u540c\u5b66"]}}]);
|
||||
//class_list.js
|
||||
app.controller("ClassListController",["$scope","config","auth","$http","$location","alertService","rms",function(e,s,a,t,o,l,n){var c=e;c.syllabuses=n.get("syllabuses")||[],c.alertService=l.create();var i=function(){t.get(s.apiUrl+"syllabuses?token="+a.token()).then(function(e){console.log(e.data),c.syllabuses=e.data.data,n.save("syllabuses",c.syllabuses)})};c.syllabuses.length<=0&&i(),c.goClass=function(e){console.log(e),o.path("/class").search({id:e})},c.newClass=function(){t.post(s.apiUrl+"syllabuses/auth",{token:a.token()}).then(function(e){console.log(e.data),0==e.data.auth?c.alertService.showMessage("\u63d0\u793a","\u975e\u6559\u5e08\u8eab\u4efd\u4e0d\u80fd\u521b\u5efa\u8bfe\u7a0b\u54e6~"):o.path("/new_class")})},c.goResource=function(){o.path("/myresource")},c.joinClass=function(){var e=window.prompt("\u8bf7\u8f93\u51655\u4f4d\u73ed\u7ea7\u9080\u8bf7\u7801(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)");e&&5==e.length?t.post(s.apiUrl+"courses/join",{token:a.token(),invite_code:e}).then(function(e){console.log(e.data),0!=e.data.status?c.alertService.showMessage("\u9519\u8bef",e.data.message):(c.alertService.showMessage("\u63d0\u793a","\u52a0\u5165\u8bfe\u7a0b\u6210\u529f"),i())}):e&&c.alertService.showMessage("\u9519\u8bef","\u9080\u8bf7\u7801\u683c\u5f0f\u4e0d\u6b63\u786e")},c.onSetting=function(e){console.log(e),n.save("current_edit_syllobus",e),o.path("/edit_class").search({id:e.id})}}]);
|
||||
//course_notice.js
|
||||
app.controller("CourseNoticeController",["$scope","$http","$routeParams","auth","common",function(o,e,t,n,a){a.init({id:t.id,scope:o,type:"newss",replyType:"News",loadCallback:function(e){o.news=e.data},replyCallback:function(){}})}]);
|
||||
//discussion.js
|
||||
app.controller("DiscussionController",["$scope","$http","$routeParams","auth","common",function(o,s,a,e,n){n.init({id:a.id,scope:o,type:"messages",replyType:"Message",loadCallback:function(s){o.discussion=s.data},replyCallback:function(){}})}]);
|
||||
app.controller("EditClassController",["$scope","$http","auth","config","alertService","$location","$routeParams","rms",function(s,e,a,l,t,o,r,n){var u=s;u.syllabus=n.get("current_edit_syllobus");var i=r.id;if(u.syllabus||e.get(l.apiUrl+"syllabuses/"+i+"?token="+a.token()).then(function(s){if(console.log(s.data),u.syllabus=s.data.data,u.syllabus){for(var e in u.syllabus.courses){var a=u.syllabus.courses[e];a.tmpname=a.name}u.syllabus.tmptitle=u.syllabus.title}}),console.log(u.syllabus),u.syllabus){for(var c in u.syllabus.courses){var d=u.syllabus.courses[c];d.tmpname=d.name}u.syllabus.tmptitle=u.syllabus.title}u.alertService_1=t.create(),u.alertService_2=t.create(),u.addClass=function(){u.syllabus.courses.push({can_setting:!0})},u.deleteClass=function(s){var t=u.syllabus.courses[s];t.id>0?u.alertService_2.showMessage("提示","您确定要删除该班级吗?",function(){e.post(l.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?u.alertService_1.showMessage("出错了",e.data.message):u.alertService_1.showMessage("提示","删除班级成功",function(){u.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):u.syllabus.courses.splice(s,1)},u.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var r=[],c=[];for(var d in u.syllabus.courses){var b=u.syllabus.courses[d];b.id?b.tmpname!=b.name&&c.push({id:b.id,name:b.tmpname}):r.push(b.tmpname)}e.post(l.apiUrl+"syllabuses/"+i+"/edit",{token:a.token(),id:i,title:u.syllabus.tmptitle,add_courses:r,modify_courses:c}).then(function(s){0!=s.data.status?u.alertService_1.showMessage("出错了",s.data.message):u.alertService_1.showMessage("提示","保存课程成功",function(){n.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})},u.fadeText=function(){s.change=!0}}]);
|
||||
//edit_class.js
|
||||
app.controller("EditClassController",["$scope","$http","auth","config","alertService","$location","$routeParams","rms",function(s,e,a,l,t,o,r,n){var u=s;u.syllabus=n.get("current_edit_syllobus");var i=r.id;if(u.syllabus||e.get(l.apiUrl+"syllabuses/"+i+"?token="+a.token()).then(function(s){if(console.log(s.data),u.syllabus=s.data.data,u.syllabus){for(var e in u.syllabus.courses){var a=u.syllabus.courses[e];a.tmpname=a.name}u.syllabus.tmptitle=u.syllabus.title}}),console.log(u.syllabus),u.syllabus){for(var c in u.syllabus.courses){var d=u.syllabus.courses[c];d.tmpname=d.name}u.syllabus.tmptitle=u.syllabus.title}u.alertService_1=t.create(),u.alertService_2=t.create(),u.addClass=function(){u.syllabus.courses.push({can_setting:!0})},u.deleteClass=function(s){var t=u.syllabus.courses[s];t.id>0?u.alertService_2.showMessage("\u63d0\u793a","\u60a8\u786e\u5b9a\u8981\u5220\u9664\u8be5\u73ed\u7ea7\u5417\uff1f",function(){e.post(l.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?u.alertService_1.showMessage("\u51fa\u9519\u4e86",e.data.message):u.alertService_1.showMessage("\u63d0\u793a","\u5220\u9664\u73ed\u7ea7\u6210\u529f",function(){u.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):u.syllabus.courses.splice(s,1)},u.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var r=[],c=[];for(var d in u.syllabus.courses){var b=u.syllabus.courses[d];b.id?b.tmpname!=b.name&&c.push({id:b.id,name:b.tmpname}):r.push(b.tmpname)}e.post(l.apiUrl+"syllabuses/"+i+"/edit",{token:a.token(),id:i,title:u.syllabus.tmptitle,add_courses:r,modify_courses:c}).then(function(s){0!=s.data.status?u.alertService_1.showMessage("\u51fa\u9519\u4e86",s.data.message):u.alertService_1.showMessage("\u63d0\u793a","\u4fdd\u5b58\u8bfe\u7a0b\u6210\u529f",function(){n.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})},u.fadeText=function(){s.change=!0}}]);
|
||||
//homework.js
|
||||
app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]);
|
||||
app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(t){})}}]);
|
||||
//invite_code.js
|
||||
app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(){})}}]);
|
||||
//issue.js
|
||||
app.controller("IssueController",["$scope","$http","$routeParams","auth","common",function(o,e,l,s,t){t.init({id:l.id,scope:o,type:"issues",replyType:"Issue",loadCallback:function(e){console.log(e),o.issue=e.data},replyCallback:function(){}})}]);
|
||||
//journals.js
|
||||
app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]);
|
||||
app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("出错了",o.data.message):r.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("出错了",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码,谢谢!")},r.goReg=function(){t.path("/reg")}}]);
|
||||
app.controller("MyResourceController",["$scope","$http","auth","config","$location","rms",function(e,a,o,s,r,t){var c=e;c.menus=["课件","作业","测验"],c.resources=[],c.homeworks=[],c.exercise=[],c.resources_tag=!1,c.homeworks_tag=!1,c.exercises_tag=!1,c.page=t.get("page")||0,c.resources=t.get("resources")||[],c.has_more=t.get("has_more"),c.homework_page=t.get("homework_page")||0,c.homeworks=t.get("homeworks")||[],c.homework_has_more=t.get("homework_has_more"),c.exercise_page=t.get("exercise_page")||0,c.exercise=t.get("exercise")||[],c.exercise_has_more=t.get("exercise_has_more"),c.searchText="",c.sendFile=function(e){r.path("/send_class_list").search({id:e.id})},c.loadResourceData=function(e,s){1==e?(c.page=s,a({method:"POST",url:apiUrl+"resources",data:{token:o.token(),page:s}}).then(function(e){c.resources_tag=!0,e.data.page>0?c.resources=c.resources.concat(e.data.data):c.resources=e.data.data,t.save("resources",c.resources),c.has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("has_more",c.has_more),t.save("page",e.data.page),console.log(e.data)},function(e){})):2==e?(c.homework_page=s,a({method:"POST",url:apiUrl+"resources/homeworks",data:{token:o.token(),page:s}}).then(function(e){c.homeworks_tag=!0,e.data.page>0?c.homeworks=c.homeworks.concat(e.data.data):c.homeworks=e.data.data,t.save("homeworks",c.homeworks),c.homework_has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("homework_has_more",c.has_more),t.save("homework_page",e.data.page),console.log(e.data)},function(e){})):3==e&&(c.exercise_page=s,a({method:"POST",url:apiUrl+"resources/exercises",data:{token:o.token(),page:s}}).then(function(e){c.exercises_tag=!0,e.data.page>0?c.exercise=c.exercise.concat(e.data.data):c.exercise=e.data.data,t.save("exercise",c.exercise),c.exercise_has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("exercise_has_more",c.exercise_has_more),t.save("exercise_page",e.data.page),console.log(e.data)},function(e){}))},c.tab=function(e){switch(c.currentTab=e,c.searchText="",e){case 1:c.resources.length<=0&&c.loadResourceData(e,0);break;case 2:c.homeworks.length<=0&&c.loadResourceData(e,0);break;case 3:c.exercise.length<=0&&c.loadResourceData(e,0)}},c.tab(1)}]);
|
||||
app.controller("NewClassController",["$scope","$http","auth","config","alertService","$location","rms",function(s,e,a,l,t,o,r){var n=s;n.alertService=t.create(),n.syllabus={courses:[{name:""}]},n.addClass=function(){n.syllabus.courses.push({})},n.deleteClass=function(s){n.syllabus.courses.splice(s,1)},n.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var c=[];for(var u in n.syllabus.courses)c.push(n.syllabus.courses[u].name);e.post(l.apiUrl+"syllabuses",{token:a.token(),title:t.title,courses:c}).then(function(s){0!=s.data.status?n.alertService.showMessage("出错了",s.data.message):n.alertService.showMessage("提示","新建课程成功",function(){r.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})}}]);
|
||||
app.controller("RegController",["$scope","$http","$location","alertService","$location",function(e,o,a,s,a){var t=e;t.errDialog=s.create(),t.successDialog=s.create(),t.goLogin=function(){a.path("/login")},t.isagreed=!0,t.agreed=function(e){t.isagreed=!e},t.reg=function(e,s){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(s),void o.post(apiUrl+"users",{login:s.username,password:s.password,mail:s.email}).then(function(e){0!=e.data.status?t.errDialog.showMessage("出错了",e.data.message):t.successDialog.showMessage("提示","注册且绑定微信成功",function(){a.path("/activities")})},function(e){t.errDialog.showMessage("出错了",e.data)})):void console.log(e.$error)}}]);
|
||||
app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService","rms",function(e,s,o,a,t,r,c){var n=e,l=o.id;n.alertService=r.create(),n.syllabuses=[];var i=function(){s.get(a.apiUrl+"syllabuses?token="+t.token()).then(function(e){console.log(e.data),n.syllabuses=e.data.data})};i(),n.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},n.sendToCourses=function(){var e=[];for(var o in n.syllabuses)for(var r in n.syllabuses[o].courses)n.syllabuses[o].courses[r].checked&&e.push(n.syllabuses[o].courses[r].id);return e.length<=0?void n.alertService.showMessage("提醒","请先选择班级"):void s.post(a.apiUrl+"resources/send",{token:t.token(),course_ids:e,send_id:l}).then(function(e){console.log(e.data),0==e.data.status?n.alertService.showMessage("提示","发送成功",function(){window.history.back()}):n.alertService.showMessage("发送出错",e.data.message)})}}]);
|
||||
//login.js
|
||||
app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("\u51fa\u9519\u4e86",o.data.message):r.alertService.showMessage("\u63d0\u793a",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("\u51fa\u9519\u4e86",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("\u63d0\u793a","\u8bf7\u8bbf\u95eewww.trustie.net\u83b7\u53d6\u5bc6\u7801\uff0c\u8c22\u8c22\uff01")},r.goReg=function(){t.path("/reg")}}]);
|
||||
//myresource.js
|
||||
app.controller("MyResourceController",["$scope","$http","auth","config","$location","rms",function(e,a,o,s,r,t){var c=e;c.menus=["\u8bfe\u4ef6","\u4f5c\u4e1a","\u6d4b\u9a8c"],c.resources=[],c.homeworks=[],c.exercise=[],c.resources_tag=!1,c.homeworks_tag=!1,c.exercises_tag=!1,c.page=t.get("page")||0,c.resources=t.get("resources")||[],c.has_more=t.get("has_more"),c.homework_page=t.get("homework_page")||0,c.homeworks=t.get("homeworks")||[],c.homework_has_more=t.get("homework_has_more"),c.exercise_page=t.get("exercise_page")||0,c.exercise=t.get("exercise")||[],c.exercise_has_more=t.get("exercise_has_more"),c.searchText="",c.sendFile=function(e){r.path("/send_class_list").search({id:e.id})},c.loadResourceData=function(e,s){1==e?(c.page=s,a({method:"POST",url:apiUrl+"resources",data:{token:o.token(),page:s}}).then(function(e){c.resources_tag=!0,c.resources=e.data.page>0?c.resources.concat(e.data.data):e.data.data,t.save("resources",c.resources),c.has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("has_more",c.has_more),t.save("page",e.data.page),console.log(e.data)},function(){})):2==e?(c.homework_page=s,a({method:"POST",url:apiUrl+"resources/homeworks",data:{token:o.token(),page:s}}).then(function(e){c.homeworks_tag=!0,c.homeworks=e.data.page>0?c.homeworks.concat(e.data.data):e.data.data,t.save("homeworks",c.homeworks),c.homework_has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("homework_has_more",c.has_more),t.save("homework_page",e.data.page),console.log(e.data)},function(){})):3==e&&(c.exercise_page=s,a({method:"POST",url:apiUrl+"resources/exercises",data:{token:o.token(),page:s}}).then(function(e){c.exercises_tag=!0,c.exercise=e.data.page>0?c.exercise.concat(e.data.data):e.data.data,t.save("exercise",c.exercise),c.exercise_has_more=e.data.count+10*e.data.page<e.data.all_count,t.save("exercise_has_more",c.exercise_has_more),t.save("exercise_page",e.data.page),console.log(e.data)},function(){}))},c.tab=function(e){switch(c.currentTab=e,c.searchText="",e){case 1:c.resources.length<=0&&c.loadResourceData(e,0);break;case 2:c.homeworks.length<=0&&c.loadResourceData(e,0);break;case 3:c.exercise.length<=0&&c.loadResourceData(e,0)}},c.tab(1)}]);
|
||||
//new_class.js
|
||||
app.controller("NewClassController",["$scope","$http","auth","config","alertService","$location","rms",function(s,e,a,l,t,o,r){var n=s;n.alertService=t.create(),n.syllabus={courses:[{name:""}]},n.addClass=function(){n.syllabus.courses.push({})},n.deleteClass=function(s){n.syllabus.courses.splice(s,1)},n.newClass=function(s,t){if(s.$setSubmitted(),console.log(t),!s.$valid)return void console.log(s.$error);var c=[];for(var u in n.syllabus.courses)c.push(n.syllabus.courses[u].name);e.post(l.apiUrl+"syllabuses",{token:a.token(),title:t.title,courses:c}).then(function(s){0!=s.data.status?n.alertService.showMessage("\u51fa\u9519\u4e86",s.data.message):n.alertService.showMessage("\u63d0\u793a","\u65b0\u5efa\u8bfe\u7a0b\u6210\u529f",function(){r.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})}}]);
|
||||
//reg.js
|
||||
app.controller("RegController",["$scope","$http","$location","alertService","$location",function(e,o,a,s,a){var t=e;t.errDialog=s.create(),t.successDialog=s.create(),t.goLogin=function(){a.path("/login")},t.isagreed=!0,t.agreed=function(e){t.isagreed=!e},t.reg=function(e,s){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(s),void o.post(apiUrl+"users",{login:s.username,password:s.password,mail:s.email}).then(function(e){0!=e.data.status?t.errDialog.showMessage("\u51fa\u9519\u4e86",e.data.message):t.successDialog.showMessage("\u63d0\u793a","\u6ce8\u518c\u4e14\u7ed1\u5b9a\u5fae\u4fe1\u6210\u529f",function(){a.path("/activities")})},function(e){t.errDialog.showMessage("\u51fa\u9519\u4e86",e.data)})):void console.log(e.$error)}}]);
|
||||
//send_class_list.js
|
||||
app.controller("SendClassListController",["$scope","$http","$routeParams","config","auth","alertService","rms",function(e,s,o,a,t,r){var c=e,n=o.id;c.alertService=r.create(),c.syllabuses=[];var l=function(){s.get(a.apiUrl+"syllabuses?token="+t.token()).then(function(e){console.log(e.data),c.syllabuses=e.data.data})};l(),c.selectCourse=function(e){"boolean"!=typeof e.checked&&(e.checked=!1),e.checked=!e.checked},c.sendToCourses=function(){var e=[];for(var o in c.syllabuses)for(var r in c.syllabuses[o].courses)c.syllabuses[o].courses[r].checked&&e.push(c.syllabuses[o].courses[r].id);return e.length<=0?void c.alertService.showMessage("\u63d0\u9192","\u8bf7\u5148\u9009\u62e9\u73ed\u7ea7"):void s.post(a.apiUrl+"resources/send",{token:t.token(),course_ids:e,send_id:n}).then(function(e){console.log(e.data),0==e.data.status?c.alertService.showMessage("\u63d0\u793a","\u53d1\u9001\u6210\u529f",function(){window.history.back()}):c.alertService.showMessage("\u53d1\u9001\u51fa\u9519",e.data.message)})}}]);
|
||||
//alert.js
|
||||
app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]),app.directive("myAlert2",["config",function(t){return{templateUrl:t.rootPath+"templates/alert2.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1},t.confirm=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]);
|
||||
//form_validate.js
|
||||
app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}});
|
||||
//input_auto.js
|
||||
app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var i=t.parent().children().children().eq(0),c=t.next();t.on("input",function(){console.log(c),i.html(t[0].value);var n=i[0].scrollHeight;t.css("height",n+"px")}),c.on("click",function(){t.css("height","28px")})}}});
|
||||
//loading_spinner.js
|
||||
app.directive("loadingSpinner",["$http","config",function(t,e){return{templateUrl:e.rootPath+"templates/loading.html"}}]);
|
||||
//routes.js
|
||||
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,l,t,o){var r=o.rootPath,s={delay:["auth",function(e){return e.get_bind()}]},n=function(e,l){return{templateUrl:r+e,controller:l,resolve:s}};e.when("/login",{templateUrl:r+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:r+"reg.html",controller:"RegController"}).when("/activites",n("activities.html","ActivityController")).when("/issues/:id",n("issue_detail.html","IssueController")).when("/project_discussion/:id",n("project_discussion.html","DiscussionController")).when("/homework/:id",n("homework_detail.html","HomeworkController")).when("/course_notice/:id",n("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",n("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",n("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",n("blog_detail.html","BlogController")).when("/class",n("class.html","ClassController")).when("/new_class",n("new_class.html","NewClassController")).when("/edit_class",n("edit_class.html","EditClassController")).when("/class_list",n("class_list.html","ClassListController")).when("/myresource",n("myresource.html","MyResourceController")).when("/invite_code",{templateUrl:r+"invite_code.html",controller:"InviteCodeController"}).when("/send_class_list",n("send_class_list.html","SendClassListController")).otherwise({redirectTo:"/activites"}),l.interceptors.push(["$q","$rootScope",function(e,l){return void 0==l.activeCalls&&(l.activeCalls=0),{request:function(e){return l.activeCalls+=1,e},requestError:function(e){return l.activeCalls-=1,e},response:function(e){return l.activeCalls-=1,e},responseError:function(e){return l.activeCalls-=1,e}}}])}]);
|
|
@ -136,7 +136,7 @@ app.controller('ActivityController',
|
|||
|
||||
//跳到详情页
|
||||
$scope.goDetail = function(type, act_id,id){
|
||||
rms.save("yoffset", window.document.body.scrollTop);
|
||||
rms.save("yoffset", document.documentElement.scrollTop);
|
||||
rms.save("activities",$scope.activities);
|
||||
rms.save("course_activities",$scope.course_activities);
|
||||
rms.save("project_activities",$scope.project_activities);
|
||||
|
|
|
@ -8,7 +8,33 @@ app.controller('BlogController',
|
|||
type: 'blog_comments',
|
||||
replyType: 'BlogComment',
|
||||
loadCallback: function(data){
|
||||
console.log(data.data);
|
||||
|
||||
//回复级别 0 一级回复 1 二级回复
|
||||
replytype = data.type;
|
||||
page = data.page;
|
||||
|
||||
if (replytype == 0){
|
||||
if (page == 0){
|
||||
$scope.blog = data.data;
|
||||
$scope.page = 0;
|
||||
}
|
||||
else{
|
||||
$scope.blog.blog_comment_children = $scope.blog.blog_comment_children.concat(data.data.blog_comment_children);
|
||||
}
|
||||
$scope.has_more = $scope.blog.blog_comment_children.length < $scope.blog.comment_count;
|
||||
console.log($scope.has_more);
|
||||
}
|
||||
else{
|
||||
comment_id = data.data.id;
|
||||
for (var i in $scope.blog.blog_comment_children) {
|
||||
var comment = $scope.blog.blog_comment_children[i];
|
||||
if(comment.id == comment_id){
|
||||
// comment.parents_reply_top = comment.parents_reply_top.concat(data.data.parents_reply_top);
|
||||
comment.parents_reply_top = data.data.parents_reply_top.concat(comment.parents_reply_top);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
replyCallback: function(){
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams', function($scope, config, $http, auth, $location, $routeParams){
|
||||
app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms', function($scope, config, $http, auth, $location, $routeParams,alertService,rms){
|
||||
|
||||
var vm = $scope;
|
||||
var courseid = $routeParams.id;
|
||||
|
@ -97,9 +97,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
vm.course = {};
|
||||
vm.students = [];
|
||||
vm.teachers = [];
|
||||
|
@ -107,21 +104,35 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
|
|||
vm.homeworks = [];
|
||||
vm.exercises = [];
|
||||
|
||||
//发送类别 1课件 2作业 3测验
|
||||
vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
vm.invite = function(){
|
||||
$location.path("/invite_code").search({id: courseid});
|
||||
};
|
||||
|
||||
vm.sendFile = function(r){
|
||||
vm.sendFile = function(r,index){
|
||||
vm.myresource_sendIndex = index;
|
||||
rms.save('myresource_sendIndex',index);
|
||||
$location.path("/send_class_list").search({id: r.id});
|
||||
}
|
||||
|
||||
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
|
||||
if (response.data.status == 0){
|
||||
vm.course = response.data.data;
|
||||
resetMenu(vm.course.current_user_is_teacher);
|
||||
vm.tab(1);
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
|
|||
var vm = $scope;
|
||||
vm.syllabuses = rms.get('syllabuses') || [];
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
vm.alertService_1 = alertService.create();
|
||||
vm.alertService_3 = alertService.create();
|
||||
|
||||
var loadClassList = function () {
|
||||
$http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then(
|
||||
|
@ -36,7 +37,7 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
|
|||
function (response) {
|
||||
console.log(response.data);
|
||||
if (response.data.auth == 0) {
|
||||
vm.alertService.showMessage('提示', '非教师身份不能创建课程哦~');
|
||||
vm.alertService_1.showMessage('提示', '非教师身份不能创建课程哦~');
|
||||
}
|
||||
else{
|
||||
$location.path("/new_class");
|
||||
|
@ -50,26 +51,27 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
|
|||
}
|
||||
|
||||
vm.joinClass = function () {
|
||||
var code = window.prompt("请输入5位班级邀请码(不区分大小写)");
|
||||
if (code && code.length == 5) {
|
||||
vm.alertService_3.showMessage('提示', '请输入5位班级邀请码(不区分大小写)', function(){
|
||||
if (vm.alertService_3.invite && vm.alertService_3.invite.length == 5) {
|
||||
$http.post(config.apiUrl + "courses/join", {
|
||||
token: auth.token(),
|
||||
invite_code: code
|
||||
invite_code: vm.alertService_3.invite
|
||||
}).then(function (response) {
|
||||
console.log(response.data);
|
||||
if (response.data.status != 0) {
|
||||
vm.alertService.showMessage('错误', response.data.message);
|
||||
vm.alertService_1.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.alertService.showMessage('提示', '加入课程成功');
|
||||
vm.alertService_1.showMessage('提示', '加入课程成功');
|
||||
vm.alertService_3.invite = "";
|
||||
loadClassList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if(code){
|
||||
vm.alertService.showMessage('错误', '邀请码格式不正确');
|
||||
if(vm.alertService_3.invite){
|
||||
vm.alertService_1.showMessage('提示', '邀请码格式不正确');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
vm.onSetting = function (syllabus) {
|
||||
|
|
|
@ -107,8 +107,4 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale
|
|||
|
||||
}
|
||||
|
||||
vm.fadeText = function () {
|
||||
$scope.change = true;
|
||||
}
|
||||
|
||||
}] );
|
|
@ -33,7 +33,8 @@ app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams
|
|||
vm.loginFailed = (response.data.status != 0);
|
||||
if (!$scope.loginFailed) { //绑定成功
|
||||
vm.alertService.showMessage('提示', response.data.message, function(){
|
||||
$location.path("/activities");
|
||||
// $location.path("/activities");
|
||||
window.WeixinJSBridge.call('closeWindow');
|
||||
});
|
||||
} else {
|
||||
vm.alertService.showMessage('出错了', response.data.message);
|
||||
|
|
|
@ -10,21 +10,30 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
|
|||
vm.homeworks_tag = false;
|
||||
vm.exercises_tag = false;
|
||||
|
||||
//课件
|
||||
vm.page = rms.get('page') || 0;
|
||||
vm.resources = rms.get("resources") || [];
|
||||
vm.has_more = rms.get("has_more");
|
||||
|
||||
//作业
|
||||
vm.homework_page = rms.get('homework_page') || 0;
|
||||
vm.homeworks = rms.get("homeworks") || [];
|
||||
vm.homework_has_more = rms.get("homework_has_more");
|
||||
|
||||
//测验
|
||||
vm.exercise_page = rms.get('exercise_page') || 0;
|
||||
vm.exercise = rms.get("exercise") || [];
|
||||
vm.exercise_has_more = rms.get("exercise_has_more");
|
||||
|
||||
vm.searchText = "";
|
||||
|
||||
vm.sendFile = function(r){
|
||||
//发送类别 1课件 2作业 3测验
|
||||
vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
|
||||
|
||||
vm.sendFile = function(r,index){
|
||||
vm.myresource_sendIndex = index;
|
||||
rms.save('myresource_sendIndex',index);
|
||||
|
||||
$location.path("/send_class_list").search({id: r.id});
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService',
|
|||
vm.errDialog.showMessage('出错了',response.data.message);
|
||||
} else {
|
||||
vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){
|
||||
$location.path("/activities");
|
||||
// $location.path("/activities");
|
||||
window.WeixinJSBridge.call('closeWindow');
|
||||
});
|
||||
}
|
||||
}, function (response) {
|
||||
|
|
|
@ -2,6 +2,9 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
|
|||
var vm = $scope;
|
||||
var send_id = $routeParams.id;
|
||||
|
||||
//发送类别 1课件 2作业 3测验
|
||||
vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
vm.syllabuses = [];
|
||||
|
||||
|
@ -39,11 +42,19 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
|
|||
}
|
||||
|
||||
$http.post(config.apiUrl + "resources/send", {
|
||||
token: auth.token(), course_ids: course_ids, send_id: send_id
|
||||
token: auth.token(), course_ids: course_ids, send_id: send_id,send_type:vm.myresource_sendIndex
|
||||
}).then(function(response){
|
||||
console.log(response.data);
|
||||
if(response.data.status == 0){
|
||||
vm.alertService.showMessage('提示', '发送成功', function () {
|
||||
var tip = "";
|
||||
if (vm.myresource_sendIndex == 1){
|
||||
tip = "课件已发送到目标班级。";
|
||||
}
|
||||
else if(vm.myresource_sendIndex == 2){
|
||||
tip = "题目已发送到目标班级的作业列表,但需要您访问Trustie网站设置发布和截止时间,以激活相应作业,谢谢。";
|
||||
}
|
||||
|
||||
vm.alertService.showMessage('发送成功', tip, function () {
|
||||
window.history.back();
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -40,3 +40,27 @@ app.directive('myAlert2', ['config', function(config){
|
|||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
app.directive('myAlert3', ['config', function(config){
|
||||
return {
|
||||
templateUrl: config.rootPath+ 'templates/alert3.html',
|
||||
scope: {
|
||||
title: "=",
|
||||
message: "=",
|
||||
visible: "=",
|
||||
cb: "=",
|
||||
invite: "="
|
||||
},
|
||||
link: function(scope){
|
||||
scope.dismiss = function(){
|
||||
scope.visible = false;
|
||||
};
|
||||
scope.confirm = function(){
|
||||
scope.visible = false;
|
||||
if(typeof scope.cb === 'function'){
|
||||
scope.cb();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
|
|
@ -8,11 +8,11 @@ app.directive('inputAuto',function(){
|
|||
element.on('input',function(){
|
||||
console.log(sendButton);
|
||||
copyContainer.html(element[0].value);
|
||||
var textHeight = copyContainer[0].scrollHeight;
|
||||
var textHeight = copyContainer[0].scrollHeight-10;
|
||||
element.css('height', textHeight + 'px');
|
||||
});
|
||||
sendButton.on('click',function(){
|
||||
element.css('height','28px');
|
||||
element.css('height','18px');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ app.factory('alertService', function(){
|
|||
this.message = null;
|
||||
this.visible = null;
|
||||
this.cb = null;
|
||||
this.invite = "";
|
||||
}
|
||||
|
||||
Alert.prototype.showMessage = function(title, msg, cb){
|
||||
|
@ -11,12 +12,14 @@ app.factory('alertService', function(){
|
|||
this.title = title;
|
||||
this.visible = true;
|
||||
this.cb = cb;
|
||||
this.invite = "";
|
||||
}
|
||||
|
||||
Alert.prototype.dismiss = function(){
|
||||
this.message = null;
|
||||
this.title = null;
|
||||
this.visible = false;
|
||||
this.invite = "";
|
||||
if(this.cb) {this.cb();}
|
||||
}
|
||||
|
||||
|
@ -118,10 +121,18 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms', function($http, au
|
|||
});
|
||||
};
|
||||
|
||||
var loadCommonData = function(id, type){
|
||||
// var loadCommonData = function(id, type,replytype,page){
|
||||
// return $http({
|
||||
// method: 'GET',
|
||||
// url: apiUrl+ type + "/" + id+"?token="+auth.token(),
|
||||
// })
|
||||
// };
|
||||
|
||||
var loadCommonData = function(id, type,replytype,page){
|
||||
return $http({
|
||||
method: 'GET',
|
||||
url: apiUrl+ type + "/" + id+"?token="+auth.token()
|
||||
method: 'POST',
|
||||
url: apiUrl+ type + "/" + id,
|
||||
data:{token:auth.token(),type:replytype,page:page}
|
||||
})
|
||||
};
|
||||
|
||||
|
@ -155,19 +166,19 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms', function($http, au
|
|||
|
||||
var init = function(args){
|
||||
args.scope.formData = {comment: ''};
|
||||
var loadData = function(id){
|
||||
loadCommonData(id, args.type).then(function successCallback(response) {
|
||||
var loadData = function(id,replytype,page){
|
||||
loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
|
||||
args.loadCallback(response.data);
|
||||
}, function errorCallback(response) {
|
||||
});
|
||||
};
|
||||
|
||||
loadData(args.id);
|
||||
loadData(args.id,0,0);
|
||||
args.scope.addReply = function(data){
|
||||
console.log(data.comment);
|
||||
addCommonReply(args.id, args.replyType, data, function(){
|
||||
args.scope.formData = {comment: ''};
|
||||
loadData(args.id);
|
||||
loadData(args.id,0,0);
|
||||
if(typeof args.replyCallback === 'function'){
|
||||
args.replyCallback();
|
||||
}
|
||||
|
@ -242,6 +253,21 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms', function($http, au
|
|||
act.has_praise = false;
|
||||
decreaseCommonPraise(act);
|
||||
};
|
||||
|
||||
args.scope.showMoreReply = function(replytype,data){
|
||||
if(!data.page){
|
||||
data.page = 1;
|
||||
}
|
||||
else{
|
||||
data.page = data.page + 1;
|
||||
}
|
||||
|
||||
loadCommonData(data.id, args.type,replytype,data.page).then(function successCallback(response) {
|
||||
args.loadCallback(response.data);
|
||||
}, function errorCallback(response) {
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return {init: init, addCommonReply: addCommonReply, loadCommonData: loadCommonData, addCommonPraise: addCommonPraise, decreaseCommonPraise: decreaseCommonPraise};
|
||||
|
|
|
@ -43,7 +43,7 @@ table{ background:#fff;}
|
|||
.no_line{ border-bottom:none;}
|
||||
.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
|
||||
.no_border{ border:none;}
|
||||
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
|
||||
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(/images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
|
||||
a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;}
|
||||
.db {display:block;}
|
||||
|
||||
|
@ -530,7 +530,7 @@ a:hover.bgreen_n_btn{background:#08a384;}
|
|||
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
|
||||
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
|
||||
.sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
|
||||
.locked_btn_cir{background: url(../images/locked.png) 0 0 no-repeat; cursor: default;}
|
||||
.locked_btn_cir{background: url(/images/locked.png) 0 0 no-repeat; cursor: default;}
|
||||
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
|
||||
.grey_border{border:1px solid #dddddd !important;}
|
||||
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
|
|
|
@ -35,8 +35,8 @@ a:hover.DropBtn{background: url(../images/homepage_icon.png) -125px -370px no-re
|
|||
.ProResultTable{ color:#888888;}
|
||||
.SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; }
|
||||
.SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; }
|
||||
a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
|
||||
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
||||
a.link_file{ background:url(/images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
|
||||
a:hover.link_file{ background:url(/images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
||||
a.remove-upload {background: url(/images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;margin-left: 5px;}
|
||||
a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
|
||||
a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
|
||||
|
@ -132,8 +132,8 @@ a:hover.tijiao{ background:#297fb8;}
|
|||
.grey_c{ color:#808181;}
|
||||
.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
|
||||
.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')}
|
||||
.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')}
|
||||
.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('/images/news_dot2.png')}
|
||||
.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('/images/news_dot.png')}
|
||||
span.author { font-size: 0.9em; color: #888; }
|
||||
.ReplyToMessageInputContainer {width: 582px;float: left;}
|
||||
.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;}
|
||||
|
@ -152,8 +152,8 @@ a.select_btn_select{ background:#64bddb; color:#fff;}
|
|||
.courses_list_pic{ border:1px solid #ede7e9; width:64px; height:64px; padding:1px;}
|
||||
.courses_list_pic:hover{border:1px solid #64bdd9;}
|
||||
.courses_list_title{ max-width:500px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.pic_eye_blue{display:block; background:url(../images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; }
|
||||
.pic_eye_grey{display:block; background:url(../images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; }
|
||||
.pic_eye_blue{display:block; background:url(/images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; }
|
||||
.pic_eye_grey{display:block; background:url(/images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; }
|
||||
.courses_list{ padding-bottom:10px;}
|
||||
.courses_list_table{ color:#6e6e6e;}
|
||||
|
||||
|
@ -349,7 +349,7 @@ a:hover.icon_remove{background:url(../images/icons.png) -20px -338px no-repeat;}
|
|||
a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;}
|
||||
.show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; }
|
||||
.show_hwork ul li{ margin-bottom:5px;}
|
||||
.show_hwork_arrow{ position:relative; top:1px; left:165px;background:url(../images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;}
|
||||
.show_hwork_arrow{ position:relative; top:1px; left:165px;background:url(/images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;}
|
||||
.tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;}
|
||||
.show_hwork_p{ width:630px; float:left;}
|
||||
.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:615px; height:35px;}
|
||||
|
@ -363,7 +363,7 @@ a:hover.ping_pic{border:1px solid #64bdd9;}
|
|||
.ping_back_tit{ float:left; width:578px; margin-left:10px; }
|
||||
a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;}
|
||||
a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;}
|
||||
.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; cursor:pointer;}
|
||||
.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(/images/public_icon.png) 185px -193px no-repeat; cursor:pointer;}
|
||||
.li_min_search{ float:right; margin-right:-10px;}
|
||||
.info_ni{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;}
|
||||
.hwork_num{ width:90px; text-align:center; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
|
@ -428,7 +428,7 @@ a:hover.rside_work_tit{ color:#0781b4;}
|
|||
.bgrey_icon{ color:#9b9b9b; border:1px solid #b6b6b6; background:#f0f0f0; font-size:12px; padding:0px 3px; }
|
||||
.dgrey_icon{ color:#717171; border:1px solid #717171; font-size:12px; padding:0px 3px;}
|
||||
.yellow_icon{ color:#ff5c60; border:1px solid #ff5c60; background:#ffffd5; font-size:12px; padding:0px 3px;}
|
||||
.arrow_r{background:url(../images/course/icons.png) 0 -450px no-repeat; width:22px; height:13px; }
|
||||
.arrow_r{background:url(/images/course/icons.png) 0 -450px no-repeat; width:22px; height:13px; }
|
||||
.c_dgreen{ color:#0e9e4f;}
|
||||
.list_more{ text-align:center; margin:10px 0;}
|
||||
.rside_massage_txt{ width:650px; margin-left:10px; }
|
||||
|
@ -436,14 +436,14 @@ a.massage_tit{ max-width:530px;overflow:hidden; white-space: nowrap; text-overfl
|
|||
a.rside_name{ display:block; max-width:80px;}
|
||||
.rside_talk_txt{ width:650px; margin-left:10px; color:#333;}
|
||||
.rside_talk_tit{ color:#0781b4; width:490px; display:block; }
|
||||
.rside_talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/course/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||
.rside_talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(/images/course/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||
.rside_talkWrapBox{ width:650px; margin-left:60px; }
|
||||
.rside_Msg_txt{ float:left; width:580px; margin-left:10px;}
|
||||
.rside_talkWrapMsg{ background:#f2f2f2; padding:10px;}
|
||||
.rside_talkWrapMsg ul li{}
|
||||
.rside_inputFeint{ border:1px solid #d9d9d9; background:#fff; width:623px; height:40px; margin:10px; margin-bottom:5px;color:#666;}
|
||||
a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
|
||||
a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; }
|
||||
a.icon_face{background:url(/images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
|
||||
a:hover.icon_face{background:url(/images/public_icon.png) -79px -671px no-repeat; }
|
||||
a.pro_mes_w{ height:20px; display:block; color:#999999;}
|
||||
.info_list{ border-top:1px solid #F2F2F2; padding:5px 0;}
|
||||
.info_list_r li{ height:20px;}
|
||||
|
@ -487,8 +487,8 @@ a:hover.btn_cancel{ color:#666;}
|
|||
.questionTitle{ width:644px; height:30px; border:1px solid #cbcbcb; padding-left:5px; background:#fff;}
|
||||
.examTime {width:90px; border:1px solid #cbcbcb; outline:none; height:28px; text-align:center; padding-left:0px; }
|
||||
.testStatus{width:698px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px; background:#ffffff; position:relative; color:#767676;}
|
||||
.testEdit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; bottom:10px; right:10px; position:absolute;}
|
||||
a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;}
|
||||
.testEdit{ background:url(../images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; bottom:10px; right:10px; position:absolute;}
|
||||
a:hover.testEdit{ background:url(../images/icons.png) -21px -272px no-repeat;}
|
||||
.testDesEdit {width:670px; overflow:hidden;}
|
||||
.testEditTitle{ padding:10px 0px ; float:left; width:564px; }
|
||||
.questionEditContainer {border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px; margin-top:10px;}
|
||||
|
|
|
@ -105,7 +105,7 @@ div.flash {margin-top :0px !important}
|
|||
/*名师榜20160505*/
|
||||
.function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;}
|
||||
.teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;}
|
||||
.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;}
|
||||
.teacher-search-icon {background:url(/images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;}
|
||||
.teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;}
|
||||
.teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;}
|
||||
.teacher-avatar {float:left;}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
color: #333;
|
||||
}
|
||||
.ui-progressbar-value{margin:-1px;height:100%}
|
||||
.ui-widget-header{border:1px solid #628db6;background:#759fcf url(jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}
|
||||
.ui-widget-header{border:1px solid #628db6;background:#759fcf url(../jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}
|
||||
.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}
|
||||
|
||||
/*发送资源弹窗*/
|
||||
|
@ -44,7 +44,7 @@ input.sendSourceText:hover {background-color:#297fb8;}
|
|||
.popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */}
|
||||
|
||||
/*上传资源弹窗*/
|
||||
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||
.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;}
|
||||
.uploadDialogText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block; font-weight: bold;}
|
||||
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;}
|
||||
|
@ -164,7 +164,7 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; }
|
|||
|
||||
/****评分弹框****/
|
||||
/*#popbox{width:488px;height:550px;position:absolute;z-index:100;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; }*/
|
||||
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}
|
||||
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(/images/close.png) no-repeat;cursor:pointer;}
|
||||
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
|
||||
.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
||||
.ping_con ul{ height:30px;}
|
||||
|
@ -173,8 +173,8 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; }
|
|||
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
||||
.ping_con p span a{ color:#777777;}
|
||||
.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
|
||||
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;}
|
||||
.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;}
|
||||
.ping_star span a{ float:right; width:20px; height:20px; background:url(../images/star.png) -2px 0 no-repeat; margin-right:3px;}
|
||||
.ping_star span a:hover{background:url(../images/star.png) -24px 0 no-repeat;}
|
||||
.ping_con textarea{ width:455px; height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
|
||||
a.ping_sub{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}
|
||||
a:hover.ping_sub{ background:#14a8b9;}
|
||||
|
@ -207,7 +207,7 @@ span.author { font-size: 0.9em; color: #888; }
|
|||
|
||||
/* 匿名评分弹框 */
|
||||
/*.popbox02{width:480px;height:200px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}*/
|
||||
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
|
||||
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(/images/close.png) no-repeat;cursor:pointer;}
|
||||
|
||||
/* 开启匿评弹框 */
|
||||
.anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||
|
@ -316,7 +316,7 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
|
|||
|
||||
/*转发样式*/
|
||||
.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:relative; z-index:1000;}
|
||||
.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;}
|
||||
.shareArrow {background:url(/images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;}
|
||||
.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:205px; min-height:150px; padding-top:5px; border:1px solid #dddddd;}
|
||||
.columnWrap {float:left; max-height:155px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; min-height:155px; border:1px solid #dddddd;}
|
||||
.columnWrap li {padding-left:10px; color:#585858; line-height:20px;}
|
||||
|
|
|
@ -159,7 +159,7 @@ div.thumbnails div {background:#fff;display:inline-block;margin-right:2px;}
|
|||
.repos_files ul li{ float:left; padding-left:10px; height:26px;}
|
||||
.repos_files ul:hover{ background:#ffffdd;}
|
||||
.repos_t_c li{ text-align:center;}
|
||||
.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
|
||||
.pic_stats{display:block; background:url(/images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
|
||||
.tree-age{width:10%; text-align:right;}
|
||||
.tree-author{width:10%; text-align:left;}
|
||||
.tree-comments{width:40%; text-align:left;}
|
||||
|
@ -260,7 +260,7 @@ p.percent {
|
|||
.label02{ width:110px; text-align:right; font-size:14px; display:block; float:left;}
|
||||
.label03{ width:70px; text-align:right; display:block; float:left; white-space: nowrap;}
|
||||
.collapsible{ border-left:none;border-right:none;border-bottom:none; border-top:1px solid #e4e4e4; padding-top:10px; }
|
||||
.icon-reload { background-image: url(../images/reload.png); }
|
||||
.icon-reload { background-image: url(/images/reload.png); }
|
||||
.icon {
|
||||
background-position: 0% 50%;
|
||||
background-repeat: no-repeat;
|
||||
|
@ -375,28 +375,28 @@ tr.entry td.age { text-align: right; }
|
|||
tr.entry.file td.filename a { margin-center: 16px; }
|
||||
tr.entry.file td.filename_no_report a { margin-left: 16px; }
|
||||
|
||||
tr span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
|
||||
tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);}
|
||||
.icon-folder { background-image: url(../images/folder.png); }
|
||||
.open .icon-folder { background-image: url(../images/folder_open.png); }
|
||||
.icon-file { background-image: url(../images/files/default.png); }
|
||||
.icon-file.text-plain { background-image: url(../images/files/text.png); }
|
||||
.icon-file.text-x-c { background-image: url(../images/files/c.png); }
|
||||
.icon-file.text-x-csharp { background-image: url(../images/files/csharp.png); }
|
||||
.icon-file.text-x-java { background-image: url(../images/files/java.png); }
|
||||
.icon-file.text-x-javascript { background-image: url(../images/files/js.png); }
|
||||
.icon-file.text-x-php { background-image: url(../images/files/php.png); }
|
||||
.icon-file.text-x-ruby { background-image: url(../images/files/ruby.png); }
|
||||
.icon-file.text-xml { background-image: url(../images/files/xml.png); }
|
||||
.icon-file.text-css { background-image: url(../images/files/css.png); }
|
||||
.icon-file.text-html { background-image: url(../images/files/html.png); }
|
||||
.icon-file.image-gif { background-image: url(../images/files/image.png); }
|
||||
.icon-file.image-jpeg { background-image: url(../images/files/image.png); }
|
||||
.icon-file.image-png { background-image: url(../images/files/image.png); }
|
||||
.icon-file.image-tiff { background-image: url(../images/files/image.png); }
|
||||
.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
|
||||
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
|
||||
.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
|
||||
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
|
||||
tr.open span.expander {background-image: url(/images/bullet_toggle_minus.png);}
|
||||
.icon-folder { background-image: url(/images/folder.png); }
|
||||
.open .icon-folder { background-image: url(/images/folder_open.png); }
|
||||
.icon-file { background-image: url(/images/files/default.png); }
|
||||
.icon-file.text-plain { background-image: url(/images/files/text.png); }
|
||||
.icon-file.text-x-c { background-image: url(/images/files/c.png); }
|
||||
.icon-file.text-x-csharp { background-image: url(/images/files/csharp.png); }
|
||||
.icon-file.text-x-java { background-image: url(/images/files/java.png); }
|
||||
.icon-file.text-x-javascript { background-image: url(/images/files/js.png); }
|
||||
.icon-file.text-x-php { background-image: url(/images/files/php.png); }
|
||||
.icon-file.text-x-ruby { background-image: url(/images/files/ruby.png); }
|
||||
.icon-file.text-xml { background-image: url(/images/files/xml.png); }
|
||||
.icon-file.text-css { background-image: url(/images/files/css.png); }
|
||||
.icon-file.text-html { background-image: url(/images/files/html.png); }
|
||||
.icon-file.image-gif { background-image: url(/images/files/image.png); }
|
||||
.icon-file.image-jpeg { background-image: url(/images/files/image.png); }
|
||||
.icon-file.image-png { background-image: url(/images/files/image.png); }
|
||||
.icon-file.image-tiff { background-image: url(/images/files/image.png); }
|
||||
.icon-file.application-pdf { background-image: url(/images/files/pdf.png); }
|
||||
.icon-file.application-zip { background-image: url(/images/files/zip.png); }
|
||||
.icon-file.application-x-gzip { background-image: url(/images/files/zip.png); }
|
||||
|
||||
/*版本库diff*/
|
||||
.showing-changes-info {width:650px; padding:10px; padding-top: 0px; background-color:#ffffff; line-height:2;}
|
||||
|
@ -428,11 +428,11 @@ tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);
|
|||
|
||||
/*gcm upload file count and deleteall*/
|
||||
#upload_file_count #count {color:red; font-size:1.5em;}
|
||||
span.add_attachment .remove_all {background:none;background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;right:10%;text-decoration:none;}
|
||||
span.add_attachment a {padding-left:16px; background: url(../images/bullet_add.png) no-repeat 0 50%; }
|
||||
span.add_attachment .remove_all {background:none;background: url(/images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;right:10%;text-decoration:none;}
|
||||
span.add_attachment a {padding-left:16px; background: url(/images/bullet_add.png) no-repeat 0 50%; }
|
||||
|
||||
/*导出*/
|
||||
a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; }
|
||||
a.atom { background: url(/images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; }
|
||||
p.other-formats { text-align: right; font-size:0.9em; color: #666; }
|
||||
.other-formats span + span:before { content: "| "; }
|
||||
|
||||
|
@ -488,11 +488,11 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
|
|||
.analysis-block {padding:15px; border:1px solid #d9d9d9;}
|
||||
.flex {display:flex;}
|
||||
.analysis-genral {flex:1; display:block; text-align:center;}
|
||||
.analysis-block-icon {background:url(../images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-serious-icon {background:url(../images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-main-icon {background:url(../images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-secondary-icon {background:url(../images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-info-icon {background:url(../images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-block-icon {background:url(/images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-serious-icon {background:url(/images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-main-icon {background:url(/images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-secondary-icon {background:url(/images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.analysis-info-icon {background:url(/images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
|
||||
.quality-percentage {width:320px; height:14px; display:inline-block;}
|
||||
.quality-percentage-rate {width:50%; height:14px; background-color:#0a6c99; display:inline-block;}
|
||||
.image-cir {border-radius:50%;}
|
||||
|
|
|
@ -131,7 +131,7 @@ html{ overflow-x:hidden;}
|
|||
.close_btn span { display:none;}
|
||||
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
|
||||
.msgserver { margin:10px 0 0px 5px;}
|
||||
.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; }
|
||||
.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; }
|
||||
.opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;}
|
||||
a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;}
|
||||
a.opnionButton:hover{background: #297fb8; }
|
||||
|
@ -796,7 +796,7 @@ a.talkmain_name{ color:#ff5722;}
|
|||
a:hover.talkmain_name{ color:#d33503;}
|
||||
.talkmain_tit{ color:#0781b4; width:450px; display:block; }
|
||||
.talklist_main{ }
|
||||
.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||
.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(/images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||
.talkConIpt{ background:#f2f2f2; }
|
||||
.talkWrapBox{ width:610px; margin-left:60px; }
|
||||
.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
|
||||
|
|
|
@ -31,8 +31,8 @@ a:hover.search_btn{ background: #0fa9bb;}
|
|||
#userInfo {float:right; display:inline-block; width:130px; padding-top:5px;}
|
||||
.userInfoRow2 {margin-top:-5px;}
|
||||
.myPractice {display:inline-block;}
|
||||
a.parent {background: url(../images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
|
||||
a.parent:hover {background: url(../images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
|
||||
a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
|
||||
a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
|
||||
a.linkToOrange:hover {color:#fe7d68;}
|
||||
#userInfo ul li {positon: relative;}
|
||||
#userInfo ul li ul {display:none;}
|
||||
|
@ -62,10 +62,10 @@ div#menu a:hover, div#menu a:hover span { color: #a1ebff; }
|
|||
div#menu li.current a {}
|
||||
div#menu {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;}
|
||||
div#menu ul a.user_name { width:170px; text-align:right; margin:0; }
|
||||
.pic_triangle{background: url(../images/item.png) -90px -48px no-repeat; float:right; display:block; width:10px; height:10px; margin-top:12px; margin-left:7px;}
|
||||
.pic_triangle:hover{background: url(../images/item.png) -90px -78px no-repeat; }
|
||||
div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;width:60px;}
|
||||
div#menu ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;}
|
||||
.pic_triangle{background: url(/images/item.png) -90px -48px no-repeat; float:right; display:block; width:10px; height:10px; margin-top:12px; margin-left:7px;}
|
||||
.pic_triangle:hover{background: url(/images/item.png) -90px -78px no-repeat; }
|
||||
div#menu ul ul a.parent {background: url(/images/item.png) -20px 6px no-repeat;width:60px;}
|
||||
div#menu ul ul a.parent:hover {background: url(/images/item.png) -20px -11px no-repeat;}
|
||||
/* menu::level1 */
|
||||
div#menu a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;}
|
||||
/*div#menu li { background: url(images/main-delimiter.png) 98% 4px no-repeat; }*/
|
||||
|
@ -153,10 +153,10 @@ a.more{ float:right; font-size:12px; font-weight:normal; color:#a9a9a9; margin-t
|
|||
a:hover.more{ color:#64bdd9;}
|
||||
.project_box_ul{ padding:0 10px;}
|
||||
.project_box_list{ padding:10px 0; border-bottom:1px dashed #e2e1e1; padding-left:30px; color:#6f6c6c;}
|
||||
.img_problem{ background:url(../images/img_project.png) 0 -20px no-repeat;}
|
||||
.img_talk{ background:url(../images/img_project.png) 0 -62px no-repeat;}
|
||||
.img_ziyuan{ background:url(../images/img_project.png) 0 -115px no-repeat;}
|
||||
.img_edition{ background:url(../images/img_project.png) 0 -167px no-repeat;}
|
||||
.img_problem{ background:url(/images/img_project.png) 0 -20px no-repeat;}
|
||||
.img_talk{ background:url(/images/img_project.png) 0 -62px no-repeat;}
|
||||
.img_ziyuan{ background:url(/images/img_project.png) 0 -115px no-repeat;}
|
||||
.img_edition{ background:url(/images/img_project.png) 0 -167px no-repeat;}
|
||||
a.project_name{ color:#058c42;}
|
||||
a:hover.project_name{ color:#016f33;}
|
||||
a.project_txt{ color:#0781b4; width:445px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
|
@ -254,7 +254,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
|
|||
.table_maxWidth table {max-width: 642px;}
|
||||
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
|
||||
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
|
||||
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px;}
|
||||
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(/images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px;}
|
||||
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
|
||||
.postAttSize {color:#888888; font-size:12px; margin-left: 5px;}
|
||||
.homepageSearchIcon {width:30px; height:32px; background:url(/images/nav_icon.png) -8px 3px no-repeat; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
|
||||
|
@ -267,9 +267,9 @@ a.replyGrey {color:#888888; display:inline-block;}
|
|||
a.replyGrey:hover {color:#4b4b4b;}
|
||||
|
||||
/*个人主页右部分*/
|
||||
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a.gz_btn{display:block; background:url(/images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a:hover.gz_btn{ color:#ff5722;}
|
||||
a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a.qx_btn{display:block; background:url(/images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a:hover.qx_btn{color:#64bdd9;}
|
||||
|
||||
.courseMenu {width:30px; display:block; float:right;height: 50px;}
|
||||
|
@ -340,7 +340,7 @@ a.homepageMenuControl {float:left; width:180px;}
|
|||
.project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;}
|
||||
.homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;}
|
||||
.homepageRightBanner {width:718px; margin:0px auto; float:right; background-color: #ffffff; padding:10px 15px; border:1px solid #dddddd;}
|
||||
.homepageRightBannerImg{width:1000px; margin:0px auto; height: 60px; margin-top: 10px; background:url(../images/TeachersDay.jpg)}
|
||||
.homepageRightBannerImg{width:1000px; margin:0px auto; height: 60px; margin-top: 10px; background:url(/images/TeachersDay.jpg)}
|
||||
a.homepageWhite {color:#ffffff;}
|
||||
a.homepageWhite:hover {color:#a1ebff}
|
||||
a.newsGrey {color:#4b4b4b;}
|
||||
|
@ -360,12 +360,12 @@ a.menuGrey:hover {color:#fe7d68;}
|
|||
#navSearchAlert {display:none;}
|
||||
|
||||
/*151228侧导航样式更新*/
|
||||
.menuSetting {background:url(../images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;}
|
||||
.praviteC {background:url(../images/hwork_icon.png) -79px -255px no-repeat;}
|
||||
.menuSetting {background:url(/images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;}
|
||||
.praviteC {background:url(/images/hwork_icon.png) -79px -255px no-repeat;}
|
||||
.praviteCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
|
||||
.publicC {background:url(../images/hwork_icon.png) -79px -125px no-repeat;}
|
||||
.publicC {background:url(/images/hwork_icon.png) -79px -125px no-repeat;}
|
||||
.publicCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
|
||||
.shild {background:url(../images/hwork_icon.png) -6px -354px no-repeat;}
|
||||
.shild {background:url(/images/hwork_icon.png) -6px -354px no-repeat;}
|
||||
.shildP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
|
||||
ul.shild:hover li ul {display:block;}
|
||||
.subNavArrow {background:url(/images/hwork_icon.png) -82px -399px no-repeat; display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
|
||||
|
@ -376,7 +376,7 @@ ul.subNavArrow:hover li ul {display:block;}
|
|||
/*左侧导航*/
|
||||
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
|
||||
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
|
||||
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
|
||||
.subNav_jiantou{background:url(/images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
|
||||
.subNav_jiantou:hover{color:#0781b4; }
|
||||
.currentDd{color:#0781b4;}
|
||||
.currentDt{background-color:#fff;}
|
||||
|
@ -404,8 +404,8 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg
|
|||
.users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
|
||||
|
||||
/*留言*/
|
||||
a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
|
||||
a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; }
|
||||
a.icon_face{background:url(/images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; }
|
||||
a:hover.icon_face{background:url(/images/public_icon.png) -79px -671px no-repeat; }
|
||||
.inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;}
|
||||
.inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; }
|
||||
.message_list_box{ background:#f5f5f5; margin-top: 10px;}
|
||||
|
@ -437,14 +437,14 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
|
|||
.uppic_btn:hover {background-color: #329cbd;}
|
||||
|
||||
/*myctrip*/
|
||||
.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(../images/item.png) 2px 4px no-repeat; line-height:1.4;}
|
||||
.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(/images/item.png) 2px 4px no-repeat; line-height:1.4;}
|
||||
a.topnav_login_a{color:#fff; display:inline-block;}
|
||||
a.topnav_login_a:hover {color:#a1ebff;}
|
||||
a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(../images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;}
|
||||
a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(/images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;}
|
||||
a.topnav_login_mes:hover {color:#a1ebff;}
|
||||
a.topnav_login_box{ color:#fff; font-size:14px; font-weight:bold; width:90px; display:inline-block;}
|
||||
.menuArrow {background:url(../images/item.png) -20px -40px no-repeat;}
|
||||
li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;}
|
||||
.menuArrow {background:url(/images/item.png) -20px -40px no-repeat;}
|
||||
li.menuArrow:hover {background:url(/images/item.png) -20px -70px no-repeat;}
|
||||
a.topnav_login_box:hover {color:#a1ebff;}
|
||||
.navRow1 {margin:0; padding:0;}
|
||||
.navRow2 {margin:0; padding:0;}
|
||||
|
|
|
@ -55,6 +55,8 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin: 5px 0.4em 5px 1.4e
|
|||
a {color:#707070;}
|
||||
a.c-grey {color:#707070;}
|
||||
a.c-grey2 {color:#9a9a9a;}
|
||||
a.c-grey3 {color:#353535;}
|
||||
a.c-green {color:#0bb20c;}
|
||||
a:link,a:visited{text-decoration:none;}
|
||||
a:hover,a:active{cursor:pointer;}
|
||||
a.link-blue {color:#269ac9;}
|
||||
|
@ -84,7 +86,7 @@ a.underline {text-decoration:underline;}
|
|||
.btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;}
|
||||
|
||||
/*tab*/
|
||||
.tab-wrap {position:relative; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;}
|
||||
.tab-wrap {position:relative; width:100%; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;}
|
||||
.tab-wrap a {position:relative; display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1;}
|
||||
.tab-wrap a:first-child:after {display:none;}
|
||||
.tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;}
|
||||
|
@ -127,8 +129,8 @@ a.underline {text-decoration:underline;}
|
|||
.post-reply-date, .post-reply-trigger {font-size:13px;}
|
||||
.post-input-container {position:relative; padding-right:70px;}
|
||||
.copy-input-container {position:relative; padding-right:70px;}
|
||||
.copy-input {width:100%; height:28px; line-height:28px; padding:0 5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;}
|
||||
.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:0 5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;}
|
||||
.copy-input {width:100%; height:18px; line-height:18px; padding:5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;}
|
||||
.post-reply-input {width:100%; height:18px; max-height:54px; line-height:18px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;}
|
||||
.post-reply-submit {position:absolute; font-size:13px; height:30px; line-height:30px; vertical-align:middle; padding:0 8px; color:#fff; background-color:#269ac9; outline:none; border:none; top:0; right:0;}
|
||||
.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}
|
||||
.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}
|
||||
|
@ -153,8 +155,8 @@ a.underline {text-decoration:underline;}
|
|||
.locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;}
|
||||
|
||||
/*20150612加入班级样式*/
|
||||
.add-class-box {position:fixed; width:80%; max-width:300px; min-width:240px; font-size:15px; color:#444; background-color:#fff; margin:0 auto; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; top:50%; left:50%; transform: translate(-50%,-50%);}
|
||||
.add-class-tip {padding-top:20px; padding-bottom:20px;}
|
||||
.add-class-box {position:fixed; width:80%; max-width:300px; min-width:240px; font-size:15px; color:#444; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); border-radius:5px; top:50%; left:50%; transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); -moz-transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); -o-transform: translate(-50%,-50%);}
|
||||
.add-class-tip {padding-top:1.2em; padding-bottom:.5em; font-weight:400;}
|
||||
.class-number-input {width:80%; max-width:240px; height:28px; border:1px solid #ccc; padding-left:5px; margin:0 auto; display:block;}
|
||||
.cancel-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;}
|
||||
.submit-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;}
|
||||
|
@ -209,7 +211,8 @@ a.underline {text-decoration:underline;}
|
|||
.students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;}
|
||||
.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
|
||||
.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
|
||||
.new-class-input {width:60%; color:#555; height:35px; line-height:35px; vertical-align:middle; border:none; outline:none;}
|
||||
.new-class-input {width:60%; color:#555; height:16px; line-height:16px; vertical-align:middle; border:none; outline:none; padding:8px 0;}
|
||||
.class-list-setting {position:absolute; top:10px; right:10px;}
|
||||
|
||||
/*20160616登录注册*/
|
||||
.login-wrap {padding:0 10px;}
|
||||
|
@ -221,3 +224,9 @@ a.underline {text-decoration:underline;}
|
|||
.login-box.checked:after{content:url(/images/wechat/checked.png);}
|
||||
.forget-psw-wrap {width:60px; margin:0 auto;}
|
||||
.forget-psw {position:fixed; bottom:10px;}
|
||||
|
||||
/*二级回复*/
|
||||
.mult-reply-container{ border:solid 1px #f3ddb3; background:#fffef4; padding:4px;color:#999;}
|
||||
.mult-reply-content{ color:#707070; font-size:13px;}
|
||||
.mult-reply-hide{ text-align:center; display:block; font-size:14px; color:#aaa; border-bottom:1px solid #F3DDB3; padding:8px 0;}
|
||||
.mult-reply-arrow{ color:#aaa; margin-right:10px; font-size:14px; font-weight:bold;}
|
|
@ -0,0 +1,11 @@
|
|||
FactoryGirl.define do
|
||||
factory :commit do
|
||||
repository_id 1
|
||||
version "MyString"
|
||||
committer "MyString"
|
||||
comments "MyText"
|
||||
committed_on "2016-07-21"
|
||||
project_id 1
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Commit, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue