Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	db/schema.rb
This commit is contained in:
Tim 2016-07-11 11:24:34 +08:00
commit 76803e90d1
72 changed files with 4352 additions and 2884 deletions

View File

@ -1 +1 @@
{"access_token":"oEEf8ZKAB8Y2G0o_xnTPkPJHKKk8iHkLC-f5ptvQ2nCMj9IpC86ivLD2-p38GfOkuG-HuQp3pWZqhs3NJXUMdPLWsr5k67hPZYuqg4ozLccx0xdLswapj0mn8ovZhK1tKIKiAFAOMO","expires_in":7200,"got_token_at":1467012449} {"access_token":"b_Pc60Dd5eyg_ut3cHbsjQO9EJJdj2Qj5F99o9LH9ltKSme7_FZ3Of22lWLL-K2V0siWzv-bd9PO0Dn-L1PBvIy9LhXa0qPVaFl6vTtZHR2kA8qjo1ps2ancya0t7KmzURGbAFAAXM","expires_in":7200,"got_token_at":1467976842}

5
.gitignore vendored
View File

@ -6,8 +6,7 @@
/config/database.yml /config/database.yml
/config/configuration.yml /config/configuration.yml
/config/additional_environment.rb /config/additional_environment.rb
/config/menu.yml
/config/wechat.yml
/files/* /files/*
/log/* /log/*
@ -35,3 +34,5 @@ vendor/cache
1234567 1234567
public/javascripts/wechat/node_modules/ public/javascripts/wechat/node_modules/
.ruby-version .ruby-version
.access_token
tmux*.log

View File

@ -5,8 +5,8 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv' gem 'iconv'
if RUBY_PLATFORM =~ /darwin/ if RUBY_PLATFORM =~ /darwin/
gem "rmagick", "= 2.15.4" ## osx must be this version gem "rmagick", "= 2.15.4" ## osx must be this version
else elsif RUBY_PLATFORM =~ /linux/
gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel #gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel
end end
gem 'certified' gem 'certified'
gem 'net-ssh', '2.9.1' gem 'net-ssh', '2.9.1'

114
Gemfile~ Normal file
View File

@ -0,0 +1,114 @@
source 'https://ruby.taobao.org/'
unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
gem "rmagick", ">= 2.0.0"
gem 'certified'
end
gem 'net-ssh', '2.9.1'
gem 'jenkins_api_client'
gem 'nokogiri'
gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack'
gem 'gitlab', path: 'lib/gitlab-cli'
gem 'rest-client'
gem "mysql2", "= 0.3.18"
gem 'redis-rails'
gem 'rubyzip'
gem 'delayed_job_active_record'#, :group => :production
gem 'daemons'
gem 'grape', '~> 0.9.0'
gem 'grape-entity'
gem 'rack-cors', :require => 'rack/cors'
gem 'seems_rateable', '~> 1.0.13'
gem 'rails', '~> 3.2'
gem "jquery-rails", "~> 2.0.2"
gem "i18n", "~> 0.6.0"
gem 'coderay', '~> 1.1.0'
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet'
gem 'ruby-ole'
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
gem 'binding_of_caller'
gem 'chinese_pinyin'
# gem 'sunspot_rails', '~> 1.3.3'
# gem 'sunspot_solr'
# gem 'sunspot'
# gem 'progress_bar'
gem 'ansi'
gem 'kaminari'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
### profile
#gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'
gem 'better_errors', '~> 1.1.0'
# gem "query_reviewer"
# gem 'rack-mini-profiler', '~> 0.9.3'
if RUBY_PLATFORM =~ /w32/
gem 'win32console'
end
end
group :development, :test do
unless RUBY_PLATFORM =~ /w32/
gem 'pry-rails'
if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug'
end
gem 'pry-stack_explorer'
if RUBY_PLATFORM =~ /darwin/
gem 'puma'
end
end
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
# Optional gem for LDAP authentication
group :ldap do
gem "net-ldap", "~> 0.3.1"
end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"
gem "rack-openid"
end
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
else
warn("Please configure your config/database.yml first")
end
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(file)
end

View File

@ -19,6 +19,7 @@ module Mobile
require_relative 'apis/new_comment' require_relative 'apis/new_comment'
require_relative 'apis/praise' require_relative 'apis/praise'
require_relative 'apis/resources' require_relative 'apis/resources'
require_relative 'apis/syllabuses'
class API < Grape::API class API < Grape::API
version 'v1', using: :path version 'v1', using: :path
@ -73,6 +74,7 @@ module Mobile
mount Apis::NewComment mount Apis::NewComment
mount Apis::Praise mount Apis::Praise
mount Apis::Resources mount Apis::Resources
mount Apis::Syllabuses
add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development? add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?

View File

@ -10,30 +10,44 @@ module Mobile
params do params do
requires :page, type: Integer requires :page, type: Integer
requires :token, type: String requires :token, type: String
requires :container_type, type: String
end end
post do post do
authenticate! authenticate!
user = current_user user = current_user
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) container_type = params[:container_type] ? params[:container_type] : "All"
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id)
if container_type == "All" || container_type == "Project"
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id)
user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")"
project_types = "('Message','Issue','Project')"
end
if container_type == "All" || container_type == "Course"
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id)
user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
end
page = params[:page] ? params[:page] : 0 page = params[:page] ? params[:page] : 0
user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage" principal_types = "JournalsForMessage"
watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(','))
user_ids = "(" + user.id.to_s + watched_user_ids + ")" user_ids = "(" + user.id.to_s + watched_user_ids + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
blog_ids = "(" + watched_user_blog_ids + ")" blog_ids = "(" + watched_user_blog_ids + ")"
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + if container_type == "Course"
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ activities = UserActivity.where("(container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc')
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " + elsif container_type == "Project"
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc') activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})").order('updated_at desc')
else
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc')
end
all_count = activities.count all_count = activities.count
activities = activities.limit(10).offset(page * 10) activities = activities.limit(10).offset(page * 10)
count = activities.count count = activities.count
@ -42,6 +56,7 @@ module Mobile
present :count, count present :count, count
present :page, page present :page, page
present :status, 0 present :status, 0
present :container_type, container_type
end end
end end
end end

View File

@ -7,7 +7,7 @@ module Mobile
desc "get special topic" desc "get special topic"
get ':id' do get ':id' do
user = UserWechat.find_by_openid(params[:openid]).user user = current_user
blog = BlogComment.find params[:id] blog = BlogComment.find params[:id]
present :data, blog, with: Mobile::Entities::BlogComment,user: user present :data, blog, with: Mobile::Entities::BlogComment,user: user
present :status, 0 present :status, 0

View File

@ -107,7 +107,7 @@ module Mobile
status = cs.join_course({role: "10", openid: params[:openid], invite_code: params[:invite_code]}, current_user) status = cs.join_course({role: "10", openid: params[:openid], invite_code: params[:invite_code]}, current_user)
{ {
status: status[:state], status: status[:state],
messsge:CoursesService::JoinCourseError.message(status[:state]) message:CoursesService::JoinCourseError.message(status[:state])
} }
end end
@ -396,6 +396,23 @@ module Mobile
present :status,0 present :status,0
end end
desc '删除课程'
params do
requires :token, type: String
end
post ':course_id/del' do
authenticate!
c = Course.find(params[:course_id])
# if c.members.count > 1
# {status: -1, message: '已经有成员加入,不能删除'}
# else
c.delete!
present :status,0
# end
end
end end
end end
end end

View File

@ -46,10 +46,26 @@ module Mobile
end end
desc '发送资源'
params do
requires :token, type: String
requires :course_ids, type: Array[Integer]
requires :send_id, type: Integer
end
post 'send' do
authenticate!
rs = ResourcesService.new
ori, flag, save_message = rs.send_resource_to_course(current_user,params)
if flag
present :status, 0
else
{status: -1, message: save_message.first}
end
end
end end
end end
end end
end end

View File

@ -0,0 +1,103 @@
#coding=utf-8
module Mobile
module Apis
class Syllabuses < Grape::API
resources :syllabuses do
desc "获取大纲列表"
params do
requires :token, type: String
end
get do
authenticate!
cs = SyllabusesService.new
courses = cs.user_syllabus(current_user)
present :data, courses, with: Mobile::Entities::Syllabus
present :status, 0
end
desc "获取某个大纲"
params do
requires :token, type: String
end
get ':id' do
authenticate!
ss = SyllabusesService.new
sy = ::Syllabus.find(params[:id])
sy.courses = sy.courses.not_deleted
sy = ss.judge_can_setting(sy,current_user)
present :data, sy, with: Mobile::Entities::Syllabus
present :status, 0
end
desc "获取新建大纲的权限"
params do
requires :token, type: String
end
post 'auth' do
authenticate!
auth = 0
if (current_user.user_extensions && current_user.user_extensions.identity == 0 && current_user.allowed_to?(:add_course, nil, :global => true))
auth = 1
end
present :auth, auth
end
desc "新建大纲"
params do
requires :token, type: String
requires :title, type: String, desc: '大纲标题'
requires :courses, type: Array[String], desc: '课程名'
end
post do
authenticate!
ss = SyllabusesService.new
sy = ss.create(current_user, params[:title],
params[:courses].map{|c| {name: c} })
if sy.new_record?
{status:-1, message: '创建大纲失败' }
else
present :data, sy, with: Mobile::Entities::Syllabus
present :status, 0
end
end
desc '编辑大纲'
params do
requires :token, type: String
requires :title, type: String, desc: '大纲标题'
# requires :add_courses, type: Array[String], desc: '课程名'
# requires :modify_courses, type: Array[Integer,String], desc: '课程名'
end
post ':id/edit' do
authenticate!
ss = SyllabusesService.new
#修改课程大纲
status = ss.edit(current_user, params)
if status == -1
{status:status, message: '修改课程信息失败' }
else
present :status, status
end
end
end
end
end
end

View File

@ -53,10 +53,20 @@ module Mobile
requires :password, type: String, desc: 'password' requires :password, type: String, desc: 'password'
end end
post do post do
openid = session[:wechat_openid]
logger.debug "openid ============== #{openid}"
raise "无法获取到openid,请在微信中打开本页面" unless openid
us = UsersService.new us = UsersService.new
user = us.register params.merge(:password_confirmation => params[:password], user = us.register params.merge(:password_confirmation => params[:password],
:should_confirmation_password => true) :should_confirmation_password => true)
raise "该邮箱已经被注册过了" if user.new_record? raise user.errors.full_messages.first if user.new_record?
UserWechat.create!(
openid: openid,
user: user
)
present :data, user, with: Mobile::Entities::User present :data, user, with: Mobile::Entities::User
present :status, 0 present :status, 0

View File

@ -15,6 +15,8 @@ module Mobile
#f.img_url if f.respond_to?(:img_url) #f.img_url if f.respond_to?(:img_url)
elsif field == :created_at || field == :updated_at elsif field == :created_at || field == :updated_at
(format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field)) (format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field))
elsif field == :member_count
::Course===c ? c.members.count : 0
else else
(c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field)) (c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field))
end end
@ -49,6 +51,8 @@ module Mobile
course_expose :qrcode course_expose :qrcode
course_expose :updated_at course_expose :updated_at
course_expose :course_student_num course_expose :course_student_num
course_expose :member_count
course_expose :can_setting
expose :teacher, using: Mobile::Entities::User do |c, opt| expose :teacher, using: Mobile::Entities::User do |c, opt|
if c.is_a? ::Course if c.is_a? ::Course
c.teacher c.teacher

View File

@ -0,0 +1,13 @@
module Mobile
module Entities
class Syllabus < Grape::Entity
include ApplicationHelper
expose :title
expose :id
expose :can_setting
expose :courses, using: Mobile::Entities::Course
end
end
end

View File

@ -1090,7 +1090,7 @@ class CoursesController < ApplicationController
#删除课程 #删除课程
#删除课程只是将课程的is_deleted状态改为falseis_deleted为false状态的课程只有管理员可以看到 #删除课程只是将课程的is_deleted状态改为falseis_deleted为false状态的课程只有管理员可以看到
def destroy def destroy
@course.update_attributes(:is_delete => true) @course.delete!
@course = nil @course = nil
redirect_to user_url(User.current) redirect_to user_url(User.current)
end end

View File

@ -71,18 +71,21 @@ class QualityAnalysisController < ApplicationController
# 判断调用sonar分析是否成功 # 判断调用sonar分析是否成功
# 等待启动时间处理, 最长时间为30分钟 # 等待启动时间处理, 最长时间为30分钟
for i in 0..60 do for i in 0..360 do
sleep(30) sleep(5)
@current_build_status = @client.job.get_current_build_status("#{job_name}") @current_build_status = @client.job.get_current_build_status("#{job_name}")
if (@current_build_status == "success" || @current_build_status == "failure") if (@current_build_status == "success" || @current_build_status == "failure")
break break
if i == 60 if i == 360
@build_console_result = false @build_console_result = false
break break
end end
end end
end end
# sonar 缓冲,取数据
sleep(5)
# 获取sonar output结果 # 获取sonar output结果
console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"] console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
logger.info("@current_build_status is ==> #{@current_build_status}") logger.info("@current_build_status is ==> #{@current_build_status}")

View File

@ -1046,11 +1046,12 @@ class UsersController < ApplicationController
homework_detail_group.save if homework_detail_group homework_detail_group.save if homework_detail_group
if homework.homework_type != 3 if homework.homework_type != 3
unless homework.course.nil? students = homework.course.student
if !homework.course.nil? && !students.empty?
name = homework.name name = homework.name
name_str = name + "的作品提交" name_str = name + "的作品提交"
str = "" str = ""
homework.course.student.each do |student| students.each do |student|
if str != "" if str != ""
str += "," str += ","
end end
@ -2021,44 +2022,8 @@ class UsersController < ApplicationController
def add_exist_file_to_course def add_exist_file_to_course
@flag = true @flag = true
if params[:send_id].present? if params[:send_id].present?
send_id = params[:send_id] rs = ResourcesService.new
@ori = Attachment.find_by_id(send_id) @ori, @flag, @save_message = rs.send_resource_to_course(params)
course_ids = params[:course_ids]
if course_ids.nil?
@flag = false
end
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
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.current.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)
end
@save_message = attach_copied_obj.errors.full_messages
end
end
elsif params[:send_ids].present? elsif params[:send_ids].present?
send_ids = params[:send_ids].split(",") send_ids = params[:send_ids].split(",")
course_ids = params[:course_ids] course_ids = params[:course_ids]

View File

@ -8,7 +8,11 @@ class WechatsController < ActionController::Base
# default text responder when no other match # default text responder when no other match
on :text do |request, content| on :text do |request, content|
#邀请码 #邀请码
sendBindClass(request, {invite_code: content}) if join_request(request)
sendBindClass(request, {invite_code: content})
else
request.reply.text '您的意见已收到,感谢您的反馈!'
end
end end
# When receive 'help', will trigger this responder # When receive 'help', will trigger this responder
@ -142,6 +146,11 @@ class WechatsController < ActionController::Base
end end
end end
def join_request(request)
openid = request[:FromUserName]
wl = WechatLog.where("openid = '#{openid}' and request_raw like '%\"Event\":\"click\"%'").order('id desc').first
wl && JSON(wl.request_raw)["EventKey"] == 'JOIN_CLASS'
end
def sendBindClass(request, params) def sendBindClass(request, params)
begin begin

View File

@ -3282,7 +3282,7 @@ end
def strip_html(text,len=0,endss="...") def strip_html(text,len=0,endss="...")
ss = "" ss = ""
if text.length>0 if !text.nil? && text.length>0
ss=text.gsub(/<\/?.*?>/, '').strip ss=text.gsub(/<\/?.*?>/, '').strip
ss = ss.gsub(/&nbsp;/, ' ') ss = ss.gsub(/&nbsp;/, ' ')

View File

@ -388,6 +388,21 @@ module UsersHelper
return result return result
end end
#获取指定用户的课程大纲
def user_syllabus(user)
results = []
courses = user_courses_list(user)
other = Syllabus.new(title: '未命名课程')
courses.each do |c|
other << c unless c.syllabus
end
user.syllabuses.to_a << other
end
#获取用户参与的公开的课程列表 #获取用户参与的公开的课程列表
def user_public_course_list user def user_public_course_list user
membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))

View File

@ -4,6 +4,8 @@ require 'elasticsearch/model'
class Course < ActiveRecord::Base class Course < ActiveRecord::Base
include Redmine::SafeAttributes include Redmine::SafeAttributes
include CoursesHelper
STATUS_ACTIVE = 1 STATUS_ACTIVE = 1
STATUS_CLOSED = 5 STATUS_CLOSED = 5
STATUS_ARCHIVED = 9 STATUS_ARCHIVED = 9
@ -22,7 +24,7 @@ class Course < ActiveRecord::Base
end end
end end
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier #belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表 belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -69,8 +71,10 @@ class Course < ActiveRecord::Base
validates_presence_of :term,:name validates_presence_of :term,:name
validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/ validates_format_of :time, :with => /^\d{4}$/
validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]*$/
validates_length_of :description, :maximum => 10000 validates_length_of :description, :maximum => 10000
before_save :self_validate before_save :self_validate
# 公开课程变成私有课程,所有资源都变成私有 # 公开课程变成私有课程,所有资源都变成私有
after_update :update_files_public,:update_course_ealasticsearch_index after_update :update_files_public,:update_course_ealasticsearch_index
@ -169,6 +173,10 @@ class Course < ActiveRecord::Base
) )
end end
def delete!
update_attribute(:is_delete, true)
end
def visible?(user=User.current) def visible?(user=User.current)
user.allowed_to?(:view_course, self) user.allowed_to?(:view_course, self)
end end
@ -296,6 +304,13 @@ class Course < ActiveRecord::Base
end end
end end
def update_default_value
self.time = Time.now.year unless time
self.term = cur_course_term unless term
self.class_period = 10 unless class_period
end
# 创建课程讨论区 # 创建课程讨论区
def create_board_sync def create_board_sync
@board = self.boards.build @board = self.boards.build
@ -480,7 +495,7 @@ class Course < ActiveRecord::Base
def generate_qrcode def generate_qrcode
ticket = self.qrcode ticket = self.qrcode
if !ticket || ticket.size < 10 if !ticket || ticket.size < 10
response = Wechat.api.qrcode_create_scene(invite_code) response = Wechat.api.qrcode_create_scene(invite_code, 2592000)
logger.debug "response = #{response}" logger.debug "response = #{response}"
self.qrcode = response['ticket'] self.qrcode = response['ticket']
save! && reload save! && reload

View File

@ -9,8 +9,10 @@ class Syllabus < ActiveRecord::Base
belongs_to :user belongs_to :user
has_many :courses has_many :courses
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
attr_accessible :user_id, :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
safe_attributes 'title', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course' safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'
validates :title, :user_id, presence: true
scope :like, lambda {|arg| scope :like, lambda {|arg|
if arg.blank? if arg.blank?

4
app/models/wechat_log.rb Normal file
View File

@ -0,0 +1,4 @@
#coding=utf-8
#
class WechatLog < ActiveRecord::Base
end

View File

@ -44,6 +44,8 @@ class CoursesService
} }
end end
#搜索课程 #搜索课程
def search_course params,current_user def search_course params,current_user
courses_all = Course.all_course courses_all = Course.all_course
@ -324,9 +326,9 @@ class CoursesService
define_error [ define_error [
0, '加入成功', 0, '加入成功',
1, '密码错误', 1, '密码错误',
2, '班级已过期 请联系班级管理员重启班级。', 2, '课程已过期 请联系课程管理员重启课程。',
3, '您已经加入了班级', 3, '您已经加入了课程',
4, '您加入的班级不存在', 4, '您的邀请码不正确',
5, '您还未登录', 5, '您还未登录',
6, '申请成功,请等待审核完毕', 6, '申请成功,请等待审核完毕',
7, '您已经发送过申请了,请耐心等待', 7, '您已经发送过申请了,请耐心等待',

View File

@ -0,0 +1,53 @@
#coding=utf-8
class ResourcesService
#发送资源到课程
def send_resource_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
end

View File

@ -0,0 +1,143 @@
#coding=utf-8
class SyllabusesService
include ApplicationHelper
include CoursesHelper
def judge_can_setting(sy,user)
sy[:can_setting] = sy[:user_id] == user.id ? true : false
sy[:can_setting] = false if sy[:id].nil?
sy.courses.each do |c|
c[:can_setting] = false
member = c.members.where("user_id=#{user.id} and course_id=#{c.id}")[0]
roleName = member.roles[0].name if member
if roleName && (roleName == "TeachingAsistant" || roleName == "Teacher" )
c[:can_setting] = true
end
if c.tea_id == user.id
c[:can_setting] = true
end
end
sy
end
#获取指定用户的课程大纲
def user_syllabus(user)
courses = CoursesService.new.user_courses_list(user)
other = Syllabus.new(title: '未命名课程',user_id: user.id)
courses.each do |c|
other.courses << c[:course] unless c[:course].syllabus
end
# user.syllabuses.each do |syllabus|
# syllabus.courses = syllabus.courses.not_deleted
# end
#
# user.syllabuses.to_a << other
courses = user.courses.not_deleted
syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
syllabuses.each do |syllabus|
syllabus.courses = courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc")
end
syllabuses.to_a << other
#管理权限 can_setting
syllabuses.each do |s|
s = judge_can_setting(s,user)
end
syllabuses
end
def after_create_course(course, user)
#unless User.current.admin?
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => user, :roles => [r])
m.project_id = -1
course_info = CourseInfos.new(:user_id => user.id, :course_id => course.id)
#user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
course.members << m
course.course_infos << course_info
end
#创建大纲
# params {title: '大纲名称', [{course}, {course}]}
def create(user, title, courses = [])
sy = Syllabus.new(title: title, user_id: user.id)
ActiveRecord::Base.transaction() do
sy.save!
courses.each do |course|
if ::Course === course
course.syllabus_id = sy.id
course.save!
elsif Hash === course
c = ::Course.new(course)
c.tea_id = user.id
c.syllabus_id = sy.id
c.update_default_value
c.is_public = 0
c.save!
after_create_course(c, user)
end
end
end
sy[:can_setting] = true
sy
end
#修改课程大纲的名称、班级名称、新增班级
def edit(user, option)
courses = []
status = -1
syllabus_id = option[:id]
sy = Syllabus.where("id=?",option[:id]).first
if sy && sy.user_id == user.id
syllabus_title = option[:title]
sy.title = syllabus_title
sy.save!
#修改班级名称
modify_courses = option[:modify_courses]
modify_courses.each do |c|
course = Course.where("id=?",c.id).first
if course && course.tea_id == user.id
course.name = c.name
!course.save
end
end
#新增班级
add_courses = option[:add_courses]
add_courses.each do |c|
course = Course.new()
course.name = c
course.tea_id = user.id
course.syllabus_id = sy.id
course.update_default_value
course.is_public = 0
course.save!
after_create_course(course, user)
end
status = 0
end
status
end
end

View File

@ -319,4 +319,8 @@ class UsersService
my_jours_arr my_jours_arr
end end
end end

View File

@ -0,0 +1,3 @@
<span>
<a title="<%= course.name %>" id="rename_course_name_<%= course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name %></a>
</span>

View File

@ -68,10 +68,8 @@
</td> </td>
<td class="center"> <td class="center">
</td> </td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'> <td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>' id="syllabus_course_name_<%=course.id %>">
<span> <%= render :partial => 'admin/rename_course_name', :locals => {:course => course} %>
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
</span>
</td> </td>
<td align="center"> <td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>

View File

@ -1 +1 @@
$("#rename_course_name_<%=@course.id %>").html("<%=@course.name %>"); $("#syllabus_course_name_<%=@course.id %>").html("<%=escape_javascript(render :partial => 'admin/rename_course_name', :locals => {:course => @course}) %>");

View File

@ -78,27 +78,27 @@
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=BLOCKER" class="fontBlue2 w70 pInline"> <a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=BLOCKER" class="fontBlue2 w70 pInline">
<%= @ha["blocker_violations"].nil? ? 0 : @ha["blocker_violations"] %> <%= @ha["blocker_violations"].nil? ? 0 : @ha["blocker_violations"] %>
</a> </a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@ha["blocker_violations"].nil? ? 0 : statistics_result_percentage(@ha["blocker_violations"].to_i, 1000) %>%;"></span></span></div> <span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@ha["blocker_violations"].nil? ? 0 : statistics_result_percentage(@ha["blocker_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span> <div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=CRITICAL" class="fontBlue2 w70 pInline"> <a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=CRITICAL" class="fontBlue2 w70 pInline">
<%= @ha["critical_violations"].nil? ? 0 : @ha["critical_violations"] %> <%= @ha["critical_violations"].nil? ? 0 : @ha["critical_violations"] %>
</a> </a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["critical_violations"].nil? ? 0 : statistics_result_percentage(@ha["critical_violations"].to_i, 1000) %>%;"></span></span></div> <span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["critical_violations"].nil? ? 0 : statistics_result_percentage(@ha["critical_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span> <div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MAJOR" class="fontBlue2 w70 pInline"> <a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MAJOR" class="fontBlue2 w70 pInline">
<%= @ha["major_violations"].nil? ? 0 : @ha["major_violations"] %> <%= @ha["major_violations"].nil? ? 0 : @ha["major_violations"] %>
</a> </a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["major_violations"].nil? ? 0 : statistics_result_percentage(@ha["major_violations"].to_i, 1000) %>%;"></span></span></div> <span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["major_violations"].nil? ? 0 : statistics_result_percentage(@ha["major_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span> <div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MINOR" class="fontBlue2 w70 pInline"> <a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MINOR" class="fontBlue2 w70 pInline">
<%= @ha["minor_violations"].nil? ? 0 : @ha["minor_violations"] %> <%= @ha["minor_violations"].nil? ? 0 : @ha["minor_violations"] %>
</a> </a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["minor_violations"].nil? ? 0 : statistics_result_percentage(@ha["minor_violations"].to_i, 1000) %>%;"></span></span></div> <span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["minor_violations"].nil? ? 0 : statistics_result_percentage(@ha["minor_violations"].to_i, 3000) %>%;"></span></span></div>
<div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span> <div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=INFO" class="fontBlue2 w70 pInline"> <a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=INFO" class="fontBlue2 w70 pInline">
<%= @ha["info_violations"].nil? ? 0 : @ha["info_violations"] %> <%= @ha["info_violations"].nil? ? 0 : @ha["info_violations"] %>
</a> </a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["info_violations"].nil? ? 0 : statistics_result_percentage(@ha["info_violations"].to_i, 200) %>%;"></span></span></div> <span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["info_violations"].nil? ? 0 : statistics_result_percentage(@ha["info_violations"].to_i, 3000) %>%;"></span></span></div>
</div> </div>
</div> </div>
<div class="analysis-tag-wrap f16"> <div class="analysis-tag-wrap f16">

View File

@ -27,30 +27,32 @@
</div> </div>
<script src="https://dn-demotest.qbox.me/angular.all.min.js"></script> <script src="https://dn-demotest.qbox.me/angular.all.min.js"></script>
<!--<script src="/javascripts/wechat/build/angular.all.min.js"></script>--> <!-- <script src="/javascripts/wechat/build/angular.all.min.js"></script> -->
<script src="/javascripts/wechat/build/app.min.js"></script> <script src="/javascripts/wechat/build/app.min.js?version=20160709-0920"></script>
<!--<script src="/javascripts/wechat/app.js"></script>--> <!-- <script src="/javascripts/wechat/app.js"></script> -->
<!--<script src="/javascripts/wechat/others/factory.js"></script>--> <!-- <script src="/javascripts/wechat/others/factory.js"></script> -->
<!--<script src="/javascripts/wechat/others/filter.js"></script>--> <!-- <script src="/javascripts/wechat/others/filter.js"></script> -->
<!--<script src="/javascripts/wechat/directives/alert.js"></script>--> <!-- <script src="/javascripts/wechat/directives/alert.js"></script> -->
<!--<script src="/javascripts/wechat/directives/form_validate.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/input_auto.js"></script> -->
<!--<script src="/javascripts/wechat/directives/loading_spinner.js"></script>--> <!-- <script src="/javascripts/wechat/directives/loading_spinner.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/reg.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/reg.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/invite_code.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/invite_code.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/login.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/login.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/activity.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/activity.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/new_class.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/new_class.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/blog.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/edit_class.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/course_notice.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/blog.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/discussion.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/course_notice.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/homework.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/discussion.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/issue.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/homework.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/journals.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/issue.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/class.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/journals.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/class_list.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/class.js"></script> -->
<!--<script src="/javascripts/wechat/controllers/myresource.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/class_list.js"></script> -->
<!--<script src="/javascripts/wechat/others/routes.js"></script>--> <!-- <script src="/javascripts/wechat/controllers/myresource.js"></script> -->
<!-- <script src="/javascripts/wechat/controllers/send_class_list.js"></script> -->
<!-- <script src="/javascripts/wechat/others/routes.js"></script> -->
</body> </body>
</html> </html>

View File

@ -2,7 +2,7 @@ button:
- -
type: "view" type: "view"
name: "我的动态" name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://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=123#wechat_redirect"
- -
name: "我的课程" name: "我的课程"
sub_button: sub_button:

View File

@ -0,0 +1,32 @@
button:
-
type: "view"
name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
-
name: "我的课程"
sub_button:
-
type: "view"
name: "课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
-
type: "view"
name: "资源"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=http://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
-
name: "更多"
sub_button:
-
type: "click"
name: "加入班级"
key: "JOIN_CLASS"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
-
type: "view"
name: "历史推文"
url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect"

35
config/menu.yml.test Normal file
View File

@ -0,0 +1,35 @@
button:
-
type: "view"
name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_b
ase&state=activities#wechat_redirect"
-
name: "我的课程"
sub_button:
-
type: "view"
name: "课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi
_base&state=class_list#wechat_redirect"
-
type: "view"
name: "资源"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi
_base&state=myresource#wechat_redirect"
-
name: "更多"
sub_button:
-
type: "click"
name: "加入班级"
key: "JOIN_CLASS"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
-
type: "view"
name: "历史推文"
url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect"

View File

@ -2,20 +2,24 @@ default: &default
# corpid: "corpid" # corpid: "corpid"
# corpsecret: "corpsecret" # corpsecret: "corpsecret"
# agentid: 1 # agentid: 1
# Or if using public account, only need above two line #
#- # guange test
# guange test
#appid: "wxf694495398c7d470" #appid: "wxf694495398c7d470"
#secret: "743e038392f1d89540e95f8f7645849a" #secret: "743e038392f1d89540e95f8f7645849a"
#production
appid: "wx8e1ab05163a28e37" appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841" secret: "beb4d3bc4b32b3557811680835357841"
#test
#appid: "wxc09454f171153c2d"
#secret: "dff5b606e34dcafe24163ec82c2715f8"
token: "123456" token: "123456"
access_token: ".access_token" access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw" encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "tmp/wechat_jsapi_ticket" jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template #template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc" binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"

33
config/wechat.yml.test Normal file
View File

@ -0,0 +1,33 @@
default: &default
# corpid: "corpid"
# corpsecret: "corpsecret"
# agentid: 1
# Or if using public account, only need above two line
# guange test
#appid: "wxf694495398c7d470"
#secret: "743e038392f1d89540e95f8f7645849a"
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: ".access_token"
encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "tmp/wechat_jsapi_ticket"
#template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
production:
<<: *default
development:
<<: *default
test:
<<: *default

View File

@ -0,0 +1,8 @@
class RenewQrcode < ActiveRecord::Migration
def up
Course.update_all(:qrcode => '')
end
def down
end
end

View File

@ -0,0 +1,5 @@
class AddIndexOpenidToWechatLogs < ActiveRecord::Migration
def change
add_index(:wechat_logs, :openid)
end
end

File diff suppressed because it is too large Load Diff

View File

@ -39,23 +39,23 @@ namespace :update_homework do
end end
end end
s_time = time s_time = time
logger.info("latest time is =========================> #{time}") puts "latest time is =========================> #{time}"
if time.strftime('%Y-%m-%d %H:%M:%S') > h.updated_at.strftime('%Y-%m-%d %H:%M:%S') if time.strftime('%Y-%m-%d %H:%M:%S') > h.updated_at.strftime('%Y-%m-%d %H:%M:%S')
h.update_column('updated_at', s_time) h.update_column('updated_at', s_time)
course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", 'HomeworkCommon', h.id).first course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", 'HomeworkCommon', h.id).first
if course_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > course_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) if course_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > course_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
course_activity.update_column('updated_at', s_time) course_activity.update_column('updated_at', s_time)
logger.info("course_activity time is =========================> #{course_activity}") puts "user_activity time is =========================> #{course_activity}"
end end
user_activity = UserActivity.where("act_type=? and act_id =?", 'HomeworkCommon', h.id).first user_activity = UserActivity.where("act_type=? and act_id =?", 'HomeworkCommon', h.id).first
if user_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > user_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) if user_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > user_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
user_activity.update_column('updated_at', s_time) user_activity.update_column('updated_at', s_time)
logger.info("user_activity time is =========================> #{user_activity}") puts "user_activity time is =========================> #{user_activity}"
end end
org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", 'HomeworkCommon', h.id).first org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", 'HomeworkCommon', h.id).first
if org_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > org_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S')) if org_activity && (time.strftime('%Y-%m-%d %H:%M:%S') > org_activity.updated_at.strftime('%Y-%m-%d %H:%M:%S'))
org_activity.update_column('updated_at', s_time) org_activity.update_column('updated_at', s_time)
logger.info("org_activity time is =========================> #{s_time}") puts "org_activity time is =========================> #{org_activity}"
end end
end end
end end

View File

@ -2,43 +2,56 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div class="class-detail-name">我的动态</div>
<!--<div class="tab-wrap">-->
<!--<a id="class_tab_1" href="javascript:void(0);" class="weixin-tab class-tab-active" ng-click="HoverLi(1)">所有动态<span id="tab_arrow_1" class="tab-active-arrow"></span></a>-->
<!--<a id="class_tab_2" href="javascript:void(0);" class="weixin-tab" ng-click="HoverLi(2)">课程动态<span id="tab_arrow_2" class="tab-active-arrow undis"></span></a>-->
<!--<a id="class_tab_3" href="javascript:void(0);" class="weixin-tab" ng-click="HoverLi(3)">项目动态<span id="tab_arrow_3" class="tab-active-arrow undis"></span></a>-->
<!--</div>-->
<div class="tab-wrap">
<a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a>
</div>
<div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="act in activities"> <div ng-repeat="act in activities">
<div ng-if="act.container_type=='Course'">
<div ng-if="act.container_type=='Course' ">
<div ng-if="act.act_type=='HomeworkCommon'"> <div ng-if="act.act_type=='HomeworkCommon'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('homework',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('homework',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"> <div class="post-dynamic-author hidden fl">
<a herf="javascript:void(0);"> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span> <span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span> <img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
</a></div> <img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<div class="post-title hidden"> </div>
<a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div> <div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title mt5 mb5 hidden"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【作业】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br /> <span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<span ng-if="act.homework_common_detail.homework_type == 1" class="c-grey f12 fl mr15">普通作业</span> <div class="fr f13">
<span ng-if="act.homework_common_detail.homework_type == 2" class="c-grey f12 fl mr15">编程作业</span> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<span ng-if="act.homework_common_detail.homework_type == 3" class="c-grey f12 fl mr15">分组作业</span> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
@ -48,28 +61,33 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('course_notice',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('course_notice',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><a herf="javascript:void(0);" class="f13 c-grey2">{{act.course_project_name}}</a></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【通知】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span> <div class="fr f13">
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
@ -79,28 +97,34 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('course_discussion',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('course_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span> <div class="fr f13">
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
@ -111,8 +135,8 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 课程</span></div> <div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 班级</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div> <div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
@ -121,35 +145,40 @@
</div> </div>
</div> </div>
<div ng-if="act.container_type=='Project'"> <div ng-if="act.container_type=='Project' ">
<div ng-if="act.act_type=='Issue'"> <div ng-if="act.act_type=='Issue'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br /> <span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span> <span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span> <div class="fr f13">
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
@ -160,28 +189,33 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span> <div class="fr f13">
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
@ -191,7 +225,7 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div> <div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div> <div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div> <div class="cl"></div>
@ -201,73 +235,318 @@
</div> </div>
</div> </div>
<div ng-if="act.container_type=='Principal'"> <div ng-if="act.container_type=='Principal' ">
<div ng-if="act.act_type=='JournalsForMessage'"> <div ng-if="act.act_type=='JournalsForMessage'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('journal_for_message',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('journal_for_message',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><span class="f12 c-grey">留言</span></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="cl"></div> <div class="post-content c-grey3 mt10 mb10">
<div class="post-content c-grey3 mt5 mb5">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">留言</span></div>
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div class="fr f13">
<a ng-if="!act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div ng-if="act.act_type=='BlogComment'"> <div ng-if="act.act_type=='BlogComment' ">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('blog_comment',act.act_id, act.id)" id="act_{{act.id}}"> <div dataID = "{{act.act_id}}" ng-click="goDetail('blog_comment',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div> <div class="post-dynamic-author hidden fl">
<div class="post-title hidden"><span class="f12 c-grey">博客</span></div> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-dynamic-title c-grey3 hidden mt12 fb">【博客】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3"> <div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-op-banner"> <div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">博客</span></div>
<span class="c-grey f12 fl">{{act.latest_update}}</span> <div class="fr f13">
<a ng-if="!act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">回复</span></a> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<a ng-if="act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" class="mr5 mt3" /><span style="vertical-align:top;">{{act.reply_count}}</span></a> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block"></span></div> <div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" class="mr5 mt3" /><span class="num-block">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div> </div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div ng-if="has_more">
<div ng-if="has_more"> <div id="more_activities" class="more-events mt10" ng-click="loadActData(1,page+1);">更多</div>
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div> </div>
</div> </div>
<div ng-class="{'undis': currentTab!=2}">
<div ng-repeat="act in course_activities">
<div ng-if="act.container_type=='Course' ">
<div ng-if="act.act_type=='HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('homework',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='News'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('course_notice',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('course_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Course'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 课程</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-if="course_has_more">
<div id="more_course_activities" class="more-events mt10" ng-click="loadActData(2,course_page+1);">更多</div>
</div>
</div>
<div ng-class="{'undis': currentTab!=3}">
<div ng-repeat="act in project_activities">
<div ng-if="act.container_type=='Project' ">
<div ng-if="act.act_type=='Issue'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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-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 />
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Project'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-if="project_has_more">
<div id="more_project_activities" class="more-events mt10" ng-click="loadActData(3,project_page+1);">更多</div>
</div>
</div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible"></my-alert>
</div> </div>

View File

@ -3,47 +3,64 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="blog.act_type == 'BlogComment'"> <div ng-if="blog.act_type == 'BlogComment'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span><img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="post-title"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div> <div class="post-avatar fl mr10"><img ng-src="{{blog.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{blog.user.realname}}
<img ng-if="blog.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="blog.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{blog.title}}<img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt10"><span class="mr10">博客</span><span>{{blog.created_at}}</span></div>
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="blog.content|safeHtml"></div> <div class="f13 c-grey3 mt10 text-control" ng-bind-html="blog.content|safeHtml"></div>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{blog.created_at}}</span> <div class="fr f13">
<div ng-if="!blog.praise_count" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="blog.praise_count && !blog.has_praise" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
<div ng-if="blog.has_praise" ng-click="decreasePraise(blog);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{blog.comment_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{blog.comment_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div>
</div>
<div id="all_blog_reply"> <div id="all_blog_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children">
<div ng-if="blog.blog_comment_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in blog.blog_comment_children">
<div class="post-reply-row"> <div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="ml55"> <div class="post-dynamic-author hidden fl">
<div class="post-reply-user hidden">{{journal.user.realname}}</div> {{journal.user.realname}}
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-date fl">{{journal.lasted_comment}}</div> <img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div>
</div> </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="cl"></div>
</div>
</div>
</div>
<div ng-if="!blog.locked" id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
<div ng-if="!blog.locked" class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,18 +1,21 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>
<div class="class-detail-name">{{course.name}}<span ng-click="invite()" class="f13 blue-title-sub">邀请码</span></div> <div class="class-detail-name">{{course.name}}<span ng-click="invite()" class="f13 blue-title-sub">邀请码</span></div>
<div class="slice3 fl"></div> <div class="tab-wrap">
<a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a>
<div ng-repeat="menu in menus">
<div id="class_tab_1" ng-class="[{'class-detail-tab': isTeacher},{'class-detail-tab3': !isTeacher},{'class-tab-active':currentTab==$index+1}]" ng-click="tab($index+1);"><a herf="javascript:void(0);">{{menu}}</a></div>
<div ng-if="!$last" class="slice2 fl">
<div class="slice-line2"></div>
</div>
</div> </div>
<!--<div class="slice3 fl"></div>-->
<div class="slice3 fl"></div>
<div class="cl"></div> <!--<div ng-repeat="menu in menus">-->
<!--<div id="class_tab_1" ng-class="[{'class-detail-tab': isTeacher},{'class-detail-tab3': !isTeacher},{'class-tab-active':currentTab==$index+1}]" ng-click="tab($index+1);"><a herf="javascript:void(0);">{{menu}}</a></div>-->
<!--<div ng-if="!$last" class="slice2 fl">-->
<!--<div class="slice-line2"></div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="slice3 fl"></div>-->
<!--<div class="cl"></div>-->
<div class="class-search-wrap"> <div class="class-search-wrap">
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" /> <div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" /> <input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
@ -20,8 +23,8 @@
</div> </div>
<div ng-class="{'undis': !showResources}"> <div ng-class="{'undis': !showResources}">
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r)">发送</a></div>
<p ng-show="resources.length<=0" class="class-test-tip">暂无课件,<br /> <p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站,在PC浏览器中上传课件。</p> 请登录Trustie网站,在PC浏览器中上传课件。</p>
</div> </div>
<div ng-class="{'undis': !showClassMate}"> <div ng-class="{'undis': !showClassMate}">
@ -37,15 +40,15 @@
</div> </div>
<div ng-class="{'undis': !showHomework}"> <div ng-class="{'undis': !showHomework}">
<div ng-repeat="r in homeworks|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in homeworks|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span></div>
<p ng-show="homeworks.length<=0" class="class-test-tip">暂无作业,<br /> <p ng-show="homeworks_tag == true && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
请登录Trustie网站,在PC浏览器中上传作业。</p> 请登录Trustie网站,在PC浏览器中上传作业。</p>
</div> </div>
<div ng-class="{'undis': !showTestcase}"> <div ng-class="{'undis': !showTestcase}">
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span></div>
<p ng-show="exercises.length<=0" class="class-test-tip">暂无小测验,<br /> <p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无小测验,<br />
请登录Trustie网站,在PC浏览器中上传小测验。</p> 请登录Trustie网站,在PC浏览器中上传小测验。</p>
</div> </div>

View File

@ -1,21 +1,25 @@
<div class="post-container" style="padding-bottom: 50px;"> <div class="post-container" style="padding-bottom: 50px;">
<div loading-spinner></div> <div loading-spinner></div>
<div class="blue-title">课程列表</div> <div class="blue-title">课程列表</div>
<div class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" width="15" class="fl ml10 mt11 retract-btn undis" /><span class="fl ml10">未命名课程</span><img src="/images/wechat/setting.png" width="15" class="fr mr10 mt10" /></div>
<ul class="class-list f13 c-grey3"> <div ng-repeat="syllabus in syllabuses">
<li ng-click="goClass(course.id)" ng-repeat="course in courses" ng-class="{'border-bottom-none': $last}"> <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><img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="fr mr10 mt10" ng-click="onSetting(syllabus)" /></div>
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /> <ul ng-show="!syllabus.show_plus" class="class-list f13 c-grey3">
<span class="fl ml10 class-list-name hidden">{{course.name}}</span> <li ng-show="course.id" ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
<span class="fr c-grey4">&gt;</span> <img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
<span class="students-amount f12 fr mt10">{{course.course_student_num}}人</span> <span class="fl ml10 class-list-name hidden">{{course.name}}</span>
</li> <span class="fr c-grey4">&gt;</span>
</ul> <span class="students-amount f12 fr mt10">{{course.member_count}}人</span>
</li>
</ul>
</div>
<div class="bottom-tab-wrap mt10"> <div class="bottom-tab-wrap mt10">
<a ng-click="newClass()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">新建课程</a> <a ng-click="newClass()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">新建课程</a>
<a href="javascript:void(0);" class="weixin-tab link-blue2 border-top">加入班级</a> <a ng-click="joinClass()" class="weixin-tab link-blue2 border-top">加入班级</a>
<a ng-click="goResource()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">我的资源</a> <a ng-click="goResource()" href="javascript:void(0);" class="weixin-tab link-blue2 border-top">我的资源</a>
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
</div> </div>

View File

@ -4,53 +4,59 @@
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div> <div class="post-avatar fl mr10"><img ng-src="{{discussion.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<table class="post-detail-info"><tr> <div class="post-dynamic-author hidden fl">
<td class="text-nowrap v-top">发布者:</td> {{discussion.user.realname}}
<td>{{discussion.user.realname}}</td> <img ng-if="discussion.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
</tr> <img ng-if="discussion.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<tr> </div>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;班级问答区</td>
</tr></table>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span> <div class="post-dynamic-title c-grey3 mt12 fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{discussion.course_project_name}} - 课程问答区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>
<div class="fr f13">
<div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="discussion.praise_count && !discussion.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
<div ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{discussion.replies_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div> </div>
<div id="all_course_message_reply"> <div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children"> <div ng-if="discussion.message_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-row"> <div class="post-reply-wrap" ng-repeat="journal in discussion.message_children">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-reply-row">
<div class="ml55"> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-reply-user hidden">{{journal.user.realname}}</div> <div class="post-dynamic-author hidden fl">
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div> {{journal.user.realname}}
<div class="post-reply-date fl">{{journal.lasted_comment}}</div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div> <img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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="cl"></div>
</div> </div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div>
<div ng-if="!discussion.locked" class="post-input-wrap"> <div ng-if="!discussion.locked" id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row"> <div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container"> <div class="post-input-container">
<textarea class="copy-input"></textarea> <textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea> <textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div> </div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,53 +3,59 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="news.act_type == 'News'"> <div ng-if="news.act_type == 'News'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{news.title}}</span></div> <div class="post-avatar fl mr10"><img ng-src="{{news.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<table class="post-detail-info"><tr> <div class="post-dynamic-author hidden fl">
<td class="text-nowrap v-top">发布者:</td> {{news.author.realname}}
<td>{{news.author.realname}}</td> <img ng-if="news.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
</tr> <img ng-if="news.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<tr> </div>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td> <div class="cl"></div>
<td>{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;班级通知</td> <div class="post-dynamic-title c-grey3 mt12 fb">{{news.title}}</div>
</tr></table> <div class="c-grey4 f13 mt10"><span class="mr10">{{news.course_name}} - 课程通知</span><span>{{news.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div> <div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{news.created_on}}</span> <div class="fr f13">
<div ng-if="!news.praise_count" ng-click="addPraise(news);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="news.praise_count && !news.has_praise" ng-click="addPraise(news);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{news.praise_count}}</span></div>
<div ng-if="news.has_praise" ng-click="decreasePraise(news);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{news.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!news.comments_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="news.comments_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{news.comments_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{news.comments_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="news.has_praise" ng-click="decreasePraise(news);">已赞 ({{news.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!news.has_praise" ng-click="addPraise(news);">赞 ({{news.praise_count}})</div>
</div>
<div id="all_news_reply"> <div id="all_news_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="comments in news.comments"> <div ng-if="news.comments == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-row"> <div class="post-reply-wrap" ng-repeat="comments in news.comments">
<div class="post-reply-avatar fl"><img ng-src="{{comments.author.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-reply-row">
<div class="ml55"> <div class="post-avatar fl mr10"><img ng-src="{{comments.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-reply-user hidden">{{comments.author.realname}}</div> <div class="post-dynamic-author hidden fl">
<div class="post-reply-content c-grey2 mb10" ng-bind-html="comments.comments|safeHtml"></div> {{comments.author.realname}}
<div class="post-reply-date fl">{{comments.created_on}}</div> <img ng-if="comments.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div> <img ng-if="comments.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{comments.created_on}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="comments.comments|safeHtml"></div>
<div class="cl"></div>
</div> </div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div>
<div class="post-input-wrap"> <div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row"> <div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container"> <div class="post-input-container">
<textarea class="copy-input"></textarea> <textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea> <textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div> </div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,15 @@
<div class="post-container">
<div loading-spinner></div>
<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 c-black" 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 required class="new-class-input ml25 c-black" ng-model="course.tmpname" placeholder="请输入班级名" /><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>
<my-alert message="alertService_1.message" title="alertService_1.title" visible="alertService_1.visible" cb="alertService_1.cb"></my-alert>
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
</div>

View File

@ -3,67 +3,66 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="homework.act_type == 'HomeworkCommon'"> <div ng-if="homework.act_type == 'HomeworkCommon'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{homework.name}}</span></div> <div class="post-avatar fl mr10"><img ng-src="{{homework.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<table class="post-detail-info"><tr> <div class="post-dynamic-author hidden fl">
<td class="text-nowrap v-top">发布者:</td> {{homework.author.realname}}
<td> <img ng-if="homework.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<span ng-if="homework.author.realname != ' '">{{homework.author.realname}}</span> <img ng-if="homework.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<span ng-if="homework.author.realname == ' '">{{homework.author.nickname}}</span></td> </div>
</tr> <div class="cl"></div>
<tr> <div class="post-dynamic-title c-grey3 mt12 fb">{{homework.name}}</div>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td> <div class="c-grey4 f13 mt10"><span class="mr10">{{homework.course_name}} - <span ng-if="homework.homework_type == 1">普通作业</span><span ng-if="homework.homework_type == 2">编程作业</span><span ng-if="homework.homework_type == 3">分组作业</span></span><span>{{homework.publish_time}}</span></div>
<td>{{homework.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程作业</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;别:</td>
<td><span ng-if="homework.homework_type == 1">普通作业</span>
<span ng-if="homework.homework_type == 2">编程作业</span>
<span ng-if="homework.homework_type == 3">分组作业</span>
</td>
</tr>
</table>
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div> <div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey f13">迟交扣分:{{homework.late_penalty}}分</span><br/> <span class="c-grey f13 mr15">迟交扣分:{{homework.late_penalty}}分</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span> <span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评开启时间:{{homework.evaluation_start}}<br /></span> <span ng-if="!homework.anonymous_comment" class="c-grey f13 mr15">匿评开启时间:{{homework.evaluation_start}}</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评关闭时间:{{homework.evaluation_end}}</span> <span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评关闭时间:{{homework.evaluation_end}}</span>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{homework.publish_time}}</span> <div class="fr f13">
<div ng-if="!homework.praise_count" ng-click="addPraise(homework);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="homework.praise_count && !homework.has_praise" ng-click="addPraise(homework);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
<div ng-if="homework.has_praise" ng-click="decreasePraise(homework);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!homework.whomework_journal_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="homework.whomework_journal_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{homework.whomework_journal_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{homework.whomework_journal_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="homework.has_praise" ng-click="decreasePraise(homework);">已赞 ({{homework.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!homework.has_praise" ng-click="addPraise(homework);">赞 ({{homework.praise_count}})</div>
</div>
<div id="all_homework_reply"> <div id="all_homework_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in homework.journals_for_messages">
<div class="post-reply-row"> <div ng-if="homework.journals_for_messages == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-reply-wrap" ng-repeat="journal in homework.journals_for_messages">
<div class="ml55"> <div class="post-reply-row">
<div class="post-reply-user hidden">{{journal.user.realname}}</div> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div> <div class="post-dynamic-author hidden fl">
<div class="post-reply-date fl">{{journal.lasted_comment}}</div> {{journal.user.realname}}
<div class="post-reply-trigger fr undis">回复</div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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.notes|safeHtml"></div>
<div class="cl"></div>
</div> </div>
<div class="cl"></div>
</div> </div>
</div> </div>
</div>
<div class="post-input-wrap"> <div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row"> <div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container"> <div class="post-input-container">
<textarea class="copy-input"></textarea> <textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment"></textarea> <textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div> </div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,57 +3,66 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="issue.act_type == 'Issue'"> <div ng-if="issue.act_type == 'Issue'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{issue.subject}}</span></div>
<table class="post-detail-info"><tr> <div class="post-avatar fl mr10"><img ng-src="{{issue.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<td class="text-nowrap v-top">发布者:</td> <div class="post-dynamic-author hidden fl">
<td>{{issue.author.realname}}</td> {{issue.author.realname}}
</tr> <img ng-if="issue.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<tr> <img ng-if="issue.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td> </div>
<td>{{issue.project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目问题</td> <div class="cl"></div>
</tr></table> <div class="post-dynamic-title c-grey3 mt12 fb">{{issue.subject}}</div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div>
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div> <div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey f13">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}<br> <span class="c-grey f13 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span>
优先级:{{issue.issue_priority}}<br /> <span class="c-grey f13">优先级:{{issue.issue_priority}}</span><br/>
指派给:{{issue.issue_assigned_to}}<br /> <span class="c-grey f13 mr15">指派给:{{issue.issue_assigned_to}}</span>
完成度:{{issue.done_ratio}}%</span> <span class="c-grey f13">完成度:{{issue.done_ratio}}%</span>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{issue.created_on}}</span> <div class="fr f13">
<div ng-if="!issue.praise_count" ng-click="addPraise(issue);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="issue.praise_count && !issue.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
<div ng-if="issue.has_praise" ng-click="decreasePraise(issue);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!issue.journals_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="issue.journals_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{issue.journals_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{issue.journals_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="issue.has_praise" ng-click="decreasePraise(issue);">已赞 ({{issue.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!issue.has_praise" ng-click="addPraise(issue);">赞 ({{issue.praise_count}})</div>
</div>
<div id="all_issue_reply"> <div id="all_issue_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in issue.issue_journals"> <div ng-if="issue.issue_journals == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-row"> <div class="post-reply-wrap" ng-repeat="journal in issue.issue_journals">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-reply-row">
<div class="ml55"> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-reply-user hidden">{{journal.user.realname}}</div> <div class="post-dynamic-author hidden fl">
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div> {{journal.user.realname}}
<div class="post-reply-date fl">{{journal.created_on}}</div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div> <img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div> </div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button> <div class="post-dynamic-time fr f13">{{journal.created_on}}</div>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button> <div class="cl"></div>
<div class="cl"></div> <div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div class="cl"></div>
</div>
</div> </div>
</div> </div>
<div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,46 +2,63 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="message.act_type == 'JournalsForMessage'"> <div ng-if="message.act_type == 'JournalsForMessage'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><a herf="javascript:void(0);" class="mr10">{{message.user.realname}}</a><span style="vertical-align:top;">给您留言了</span><br /></div>
<div class="post-title">{{message.created_on}}</div> <div class="post-avatar fl mr10"><img ng-src="{{message.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{message.user.realname}}
<img ng-if="message.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="message.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div> <div class="cl"></div>
<div class="c-grey4 f13 mt10"><span class="mr10">留言</span><span>{{message.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="message.notes|safeHtml"></div> <div class="f13 c-grey3 mt10 text-control" ng-bind-html="message.notes|safeHtml"></div>
<div class="cl"></div> <div class="cl"></div>
</div> <div class="fr f13">
<div class="post-interactive border-bottom"> <div ng-if="!message.praise_count" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{message.reply_count}})</span></div> <div ng-if="message.praise_count && !message.has_praise" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
<div class="post-interactive-column c-grey" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div> <div ng-if="message.has_praise" ng-click="decreasePraise(message);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
<div class="post-interactive-column c-grey" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div> </div>
<div class="fr mr25 f13">
<a ng-if="!message.reply_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="message.reply_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{message.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div> </div>
<div id="all_message_reply"> <div id="all_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in message.child_reply"> <div ng-if="message.child_reply == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in message.child_reply">
<div class="post-reply-row"> <div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="ml55"> <div class="post-dynamic-author hidden fl">
<div class="post-reply-user hidden">{{journal.user.realname}}</div> {{journal.user.realname}}
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-date fl">{{journal.lasted_comment}}</div> <img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div>
</div> </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.notes|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addReply(formData)" ng-hide="formData.disabled" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -22,4 +22,4 @@
</form> </form>
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>

View File

@ -1,26 +1,29 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div>
<div class="class-detail-name">我的资源</div> <div class="class-detail-name">我的资源</div>
<div class="tab-wrap"> <div class="tab-wrap">
<a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a> <a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a>
</div> </div>
<div class="class-search-wrap"> <div class="class-search-wrap">
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" /> <div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
<input class="class-detail-search" placeholder="输入关键词进行搜索" /> <input class="class-detail-search" placeholder="输入关键词进行搜索" ng-model="searchText" />
</div> </div>
</div> </div>
<div ng-class="{'undis': currentTab!=1}"> <div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="r in resources" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in resources|filter:{filename:searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a ng-click="sendFile(r)" class="fr mr10 link-blue2">发送</a></div>
<p ng-show="resources.length<=0" class="class-test-tip">暂无课件,<br /> <p ng-show="resources && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站,在PC浏览器中上传课件。</p> 请登录Trustie网站,在PC浏览器中上传课件。</p>
</div> </div>
<div ng-class="{'undis': currentTab!=2}"> <div ng-class="{'undis': currentTab!=2}">
<div ng-repeat="r in homeworks" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span><a herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in homeworks|filter:{homework_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span></div>
<p ng-show="homeworks.length<=0" class="class-test-tip">暂无作业,<br /> <p ng-show="homeworks && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
请登录Trustie网站,在PC浏览器中创建作业。</p> 请登录Trustie网站,在PC浏览器中创建作业。</p>
</div> </div>
<div ng-class="{'undis': currentTab!=3}"> <div ng-class="{'undis': currentTab!=3}">
<div ng-repeat="r in exercise" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span><a herf="javascript:void(0);" class="fr mr10 link-blue2">发送</a></div> <div ng-repeat="r in exercise|filter:{exercise_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span></div>
<p ng-show="exercise.length<=0" class="class-test-tip">暂无测验,<br /> <p ng-show="exercise && exercise.length<=0" class="class-test-tip">暂无测验,<br />
请登录Trustie网站,在PC浏览器中创建测验。</p> 请登录Trustie网站,在PC浏览器中创建测验。</p>
</div> </div>
</div> </div>

View File

@ -1,7 +1,14 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div>
<div class="blue-title">新建课程</div> <div class="blue-title">新建课程</div>
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input class="new-class-input ml25" placeholder="请输入课程名" /></div> <form novalidate name="classForm">
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">班级</span><input class="new-class-input ml25" 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="tac"><a herf="javascript:void(0);" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div>
<a href="javascript:void(0);" class="finish-btn">完成</a> <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="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>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
</div> </div>

View File

@ -3,51 +3,58 @@
<div loading-spinner></div> <div loading-spinner></div>
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper" style="margin-top:0;">
<div class="post-main"> <div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div> <div class="post-avatar fl mr10"><img ng-src="{{discussion.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<table class="post-detail-info"><tr> <div class="post-dynamic-author hidden fl">
<td class="text-nowrap v-top">发布者:</td> {{discussion.user.realname}}
<td>{{discussion.user.realname}}</td> <img ng-if="discussion.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
</tr> <img ng-if="discussion.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<tr> </div>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td> <div class="cl"></div>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目讨论区</td> <div class="post-dynamic-title c-grey3 mt12 fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
</tr></table> <div class="c-grey4 f13 mt10"><span class="mr10">{{discussion.course_project_name}} - 项目讨论区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div> <div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span> <div class="fr f13">
<div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="discussion.praise_count && !discussion.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
<div ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{discussion.replies_count}}</span></a>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div>
<div id="all_course_message_reply"> <div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children"> <div ng-if="discussion.message_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in discussion.message_children">
<div class="post-reply-row"> <div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="ml55"> <div class="post-dynamic-author hidden fl">
<div class="post-reply-user hidden">{{journal.user.realname}}</div> {{journal.user.realname}}
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div> <img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<div class="post-reply-date fl">{{journal.lasted_comment}}</div> <img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
<div class="post-reply-trigger fr undis">回复</div>
</div> </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="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>
<div ng-if="!discussion.locked" class="post-input-wrap"> <div ng-if="!discussion.locked" id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row"> <div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container"> <div class="post-input-container">
<textarea class="copy-input"></textarea> <textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea> <textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div> </div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,7 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div>
<form name="regFrm" novalidate> <form name="regFrm" novalidate>
<div class="blue-title">注册<span class="f13 blue-title-sub" ng-click="goLogin()">登录</span></div> <div class="blue-title">注册<span class="f13 blue-title-sub" ng-click="goLogin()">登录</span></div>
<img src="/images/wechat/male.jpg" width="60" class="img-circle mt15 block-center"/> <img src="/images/wechat/male.jpg" width="60" class="img-circle mt15 block-center"/>
@ -40,4 +43,5 @@
</form> </form>
</div> </div>
<my-alert message="errDialog.message" title="errDialog.title" visible="errDialog.visible"></my-alert> <my-alert message="errDialog.message" title="errDialog.title" visible="errDialog.visible"></my-alert>
<my-alert message="successDialog.message" title="successDialog.title" visible="successDialog.visible" cb="successDialog.cb"></my-alert>

View File

@ -0,0 +1,24 @@
<div class="post-container">
<div loading-spinner></div>
<div class="blue-title">发送课程列表</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 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>
</ul>
</div>
<!--<div class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" width="15" class="fl ml10 mt11 spread-btn undis" /><img src="/images/wechat/minus.png" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">未命名课程</span></div>-->
<!--<ul class="class-list f13 c-grey3">-->
<!--<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>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
</div>

View File

@ -0,0 +1,11 @@
<div class="weui_dialog_confirm" ng-show="visible">
<div class="weui_mask"></div>
<div class="weui_dialog">
<div class="weui_dialog_hd"><strong class="weui_dialog_title">{{title}}</strong></div>
<div class="weui_dialog_bd">{{message}}</div>
<div class="weui_dialog_ft">
<a class="weui_btn_dialog default" ng-click="dismiss()">取消</a>
<a class="weui_btn_dialog primary" ng-click="confirm()">确定</a>
</div>
</div>
</div>

View File

@ -0,0 +1,21 @@
<!-- loading toast -->
<div id="loadingToast" class="weui_loading_toast" ng-show="activeCalls>0">
<div class="weui_mask_transparent"></div>
<div class="weui_toast">
<div class="weui_loading">
<div class="weui_loading_leaf weui_loading_leaf_0"></div>
<div class="weui_loading_leaf weui_loading_leaf_1"></div>
<div class="weui_loading_leaf weui_loading_leaf_2"></div>
<div class="weui_loading_leaf weui_loading_leaf_3"></div>
<div class="weui_loading_leaf weui_loading_leaf_4"></div>
<div class="weui_loading_leaf weui_loading_leaf_5"></div>
<div class="weui_loading_leaf weui_loading_leaf_6"></div>
<div class="weui_loading_leaf weui_loading_leaf_7"></div>
<div class="weui_loading_leaf weui_loading_leaf_8"></div>
<div class="weui_loading_leaf weui_loading_leaf_9"></div>
<div class="weui_loading_leaf weui_loading_leaf_10"></div>
<div class="weui_loading_leaf weui_loading_leaf_11"></div>
</div>
<p class="weui_toast_content">数据加载中</p>
</div>
</div>

View File

@ -1,22 +1,24 @@
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){})}]); 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,e,n){this.message=e,this.title=t,this.visible=!0,this.cb=n},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,e,n,o,a){var i=function(){var a=n.defer(),i=c();if(i&&i.length>10)a.resolve(i);else{window.g_code||e.code||o.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?a.reject(t.data.message):(o.save("token",t.data.token),a.resolve(t.data.token))})["catch"](function(t){a.reject(t)})}return a.promise},c=function(){return o.get("token")};return{get_bind:i,token:c}}]),app.factory("session",function(){return{save:function(t,e){sessionStorage.setItem(t,e)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]};return{save:e,get:n}}),app.factory("common",["$http","auth","$routeParams",function(t,e,n){var o=function(n,o,a,i){if(a.comment&&!(a.comment.length<=0)){var c=a.comment.replace(/\n/g,"<br/>"),s={type:o,content:c,token:e.token()};a.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+n,data:s}).then(function(t){a.disabled=!1,"function"==typeof i&&i()},function(t){})}},a=function(n,o){return t({method:"GET",url:apiUrl+o+"/"+n+"?token="+e.token()})},i=function(n){n.praise_count+=1,n.has_praise=!0,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},c=function(n){n.praise_count-=1,n.has_praise=!1,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},s=function(t){t.scope.formData={comment:""};var e=function(e){a(e,t.type).then(function(e){t.loadCallback(e.data)},function(t){})};e(t.id),t.scope.addReply=function(n){console.log(n.comment),o(t.id,t.replyType,n,function(){t.scope.formData={comment:""},e(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=i,t.scope.decreasePraise=c};return{init:s,addCommonReply:o,loadCommonData:a,addCommonPraise:i,decreaseCommonPraise:c}}]); app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,e,n){this.message=e,this.title=t,this.visible=!0,this.cb=n},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,e,n,o,a){var i=function(){var a=n.defer(),i=c();if(i&&i.length>10)a.resolve(i);else{window.g_code||e.code||o.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?a.reject(t.data.message):(o.save("token",t.data.token),a.resolve(t.data.token))})["catch"](function(t){a.reject(t)})}return a.promise},c=function(){return o.get("token")};return{get_bind:i,token:c}}]),app.factory("session",function(){return{save:function(t,e){sessionStorage.setItem(t,e)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]};return{save:e,get:n}}),app.factory("common",["$http","auth","$routeParams",function(t,e,n){var o=function(n,o,a,i){if(a.comment&&!(a.comment.length<=0)){var c=a.comment.replace(/\n/g,"<br/>"),s={type:o,content:c,token:e.token()};a.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+n,data:s}).then(function(t){a.disabled=!1,"function"==typeof i&&i()},function(t){})}},a=function(n,o){return t({method:"GET",url:apiUrl+o+"/"+n+"?token="+e.token()})},i=function(n){n.praise_count+=1,n.has_praise=!0,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},c=function(n){n.praise_count-=1,n.has_praise=!1,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},s=function(t){t.scope.formData={comment:""};var e=function(e){a(e,t.type).then(function(e){t.loadCallback(e.data)},function(t){})};e(t.id),t.scope.addReply=function(n){console.log(n.comment),o(t.id,t.replyType,n,function(){t.scope.formData={comment:""},e(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=i,t.scope.decreasePraise=c};return{init:s,addCommonReply:o,loadCommonData:a,addCommonPraise:i,decreaseCommonPraise:c}}]);
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}}); 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,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page<a.data.all_count,n.save("has_more",e.has_more),n.save("page",a.data.page),console.log(a.data)},function(a){})},e.activities.length<=0?e.loadActData(0):i(function(){window.scrollTo(0,n.get("yoffset"))}),e.goDetail=function(a,e,o){n.save("yoffset",window.document.body.scrollTop),t.path("/"+a+"/"+e)},e.addPraise=function(a){r.addCommonPraise(a)},e.decreasePraise=function(a){r.decreaseCommonPraise(a)}}]); app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(e,a,t,c,o,i,r,s,n){t.replaceUrl=function(e){return e},t.menus=["所有动态","课程动态","项目动态"],t.alertService=n.create(),console.log("ActivityController load"),t.page=r.get("page")||0,t.activities=r.get("activities")||[],t.has_more=r.get("has_more"),t.course_page=r.get("course_page")||0,t.course_activities=r.get("course_activities")||[],t.course_has_more=r.get("course_has_more"),t.project_page=r.get("project_page")||0,t.project_activities=r.get("project_activities")||[],t.project_has_more=r.get("project_has_more"),t.loadActData=function(e,a){switch(container_type="All",e){case 1:container_type="All",t.page=a;break;case 2:container_type="Course",t.course_page=a;break;case 3:container_type="Project",t.project_page=a}c({method:"POST",url:apiUrl+"activities",data:{token:i.token(),page:a,container_type:container_type}}).then(function(e){if(e.data.page>0)switch(e.data.container_type){case"All":t.activities=t.activities.concat(e.data.data);break;case"Course":t.course_activities=t.course_activities.concat(e.data.data);break;case"Project":t.project_activities=t.project_activities.concat(e.data.data);break;case 3:}else switch(e.data.container_type){case"All":t.activities=e.data.data;break;case"Course":t.course_activities=e.data.data;break;case"Project":t.project_activities=e.data.data;break;case 3:}switch(e.data.container_type){case"All":r.save("activities",t.activities),t.has_more=e.data.count+10*e.data.page<e.data.all_count,r.save("has_more",t.has_more),r.save("page",e.data.page);break;case"Course":r.save("course_activities",t.course_activities),t.course_has_more=e.data.count+10*e.data.page<e.data.all_count,r.save("course_has_more",t.course_has_more),r.save("course_page",e.data.page);break;case"Project":r.save("project_activities",t.project_activities),t.project_has_more=e.data.count+10*e.data.page<e.data.all_count,r.save("project_has_more",t.project_has_more),r.save("project_page",e.data.page);break;case 3:}console.log(e.data)},function(e){})},t.tab=function(e){switch(t.currentTab=e,e){case 1:t.activities.length<=0&&t.loadActData(e,0);break;case 2:t.course_activities.length<=0&&t.loadActData(e,0);break;case 3:t.project_activities.length<=0&&t.loadActData(e,0)}},t.currentTab=1,t.activities.length<=0?t.loadActData(1,0):o(function(){window.scrollTo(0,r.get("yoffset"))}),t.goDetail=function(e,t,c){r.save("yoffset",window.document.body.scrollTop),a.path("/"+e+"/"+t)},t.addPraise=function(e){s.addCommonPraise(e)},t.decreasePraise=function(e){s.decreaseCommonPraise(e)}}]);
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("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,t,s,o,a,n){var c=e,r=n.id,u=function(){c.teachers.length<=0&&s.get(t.apiUrl+"courses/teachers?token="+o.token()+"&course_id="+r).then(function(e){console.log(e.data),c.teachers=e.data.data}),c.students.length<=0&&s.get(t.apiUrl+"courses/students?token="+o.token()+"&course_id="+r).then(function(e){console.log(e.data),c.students=e.data.data})},h=function(){c.resources.length<=0&&s.post(t.apiUrl+"courses/"+r+"/attachments",{token:o.token(),name:""}).then(function(e){c.resources=e.data.data})},i=function(){c.homeworks.length<=0&&s.get(t.apiUrl+"courses/homeworks/"+r+"?token="+o.token()).then(function(e){c.homeworks=e.data.data,console.log(e.data)})},l=function(){c.exercises.length<=0&&s.get(t.apiUrl+"courses/"+r+"/exercises?token="+o.token()).then(function(e){c.exercises=e.data.data,console.log(e.data)})};c.isTeacher=!1,c.currentTab=1,c.tab=function(e){c.currentTab=e,c.searchText="",c.showClassMate=!1,c.showResources=!1,c.showHomework=!1,c.showTestcase=!1,c.isTeacher?1==e?(h(),c.showResources=!0):2==e?(i(),c.showHomework=!0):3==e?(l(),c.showTestcase=!0):4==e&&(u(),c.showClassMate=!0):2==e?(u(),c.showClassMate=!0):1==e&&(h(),c.showResources=!0)},c.course={},c.students=[],c.teachers=[],c.resources=[],c.homeworks=[],c.exercises=[],c.invite=function(){a.path("/invite_code").search({id:r})},s.get(t.apiUrl+"courses/"+r+"?token="+o.token()).then(function(e){console.log(e.data),c.course=e.data.data,d(c.course.current_user_is_teacher),c.tab(1)});var d=function(e){c.isTeacher=e,e?c.menus=["课件","作业","小测验","学生管理"]:c.menus=["课堂资源","我的同学"]}}]); 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",function(o,s,t,a,e){var n=o;n.courses=[],a.get(s.apiUrl+"courses?token="+t.token()+"&per_page_count=10&page=1").then(function(o){console.log(o.data),n.courses=o.data.data}),n.goClass=function(o){console.log(o),e.path("/class").search({id:o})},n.newClass=function(){e.path("/new_class")},n.goResource=function(){e.path("/myresource")}}]); 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})}}]);
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(){}})}]); 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(){}})}]);
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("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,u){var n=s;n.syllabus=u.get("current_edit_syllobus");var i=r.id;if(n.syllabus||e.get(l.apiUrl+"syllabuses/"+i+"?token="+a.token()).then(function(s){if(console.log(s.data),n.syllabus=s.data.data,n.syllabus){for(var e in n.syllabus.courses){var a=n.syllabus.courses[e];a.tmpname=a.name}n.syllabus.tmptitle=n.syllabus.title}}),console.log(n.syllabus),n.syllabus){for(var c in n.syllabus.courses){var d=n.syllabus.courses[c];d.tmpname=d.name}n.syllabus.tmptitle=n.syllabus.title}n.alertService_1=t.create(),n.alertService_2=t.create(),n.addClass=function(){n.syllabus.courses.push({can_setting:!0})},n.deleteClass=function(s){var t=n.syllabus.courses[s];t.id>0?n.alertService_2.showMessage("提示","您确定要删除该班级吗?",function(){e.post(l.apiUrl+"courses/"+t.id+"/del",{token:a.token()}).then(function(e){0!=e.data.status?n.alertService_1.showMessage("出错了",e.data.message):n.alertService_1.showMessage("提示","删除班级成功",function(){n.syllabus.courses.splice(s,1)}),console.log(e.data.data)})}):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 r=[],c=[];for(var d in n.syllabus.courses){var b=n.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:n.syllabus.tmptitle,add_courses:r,modify_courses:c}).then(function(s){0!=s.data.status?n.alertService_1.showMessage("出错了",s.data.message):n.alertService_1.showMessage("提示","保存课程成功",function(){u.save("syllabuses",[]),o.path("/class_list")}),console.log(s.data.data)})}}]);
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("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){})}}]); 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){})}}]);
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(){}})}]); 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(){}})}]);
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("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("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",function(e,o,t,a){var n=e;n.menus=["课件","作业","测验"],n.resources=[],n.homeworks=[],n.exercise=[],n.tab=function(e){n.currentTab=e,1==e?o.get(a.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),n.resources=e.data.data}):2==e?o.get(a.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),n.homeworks=e.data.data}):3==e&&o.get(a.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),n.exercise=e.data.data})},n.tab(1)}]); app.controller("MyResourceController",["$scope","$http","auth","config","$location",function(e,o,t,n,r){var s=e;s.menus=["课件","作业","测验"],s.resources=null,s.homeworks=null,s.exercise=null,s.searchText="",s.tab=function(e){s.currentTab=e,s.searchText="",1==e&&(!s.resources||s.resources.length<=0)?o.get(n.apiUrl+"resources?token="+t.token()).then(function(e){console.log(e.data),s.resources=e.data.data}):2==e&&(!s.homeworks||s.homeworks.length<=0)?o.get(n.apiUrl+"resources/homeworks?token="+t.token()).then(function(e){console.log(e.data),s.homeworks=e.data.data}):3==e&&(!s.exercise||s.exercise.length<=0)&&o.get(n.apiUrl+"resources/exercies?token="+t.token()).then(function(e){console.log(e.data),s.exercise=e.data.data})},s.tab(1),s.sendFile=function(e){r.path("/send_class_list").search({id:e.id})}}]);
app.controller("NewClassController",["$scope","$http","auth","config",function(e,o,r,s){var c=e;c.resources=[],c.homeworks=[],c.exercises=[]}]); app.controller("NewClassController",["$scope","$http","auth","config","alertService","$location",function(s,e,a,o,l,t){var r=s;r.alertService=l.create(),r.syllabus={courses:[{name:""}]},r.addClass=function(){r.syllabus.courses.push({})},r.deleteClass=function(s){r.syllabus.courses.splice(s,1)},r.newClass=function(s,l){if(s.$setSubmitted(),console.log(l),!s.$valid)return void console.log(s.$error);var t=[];for(var n in r.syllabus.courses)t.push(r.syllabus.courses[n].name);e.post(o.apiUrl+"syllabuses",{token:a.token(),title:l.title,courses:t}).then(function(s){0!=s.data.status?r.alertService.showMessage("出错了",s.data.message):r.alertService.showMessage("提示","新建课程成功",function(){window.history.back()}),console.log(s.data.data)})}}]);
app.controller("RegController",["$scope","$http","$location","alertService",function(e,o,a,r){var s=e;s.errDialog=r.create(),s.goLogin=function(){a.path("/login")},s.isagreed=!0,s.agreed=function(e){s.isagreed=!e},s.reg=function(e,a){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(a),void o.post(apiUrl+"users",{login:a.username,password:a.password,mail:a.email}).then(function(e){0!=e.data.status?s.errDialog.showMessage("出错了",e.data.message):s.errDialog.showMessage("提示","注册且绑定微信成功")},function(e){s.errDialo.showMessage("出错了",e.data)})):void console.log(e.$error)}}]); 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.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.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)})}}]);
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()}}}}]);
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}}}}); 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}}}});
app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}}); app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}});
app.directive("loadingSpinner",["$http",function(i){return{restrict:"A",replace:!0,template:'<div ng-show="activeCalls>0" class="loading-bg"><div class="loading-box"><img src="/images/loading.gif" alt=""/><span>加载中...</span></div></div>'}}]); app.directive("loadingSpinner",["$http","config",function(t,e){return{templateUrl:e.rootPath+"templates/loading.html"}}]);
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,r,t){var l=t.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},s=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",s("activities.html","ActivityController")).when("/issues/:id",s("issue_detail.html","IssueController")).when("/project_discussion/:id",s("project_discussion.html","DiscussionController")).when("/homework/:id",s("homework_detail.html","HomeworkController")).when("/course_notice/:id",s("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",s("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",s("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",s("blog_detail.html","BlogController")).when("/class",s("class.html","ClassController")).when("/new_class",s("new_class.html","NewClassController")).when("/class_list",s("class_list.html","ClassListController")).when("/myresource",s("myresource.html","MyResourceController")).when("/invite_code",s("invite_code.html","InviteCodeController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]); app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,l){var r=l.rootPath,s={delay:["auth",function(e){return e.get_bind()}]},n=function(e,o){return{templateUrl:r+e,controller:o,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",n("invite_code.html","InviteCodeController")).when("/send_class_list",n("send_class_list.html","SendClassListController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]);

View File

@ -6,6 +6,8 @@ app.controller('ActivityController',
return url; return url;
}; };
$scope.menus = ['所有动态', '课程动态', '项目动态'];
$scope.alertService = alertService.create(); $scope.alertService = alertService.create();
console.log("ActivityController load"); console.log("ActivityController load");
@ -13,33 +15,119 @@ app.controller('ActivityController',
$scope.activities = rms.get("activities") || []; $scope.activities = rms.get("activities") || [];
$scope.has_more = rms.get("has_more"); $scope.has_more = rms.get("has_more");
$scope.loadActData = function(page){ $scope.course_page = rms.get('course_page') || 0;
$scope.course_activities = rms.get("course_activities") || [];
$scope.course_has_more = rms.get("course_has_more");
$scope.project_page = rms.get('project_page') || 0;
$scope.project_activities = rms.get("project_activities") || [];
$scope.project_has_more = rms.get("project_has_more");
$scope.loadActData = function(index,page){
container_type = "All";
switch(index){
case 1:
container_type = "All";
$scope.page = page;
break;
case 2:
container_type = "Course";
$scope.course_page = page;
break;
case 3:
container_type = "Project";
$scope.project_page = page;
break;
}
$scope.page = page;
$http({ $http({
method: 'POST', method: 'POST',
url: apiUrl+ "activities", url: apiUrl+ "activities",
data: {token: auth.token(), page: page} data: {token: auth.token(), page: page, container_type: container_type}
}).then(function successCallback(response) { }).then(function successCallback(response) {
if(response.data.page >0) { if(response.data.page >0) {
$scope.activities = $scope.activities.concat(response.data.data); switch(response.data.container_type){
case "All":
$scope.activities = $scope.activities.concat(response.data.data);
break;
case "Course":
$scope.course_activities = $scope.course_activities.concat(response.data.data);
break;
case "Project":
$scope.project_activities = $scope.project_activities.concat(response.data.data);
break;
case 3:
}
} else { } else {
$scope.activities = response.data.data; switch(response.data.container_type){
case "All":
$scope.activities = response.data.data;
break;
case "Course":
$scope.course_activities = response.data.data;
break;
case "Project":
$scope.project_activities = response.data.data;
break;
case 3:
}
} }
rms.save("activities", $scope.activities); switch(response.data.container_type){
$scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count; case "All":
rms.save('has_more', $scope.has_more); rms.save("activities", $scope.activities);
rms.save('page', response.data.page); $scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('has_more', $scope.has_more);
rms.save('page', response.data.page);
break;
case "Course":
rms.save("course_activities", $scope.course_activities);
$scope.course_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('course_has_more', $scope.course_has_more);
rms.save('course_page', response.data.page);
break;
case "Project":
rms.save("project_activities", $scope.project_activities);
$scope.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('project_has_more', $scope.project_has_more);
rms.save('project_page', response.data.page);
break;
case 3:
}
console.log(response.data); console.log(response.data);
}, function errorCallback(response) { }, function errorCallback(response) {
}); });
}; };
$scope.tab = function(index){
$scope.currentTab = index;
switch(index){
//ALL
case 1:
if($scope.activities.length<=0){
$scope.loadActData(index,0);
}
break;
//Course
case 2:
if($scope.course_activities.length<=0){
$scope.loadActData(index,0);
}
break;
//Project
case 3:
if($scope.project_activities.length<=0){
$scope.loadActData(index,0);
}
break;
}
}
$scope.currentTab = 1;
if($scope.activities.length<=0){ if($scope.activities.length<=0){
$scope.loadActData(0); $scope.loadActData(1,0);
} else { } else {
$timeout(function(){ $timeout(function(){
window.scrollTo(0, rms.get("yoffset")); window.scrollTo(0, rms.get("yoffset"));

View File

@ -31,6 +31,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
{token: auth.token(), name: ''} {token: auth.token(), name: ''}
).then(function(response){ ).then(function(response){
vm.resources = response.data.data; vm.resources = response.data.data;
vm.resources_tag = true;
}); });
} }
} }
@ -40,6 +41,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){ $http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){
vm.homeworks = response.data.data; vm.homeworks = response.data.data;
console.log(response.data); console.log(response.data);
vm.homeworks_tag = true;
}); });
} }
} }
@ -49,6 +51,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){ $http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){
vm.exercises = response.data.data; vm.exercises = response.data.data;
console.log(response.data); console.log(response.data);
vm.exercises_tag = true;
}); });
} }
} }
@ -64,6 +67,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.showResources = false; vm.showResources = false;
vm.showHomework = false; vm.showHomework = false;
vm.showTestcase = false; vm.showTestcase = false;
vm.resources_tag = false;
vm.homeworks_tag = false;
vm.exercises_tag = false;
if(vm.isTeacher){ if(vm.isTeacher){
if(index == 1){ //课件 if(index == 1){ //课件
@ -105,6 +111,10 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/invite_code").search({id: courseid}); $location.path("/invite_code").search({id: courseid});
}; };
vm.sendFile = function(r){
$location.path("/send_class_list").search({id: r.id});
}
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then( $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
function(response) { function(response) {
console.log(response.data); console.log(response.data);
@ -120,7 +130,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
if(is_teacher){ if(is_teacher){
vm.menus = ["课件", "作业", "小测验", "学生管理"]; vm.menus = ["课件", "作业", "小测验", "学生管理"];
} else { } else {
vm.menus = ['课堂资源', "我的同学"]; vm.menus = ['课', "我的同学"];
} }
} }

View File

@ -3,28 +3,79 @@
*/ */
app.controller('ClassListController', ['$scope','config','auth','$http','$location', function($scope, config, auth, $http, $location){ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms',
var vm = $scope; function ($scope, config, auth, $http, $location, alertService,rms) {
vm.courses = []; var vm = $scope;
vm.syllabuses = rms.get('syllabuses') || [];
$http.get(config.apiUrl + "courses?token="+ auth.token() + "&per_page_count=10&page=1").then( vm.alertService = alertService.create();
function(response){
console.log(response.data); var loadClassList = function () {
vm.courses = response.data.data; $http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then(
function (response) {
console.log(response.data);
vm.syllabuses = response.data.data;
rms.save('syllabuses', vm.syllabuses);
}
);
};
if(vm.syllabuses.length<=0){
loadClassList();
} }
);
vm.goClass = function(course_id){
console.log(course_id);
$location.path("/class").search({id: course_id});
}
vm.newClass = function(){ vm.goClass = function (course_id) {
$location.path("/new_class"); console.log(course_id);
} $location.path("/class").search({id: course_id});
}
vm.goResource =function(){ vm.newClass = function () {
$location.path("/myresource"); //先判断下权限
} $http.post(config.apiUrl + "syllabuses/auth",{token: auth.token()} ).then(
function (response) {
console.log(response.data);
if (response.data.auth == 0) {
vm.alertService.showMessage('提示', '非教师身份不能创建课程哦~');
}
else{
$location.path("/new_class");
}
}
);
}
}]); vm.goResource = function () {
$location.path("/myresource");
}
vm.joinClass = function () {
var code = window.prompt("请输入5位班级邀请码(不区分大小写)");
if (code && code.length == 5) {
$http.post(config.apiUrl + "courses/join", {
token: auth.token(),
invite_code: code
}).then(function (response) {
console.log(response.data);
if (response.data.status != 0) {
vm.alertService.showMessage('错误', response.data.message);
} else {
vm.alertService.showMessage('提示', '加入课程成功');
loadClassList();
}
});
} else {
if(code){
vm.alertService.showMessage('错误', '邀请码格式不正确');
}
}
};
vm.onSetting = function (syllabus) {
console.log(syllabus);
rms.save('current_edit_syllobus', syllabus);
$location.path("/edit_class").search({id: syllabus.id});
}
}]);

View File

@ -0,0 +1,110 @@
app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
var vm = $scope;
vm.syllabus = rms.get('current_edit_syllobus');
var syllabus_id = $routeParams.id;
if(!vm.syllabus){
$http.get(config.apiUrl+"syllabuses/"+syllabus_id+"?token="+auth.token()).then(function(response){
console.log(response.data);
vm.syllabus = response.data.data;
if (vm.syllabus) {
for (var i in vm.syllabus.courses) {
var course = vm.syllabus.courses[i];
course.tmpname = course.name;
}
vm.syllabus.tmptitle = vm.syllabus.title;
}
});
}
console.log(vm.syllabus);
//名字用两份
if (vm.syllabus) {
for (var i in vm.syllabus.courses) {
var course = vm.syllabus.courses[i];
course.tmpname = course.name;
}
vm.syllabus.tmptitle = vm.syllabus.title;
}
//单弹框
vm.alertService_1 = alertService.create();
//双弹框
vm.alertService_2 = alertService.create();
vm.addClass = function(){
vm.syllabus.courses.push({can_setting:true});
};
vm.deleteClass = function(index){
var course = vm.syllabus.courses[index];
if(course.id >0){
vm.alertService_2.showMessage('提示', '您确定要删除该班级吗?', function() {
$http.post(config.apiUrl+'courses/'+course.id+'/del', {
token: auth.token()
}).then(function(response){
if(response.data.status!=0){
vm.alertService_1.showMessage('出错了', response.data.message);
} else {
vm.alertService_1.showMessage('提示', '删除班级成功', function(){
vm.syllabus.courses.splice(index, 1);
});
}
console.log(response.data.data);
});
});
} else {
vm.syllabus.courses.splice(index, 1);
}
}
vm.newClass = function (frm, syllabus) {
frm.$setSubmitted();
console.log(syllabus);
if(!frm.$valid){
console.log(frm.$error);
return;
}
var add_courses = [];
var modify_courses = [];
for(var i in vm.syllabus.courses){
var course = vm.syllabus.courses[i];
if(!course.id){
add_courses.push(course.tmpname);
}
else if(course.tmpname != course.name){
modify_courses.push({id:course.id,name:course.tmpname});
}
}
$http.post(config.apiUrl+'syllabuses/'+syllabus_id+'/edit', {
token: auth.token(),
id: syllabus_id,
title:vm.syllabus.tmptitle,
add_courses: add_courses,
modify_courses: modify_courses
}).then(function(response){
if(response.data.status!=0){
vm.alertService_1.showMessage('出错了', response.data.message);
} else {
vm.alertService_1.showMessage('提示', '保存课程成功', function(){
// window.history.back();
rms.save('syllabuses',[]);
$location.path("/class_list");
});
}
console.log(response.data.data);
});
}
}] );

View File

@ -1,24 +1,27 @@
app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', function($scope, $http, auth, config){ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', function($scope, $http, auth, config, $location){
var vm = $scope; var vm = $scope;
vm.menus = ['课件', '作业', '测验']; vm.menus = ['课件', '作业', '测验'];
vm.resources = []; vm.resources = null;
vm.homeworks = []; vm.homeworks = null;
vm.exercise = []; vm.exercise = null;
vm.searchText = "";
vm.tab = function(index){ vm.tab = function(index){
vm.currentTab = index; vm.currentTab = index;
if(index==1){ vm.searchText = "";
if(index==1 && (!vm.resources || vm.resources.length <= 0 )){
$http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){ $http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){
console.log(response.data); console.log(response.data);
vm.resources = response.data.data; vm.resources = response.data.data;
}); });
} else if(index==2){ } else if(index==2 && (!vm.homeworks || vm.homeworks.length <= 0) ){
$http.get(config.apiUrl + "resources/homeworks?token="+auth.token()).then(function(response){ $http.get(config.apiUrl + "resources/homeworks?token="+auth.token()).then(function(response){
console.log(response.data); console.log(response.data);
vm.homeworks = response.data.data; vm.homeworks = response.data.data;
}); });
} else if(index==3){ } else if(index==3 && (!vm.exercise || vm.exercise.length <= 0) ){
$http.get(config.apiUrl + "resources/exercies?token="+auth.token()).then(function(response){ $http.get(config.apiUrl + "resources/exercies?token="+auth.token()).then(function(response){
console.log(response.data); console.log(response.data);
vm.exercise = response.data.data; vm.exercise = response.data.data;
@ -27,4 +30,8 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', fun
} }
vm.tab(1); vm.tab(1);
}] );
vm.sendFile = function(r){
$location.path("/send_class_list").search({id: r.id});
}
}] );

View File

@ -1,12 +1,51 @@
app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', function($scope, $http, auth, config){ app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location', function($scope, $http, auth, config, alertService, $location){
var vm = $scope; var vm = $scope;
vm.resources = []; vm.alertService = alertService.create();
vm.homeworks = [];
vm.exercises = [];
vm.syllabus = {
courses: [{name: ''}],
};
vm.addClass = function(){
vm.syllabus.courses.push({});
};
vm.deleteClass = function(index){
vm.syllabus.courses.splice(index, 1);
}
vm.newClass = function (frm, syllabus) {
frm.$setSubmitted();
console.log(syllabus);
if(!frm.$valid){
console.log(frm.$error);
return;
}
var courses = [];
for(var i in vm.syllabus.courses){
courses .push(vm.syllabus.courses[i].name);
}
$http.post(config.apiUrl+"syllabuses", {
token: auth.token(),
title: syllabus.title,
courses: courses
}).then(function(response){
if(response.data.status!=0){
vm.alertService.showMessage('出错了', response.data.message);
} else {
vm.alertService.showMessage('提示', '新建课程成功', function(){
window.history.back();
});
}
console.log(response.data.data);
});
}
}] ); }] );

View File

@ -1,8 +1,9 @@
app.controller('RegController', ['$scope', '$http', '$location', 'alertService', app.controller('RegController', ['$scope', '$http', '$location', 'alertService','$location',
function ($scope, $http, $location, alertService) { function ($scope, $http, $location, alertService, $location) {
var vm = $scope; var vm = $scope;
vm.errDialog = alertService.create(); vm.errDialog = alertService.create();
vm.successDialog = alertService.create();
vm.goLogin = function () { vm.goLogin = function () {
$location.path("/login"); $location.path("/login");
@ -32,10 +33,12 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService',
if (response.data.status != 0) { if (response.data.status != 0) {
vm.errDialog.showMessage('出错了',response.data.message); vm.errDialog.showMessage('出错了',response.data.message);
} else { } else {
vm.errDialog.showMessage("提示","注册且绑定微信成功"); vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){
$location.path("/activities");
});
} }
}, function (response) { }, function (response) {
vm.errDialo.showMessage('出错了',response.data); vm.errDialog.showMessage('出错了',response.data);
}); });
} }

View File

@ -0,0 +1,55 @@
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', 'rms', function($scope, $http, $routeParams, config, auth, alertService,rms){
var vm = $scope;
var send_id = $routeParams.id;
vm.alertService = alertService.create();
vm.syllabuses = [];
var loadClassList = function () {
$http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then(
function (response) {
console.log(response.data);
vm.syllabuses = response.data.data;
// rms.save('syllabuses', vm.syllabuses);
}
);
};
loadClassList();
vm.selectCourse = function(course){
if( typeof course.checked !== 'boolean' ) course.checked = false;
course.checked = !course.checked;
}
vm.sendToCourses = function(){
var course_ids = [];
for(var i in vm.syllabuses) {
for (var j in vm.syllabuses[i].courses) {
if (vm.syllabuses[i].courses[j].checked) {
course_ids.push(vm.syllabuses[i].courses[j].id);
}
}
}
if(course_ids.length <= 0){
vm.alertService.showMessage('提醒', '请先选择班级');
return;
}
$http.post(config.apiUrl + "resources/send", {
token: auth.token(), course_ids: course_ids, send_id: send_id
}).then(function(response){
console.log(response.data);
if(response.data.status == 0){
vm.alertService.showMessage('提示', '发送成功', function () {
window.history.back();
});
} else {
vm.alertService.showMessage('发送出错', response.data.message);
}
})
}
}]);

View File

@ -16,4 +16,27 @@ app.directive('myAlert', ['config', function(config){
}; };
} }
} }
}]); }]);
app.directive('myAlert2', ['config', function(config){
return {
templateUrl: config.rootPath+ 'templates/alert2.html',
scope: {
title: "=",
message: "=",
visible: "=",
cb: "="
},
link: function(scope){
scope.dismiss = function(){
scope.visible = false;
};
scope.confirm = function(){
scope.visible = false;
if(typeof scope.cb === 'function'){
scope.cb();
}
}
}
}
}]);

View File

@ -1,7 +1,5 @@
app.directive('loadingSpinner', ['$http', function ($http) { app.directive('loadingSpinner', ['$http', 'config', function ($http, config) {
return { return {
restrict: 'A', templateUrl: config.rootPath+ 'templates/loading.html',
replace: true,
template: '<div ng-show="activeCalls>0" class="loading-bg"><div class="loading-box"><img src="/images/loading.gif" alt=""/><span>加载中...</span></div></div>',
}; };
}]); }]);

View File

@ -32,9 +32,11 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/blog_comment/:id', makeRoute('blog_detail.html', 'BlogController')) .when('/blog_comment/:id', makeRoute('blog_detail.html', 'BlogController'))
.when('/class', makeRoute('class.html', 'ClassController')) .when('/class', makeRoute('class.html', 'ClassController'))
.when('/new_class', makeRoute('new_class.html', 'NewClassController')) .when('/new_class', makeRoute('new_class.html', 'NewClassController'))
.when('/edit_class', makeRoute('edit_class.html', 'EditClassController'))
.when('/class_list', makeRoute('class_list.html', 'ClassListController')) .when('/class_list', makeRoute('class_list.html', 'ClassListController'))
.when('/myresource', makeRoute('myresource.html', 'MyResourceController')) .when('/myresource', makeRoute('myresource.html', 'MyResourceController'))
.when('/invite_code', makeRoute('invite_code.html', 'InviteCodeController')) .when('/invite_code', makeRoute('invite_code.html', 'InviteCodeController'))
.when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController'))
.otherwise({ .otherwise({
redirectTo: '/activites' redirectTo: '/activites'
}); });

View File

@ -4,14 +4,16 @@
/*基本样式*/ /*基本样式*/
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;}
body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;}
body{background-color: #EFEFF4;} body{background-color: #efeff4;}
ul li {list-style:none;} ul li {list-style:none;}
img {max-width:100%;} img {max-width:100%;}
blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin-right: 0.4em; border-radius: 4px; font-family: "Microsoft YaHei"; background-size: 100% 100%; margin-top:5px;} blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin-right: 0.4em; border-radius: 4px; font-family: "Microsoft YaHei"; background-size: 100% 100%; margin-top:5px;}
.text-control {word-break:normal; word-wrap:break-word;} .text-control {word-break:normal; word-wrap:break-word;}
.f12 {font-size:12px;} .f12 {font-size:12px;}
.f13 {font-size:13px;} .f13 {font-size:13px;}
.f14 {font-size:14px;}
.f15 {font-size:15px;} .f15 {font-size:15px;}
.f16 {font-size:16px;}
.fb {font-weight:bold;} .fb {font-weight:bold;}
.mt2 {margin-top:2px;} .mt2 {margin-top:2px;}
.mt3 {margin-top:3px;} .mt3 {margin-top:3px;}
@ -19,12 +21,14 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin
.mt5 {margin-top:5px;} .mt5 {margin-top:5px;}
.mt10 {margin-top:10px;} .mt10 {margin-top:10px;}
.mt11 {margin-top:11px;} .mt11 {margin-top:11px;}
.mt12 {margin-top:12px;}
.mt15 {margin-top:15px;} .mt15 {margin-top:15px;}
.mt30 {margin-top:30px;} .mt30 {margin-top:30px;}
.mt70 {margin-top:70px;} .mt70 {margin-top:70px;}
.mb5 {margin-bottom:5px;} .mb5 {margin-bottom:5px;}
.mb10 {margin-bottom:10px;} .mb10 {margin-bottom:10px;}
.mb20 {margin-bottom:20px;} .mb20 {margin-bottom:20px;}
.ml5 {margin-left:5px;}
.ml10 {margin-left:10px;} .ml10 {margin-left:10px;}
.mr5 {margin-right:5px;} .mr5 {margin-right:5px;}
.mr10 {margin-right:10px;} .mr10 {margin-right:10px;}
@ -44,6 +48,8 @@ blockquote {border:1px solid #d4d4d4; padding: 0.6em; margin-left: 1.4em; margin
.c-grey5 {color:#aaaaaa;} .c-grey5 {color:#aaaaaa;}
.c-grey6 {color:#777777;} .c-grey6 {color:#777777;}
.c-blue {color:#3b94d6;} .c-blue {color:#3b94d6;}
.c-white {color:#ffffff;}
.c-black {color:#333}
a {color:#707070;} a {color:#707070;}
a.c-grey {color:#707070;} a.c-grey {color:#707070;}
a.c-grey2 {color:#9a9a9a;} a.c-grey2 {color:#9a9a9a;}
@ -72,8 +78,8 @@ a.underline {text-decoration:underline;}
/*按钮样式*/ /*按钮样式*/
.btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;} .btn1 {width:100%; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:block; border-radius:5px;}
.bg-blue:not(.btn-disabled):active {background-color:#2780c2;} .bg-blue:not(.btn-disabled):active {background-color:#2780c2;}
.btn-disabled {background-color:#ccc;} .btn-disabled {background-color:#ccc !important;}
.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*/
.tab-wrap {position:relative; line-height:38px; display:flex; font-size:13px; background-color:#fff;} .tab-wrap {position:relative; line-height:38px; display:flex; font-size:13px; background-color:#fff;}
@ -87,43 +93,52 @@ a.underline {text-decoration:underline;}
.bottom-tab-wrap a {display:block; flex:1; position:relative;} .bottom-tab-wrap a {display:block; flex:1; position:relative;}
.bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;} .bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;}
/*动态样式*/ /*动态样式*/
.post-container {width:100%;} .post-container {width:100%;}
.post-wrapper {width:98%; border-radius:3px; box-shadow:0px 0px 8px rgba(146, 153, 169, 0.5); background-color:#ffffff; margin:10px auto;} .post-wrapper {width:100%; background-color:#ffffff; margin:10px auto;}
.post-main {padding:10px; color:#9a9a9a;} .post-main {padding:10px 15px; color:#9a9a9a;}
.post-avatar {width:40px; height:40px; margin-right:5px;} .post-avatar {width:30px; height:30px;}
.post-title {font-size:13px; text-align:left;} .post-title {font-size:13px; text-align:left;}
.post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;} .post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;}
.fl {float:left;} .fl {float:left;}
.fr {float:right;} .fr {float:right;}
.cl {clear:both; overflow:hidden;} .cl {clear:both; overflow:hidden;}
.post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} .post-content {width:100%; font-size:14px; line-height:20px; height:100px; overflow:hidden; word-break:break-all; word-wrap:break-word;}
.post-all-content a {color:#136ec2;} .post-all-content a {color:#136ec2;}
.post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} .post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;}
.post-interactive-column, .post-interactive-column,
.post-interactive-reply, .post-interactive-reply,
.post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} .post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;}
.more-wrap {width:100%;} .more-wrap {width:100%;}
.more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; }
.border-bottom {border-bottom:1px solid #e6e6e6;} .border-bottom {border-bottom:1px solid #e6e6e6;}
.post-reply-wrap, .post-input-wrap {width:100%; background-color:#f8f9fb;} .post-reply-wrap {width:100%;}
.post-reply-row {padding:10px; color:#9a9a9a;} .post-reply-wrap:first-child {border-top:1px solid #ccc;}
.post-input-wrap {width:100%; position:fixed; bottom:0;}
.post-input-wrap2 {width:100%;}
.post-reply-row {padding:10px 15px; color:#9a9a9a; background-color:#fff;}
.post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;} .post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;}
.post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;} .post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;}
.post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden;} .post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden; padding-bottom:15px; border-bottom:1px solid #ccc;}
.post-reply-content img {max-width:100%;} .post-reply-content img {max-width:100%;}
.post-reply-date, .post-reply-trigger {font-size:13px;} .post-reply-date, .post-reply-trigger {font-size:13px;}
.post-input-container {padding-right:12px;} .post-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:-9999em;} .copy-input {width:100%; height:28px; line-height:28px; padding:0 5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-9999em;}
.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; vertical-align: middle; font-size:12px; border:1px solid #e6e6e6; outline:none; padding:0 5px; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .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;}
.post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} .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;} .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;} .praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}
.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}
.num-block {display:inline-block; vertical-align:top;} .num-block {display:inline-block; vertical-align:top;}
.post-op-banner {height:20px; line-height:20px; vertical-align:middle;} .post-op-banner {height:20px; line-height:20px; vertical-align:middle;}
/*20160628动态新样式*/
.post-dynamic-author {width:50%; height:30px; line-height:30px; font-size:14px; color:#5b5b5b; vertical-align:middle;}
.post-dynamic-time {height:30px; line-height:30px; vertical-align:middle;}
.post-dynamic-title {font-size:15px;}
.post-dynamic-from {width:50%; font-size:13px;}
.post-box-shadow {box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
/* loading 弹框*/ /* loading 弹框*/
.loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;} .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;}
.loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} .loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;}
@ -134,7 +149,7 @@ a.underline {text-decoration:underline;}
.locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;} .locked_btn_cir {background: url("/images/wechat/locked.png") 0 0 no-repeat; cursor: default;}
/*20150612加入班级样式*/ /*20150612加入班级样式*/
.add-class-box {width:80%; max-width:300px; min-width:240px; height:150px; 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; margin-top:100px;} .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-tip {padding-top:20px; padding-bottom:20px;}
.class-number-input {width:80%; max-width:240px; height:28px; border:1px solid #ccc; padding-left:5px; margin:0 auto; display:block;} .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;} .cancel-btn {width:49%; height:37px; line-height:37px; text-align:center; vertical-align:middle; border-top:1px solid #ccc;}
@ -162,7 +177,8 @@ a.underline {text-decoration:underline;}
.class-detail-tab {width:23%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} .class-detail-tab {width:23%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;}
.class-detail-tab2 {width:32%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} .class-detail-tab2 {width:32%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;}
.class-detail-tab3 {width:48%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;} .class-detail-tab3 {width:48%; height:38px; line-height:38px; font-size:13px; color:#444; background-color:#fff; float:left; text-align:center; vertical-align:middle; border-bottom:1px solid #ccc;}
.class-tab-active {border-bottom:1px solid #3b94d6;} .class-tab-active {border-bottom:3px solid #3b94d6;}
.tab-active-arrow {border-width:4px; position:absolute; top:41px; left:50%; transform:translate(-50%,0); border-color:#3b94d6 transparent transparent transparent; border-style:solid dashed dashed dashed;}
.class-search-wrap {padding:8px 12px; position:relative;} .class-search-wrap {padding:8px 12px; position:relative;}
.class-search-inner {padding:0 30px; background-color:#fff;} .class-search-inner {padding:0 30px; background-color:#fff;}
.class-search-icon {position:absolute; top:16px; left:16px;} .class-search-icon {position:absolute; top:16px; left:16px;}
@ -183,7 +199,7 @@ a.underline {text-decoration:underline;}
.students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;} .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;} .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;} .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:#aaa; height:35px; line-height:35px; vertical-align:middle; border:none; outline:none;} .new-class-input {width:60%; color:#555; height:35px; line-height:35px; vertical-align:middle; border:none; outline:none;}
/*20160616登录注册*/ /*20160616登录注册*/
.login-wrap {padding:0 10px;} .login-wrap {padding:0 10px;}
@ -191,7 +207,7 @@ a.underline {text-decoration:underline;}
.input-box { -webkit-appearance: none; font-size: 16px;width:100%; height:16px; padding: 10px 0px 10px 5px; line-height:16px; border:1px solid #ccc; border-radius:5px;} .input-box { -webkit-appearance: none; font-size: 16px;width:100%; height:16px; padding: 10px 0px 10px 5px; line-height:16px; border:1px solid #ccc; border-radius:5px;}
.login-op-wrap {height:30px; line-height:30px; vertical-align:middle;} .login-op-wrap {height:30px; line-height:30px; vertical-align:middle;}
.login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;} .login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;}
.login-box.checked{background:#63c360;} .login-box.checked{background:#63c360; border:1px solid #63c360;}
.login-box.checked:after{content:url(/images/wechat/checked.png);} .login-box.checked:after{content:url(/images/wechat/checked.png);}
.forget-psw-wrap {width:60px; margin:0 auto;} .forget-psw-wrap {width:60px; margin:0 auto;}
.forget-psw {position:fixed; bottom:10px;} .forget-psw {position:fixed; bottom:10px;}

File diff suppressed because one or more lines are too long