Merge branch 'develop' into cxt_course

cxt_course
cxt 9 years ago
commit 5b66489b61

@ -1 +0,0 @@
{"access_token":"b_Pc60Dd5eyg_ut3cHbsjQO9EJJdj2Qj5F99o9LH9ltKSme7_FZ3Of22lWLL-K2V0siWzv-bd9PO0Dn-L1PBvIy9LhXa0qPVaFl6vTtZHR2kA8qjo1ps2ancya0t7KmzURGbAFAAXM","expires_in":7200,"got_token_at":1467976842}

1
.gitignore vendored

@ -36,3 +36,4 @@ public/javascripts/wechat/node_modules/
.ruby-version
.access_token
tmux*.log
config/wechat.yml

@ -49,9 +49,11 @@ gem 'kaminari'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
#rails 3.2.22.2 bug
gem "test-unit", "~>3.0"
### profile
# gem 'oneapm_rpm'
gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'

@ -20,13 +20,14 @@ module Mobile
require_relative 'apis/praise'
require_relative 'apis/resources'
require_relative 'apis/syllabuses'
require_relative 'apis/projects'
class API < Grape::API
version 'v1', using: :path
format :json
content_type :json, "application/json;charset=UTF-8"
use ActionDispatch::Session::CookieStore
use Mobile::Middleware::ErrorHandler
use Middleware::ErrorHandler
helpers do
def logger
@ -42,9 +43,9 @@ module Mobile
end
def current_user
openid = params[:openid]
openid = session[:wechat_openid]
if openid
uw = UserWechat.find_by_openid(params[:openid])
uw = UserWechat.find_by_openid(openid)
return uw.user if uw
end
@ -75,6 +76,7 @@ module Mobile
mount Apis::Praise
mount Apis::Resources
mount Apis::Syllabuses
mount Apis::Projects
add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?

@ -419,6 +419,53 @@ module Mobile
end
desc "获取班级某成员角色信息"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
end
post 'get_member_info' do
authenticate!
c = Course.find("#{params[:id]}")
my_member = c.member_principals.where("users.id=#{params[:user_id]}").first
if my_member && my_member.roles[0]
present :course_id,params[:id]
present :user_id,params[:user_id]
present :member_info,my_member, with: Mobile::Entities::ProjectMember
present :status, 0
else
present :status, -1
end
end
desc "修改班级某成员角色信息"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
requires :role_id, type: Integer
end
post 'edit_member_role' do
authenticate!
c = Course.find("#{params[:id]}")
#7教辅 9教师 10学生
if c.tea_id == params[:user_id] || c.tea_id != current_user.id || !(params[:role_id] == 7 || params[:role_id] == 9 || params[:role_id] == 10)
present :status, -1
else
cs = CoursesService.new
status = cs.modify_user_course_role params
present :status, status
end
end
end
end
end

@ -0,0 +1,181 @@
#coding=utf-8
module Mobile
module Apis
class Projects < Grape::API
resources :projects do
desc "获取项目列表"
params do
requires :token, type: String
end
get do
authenticate!
ps = ProjectsService.new
projects = ps.user_projects(current_user)
present :data, projects, with: Mobile::Entities::Project,user: current_user
present :status, 0
end
desc "返回单个项目"
params do
requires :id, type: Integer
requires :token,type:String
end
route_param :id do
get do
# course = Course.find(params[:id])
ps = ProjectsService.new
project = ps.show_project(params,current_user)
if project[:status] == 9
{status:-1, message: '该项目不存在或已被删除啦' }
else
present :data, project, with: Mobile::Entities::Project,user: current_user
present :status, 0
end
end
end
desc "获取项目动态"
params do
requires :id, type: Integer
requires :token, type: String
end
post 'activities' do
authenticate!
user = current_user
project_types = "('Message','Issue','Project')"
activities = UserActivity.where("(container_type = 'Project' and container_id = #{params[:id]} and act_type in #{project_types})").order('updated_at desc')
page = params[:page] ? params[:page] : 0
all_count = activities.count
activities = activities.limit(10).offset(page * 10)
count = activities.count
present :data, activities, with: Mobile::Entities::Activity,user: user
present :all_count, all_count
present :count, count
present :page, page
present :status, 0
end
desc "获取项目成员"
params do
requires :id, type: Integer
requires :token, type: String
end
post 'members' do
authenticate!
project = Project.find("#{params[:id]}")
members = project.member_principals
master_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=3").all.sort
master_members.each do |m|
if m.user_id == project.user_id
master_members.delete(m)
master_members.insert(0,m)
break
end
end
develop_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=4").all.sort
report_members = project.member_principals.includes(:roles, :principal).where("member_roles.role_id=5").all.sort
present :master_members,master_members, with: Mobile::Entities::ProjectMember
present :develop_members,develop_members, with: Mobile::Entities::ProjectMember
present :report_members,report_members, with: Mobile::Entities::ProjectMember
present :status, 0
end
desc "获取项目某成员角色信息"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
end
post 'get_member_info' do
authenticate!
project = Project.find("#{params[:id]}")
my_member = project.member_principals.where("users.id=#{params[:user_id]}").first
if my_member && my_member.roles[0]
present :project_id,params[:id]
present :user_id,params[:user_id]
present :member_info,my_member, with: Mobile::Entities::ProjectMember
present :status, 0
else
present :status, -1
end
end
desc "修改项目某成员角色信息"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
requires :role_id, type: Integer
end
post 'edit_member_role' do
authenticate!
project = Project.find("#{params[:id]}")
my_member = project.member_principals.where("users.id=#{current_user.id}").first
#3管理 4开发 5报告
if !(my_member && my_member.roles[0] && my_member.roles[0].id == 3 ) || project.user_id == params[:user_id] || !(params[:role_id] == 3 || params[:role_id] == 4 || params[:role_id] == 5)
present :status, -1
else
ps = ProjectsService.new
status = ps.modify_user_project_role params
present :status, status
end
end
desc "新建项目"
params do
requires :token, type: String
requires :name, type: String, desc: '项目名称'
end
post 'create' do
authenticate!
ps = ProjectsService.new
status = ps.createNewProject params,current_user
present :status, 0
end
desc "加入项目"
params do
requires :token, type: String
requires :invite_code, type: String, desc: '邀请码'
end
post "join" do
authenticate!
# ps = ProjectsService.new
# status = ps.join_project({role: "5", openid: params[:openid], invite_code: params[:invite_code]}, current_user)
#
# present :status, status
{status:-1, message: '该功能将在近日开放,敬请期待!' }
end
end
end
end
end

@ -42,7 +42,7 @@ module Mobile
user: user
)
ws = WechatService.new
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, Time.now.strftime("%Y-%m-%d"))
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, Time.now.strftime("%Y-%m-%d"))
present status: 0, message: '您已成功绑定Trustie平台'
end
@ -68,7 +68,7 @@ module Mobile
user: user
)
ws = WechatService.new
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, Time.now.strftime("%Y-%m-%d"))
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, Time.now.strftime("%Y-%m-%d"))
present :data, user, with: Mobile::Entities::User
present :status, 0
end

@ -13,8 +13,14 @@ module Mobile
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
homework = HomeworkCommon.find params[:id]
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page
if type == 0
homework = HomeworkCommon.find params[:id]
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page,comment_type: "homework"
else
jour = JournalsForMessage.find params[:id]
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page,comment_type: "homework"
end
present :type, type
present :page, page
present :status, 0

@ -51,9 +51,8 @@ module Mobile
blog_comment_expose :id
blog_comment_expose :locked
blog_comment_expose :praise_count
expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt|
expose :all_children, using:Mobile::Entities::BlogComment do |c,opt|
if c.is_a? (::BlogComment)
##自己的父回复为空 才有子回复
if !opt[:children]
if c.parent.nil? && opt[:type] == 0
opt[:children] = true
@ -86,7 +85,7 @@ module Mobile
#取二级回复的底楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count > 0 && !opt[:bottom]
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
@ -105,7 +104,7 @@ module Mobile
#取二级回复的顶楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count > 0 && !opt[:top]
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2

@ -86,6 +86,15 @@ module Mobile
expose :my_homework,using: Mobile::Entities::Homework do |f, opt|
f[:my_homework] if f.is_a?(Hash) && f.key?(:my_homework)
end
expose :is_creator, if: lambda { |instance, options| options[:user] } do |instance, options|
if instance[:course]
course = instance[:course]
else
course = instance
end
current_user = options[:user]
course.tea_id == current_user.id
end
course_expose :current_user_is_member
course_expose :current_user_is_teacher
course_expose :work_unit

@ -22,10 +22,10 @@ module Mobile
(get_user(issue.assigned_to_id)).login
when :issue_status
IssueStatus.find(issue.status_id).name
when :journals_count
# issue.journals.where("notes is not null and notes != ''").count
all_comments = []
get_all_children(all_comments, f).count
when :comment_count
issue.journals.where("notes is not null and notes != ''").count
# all_comments = []
# get_all_children(all_comments, f).count
when :project_name
issue.project.name
when :praise_count
@ -49,7 +49,7 @@ module Mobile
issue_expose :issue_priority
issue_expose :issue_assigned_to
issue_expose :issue_status
issue_expose :journals_count
issue_expose :comment_count
issue_expose :project_name
issue_expose :praise_count
expose :issue_journals, using: Mobile::Entities::Journal do |f, opt|

@ -17,7 +17,7 @@ module Mobile
case field
when :lasted_comment
time_from_now f.created_on
when :reply_count
when :comment_count
# f.children.count
all_comments = []
get_all_children(all_comments, f).count
@ -27,6 +27,8 @@ module Mobile
'JournalsForMessage'
when :act_id
f.id
when :content
f.notes
end
end
end
@ -42,10 +44,10 @@ module Mobile
end
jours_expose :created_on
jours_expose :lasted_comment
jours_expose :notes
jours_expose :content
jours_expose :m_reply_id
jours_expose :m_parent_id
jours_expose :reply_count
jours_expose :comment_count
jours_expose :praise_count
expose :course,using:Mobile::Entities::Course do |f,opt|
if f.is_a?(::JournalsForMessage) && f[:jour_type] == "Course"
@ -55,9 +57,20 @@ module Mobile
expose :reply_user,using: Mobile::Entities::User do |f, opt|
f.at_user
end
expose :child_reply,using: Mobile::Entities::Jours do |f, opt|
expose :all_children,using: Mobile::Entities::Jours do |f, opt|
if f.is_a?(::JournalsForMessage)
f.children.reverse
# f.children.reverse
if !opt[:children] && opt[:comment_type].nil?
if f.parent.nil? && opt[:type] == 0
opt[:children] = true
all_comments = []
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = get_all_children(all_comments, f)[tStart..tEnd]
all_comments
end
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
@ -67,6 +80,78 @@ module Mobile
has_praise = obj.empty? ? false : true
has_praise
end
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
parents_reply = []
if options[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, instance)
elsif options[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, instance)
end
parents_reply.count
end
expose :parents_reply_bottom, using:Mobile::Entities::Jours do |f,opt|
if f.is_a? (::JournalsForMessage)
#取二级回复的底楼层
parents_reply = []
if opt[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, f)
elsif opt[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, f)
end
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
else
opt[:bottom] = true
parents_reply[0..0]
end
else
[]
end
end
end
expose :parents_reply_top, using:Mobile::Entities::Jours do |f,opt|
if f.is_a? (::JournalsForMessage)
#取二级回复的顶楼层
parents_reply = []
if opt[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, f)
elsif opt[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, f)
end
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2
tEnd = (opt[:page])*5+2 - 1
if tEnd >= parents_reply.count - 1
tEnd = parents_reply.count - 2
end
if tStart <= parents_reply.count - 2
parents_reply = parents_reply.reverse[tStart..tEnd]
parents_reply.reverse
else
[]
end
else
opt[:top] = true
parents_reply = parents_reply.reverse[0..1]
parents_reply.reverse
end
else
[]
end
end
end
end
end
end

@ -30,7 +30,7 @@ module Mobile
'Message'
when :act_id
u.id
when :replies_count
when :comment_count
all_comments = []
get_all_children(all_comments, u).count
end
@ -51,15 +51,26 @@ module Mobile
message_expose :board_id
message_expose :subject
message_expose :content
message_expose :replies_count
message_expose :comment_count
message_expose :praise_count
message_expose :created_on
message_expose :locked
message_expose :id
message_expose :lasted_comment
expose :message_children,using:Mobile::Entities::Message do |c,opt|
expose :all_children,using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
c.children.reverse
# c.children.reverse
if !opt[:children]
if c.parent.nil? && opt[:type] == 0
opt[:children] = true
all_comments = []
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = get_all_children(all_comments, c)[tStart..tEnd]
all_comments
end
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
@ -69,6 +80,63 @@ module Mobile
has_praise = obj.empty? ? false : true
has_praise
end
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, instance)
parents_reply.count
end
expose :parents_reply_bottom, using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
#取二级回复的底楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
else
opt[:bottom] = true
parents_reply[0..0]
end
else
[]
end
end
end
expose :parents_reply_top, using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
#取二级回复的顶楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2
tEnd = (opt[:page])*5+2 - 1
if tEnd >= parents_reply.count - 1
tEnd = parents_reply.count - 2
end
if tStart <= parents_reply.count - 2
parents_reply = parents_reply.reverse[tStart..tEnd]
parents_reply.reverse
else
[]
end
else
opt[:top] = true
parents_reply = parents_reply.reverse[0..1]
parents_reply.reverse
end
else
[]
end
end
end
end
end
end

@ -24,9 +24,8 @@ module Mobile
'News'
when :act_id
f.id
when :comments_count
all_comments = []
get_all_children(all_comments, f).count
when :comment_count
f.comments.count
end
end
elsif f.is_a?(Hash) && !f.key?(field)
@ -70,7 +69,7 @@ module Mobile
#发布时间
news_expose :created_on
#评论数量
news_expose :comments_count
news_expose :comment_count
news_expose :praise_count
#课程名字
news_expose :course_name

@ -0,0 +1,32 @@
module Mobile
module Entities
class Project < Grape::Entity
expose :name
expose :id
expose :user_id
# expose :invite_code
# expose :qrcode
expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
my_member = instance.member_principals.where("users.id=#{current_user.id}").first
can_setting = false
if my_member && my_member.roles[0] && my_member.roles[0].id == 3
can_setting = true
end
can_setting
end
expose :is_creator, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
current_user.id == instance.user_id
end
expose :member_count, if: lambda { |instance, options| options[:user] } do |instance, options|
instance.members.count
end
end
end
end

@ -0,0 +1,35 @@
module Mobile
module Entities
class ProjectMember < Grape::Entity
include Redmine::I18n
include ApplicationHelper
include ApiHelper
def self.member_expose(f)
expose f do |u,opt|
if u.is_a?(Hash) && u.key?(f)
u[f]
elsif u.is_a?(::Member)
if u.respond_to?(f)
u.send(f)
else
case f
when :roles_id
u.roles[0].id
end
end
end
end
end
expose :user, using: Mobile::Entities::User do |c, opt|
if c.is_a?(::Member)
c.user
end
end
member_expose :roles_id
end
end
end

@ -24,10 +24,12 @@ module Mobile
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
when :student_num
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.student_id
when :realname
u.nil? ? "" : get_user_realname(u)
when :real_name
u.nil? ? "" : get_user_realname(u).gsub(/\s*/,"");
when :name
u.nil? ? "" : u.show_name
when :roles_id
u[:roles_id].nil? ? nil : u.roles_id
end
end
end
@ -37,11 +39,13 @@ module Mobile
expose :id
#头像
user_expose :img_url
#昵称
expose :nickname
#真名
user_expose :realname
user_expose :img_url
#昵称
expose :realname
#昵称
user_expose :real_name
#性别
user_expose :gender
#我的二维码
@ -62,6 +66,8 @@ module Mobile
user_expose :role_name
user_expose :roles_id
user_expose :name
end

@ -26,7 +26,7 @@ module Mobile
wh.nil? || wh.homework_detail_manual.nil? ? nil : convert_to_time(wh.homework_detail_manual.evaluation_end, 1)
when :praise_count
get_activity_praise_num(wh)
when :whomework_journal_count
when :comment_count
wh.journals_for_messages.count
when :course_name
wh.course.name
@ -58,6 +58,7 @@ module Mobile
expose :anonymous_comment
expose :quotes
expose :is_open
expose :id
whomework_expose :act_type
whomework_expose :act_id
whomework_expose :course_name
@ -66,11 +67,19 @@ module Mobile
whomework_expose :evaluation_start
whomework_expose :evaluation_end
whomework_expose :praise_count
whomework_expose :whomework_journal_count
expose :journals_for_messages, using: Mobile::Entities::Jours do |f, opt|
whomework_expose :comment_count
expose :all_children, using: Mobile::Entities::Jours do |f, opt|
#f[:journals_for_messages] if f.is_a?(Hash) && f.key?(:journals_for_messages)
if f.is_a?(::HomeworkCommon)
f.journals_for_messages.reverse
# f.journals_for_messages.reverse
if !opt[:children] && opt[:type] == 0
opt[:children] = true
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = f.journals_for_messages.reorder("created_on desc")
all_comments[tStart..tEnd]
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|

@ -0,0 +1,13 @@
#coding=utf-8
#
module Mobile
module Exceptions
class AuthException < StandardError
attr_reader :err_code, :msg
def initialize(code, msg)
@err_code = code
@msg = msg
end
end
end
end

@ -1,3 +1,6 @@
#coding=utf-8
module Mobile
module Middleware
class ErrorHandler < Grape::Middleware::Base
@ -6,7 +9,10 @@ module Mobile
begin
@app.call(@env)
rescue =>e
message = {status: 1, message: e.message }.to_json
code = 1
message = {status: code, message: e.message }.to_json
Rails.logger.error e.inspect
Rails.logger.error e.backtrace.join("\n")
status = 200

@ -154,6 +154,19 @@ class AdminController < ApplicationController
end
end
# 单位名称列表下的已审批按照名字排序
def apply_shcool_sort
@order = ""
@sort = ""
if params[:sort] && (params[:order] == 'name')
# courses = School.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc")
school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' ORDER BY CONVERT(aas.name USING gbk) #{params[:sort]}, aas.id asc ")
@order = params[:order]
@sort = params[:sort]
end
redirect_to unapplied_schools_url
end
#精品课程下的全部课程
def excellent_all_courses
name = params[:name]
@ -599,63 +612,122 @@ class AdminController < ApplicationController
end
end
# 获取申请的高校列表
# status: 0 未审批; 1 已批阅;
# 单位审核
# 未审批tab页
# status: 0 未审批; 1 已批阅; 2已更改 3拒绝
def applied_schools
@name = params[:name]
@apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc')
@apply_count = @apply_status.count
@name = params[:name] || ""
condition = "#{@name.strip}".gsub(" ","")
@apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc')
@apply_count = @apply_status.count
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
@apply_status = paginateHelper @apply_status, 30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
# 单位审核
# 已审批tab页
def has_applied_schools
@name = params[:name]
@has_apply_status = ApplyAddSchools.where(:status => 1).order('created_at desc')
@has_apply_count = @has_apply_status.count
@name = params[:name] || ""
condition = "#{@name.strip}".gsub(" ","")
@has_apply_status = ApplyAddSchools.where("(status = 1 or status = 2) and name like '%#{condition}%'").order('created_at desc')
@has_apply_count = @has_apply_status.count
@has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1
@has_apply_status = paginateHelper @has_apply_status, 30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
# 批准未审批的高校
# 单位审核:批准
# 消息发送,发送对象为申请人
# status: 0表示未批准 status1表示已批准 status 2表示已拒绝
# status: 0表示未批准 status1表示已批准 status 2表示已更改; status 3表示已拒绝
def approve_applied_schools
applied_school = ApplyAddSchools.find params[:id]
applied_school.update_column('status', 1) unless applied_school.nil?
AppliedMessage.create(:user_id => applied_school.user_id, :status => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools")
school = applied_school.school
school.update_attribute("province", applied_school.province)
AppliedMessage.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
# School.create(:user_id => applied_school.user_id, :status => 1, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
respond_to do |format|
format.html{ redirect_to unapplied_schools_url }
end
end
# 更改申请的高校名称
# 单位审核:更改
# REDO: 修改该字段
# REDO: 同步修改使用了改名称的用户单位
def edit_applied_schools
@applied_schools = ApplyAddSchools.find params[:id]
@applied_schools.update_column('name', params[:name])
aas = ApplyAddSchools.find(params[:applied_id])
# aas.update_attribute(:name, params[:name])
#applied_add_school = ApplyAddSchools.where(:name => aas.name)
school = School.find params[:school_id]
begin
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => true, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
users = UserExtensions.where("school_id = #{aas.school_id}")
users.each do |user|
user.update_column("school_id", school[0].id)
end
if aas.school_id != school[0].id.to_i
aas.school.destroy
end
aas.update_attribute(:school_id, school[0].id)
rescue Exception => e
puts e
end
# applied_schools = ApplyAddSchools.find params[:applied_id]
# applied_schools.update_column('name', params[:name])
redirect_to unapplied_schools_url
end
# 删除申请的高校
# 单位审核:更改功能搜索合法学校弹框
def all_schools
apply_schools = ApplyAddSchools.where("status = 0")
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p",:p=>search)
#@schools = School.all
else
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
@schools = School.where("id not in #{apply_school_ids}")
end
@edit_id = params[:school_id]
@search = params[:search]
respond_to do |format|
format.js
end
end
# 单位审核:删除
# REDO: destroy关联删除
# REDO: 删除确认提示,是否删除
# REDO: 给申请人发送消息
def delete_applied_schools
@applied_schools = ApplyAddSchools.find params[:id]
@applied_schools.destroy
applied_school = ApplyAddSchools.find(params[:id])
applied_school.update_attribute(:status, 3)
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.each do |user|
user.update_column("school_id", nil)
end
applied_school.school.destroy
# 跳转当前页面
if params[:tip] == "unapplied"
redirect_to unapplied_schools_url
elsif params[:tip] == "applied"
redirect_to applied_schools_url
end
end
#移动端版本管理

@ -1,8 +1,10 @@
class AppliedProjectController < ApplicationController
helper :watchers
#申请加入项目
def applied_join_project
@project = Project.find_by_id(params[:object_id])
if params[:object_id]
@project = Project.find_by_id(params[:object_id])
end
# @user_id = params[:user_id]
# if params[:project_join]
# if @project
@ -43,22 +45,28 @@ class AppliedProjectController < ApplicationController
end
# @flage:提示语标志1邀请码错误2已经是项目成员 3角色没有选择; 4申请成功
# role:成员角色 => 01管理人员2开发人员3:报告人员)
# role:成员角色 => 04管理人员5开发人员6:报告人员)
# 申请成功则发送消息
def applied_project_info
@project = Project.find(params[:project_id])
if params[:invite_code].to_s != @project.invite_code
if params[:project_id].nil?
@project = Project.where(:invite_code => params[:invite_code]).first
else
@project = Project.find(params[:project_id])
end
if !@project || params[:invite_code].to_s != @project.invite_code
@flag = 1
elsif User.current.member_of?(@project)
@flag = 2
elsif params[:member].nil?
@flag = 3
elsif !AppliedProject.where(:project_id => @project.id, :user_id => User.current.id).first.nil?
@flag = 5
else
@flag = 4
role = params[:member] == "member_manager" ? 1 : (params[:member] = "member_developer" ? 2 : 3)
applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => params[:project_id], :role => role)
role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5)
applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => @project.id, :role => role)
# 申请成功则给项目管理员发送邮件及发送消息
Mailer.run.applied_project(applied_project)
# Mailer.run.applied_project(applied_project)
end
end

@ -652,8 +652,11 @@ class CoursesController < ApplicationController
end
if @course
#发送微信消息
ss = SyllabusesService.new
ss.send_wechat_create_class_notice User.current,@course
count = ShieldWechatMessage.where("container_type='User' and container_id=#{User.current.id} and shield_type='Course' and shield_id=#{@course.id}").count
if count == 0
ss = SyllabusesService.new
ss.send_wechat_create_class_notice User.current,@course
end
respond_to do |format|
flash[:notice] = l(:notice_successful_create)
format.html {redirect_to course_url(@course)}

@ -17,10 +17,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MembersController < ApplicationController
helper :users
model_object Member
before_filter :find_model_object, :except => [:index, :create, :autocomplete]
before_filter :find_model_object, :except => [:index, :create, :autocomplete, :allow_to_join_project, :refused_allow_to_join_project]
#before_filter :find_model_object_contest, :except => [:index, :create, :autocomplete]
before_filter :find_project_from_association, :except => [:index, :create, :autocomplete]
before_filter :find_project_from_association, :except => [:index, :create, :autocomplete, :allow_to_join_project, :refused_allow_to_join_project]
before_filter :find_project_by_project_id, :only => [:index, :create, :autocomplete]
before_filter :authorize
accept_api_auth :index, :show, :create, :update, :destroy
@ -49,6 +50,62 @@ class MembersController < ApplicationController
end
end
# 同意消息中申请加入项目
# 之所以role不在参数中传送是考虑到安全问题
# status(1申请的消息2已操作过该消息包括同意或者拒绝消息状态更新3决绝消息4:被拒人收到消息5拒绝者收到消息6同意后申请人收到消息7同意后批准人收到消息)
def allow_to_join_project
@applied_message = AppliedMessage.find(params[:applied_message_id])
applied_project = @applied_message.applied
user = User.find(@applied_message.applied_user_id)
project = Project.find(applied_project.project_id)
if user.member_of?(project)
@flash_message = "您已经是项目成员了"
@applied_message.update_attribute(:status, 2)
else
ap_role = applied_project.try(:role)
if ap_role
begin
members = []
user_grades = []
project_info = []
members << Member.new(:role_ids => ["#{ap_role}"], :user_id => @applied_message.applied_user_id)
user_grades << UserGrade.new(:user_id => @applied_message.applied_user_id, :project_id => project.id)
role = Role.find(ap_role)
project_info << ProjectInfo.new(:project_id => project.id, :user_id => @applied_message.applied_user_id) if role.allowed_to?(:is_manager)
project.members << members
project.project_infos << project_info
project.user_grades << user_grades unless user_grades.first.user_id.nil?
@applied_message.update_attribute(:status, 2)
# 添加成功后,申请人收到消息
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,
:status => 6, :viewed => true, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)
# 添加成功后,批准人收到消息
AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,
:status => 7, :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id)
rescue Exception => e
puts e
end
end
end
end
# 同意消息中拒绝加入项目
# params[:user_id]为申请者ID
# params[:send_id]为拒绝人ID
# status(1申请的消息2已操作过该消息包括同意或者拒绝消息状态更新3拒绝消息4:被拒人收到消息5拒绝者收到消息6同意后申请人收到消息7同意后批准人收到消息)
def refused_allow_to_join_project
@applied_message = AppliedMessage.find(params[:applied_message_id])
@applied_message.update_attribute(:status, 3)
applied_project = @applied_message.applied
# 发送消息给被拒者,user_id对应的收到信息的用户
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 4,
:viewed => true, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)
# 发送消息给拒绝者
AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 5,
:viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id)
applied_project.delete
end
def create
if params[:refusal_button]
members = []
@ -318,6 +375,11 @@ class MembersController < ApplicationController
grade.destroy
end
end
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => @member.user_id).first
unless applied_projects.nil?
applied_projects.delete
end
#移出项目发送消息
ForgeMessage.create(:user_id => @member.user_id, :project_id => @project.id, :forge_message_type => "RemoveFromProject", :viewed => false, :forge_message_id => User.current.id)
end

@ -238,6 +238,10 @@ class ProjectsController < ApplicationController
#end
@project.members << m
@project.project_infos << project_info
p = Project.find("#{@project.id}")
ps = ProjectsService.new
ps.send_wechat_create_project_notice User.current,p
#end
respond_to do |format|
format.html {
@ -788,6 +792,11 @@ class ProjectsController < ApplicationController
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
if members != nil && members.roles.first.to_s != "Manager"
members.destroy
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first
unless applied_projects.nil?
applied_projects.delete
end
end
respond_to do |format|
format.js

@ -37,7 +37,7 @@ class QualityAnalysisController < ApplicationController
quality_an.delete unless quality_an.blank?
end
# Checks if the given job exists in Jenkins.
unless @client.job.exists?(job_name)
# unless @client.job.exists?(job_name)
@g = Gitlab.client
branch = params[:branch]
language = swith_language_type(params[:language])
@ -111,7 +111,7 @@ class QualityAnalysisController < ApplicationController
end
end
end
end
# end
rescue => e
@message = e.message
end

@ -169,6 +169,7 @@ class SchoolController < ApplicationController
school = School.new
school.name = params[:name].strip
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
school.province = params[:province]
#status 0未处理 1通过 2拒绝
applyschool = ApplyAddSchools.new
@ -183,6 +184,15 @@ class SchoolController < ApplicationController
applyschool.user_id = User.current.id
if applyschool.save
data[:school_id] = school.id
user_extention= User.current.extensions
user_extention.school_id = school.id
user_extention.save!
# status=4 向管理员发送信息
users = User.where(:admin => 1)
users.each do |user|
AppliedMessage.create(:user_id => user.id, :status => 4, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
end
else
data[:result] = 3
end
@ -203,6 +213,72 @@ class SchoolController < ApplicationController
end
end
render :json =>status
end
def edit_apply_name
name = params[:name] || ""
status = -1
if name != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.name = name.strip
if applyschool.school
applyschool.school.name = name
applyschool.school.pinyin = Pinyin.t(name.strip, splitter: '')
applyschool.school.save!
end
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:name=>name}
end
def edit_apply_address
address = params[:address] || ""
status = -1
if address != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.address = address
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:address=>address}
end
def edit_apply_province
province = params[:province] || ""
city = params[:city] || ""
status = -1
if(province != "") &&(city != "")
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.province = province
applyschool.city = city
if applyschool.school
applyschool.school.province = province
applyschool.school.save!
end
applyschool.save!
if applyschool.user_id && applyschool.user_id != 0
user = User.find(applyschool.user_id)
user_extention= user.extensions
user_extention.location = province
user_extention.location_city = city
user_extention.save!
end
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city}
end
end

@ -8,10 +8,12 @@ class WechatsController < ActionController::Base
# default text responder when no other match
on :text do |request, content|
#邀请码
if join_request(request)
if join_class_request(request)
sendBindClass(request, {invite_code: content})
# elsif join_project_request(request)
# sendBindProject(request, {invite_code: content})
else
request.reply.text '您的意见已收到,感谢您的反馈!'
request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群173184401\n我们会认真聆听您的意见和建议。"
end
end
@ -143,11 +145,17 @@ class WechatsController < ActionController::Base
end
on :click, with: 'PROJECT' do |request, key|
request.reply.text "此功能正在开发中,很快就会上线,谢谢"
request.reply.text "该功能将在近日开放,敬请期待"
end
on :click, with: 'JOIN_PROJECT' do |request, key|
request.reply.text "此功能正在开发中,很快就会上线,谢谢!"
request.reply.text "该功能将在近日开放,敬请期待!"
# uw = user_binded?(request[:FromUserName])
# unless uw
# sendBind(request)
# else
# request.reply.text "请直接回复6位项目邀请码\n(不区分大小写):"
# end
end
on :click, with: 'JOIN_CLASS' do |request, key|
@ -159,12 +167,18 @@ class WechatsController < ActionController::Base
end
end
def join_request(request)
def join_class_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 join_project_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_PROJECT'
end
def sendBindClass(request, params)
begin
uw = user_binded?(request[:FromUserName])
@ -180,6 +194,21 @@ class WechatsController < ActionController::Base
end
end
def sendBindProject(request, params)
begin
uw = user_binded?(request[:FromUserName])
if !uw
return sendBind(request)
else
return join_project(params, uw.user, request)
end
rescue => e
logger.error e.inspect
logger.error e.backtrace.join("\n")
return request.reply.text e
end
end
def default_msg(request)
uw = user_binded?(request[:FromUserName])
if uw && uw.user
@ -234,6 +263,36 @@ class WechatsController < ActionController::Base
end
def join_project(params, user, request)
project = nil
project = Project.where(qrcode: params[:ticket]).first if params[:ticket]
project = Project.where(invite_code: params[:invite_code]).first if params[:invite_code]
raise "项目不存在,请确认您的邀请码是否输入正确,谢谢!" unless project
#取出用户角色类型
role = 5
ps = ProjectsService.new
status = ps.join_project({invite_code: project.invite_code}, user)
if status[:state] != 0
raise ProjectService::JoinProjectError.message(status)
end
creator = User.find(project.user_id)
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入项目,开始研发吧!',
content: "项目名称:#{project.name}\n发起人:#{creator.name}\n进入项目,和小伙伴轻松的研发吧!"} }
return request.reply.news(news) do |article, n, index| # article is return object
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities#/project?id='+project.id.to_s}&response_type=code&scope=snsapi_base&state=myproject#wechat_redirect"
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
article.item title: "#{n[:title]}",
description: n[:content],
pic_url: pic_url,
url: url
end
end
### controller method
module Controllers
def get_bind
@ -288,8 +347,7 @@ class WechatsController < ActionController::Base
session[:wechat_code] = params[:code] if params[:code]
openid = get_openid_from_code(params[:code])
@wechat_user = user_binded?(openid)
render 'wechats/login', layout: 'base_wechat'
render 'wechats/user_activities', layout: nil
end
def user_activities
@ -299,13 +357,20 @@ class WechatsController < ActionController::Base
unless open_id
render 'wechats/open_wechat', layout: nil and return
end
if params[:state] == 'myclass'
@course_id = params[:id];
end
unless user_binded?(open_id)
@path = '/login'
else
if params[:state] == 'myclass'
@course_id = params[:id];
elsif params[:state] == 'myproject'
@project_id = params[:id];
end
session[:wechat_openid] = open_id
if params[:code]
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
session[:wechat_openid] = open_id
if params[:code]
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
end
end
render 'wechats/user_activities', layout: nil
end

@ -57,15 +57,41 @@ module UsersHelper
# 获取消息角色
def applied_project_message_type role
case role
when 1
when 3
"管理员"
when 2
when 4
"开发人员"
when 3
when 5
"报告人员"
end
end
# 判断当前用户能否对消息进行操作
def allow_to_show applied_message
(User.current.id == applied_message.user_id && applied_message.status == 1) ? true : false
end
# 项目申请消息通过状态判断用户
# status(1申请的消息2已操作过该消息包括同意或者拒绝消息状态更新3拒绝消息4:被拒人收到消息5拒绝者收到消息6同意后申请人收到消息7同意后批准人收到消息)
def applied_project_users applied_message
# case applied_message.status
# when 3,2,1,5,4,7,6
user = User.find(applied_message.applied_user_id)
# end
end
# 项目申请消息通过状态判断tip描述
def applied_project_tip applied_message
case applied_message.status
when 4
"拒绝申请加入项目:"
when 5,3,2,1,7
"申请加入项目:"
when 6
"同意申请加入项目"
end
end
def get_resource_origin attach
type = attach.container_type
content = attach.container

@ -1,6 +1,7 @@
class AppliedMessage < ActiveRecord::Base
# status: 0表示未批准 status1表示已批准 status 2表示已拒绝
attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed
attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name
belongs_to :applied ,:polymorphic => true
belongs_to :apply_add_schools
belongs_to :user

@ -10,7 +10,7 @@ class AppliedProject < ActiveRecord::Base
# 仅仅给项目管理人员发送消息
def send_appliled_message
self.project.managers.each do |member|
self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => true, :viewed => false)
self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => true, :viewed => false, :applied_user_id => self.user_id, :role => self.role, :project_id => self.project_id)
end
# end
end

@ -1,7 +1,7 @@
class ApplyAddSchools < ActiveRecord::Base
# status0 未审批 1 已批阅
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied, :dependent => :destroy
has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied
belongs_to :school
after_create :send_massage

@ -165,6 +165,7 @@ class Project < ActiveRecord::Base
scope :has_module, lambda {|mod|
where("#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s)
}
scope :not_deleted, lambda{where("status<>9")}
scope :active, lambda { where(:status => STATUS_ACTIVE) }
scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) }
scope :all_public, lambda { where(:is_public => true) }
@ -919,8 +920,8 @@ class Project < ActiveRecord::Base
CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z)
def generate_invite_code
code = read_attribute(:invite_code)
if !code || code.size <5
code = CODES.sample(5).join
if !code || code.size <6
code = CODES.sample(6).join
return generate_invite_code if Project.where(invite_code: code).present?
update_attribute(:invite_code, code)
end

@ -369,7 +369,8 @@ class User < Principal
system_messages_count = SystemMessage.where("created_at >?", onclick_time).count
at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time).count
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count
applied_count = AppliedMessage.where("user_id=? and viewed =? and created_at >?", user.id, 0, onclick_time).count
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count
end
# 查询指派给我的缺陷记录

@ -89,7 +89,8 @@ class CoursesService
@members = searchTeacherAndAssistant(c)
when '2'
#@subPage_title = l :label_student_list
@members = searchStudent(c)
# @members = searchStudent(c)
@members = searchmember_by_name(student_homework_score(0,c.id, 0,"desc"),"")
else
#@subPage_title = ''
@members = c.member_principals.includes(:roles, :principal).all.sort
@ -104,6 +105,7 @@ class CoursesService
:work_unit => work_unit, :mail => m.user.mail, :location => location,
role_name: m.roles.first.name,
name: m.user.show_name,
roles_id: m.roles[0].id,
:brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname}
end
users
@ -1051,5 +1053,49 @@ class CoursesService
# student_works[index + 1 .. index + n]
# end
#修改班级成员角色
def modify_user_course_role params
status = -1
c = Course.find("#{params[:id]}")
member = c.member_principals.includes(:roles, :principal).where("user_id=?",params[:user_id]).first
if member
role = Role.find(params[:role_id])
member.member_roles[0].role_id = params[:role_id]
# 这里的判断只能通过角色名,可以弄成常量
if params[:role_id] == 10
StudentsForCourse.create(:student_id => params[:user_id], :course_id =>params[:id])
else
joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:id])
joined.each do |join|
join.delete
end
member.course_group_id = 0
end
if role.allowed_to?(:is_manager)
courseInfo = CourseInfos.new(:user_id => params[:user_id], :course_id => params[:id])
courseInfo.save
else
user_admin = CourseInfos.where("user_id = ? and course_id = ?", params[:user_id], params[:id])
if user_admin.size > 0
user_admin.each do |user|
user.destroy
end
end
end
Role.givable.all[3..5]
if member.member_roles[0].save
status = 0
end
end
status
end
end

@ -0,0 +1,145 @@
#coding=utf-8
class ProjectsService
include ApplicationHelper
#获取指定用户的项目列表
def user_projects(user)
projects = user.projects.not_deleted.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updated_at ").order("updated_at desc")
projects
end
#显示项目
def show_project(params,current_user)
project = Project.find(params[:id])
# project.generate_invite_code
# project.generate_qrcode
project
end
def send_wechat_create_project_notice user,project
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
Rails.logger.info "!!!!!!!!!!!!!!!!!!!!!!#{project}"
if count == 0
ws = WechatService.new
title = "恭喜您创建项目成功。"
ws.create_project_notice user.id, "create_project_notice", project.id,title, project.name, format_time(project.created_on),"点击查看项目详情。"
end
end
def createNewProject params,user
status = -1
issue_custom_fields = IssueCustomField.sorted.all
trackers = Tracker.sorted.all
project = Project.new
project[:name] = params[:name]
project[:description] = ''
project[:is_public] = '0' #公开
project[:project_type] = 0
project[:project_new_type] = 1
project[:identifier] = Project.next_identifier if Setting.sequential_project_identifiers?
project.organization_id = params[:organization_id]
project.user_id = user.id
# if validate_parent_id && @project.save
if project.save
p = Project.find("#{project.id}")
send_wechat_create_project_notice user,p
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => user, :roles => [r])
# project's score
if ProjectScore.where("project_id=?", project.id).first.nil?
ProjectScore.create(:project_id => project.id, :score => false)
end
# end
project_info = ProjectInfo.new(:user_id => user.id, :project_id => project.id)
user_grades = UserGrade.create(:user_id => user.id, :project_id => project.id)
project_status = ProjectStatus.create(:project_id => project.id, :watchers_count => 0, :changesets_count => 0, :project_type => project.project_type,:grade => 0)
project.members << m
project.project_infos << project_info
status = 0
end
status
end
#修改项目成员角色
def modify_user_project_role params
status = -1
project = Project.find("#{params[:id]}")
member = project.member_principals.includes(:roles, :principal).where("user_id=?",params[:user_id]).first
if member
member.member_roles[0].role_id = params[:role_id]
role = Role.find(params[:role_id])
if role.allowed_to?(:is_manager)
projectInfo = ProjectInfo.new(:user_id => member.user_id, :project_id => project.id)
projectInfo.save
else
user_admin = ProjectInfo.where("user_id = ? and project_id = ?", member.user_id, project.id)
if user_admin.size > 0
user_admin.each do |user|
user.destroy
end
end
end
if member.member_roles[0].save
status = 0
end
end
status
end
class JoinProjectError < Errors
define_error [
0, '加入成功',
1, '您的邀请码不正确',
2, '您还未登录',
3, '您已经是该项目的管理人员',
4, '您已经是该项目的开发人员',
5, '您已经是该项目的报告人员',
6, '该项目不存在或已被删除啦',
'未知错误,请稍后再试'
]
end
def join_project params,current_user
status = -1
project = project.find_by_invite_code(params[:invite_code]) if params[:invite_code]
if project
if project[:is_delete] == 1
status = 6
else
if current_user.member_of?(project) #如果已经是成员
member = project.member_principals.includes(:roles, :principal).where("user_id=?",current_user.id).first
status = member.member_roles[0].role_id
else
if params[:invite_code].present?
members = []
members << Member.new(:role_ids => [5], :user_id => current_user.id)
project.members << members
projectInfo = ProjectInfo.new(:user_id => current_user.id, :project_id => project.id)
projectInfo.save
status = 0
else
status = 4
end
end
end
else
status = 4
end
status
end
end

@ -323,4 +323,41 @@ class WechatService
end
end
def create_project_notice(user_id, type, id, first, key1, key2,remark="")
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = {
touser:uw.openid,
template_id:Wechat.config.create_project_notice,
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/project?id="+id.to_s,
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#707070"
},
keyword1:{
value:key1,
color:"#707070"
},
keyword2:{
value:key2,
color:"#707070"
},
remark:{
value:remark,
color:"#707070"
}
}
}
#data = three_keys_template uw.openid,Wechat.config.create_class_notice, type, id, first, key1, key2, key3, remark
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[wechat_create_project_notice] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
end

@ -0,0 +1,55 @@
<%= stylesheet_link_tag 'css/common','css/popup' %>
<div class="boxContainer" style="height: auto;">
<div class="sendText fl mr10" style="width: auto">更改为</div>
<div class="cl"></div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div>
<!--<input type="text" name="search" placeholder="输入班级ID或者名称搜索" class="subjectSearch fr" />-->
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入名称搜索" class="mt10 mb10 course-search" />
</div>
<div id="schools_list">
<%= render :partial => "admin/update_school_form", :locals => {:schools => schools, :edit_id => edit_id} %>
</div>
</div>
<script type="text/javascript">
function school_submit() {
var checkboxs = $("input[name='school_id[]']:checked");
if(checkboxs.length == 0) {
$("#choose_courses_notice").text("请选择单位");
} else{
$("#choose_courses_notice").text("");
$("#schools_list_form").submit();
hideModal();
}
}
var lastSearchCondition = '';
var count = 0;
function search_courses(e){
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
{
return;
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'admin', :action => 'all_schools') %>'+'?search='+ e.target.value+'&school_id=<%=edit_id %>',
type:'get',
data: {is_observe:true},
success: function(data){ },
beforeSend: function(){ $(this).addClass('ajax-loading'); },
complete: function(){ $(this).removeClass('ajax-loading'); }
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询项目
$("input[name='search']").on('input', function (e) {
throttle(search_courses,window,e);
});
</script>

@ -0,0 +1,27 @@
<%= form_tag admin_edit_applied_schools_path(:applied_id =>edit_id), :id => 'schools_list_form' %>
<div>
<%#= hidden_field_tag(:send_id, edit_id) %>
<div class="courseReferContainer">
<% if !schools.empty? %>
<% schools.each do |school| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="school_id[]" type="radio" value="<%= school.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName"><%= truncate(school.name, :lendght => 25)%></li>
</ul>
<% end %>
<% end %>
</div>
</div>
<div class="cl"></div>
<span id="choose_courses_notice" class="c_red"></span>
<div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" onfocus='this.blur();' onclick="school_submit();" class="sendSourceText">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a>
</div>
</div>
<div class="cl"></div>

@ -0,0 +1,11 @@
<% if params[:search].nil? %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'admin/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
<% else %>
$("#schools_list").html("<%= escape_javascript(render :partial => 'admin/update_school_form', :locals => {:schools => @schools, :edit_id => @edit_id}) %>");
<% end %>

@ -16,15 +16,18 @@
<% end %>
&nbsp;
<div class="autoscroll">
<div class="autoscroll" id = "applied_school">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 20px;">
序号
</th>
<th style="width: 85px;">
单位名称
<th style="width: 85px;" class = "<%= @order == 'name' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
<%= link_to '单位名称', apply_shcool_sort_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'name', :tip=>'unapplied') %>
</th>
<th style="width: 30px;">
申请者
</th>
<th style="width: 75px;">
地区
@ -32,7 +35,7 @@
<th style="width: 75px;">
详细地址
</th>
<th style="width: 20px;">
<th style="width: 30px;">
用户
</th>
<th style="width: 60px;">
@ -46,33 +49,99 @@
<tbody>
<% @apply_status.each do |apply| %>
<% if apply.status == 0 %>
<tr class="odd">
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= apply.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_title_<%= apply.id %>">
<%= apply.name %>
<td class="name" title='<%=apply.name%>' >
<span id="apply_title_<%= apply.id %>"><%= apply.name %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.name %></textarea>
</td>
<td class="center">
<%= apply.province + apply.city %>
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
<%=link_to user.show_name, user_path(user),:target => '_blank' %>
<% end %>
</td>
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= apply.address %>
<td class="center">
<span ondblclick = "show_edit_school_province('<%= apply.id %>');" id="apply_province_<%= apply.id %>">
<%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %>
</span>
<select onchange="showcity(this.value, document.getElementById('schoolCity_<%=apply.id%>'));edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="province" id="school_province_edit_<%=apply.id%>" class="fl" style="width:50px; height:18px; display: none">
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>
<option value="江苏">江苏</option>
<option value="浙江">浙江</option>
<option value="重庆">重庆</option>
<option value="安徽">安徽</option>
<option value="福建">福建</option>
<option value="甘肃">甘肃</option>
<option value="广西">广西</option>
<option value="贵州">贵州</option>
<option value="海南">海南</option>
<option value="河北">河北</option>
<option value="黑龙江">黑龙江</option>
<option value="河南">河南</option>
<option value="湖北">湖北</option>
<option value="湖南">湖南</option>
<option value="江西">江西</option>
<option value="吉林">吉林</option>
<option value="辽宁">辽宁</option>
<option value="内蒙古">内蒙古</option>
<option value="宁夏">宁夏</option>
<option value="青海">青海</option>
<option value="山东">山东</option>
<option value="山西">山西</option>
<option value="陕西">陕西</option>
<option value="四川">四川</option>
<option value="天津">天津</option>
<option value="新疆">新疆</option>
<option value="西藏">西藏</option>
<option value="云南">云南</option>
<option value="香港">香港特别行政区</option>
<option value="澳门">澳门特别行政区</option>
<option value="台湾">台湾</option>
<option value="海外">海外</option>
</select>
<select onchange="edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="city" id="schoolCity_<%=apply.id%>" class="fl ml5" style="width:50px; height:18px; display: none"></select>
</td>
<td class="center">
<%= apply.user_id %>
<span title="双击可编辑" ondblclick = "show_edit_school_address('<%= apply.id %>');" id="apply_address_<%= apply.id %>"><%= apply.address %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位地址" id="school_address_edit_<%=apply.id%>" onblur="edit_school_address('<%= edit_apply_address_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.address %></textarea>
</td>
<td class="center">
<% count = UserExtensions.where("school_id = #{apply.school_id}").count %>
<%= count %>
</td>
<td class="center">
<%= format_date(apply.created_at) %>
</td>
<td class="center">
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %>
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure), :class => "application-default-link") %>
<%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true, :class => "application-default-link" %>
</td>
</tr>
<script>
init_province_and_city(document.getElementById('school_province_edit_<%=apply.id%>'), '<%=apply.province%>', document.getElementById('schoolCity_<%=apply.id%>'), '<%=apply.city%>');
</script>
<% unless apply.remarks.blank? %>
<tr class="odd">
<td>
</td>
<td style="text-align: left;" colspan="6">
<%= apply.remarks %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
<%= pagination_links_full @apply_pages, @apply_count ,:per_page_links => true, :remote => false, :flag => true %>
</ul>

@ -23,19 +23,25 @@
<th style="width: 20px;">
序号
</th>
<th style="width: 85px;">
<th style="width: 80px;">
单位名称
</th>
<th style="width: 75px;">
<th style="width: 35px;">
申请者
</th>
<th style="width: 95px;">
地区
</th>
<th style="width: 75px;">
详细地址
</th>
<th style="width: 20px;">
<th style="width: 85px;">
原名
</th>
<th style="width: 30px;">
用户
</th>
<th style="width: 60px;">
<th style="width: 65px;">
创建时间
</th>
<th style="width: 75px;">
@ -45,33 +51,93 @@
</thead>
<tbody>
<% @has_apply_status.each do |apply| %>
<% if apply.status == 1 %>
<tr class="odd">
<% if apply.status == 1 || apply.status == 2%>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= apply.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_title_<%= apply.id %>">
<%= apply.name %>
<td class="name" title='<%=apply.name%>' >
<% unless apply.school_id.nil? %>
<% school_name = School.where("id=?", apply.school_id).first %>
<span title="双击可编辑" ondblclick = "show_edit_school_name('<%= apply.id %>');" id="apply_title_<%= apply.id %>"><%= school_name.name %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"><%= school_name.name %></textarea>
<% end %>
</td>
<td class="center">
<%= apply.province + apply.city %>
<% user = User.where("id=?", apply.user_id).first%>
<% unless user.nil? %>
<%=link_to user.show_name, user_path(user), :target => '_blank'%>
<% end %>
</td>
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= apply.address %>
<td class="center">
<span ondblclick = "show_edit_school_province('<%= apply.id %>');" id="apply_province_<%= apply.id %>">
<%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %>
</span>
<select onchange="showcity(this.value, document.getElementById('schoolCity_<%=apply.id%>'));edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="province" id="school_province_edit_<%=apply.id%>" class="fl" style="width:50px; height:18px; display: none">
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>
<option value="江苏">江苏</option>
<option value="浙江">浙江</option>
<option value="重庆">重庆</option>
<option value="安徽">安徽</option>
<option value="福建">福建</option>
<option value="甘肃">甘肃</option>
<option value="广西">广西</option>
<option value="贵州">贵州</option>
<option value="海南">海南</option>
<option value="河北">河北</option>
<option value="黑龙江">黑龙江</option>
<option value="河南">河南</option>
<option value="湖北">湖北</option>
<option value="湖南">湖南</option>
<option value="江西">江西</option>
<option value="吉林">吉林</option>
<option value="辽宁">辽宁</option>
<option value="内蒙古">内蒙古</option>
<option value="宁夏">宁夏</option>
<option value="青海">青海</option>
<option value="山东">山东</option>
<option value="山西">山西</option>
<option value="陕西">陕西</option>
<option value="四川">四川</option>
<option value="天津">天津</option>
<option value="新疆">新疆</option>
<option value="西藏">西藏</option>
<option value="云南">云南</option>
<option value="香港">香港特别行政区</option>
<option value="澳门">澳门特别行政区</option>
<option value="台湾">台湾</option>
<option value="海外">海外</option>
</select>
<select onchange="edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="city" id="schoolCity_<%=apply.id%>" class="fl ml5" style="width:50px; height:18px; display: none"></select>
</td>
<td class="center">
<span title="双击可编辑" ondblclick = "show_edit_school_address('<%= apply.id %>');" id="apply_address_<%= apply.id %>"><%= apply.address %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位地址" id="school_address_edit_<%=apply.id%>" onblur="edit_school_address('<%= edit_apply_address_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.address %></textarea>
</td>
<td class="center">
<%= apply.user_id %>
<%= apply.name %>
</td>
<td class="center">
<% count = UserExtensions.where("school_id = #{apply.school_id}").count %>
<%= count %>
</td>
<td class="center">
<%= format_date(apply.created_at) %>
</td>
<td class="center">
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'applied' },:method => :delete, :confirm => l(:text_are_you_sure) ) %>
</td>
</tr>
<% end %>
<script>
init_province_and_city(document.getElementById('school_province_edit_<%=apply.id%>'), '<%=apply.province%>', document.getElementById('schoolCity_<%=apply.id%>'), '<%=apply.city%>');
</script>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
<%= pagination_links_full @has_apply_pages, @has_apply_count ,:per_page_links => true, :remote => false, :flag => true %>
</ul>

@ -4,7 +4,7 @@
<div class="cl"></div>
</div>
<div class="sy_popup_con" style="width:370px;">
<%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => @project.id), :remote => true, :id => 'project_applied_form') do %>
<%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => (@project.nil? ? nil : @project.id)), :remote => true, :id => 'project_applied_form') do %>
<ul class="sy_popup_add ">
<li>
<label >项目邀请码:</label>
@ -19,8 +19,8 @@
<div class="cl"></div>
</li>
<li>
<label>&nbsp;</label>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确&nbsp;&nbsp;定</a></div>
<label class="mr27">&nbsp;</label>
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确&nbsp;&nbsp;定</a>
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取&nbsp;&nbsp;消</a>
<div class="cl"></div>
</li>

@ -15,6 +15,8 @@
<p>请选择一个角色</p>
<% elsif @flag == 4 %>
<p>您的申请已提交,请等待项目管理员审批</p>
<% elsif @flag == 5 %>
<p>您已经申请加入该项目了,请耐心等待</p>
<% end %>
</li>
<li>

@ -1,3 +1,3 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => @project.id}) %>";
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => (@project.nil? ? nil : @project.id)}) %>";
pop_box_new(htmlvalue,460,40,50);

@ -1,3 +1,5 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip', locals: {:project_id => @project.id}) %>";
<% if @project %>
$("#join_in_project_applied").html('<%= escape_javascript( render :partial => 'projects/applied_status') %>');
<% end %>
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip') %>";
pop_box_new(htmlvalue,380,40,50);
//$("#join_in_project").attr('href','<%#= join_in_project_link(@project, User.current) %>');

@ -29,12 +29,12 @@
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %>
</div>
<div class="sy_class_id fl">
<p>邀请码<br />
<p>邀 码<br />
<span class="sy_corange">
<% if User.current.admin? || User.current.member_of_course?(@course) %>
<%=@course.generate_invite_code %>
<% else %>
*****
<span class="f12">请询问老师</span>
<% end %>
</span>
</p>

@ -1,12 +1,8 @@
<div class="pr_info_join fl">
<!--关注:非项目成员-->
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span>
<!--加入项目 -->
<span id="join_in_project">
<%= join_in_project_link(@project, User.current) %>
</span>
<% end %>
<div id="join_in_project_applied">
<%= render :partial => "projects/applied_status" %>
</div>
<!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>

@ -62,3 +62,10 @@
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>
<script>
$("#sidebar ul").css({"marginLeft":"40px","marginTop":"1em","padding":"0"});
$("#sidebar a").css({"color":"#169","fontSize":"12px","lineHeight":"1.5"});
$("#sidebar a").mouseover(function(){$(this).css({"color":"#fff","backgroundColor":"#169"});});
$("#sidebar a").mouseout(function(){$(this).css({"color":"#169","backgroundColor":"#fff"});});
</script>

@ -245,8 +245,21 @@
</div>
<div class="homepageLeftMenuBlock">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %>
<% if is_current_user%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
<% if is_current_user %>
<div class="courseMenu" id="projectMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_project_menu">
<li>
<%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :class => "menuGrey"%>
</li>
<li>
<%= link_to "加入项目", applied_join_project_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
<%# if @user.projects.visible.count > 0
@ -362,6 +375,12 @@
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
$("#projectMenu").mouseenter(function(){
$("#topnav_project_menu").show();
});
$("#projectMenu").mouseleave(function(){
$("#topnav_project_menu").hide();
});
function leftCourseslistChange(){
$('#homepageLeftMenuCourses').slideToggle();
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");

@ -0,0 +1,5 @@
<% if @flash_message %>
alert("<%= @flash_message %>");
<% else%>
$("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>');
<% end%>

@ -0,0 +1 @@
$("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>');

@ -369,7 +369,7 @@
function apply_add_school(){
var htmlvalue = "<%= escape_javascript( render :partial => 'my/apply_add_school' )%>";
pop_up_box(htmlvalue,580,20,48);
$("#schoolname").val($("input[name='province']").val());
}
function add_school(name){
$.ajax({

@ -0,0 +1,9 @@
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span>
<!--加入项目 -->
<% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %>
<%= join_in_project_link(@project, User.current) %>
<% else %>
等待审批
<% end %>
<% end %>

@ -55,12 +55,6 @@
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<div class="subNav">
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "f14 c_blue02" %>
</div>
<% end %>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>

@ -92,32 +92,6 @@
<% if roles.any? %>
<div class="members_right">
<!-- applied -->
<% if @project.applied_projects.any? %>
<div class="members_jion">
<p class="c_blue mb10 fb"><%= l(:label_apply_project) %></p>
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div id="principals_for_applied_member">
<%= render_principals_for_applied_members_new(@project) %>
</div>
<ul class="mb10">
<li><%= l(:label_role_plural) %>:</li>
<% roles.each do |role| %>
<li>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<label ><%= h role %></label >
</li>
<% end %>
</ul>
<a remote="true" href="javascript:void(0)" class="blue_btn fl" onclick="$('#new_membership').submit();">
<%= l(:label_approve) %>
</a>
<a remote="true" href="javascript:void(0)" class="grey_btn fl ml10" onclick="refusal_applied_member();">
<%= l(:label_refusal) %>
</a>
<% end %>
<div class="cl"></div>
</div>
<% end %><!--members_jion end-->
<div class="cl"></div>
<!-- add members -->
<p class="c_blue fb mt10 mb5"><%= l(:label_member_new) %></p>

@ -7,6 +7,10 @@
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<% end %>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>

@ -26,7 +26,7 @@
<li >
<span class="tit_fb ">编程代码:</span>
<div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description ? work.description : "该作品尚未提交相关内容。"%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
<div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
</div>
</div>
<div class="cl"></div>

@ -59,14 +59,9 @@
<li >
<span class="tit_fb ">内容:</span>
<% com_contents = work.work_status %>
<% if com_contents != 0 && work.description %>
<div class="showHworkP break_word upload_img" id="student_work_img_<%= work.id %>">
<%= work.description.html_safe %>
</div>
<% else %>
<span style="color: #999999">该作品未在线下完成提交</span>
<% end %>
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= work.description.html_safe if work.description%>
</div>
<div class="cl"></div>
</li>
<li >

@ -13,7 +13,7 @@
</div>
<div class="">
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
<div class="cl"></div>
</div>
</div>

@ -18,14 +18,14 @@
<p>真实姓名:<%= User.find(ma.course_message_id).realname %></p>
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
<div class="fl">课程描述:</div>
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%= ma.content.include?('9') ? "教师" : "教辅"%></p>
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "教辅"%></p>
</div>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
<span id="deal_info_<%=ma.id%>">
<% if ma.status == 0 || ma.status.nil?%>
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%>
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
|
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%>
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
<% elsif ma.status == 1%> <!-- 同意 -->
您已经同意了该申请
<% elsif ma.status == 2%> <!-- 拒绝 -->

@ -0,0 +1,12 @@
<% if allow_to_show(ma) %>
<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> |
<%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %>
<% elsif ma.status == 4 %>
<span class="fontGrey3">被拒绝</span>
<% elsif ma.status == 5 %>
<span class="fontGrey3">您已拒绝</span>
<% elsif ma.status == 6 %>
<span class="fontGrey3">已通过</span>
<% elsif ma.status == 7 %>
<span class="fontGrey3">您已同意</span>
<% end %>

@ -0,0 +1,2 @@
<%=link_to applied_project_users(ma), user_path(applied_project_users(ma)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="homepageNewsType fl"><%= applied_project_tip(ma) %></span>

@ -1,34 +1,70 @@
<% if ma.class == AppliedMessage %>
<!--申请加入项目-->
<% if ma.applied_type == "ApplyAddSchools" %>
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %></a>
<a href="javascript:void(0);">
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 %>
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% elsif ma.status == 4 %>
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
<% end %>
</a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">批准你加入项目:</span>
<% if ma.status == 1 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过">“<%= ma.name %>”的申请,已通过</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 2 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”">“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 3 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
<li class="homepageNewsContent fl">
<%= link_to "“"+ma.name+"”" + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 4 %>
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> 申请了单位:</span>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% end %>
</li>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'><%= ma.applied.name %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% elsif ma && ma.applied_type == "AppliedProject" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.applied.user), :width => "30", :height => "30"), user_path(ma.applied.user), :target => '_blank' %></a>
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(applied_project_users(ma)), :width => "30", :height => "30"), user_path(applied_project_users(ma)), :target => '_blank' %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.applied.user, user_path(ma.applied.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
<%= render :partial => "users/user_message_applide_users", :locals =>{:ma => ma} %>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
以“<%= applied_project_message_type(ma.applied.role) %>”身份加入
<%= link_to ma.applied.project, settings_project_path(:id => ma.applied.project.id, :tab => "members"), :class => "link-blue", :target => '_blank' %>
:同意 | 拒绝
<li class="homepageNewsContent fl" style="width:283px;"><a href="javascript:void(0);" class="newsGrey">
以“<%= applied_project_message_type(ma.role) %>”身份加入
<% project = Project.find(ma.project_id) %>
<%= link_to project.name, project_path(ma.project_id), :class => "link-blue", :target => '_blank', :title => "#{project.name}" %>
</a>
</li>
<li class="fl" style="width:71px; height:49px;">
<span id="applied_project_<%= ma.id %>">
<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => ma} %>
</span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>

@ -18,6 +18,8 @@
window.g_redirect_path = '<%= @path %>';
<% if @course_id %>
window.g_courseid = <%= @course_id %>;
<% elsif @project_id %>
window.g_projectid = <%= @project_id %>;
<% end %>
</script>

@ -388,7 +388,7 @@ zh:
label_organization_name: 组织名称
label_organization_list: 组织列表
label_school_plural: 学校列表
label_applied_shcools: 单位名称列表
label_applied_shcools: 单位审核
label_organization_new: 新建组织
label_edit_organization: 编辑组织
label_organization_edit: 修改组织
@ -2141,21 +2141,21 @@ zh:
label_resource_belongs_project: 所属项目
#微信模板消息
label_new_homework_template: 您有新作业了
label_update_homework_template: 您的作业已被修改
label_course_topic_template: 课程问答区有新帖子发布了
label_topic_comment_template: 您的帖子有新回复了
label_project_topic_template: 项目讨论区有新帖子发布了
label_issue_comment_template: 您的缺陷有新回复了
label_notice_comment_template: 您的课程通知有新回复了
label_news_comment_template: 您的项目新闻有新回复了
label_homework_comment_template: 您的作业有新回复了
label_new_second_comment_template: 您有新回复了
label_new_journals_template: 您有新留言了
label_journals_comment_template: 您的留言有新回复了
label_blog_comment_template: 您的博客有新回复了
label_new_blog_template: 有新博客了
label_new_issue_template: 有新的问题动态了
label_new_notice_template: 您的课程有新通知了
label_new_homework_template: 您有新作业了
label_update_homework_template: 您的作业已被修改
label_course_topic_template: 课程问答区有新帖子发布了
label_topic_comment_template: 您的帖子有新回复了
label_project_topic_template: 项目讨论区有新帖子发布了
label_issue_comment_template: 您的缺陷有新回复了
label_notice_comment_template: 您的课程通知有新回复了
label_news_comment_template: 您的项目新闻有新回复了
label_homework_comment_template: 您的作业有新回复了
label_new_second_comment_template: 您有新回复了
label_new_journals_template: 您有新留言了
label_journals_comment_template: 您的留言有新回复了
label_blog_comment_template: 您的博客有新回复了
label_new_blog_template: 有新博客了
label_new_issue_template: 有新的问题动态了
label_new_notice_template: 您的课程有新通知了
#edit yk
label_code_work_tests: 代码测试列表

@ -11,9 +11,9 @@ button:
name: "我的课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
-
type: "click"
type: "view"
name: "我的项目"
key: "PROJECT"
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=project_list#wechat_redirect"
-
type: "view"
name: "我的宝库"
@ -30,11 +30,11 @@ button:
type: "click"
name: "加入项目"
key: "JOIN_PROJECT"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
-
type: "view"
name: "历史推文"
url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect"
-
type: "click"
name: "联系我们"
key: "FEEDBACK"

@ -2,18 +2,22 @@ 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"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
-
name: "我的课程"
name: "我的群组"
sub_button:
-
type: "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"
name: "我的课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
-
type: "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: "我的项目"
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=project_list#wechat_redirect"
-
type: "view"
name: "我的宝库"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
-
name: "更多"
@ -24,9 +28,13 @@ button:
key: "JOIN_CLASS"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
name: "加入项目"
key: "JOIN_PROJECT"
-
type: "view"
name: "历史推文"
url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect"
-
type: "click"
name: "联系我们"
key: "FEEDBACK"

@ -2,22 +2,22 @@ button:
-
type: "view"
name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=activities#wechat_redirect"
-
name: "我的群组"
sub_button:
-
type: "view"
name: "我的课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=class_list#wechat_redirect"
-
type: "click"
type: "view"
name: "我的项目"
key: "PROJECT"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=project_list#wechat_redirect"
-
type: "view"
name: "我的宝库"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=myresource#wechat_redirect"
-
name: "更多"
@ -30,11 +30,11 @@ button:
type: "click"
name: "加入项目"
key: "JOIN_PROJECT"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
-
type: "view"
name: "历史推文"
url: "http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzIwOTM2NDkxMA==#wechat_webview_type=1&wechat_redirect"
-
type: "click"
name: "联系我们"
key: "FEEDBACK"

@ -226,6 +226,9 @@ RedmineApp::Application.routes.draw do
member do
get 'upload_logo'
post 'upload'
get 'edit_apply_name'
get 'edit_apply_address'
get 'edit_apply_province'
end
end
@ -770,6 +773,8 @@ RedmineApp::Application.routes.draw do
collection do
get 'autocomplete'
get 'appliedproject'
post 'allow_to_join_project'
get 'refused_allow_to_join_project'
end
end
@ -1076,6 +1081,10 @@ RedmineApp::Application.routes.draw do
get 'admin/applied_schools', as: :unapplied_schools
get 'admin/has_applied_schools', as: :applied_schools
get 'admin/approve_applied_schools'
post 'admin/edit_applied_schools'
get 'admin/all_schools'
get 'admin/apply_shcool_sort', as: :apply_shcool_sort
delete 'admin/delete_applied_schools'
get 'admin/leave_messages'
match 'admin/messages_list', as: :messages_list

@ -2,19 +2,11 @@ default: &default
# corpid: "corpid"
# corpsecret: "corpsecret"
# agentid: 1
#
#- # guange test
#appid: "wxf694495398c7d470"
#secret: "743e038392f1d89540e95f8f7645849a"
#production
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
#test
# appid: "wxc09454f171153c2d"
# secret: "dff5b606e34dcafe24163ec82c2715f8"
token: "123456"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
@ -22,24 +14,14 @@ default: &default
#production
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#
# #template
#template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
#test
# encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
# jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#
# #template
# binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
# journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
# homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
# class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
# create_class_notice: "9CDIvHIKiGwPEQWRw_-wieec1o50tMXQPPZIfECKu0I"
create_project_notice: "jYu0iimbDpgWYZaTLXioZe2lvqoWTdKnUPyphTJ1mxs"
production:
<<: *default

@ -2,26 +2,26 @@ 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"
#test
appid: "wxc09454f171153c2d"
secret: "dff5b606e34dcafe24163ec82c2715f8"
token: "123456"
access_token: ".access_token"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "tmp/wechat_jsapi_ticket"
#test
encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
create_class_notice: "9CDIvHIKiGwPEQWRw_-wieec1o50tMXQPPZIfECKu0I"
create_project_notice: "R2ZaQKJfDJgujPcHWPzadKHIRkIyj2CjX2o_qIuRqig"
production:
<<: *default

@ -0,0 +1,5 @@
class AddNameToAppliedMessage < ActiveRecord::Migration
def change
add_column :applied_messages, :name, :string
end
end

@ -0,0 +1,5 @@
class AddAppliedUserIdToAppliedMessage < ActiveRecord::Migration
def change
add_column :applied_messages, :applied_user_id, :integer
end
end

@ -0,0 +1,5 @@
class AddRoleToAppliedMessage < ActiveRecord::Migration
def change
add_column :applied_messages, :role, :integer
end
end

@ -0,0 +1,5 @@
class AddProjectIdToAppliedMessage < ActiveRecord::Migration
def change
add_column :applied_messages, :project_id, :integer
end
end

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160728075947) do
ActiveRecord::Schema.define(:version => 20160729124833) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -56,10 +56,14 @@ ActiveRecord::Schema.define(:version => 20160728075947) do
t.integer "user_id"
t.integer "applied_id"
t.string "applied_type"
t.integer "viewed", :default => 0
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed", :default => 0
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "name"
t.integer "applied_user_id"
t.integer "role"
t.integer "project_id"
end
create_table "applied_projects", :force => true do |t|

@ -1 +0,0 @@
Subproject commit 222a9bdd72014f197baf2131ab71cc41660111ed

@ -51,7 +51,7 @@ module Redmine
#通过model层删除以触发before_destroy事件 -by zjc
watchers = Watcher.find_by_sql "select * from `watchers` where watchable_type = 'Principal' AND watchable_id = #{self.id} AND user_id = #{user.id}"
watchers.each do |watcher|
watcher.destroy
watcher.destroy
end
#Watcher.delete_all "watchable_type = 'Principal' AND watchable_id = #{self.id} AND user_id = #{user.id}"
else

@ -1,3 +1,4 @@
require 'wechat/cache_file.rb'
require 'wechat/api_loader'
require 'wechat/api'
require 'wechat/corp_api'

@ -0,0 +1,25 @@
#coding=utf-8
#
module Wechat
class CacheFile
class << self
def cache
if defined?(Rails)
Rails.cache
else
File
end
end
def read(key)
cache.read(key) || ''
end
def write(key, val)
cache.write(key, val)
end
end
end
end

@ -44,7 +44,7 @@ module Wechat
protected
def read_ticket_from_file
td = JSON.parse(File.read(jsapi_ticket_file))
td = JSON.parse(CacheFile.read(jsapi_ticket_file))
@got_ticket_at = td.fetch('got_ticket_at').to_i
@ticket_life_in_seconds = td.fetch('expires_in').to_i
@access_ticket = td.fetch('ticket')
@ -54,7 +54,7 @@ module Wechat
def write_ticket_to_file(ticket_hash)
ticket_hash.merge!('got_ticket_at'.freeze => Time.now.to_i)
File.write(jsapi_ticket_file, ticket_hash.to_json)
CacheFile.write(jsapi_ticket_file, ticket_hash.to_json)
end
def remain_life_seconds

@ -21,7 +21,7 @@ module Wechat
protected
def read_token_from_file
td = JSON.parse(File.read(token_file))
td = JSON.parse(CacheFile.read(token_file))
@got_token_at = td.fetch('got_token_at').to_i
@token_life_in_seconds = td.fetch('expires_in').to_i
@access_token = td.fetch('access_token')
@ -31,7 +31,7 @@ module Wechat
def write_token_to_file(token_hash)
token_hash.merge!('got_token_at'.freeze => Time.now.to_i)
File.write(token_file, token_hash.to_json)
CacheFile.write(token_file, token_hash.to_json)
end
def remain_life_seconds

@ -1,3 +0,0 @@
[submodule "app/assets/javascripts/ckeditor-releases"]
path = app/assets/javascripts/ckeditor-releases
url = git://github.com/ckeditor/ckeditor-releases.git

@ -35,7 +35,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
<span class="mr15 f12 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f12 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f12 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f12 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
</div>
@ -73,7 +73,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
</div>
<div class="cl"></div>
</div>
@ -109,7 +109,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></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>
@ -162,7 +162,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
<span class="mr15 f12 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f12 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15 f12 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f12 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
</div>
@ -201,7 +201,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
</div>
<div class="cl"></div>
</div>
@ -251,7 +251,7 @@
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<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" ellipsis-show></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>
@ -289,7 +289,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></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>
@ -335,7 +335,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></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>
@ -373,7 +373,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
</div>
<div class="cl"></div>
</div>
@ -409,7 +409,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></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>
@ -469,7 +469,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></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>
@ -508,7 +508,7 @@
<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 class="post-all-content" ng-bind-html="act.description|safeHtml" ellipsis-show></div>
</div>
<div class="cl"></div>
</div>

@ -1,55 +1,56 @@
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<base href="/">
<title>仅供本地调试使用</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content='True' name='HandheldFriendly' />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weui.min.css" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
</head>
<body>
<div ng-view>
</div>
<script type="text/javascript">
window.g_openid = 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg';
window.g_debug = true; //调试标志,如果在本地请置为true
window.apiUrl = 'http://localhost:3000/api/v1/';
</script>
<script src="/javascripts/wechat/build/angular.all.min.js"></script>
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
<script src="/javascripts/wechat/app.js"></script>
<script src="/javascripts/wechat/others/factory.js"></script>
<script src="/javascripts/wechat/others/filter.js"></script>
<script src="/javascripts/wechat/directives/alert.js"></script>
<script src="/javascripts/wechat/directives/form_validate.js"></script>
<script src="/javascripts/wechat/directives/input_auto.js"></script>
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
<script src="/javascripts/wechat/controllers/reg.js"></script>
<script src="/javascripts/wechat/controllers/login.js"></script>
<script src="/javascripts/wechat/controllers/activity.js"></script>
<script src="/javascripts/wechat/controllers/add_class.js"></script>
<script src="/javascripts/wechat/controllers/blog.js"></script>
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
<script src="/javascripts/wechat/controllers/discussion.js"></script>
<script src="/javascripts/wechat/controllers/homework.js"></script>
<script src="/javascripts/wechat/controllers/issue.js"></script>
<script src="/javascripts/wechat/controllers/journals.js"></script>
<script src="/javascripts/wechat/others/routes.js"></script>
</body>
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<base href="/">
<title>仅供本地调试使用</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content='True' name='HandheldFriendly' />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weui.min.css" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
</head>
<body>
<div ng-view>
</div>
<script type="text/javascript">
window.g_openid = 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg';
window.g_debug = true; //调试标志,如果在本地请置为true
window.apiUrl = 'http://localhost:3000/api/v1/';
</script>
<script src="/javascripts/wechat/build/angular.all.min.js"></script>
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
<script src="/javascripts/wechat/app.js"></script>
<script src="/javascripts/wechat/others/factory.js"></script>
<script src="/javascripts/wechat/others/filter.js"></script>
<script src="/javascripts/wechat/directives/alert.js"></script>
<script src="/javascripts/wechat/directives/form_validate.js"></script>
<script src="/javascripts/wechat/directives/input_auto.js"></script>
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
<!--<script src="/javascripts/wechat/directives/ellipsis.js"></script>-->
<script src="/javascripts/wechat/controllers/reg.js"></script>
<script src="/javascripts/wechat/controllers/login.js"></script>
<script src="/javascripts/wechat/controllers/activity.js"></script>
<script src="/javascripts/wechat/controllers/add_class.js"></script>
<script src="/javascripts/wechat/controllers/blog.js"></script>
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
<script src="/javascripts/wechat/controllers/discussion.js"></script>
<script src="/javascripts/wechat/controllers/homework.js"></script>
<script src="/javascripts/wechat/controllers/issue.js"></script>
<script src="/javascripts/wechat/controllers/journals.js"></script>
<script src="/javascripts/wechat/others/routes.js"></script>
</body>
</html>

@ -13,11 +13,13 @@
<img ng-if="blog.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</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="ml40">
<div class="post-dynamic-title c-black fb">{{blog.title}}<img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt5"><span class="mr10">博客</span><span>{{blog.created_at}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="blog.content|safeHtml"></div>
<div class="cl"></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="blog.content|safeHtml"></div>
<div class="cl"></div>
</div>
<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>
@ -31,64 +33,32 @@
</div>
<div class="mb50" id="all_blog_reply">
<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 ng-if="blog.all_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in blog.all_children">
<div class="post-reply-row" ng-class="['post-reply-row',{'border-bottom-none' : $last}]">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{journal.user.realname}}
<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="post-reply-time fr f12">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<!--<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>-->
<div ng-show="journal.parents_count > 0" class="mult-reply-container mt10">
<!--<div ng-repeat="reply_top in journal.parents_reply_top" >-->
<div class="mult-reply-container mt2">
<ul ng-if="journal.parents_reply_top[1]" ng-include="'comment_reply'" ng-init="i=1;journal=journal"></ul>
<div class="post-avatar fl mr10"><img ng-src="{{journal.parents_reply_top[0].user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
<div class="post-dynamic-author hidden fl ng-binding">
{{journal.parents_reply_top[0].user.realname}}
<img ng-if="journal.parents_reply_top[0].user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.parents_reply_top[0].user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.parents_reply_top[0].lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="journal.parents_reply_top[0].content|safeHtml"></div>
<div class="cl"></div>
</div>
<!--</div>-->
<!--['weixin-tab', {'class-tab-active': currentTab == $index+1}]-->
<!--一层end-->
<!--<div class="mt10">-->
<!--<div class="post-avatar fl mr10"><img src="images/pic01.jpg" ng-src="/images/avatars/User/0" class="border-radius img-circle" height="30" width="30"></div>-->
<!--<div class="post-dynamic-author hidden fl ng-binding">yixin<img src="images/female.png" class="ml5" width="14"></div>-->
<!--<div class="post-dynamic-time fr f13">5分钟前</div>-->
<!--<div class="cl"></div>-->
<!--<div class="post-reply-content c-grey2 mt12 border-bottom-none">烤活牛你见过似的,美国那边吃人你怎么不信?</div>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<!--二层end-->
<div ng-show="journal.parents_count > 0" class="mult-reply-container ml40 mb5">
<comment-reply i="0" journal="journal" ></comment-reply>
<div ng-click="showMoreReply(1,journal)" ng-show="journal.parents_reply_top.length + journal.parents_reply_bottom.length < journal.parents_count" class="mult-reply-hide"><span class="mult-reply-arrow" >&darr; </span><span class="mult-reply-arrow" style="display:none;" > &uarr;</span>点击展开更多楼层</div>
<div class="mt10" ng-repeat="reply_bottom in journal.parents_reply_bottom">
<div class="post-avatar fl mr10"><img ng-src="{{reply_bottom.user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
<div class="post-dynamic-author hidden fl ng-binding">
<div ng-repeat="reply_bottom in journal.parents_reply_bottom" class="ml5 mr5">
<div class="post-reply-author hidden fl ng-binding">
{{reply_bottom.user.realname}}
<img ng-if="reply_bottom.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="reply_bottom.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{reply_bottom.lasted_comment}}</div>
<div class="post-reply-time fr f12">{{reply_bottom.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
<div class="post-reply-content c-grey2 mt5 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div class="post-reply-content">
<div class="mult-reply-content">
<div class="mt10" ng-bind-html="journal.content|safeHtml"></div>
<div class="post-reply-content c-grey3 ml40">
<div class="mult-reply-content mb15">
<div ng-bind-html="journal.content|safeHtml"></div>
</div>
<div class="cl"></div>
</div>
@ -100,7 +70,7 @@
</div>
<div ng-if="!blog.locked" id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
@ -113,20 +83,4 @@
</div>
</div>
</div>
<script id="comment_reply" type="text/ng-template">
<div class="mult-reply-container mt2">
<ul ng-if="journal.parents_reply_top[i+1]" ng-include="'comment_reply'" ng-init="i=i+1;journal=journal"></ul>
<div class="post-avatar fl mr10"><img ng-src="{{journal.parents_reply_top[i].user.img_url}}" class="border-radius img-circle" height="30" width="30"></div>
<div class="post-dynamic-author hidden fl ng-binding">
{{journal.parents_reply_top[i].user.realname}}
<img ng-if="journal.parents_reply_top[i].user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.parents_reply_top[i].user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.parents_reply_top[i].lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="journal.parents_reply_top[i].content|safeHtml"></div>
<div class="cl"></div>
</div>
</script>
</div>

@ -1,6 +1,6 @@
<div class="post-container">
<div loading-spinner></div>
<div class="class-detail-name">{{course.name}}<span ng-click="invite()" class="f13 blue-title-sub">邀请码</span></div>
<div class="class-detail-name"><span class="course-name-width hidden inline-block">{{course.name}}</span><span ng-click="invite()" class="f13 blue-title-sub">邀请码</span></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>
@ -31,12 +31,16 @@
<div class="member-banner f13 c-grey3">授课老师</div>
<div class="class-member-row f13 c-grey3" ng-repeat="teacher in teachers|filter:searchText">
<img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{teacher.name}}</span><span class="fr mr10 c-grey2">{{teacher.role_name|identify}}</span><img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
<img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{teacher.name}}</span><img ng-src="/images/wechat/{{teacher.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
<img src="/images/wechat/setting.png" ng-show = "course.is_creator && teacher.id != course.tea_id" width="15" class="fr mr10" style="margin-top:7px;" ng-click="onSetting(teacher)" />
<span class = "fr mr25 mt5" ng-show ="teacher.id == course.tea_id">管理员</span>
<span ng-class="['fr','mt5',{'mr10': course.is_creator,'mr25': !course.is_creator}]" ng-show ="teacher.id != course.tea_id && teacher.roles_id == 7">教辅</span>
<div class="cl"></div>
</div>
<div class="member-banner f13 mt10 c-grey3">我的同学</div>
<div class="class-member-row f13 c-grey3" ng-repeat="student in students|filter:searchText">
<img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle" /><span class="fl ml10 mt5">{{student.name}}</span><img ng-src="/images/wechat/{{student.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt5" />
<img src="/images/wechat/setting.png" ng-show = "course.is_creator" width="15" class="class-list-setting" ng-click="onSetting(student)" />
<div class="cl"></div>
</div>
</div>
@ -50,8 +54,8 @@
<div ng-class="{'undis': !showTestcase}">
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2 undis" ng-click="sendFile(r,3)">发送</a><div class="cl"></div></div>
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无测验,<br />
请登录Trustie网站在PC浏览器中上传测验。</p>
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无测验,<br />
请登录Trustie网站在PC浏览器中上传测验。</p>
</div>

@ -5,13 +5,13 @@
<div class="course-diff-row"><span class="c-blue f13 ml10">我创建的课程</span></div>
<div ng-show = "syllabus.can_setting" ng-repeat="syllabus in syllabuses" style="position:relative;">
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10 class-list-name hidden">{{syllabus.title}}</span></div>
<img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" ng-click="onSetting(syllabus)" />
<div class="class-setting-wrap" ng-click="onSetting(syllabus)"><img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" /></div>
<ul ng-show="syllabus.show_plus" class="class-list f13 c-grey3">
<li ng-show="course.id" ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
<span class="fl ml10 class-list-name hidden">{{course.name}}</span>
<span class="fr c-grey4">&gt;</span>
<span class="students-amount f12 fr mt10">{{course.member_count}}人</span>
<span class="students-amount f12 fr mt10 mr5">{{course.member_count}}人</span>
</li>
</ul>
</div>
@ -20,13 +20,13 @@
<div class="course-diff-row border-top mt10"><span class="c-blue f13 ml10">我参与的课程</span></div>
<div ng-show = "!syllabus.can_setting" ng-repeat="syllabus in syllabuses" style="position:relative;">
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 border-top-none"><img src="/images/wechat/plus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10 class-list-name hidden">{{syllabus.title}}</span></div>
<img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" ng-click="onSetting(syllabus)" />
<div class="class-setting-wrap" ng-click="onSetting(syllabus)"><img src="/images/wechat/setting.png" ng-show = "syllabus.can_setting" width="15" class="class-list-setting" /></div>
<ul ng-show="syllabus.show_plus" class="class-list f13 c-grey3">
<li ng-show="course.id" ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
<span class="fl ml10 class-list-name hidden">{{course.name}}</span>
<span class="fr c-grey4">&gt;</span>
<span class="students-amount f12 fr mt10">{{course.member_count}}人</span>
<span class="students-amount f12 fr mt10 mr5">{{course.member_count}}人</span>
</li>
</ul>
</div>
@ -35,7 +35,7 @@
<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="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>
<my-alert message="alertService_1.message" title="alertService_1.title" visible="alertService_1.visible" cb="alertService_1.cb"></my-alert>

@ -13,41 +13,60 @@
<img ng-if="discussion.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<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 class="ml40">
<div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.course_project_name}} - 课程问答区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-black mt5 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.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="discussion.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;">{{discussion.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="mb50" id="all_course_message_reply">
<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 ng-if="discussion.all_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in discussion.all_children">
<div class="post-reply-row">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{journal.user.realname}}
<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="post-reply-time fr f12">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>
<div ng-show="journal.parents_count > 0" class="mult-reply-container ml40 mb5">
<!--<ul ng-if="journal.parents_reply_top[0]" ng-include="'comment_reply'" ng-init="i=0;journal=journal"></ul>-->
<comment-reply i="0" journal="journal" ></comment-reply>
<div ng-click="showMoreReply(1,journal)" ng-show="journal.parents_reply_top.length + journal.parents_reply_bottom.length < journal.parents_count" class="mult-reply-hide"><span class="mult-reply-arrow" >&darr; </span><span class="mult-reply-arrow" style="display:none;" > &uarr;</span>点击展开更多楼层</div>
<div class="mt10" ng-repeat="reply_bottom in journal.parents_reply_bottom">
<div class="post-reply-author hidden fl ng-binding">
{{reply_bottom.user.realname}}
</div>
<div class="post-reply-time fr f12">{{reply_bottom.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div ng-if="has_more">
<div id="more_reply" class="more-events mt10" ng-click="showMoreReply(0,discussion);">更多</div>
</div>
</div>
<div ng-if="!discussion.locked" id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>

@ -12,41 +12,41 @@
<img ng-if="news.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{news.title}}</div>
<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="cl"></div>
<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 class="ml40">
<div class="post-dynamic-title c-black fb">{{news.title}}</div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{news.course_name}} - 课程通知</span><span>{{news.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div>
<div class="cl"></div>
<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.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="news.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;">{{news.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="mb50" id="all_news_reply">
<div ng-if="news.comments == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="comments in news.comments">
<div class="post-reply-row">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{comments.author.realname}}
<img ng-if="comments.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<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="post-reply-time fr f12">{{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="post-reply-content c-grey3 ml40 mb15" ng-bind-html="comments.comments|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>

@ -3,9 +3,9 @@
<div class="blue-title">管理课程</div>
<form novalidate name="classForm">
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程</span><input ng-change="syllabus.change = true" ng-class="['new-class-input ml25', {'c-grey':syllabus.change} ]" ng-model="syllabus.tmptitle" required placeholder="请输入课程名,如:软件工程" /></div>
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程名称</span><input ng-change="syllabus.change = true" ng-class="['new-class-input ml25', {'c-grey':syllabus.change} ]" ng-model="syllabus.tmptitle" required placeholder="如:软件工程" /></div>
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级</span><input ng-change="course.change = true" required ng-class="['new-class-input ml25', {'c-grey':course.change} ]" ng-model="course.tmpname" placeholder="请输入班级名,计算机学院A班" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级名称</span><input ng-change="course.change = true" required ng-class="['new-class-input ml25', {'c-grey':course.change} ]" ng-model="course.tmpname" placeholder="如:软件工程计算机学院A班" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
<div class="tac"><a ng-click="addClass()" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div>
<a ng-click="newClass(classForm, syllabus)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
</form>

@ -0,0 +1,21 @@
<div class="post-container">
<div loading-spinner></div>
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
<div class="blue-title">角色变更</div>
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}</span><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
<ul class="class-list f13 c-grey3">
<li><span class="fl ml10 class-list-name hidden">教师</span><span ng-click="selectRole(9)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 9}]"></span></li>
<li><span class="fl ml10 class-list-name hidden">教辅</span><span ng-click="selectRole(7)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 7}]"></span></li>
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">学生</span><span ng-click="selectRole(10)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 10}]"></span></li>
</ul>
<div class="bottom-tab-wrap mt10">
<a href="javascript:void(0);" ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
<a href="javascript:void(0);" ng-click="edit_member_role()" 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>

@ -0,0 +1,21 @@
<div class="post-container">
<div loading-spinner></div>
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
<div class="blue-title">角色变更</div>
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_edit_member.user.real_name == "" ? current_edit_member.user.name : current_edit_member.user.real_name}}</span><img ng-src="/images/wechat/{{current_edit_member.user.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
<ul class="class-list f13 c-grey3">
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-click="selectRole(3)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 3}]"></span></li>
<li><span class="fl ml10 class-list-name hidden">开发人员</span><span ng-click="selectRole(4)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 4}]"></span></li>
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">报告人员</span><span ng-click="selectRole(5)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': current_edit_member.roles_id == 5}]"></span></li>
</ul>
<div class="bottom-tab-wrap mt10">
<a href="javascript:void(0);" ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
<a href="javascript:void(0);" ng-click="edit_member_role()" 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>

@ -12,47 +12,65 @@
<img ng-if="homework.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{homework.name}}</div>
<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>
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey f12 mr15">迟交扣分:{{homework.late_penalty}}分</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评开启时间:{{homework.evaluation_start}}</span><br />
<span ng-if="!homework.anonymous_comment" class="c-grey f12 mr15">缺评扣分:{{homework.absence_penalty}}分/作品</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评关闭时间:{{homework.evaluation_end}}</span>
<div class="ml40">
<div class="post-dynamic-title c-black fb">{{homework.name}}</div>
<div class="c-grey4 mt5 f13"><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>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey f12 mr15">迟交扣分:{{homework.late_penalty}}分</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评开启时间:{{homework.evaluation_start}}</span><br />
<span ng-if="!homework.anonymous_comment" class="c-grey f12 mr15">缺评扣分:{{homework.absence_penalty}}分/作品</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评关闭时间:{{homework.evaluation_end}}</span>
<div class="cl"></div>
</div>
<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>
<a ng-if="!homework.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="homework.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;">{{homework.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="mb50" id="all_homework_reply">
<div ng-if="homework.journals_for_messages == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in homework.journals_for_messages">
<div ng-if="homework.all_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in homework.all_children">
<div class="post-reply-row">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{journal.user.realname}}
<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="post-reply-time fr f12">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div ng-show="journal.parents_count > 0" class="mult-reply-container ml40 mb5">
<!--<ul ng-if="journal.parents_reply_top[0]" ng-include="'comment_reply'" ng-init="i=0;journal=journal"></ul>-->
<comment-reply i="0" journal="journal" ></comment-reply>
<div ng-click="showMoreReply(1,journal)" ng-show="journal.parents_reply_top.length + journal.parents_reply_bottom.length < journal.parents_count" class="mult-reply-hide"><span class="mult-reply-arrow" >&darr; </span><span class="mult-reply-arrow" style="display:none;" > &uarr;</span>点击展开更多楼层</div>
<div class="ml5 mr5 mt10" ng-repeat="reply_bottom in journal.parents_reply_bottom">
<div class="post-reply-author hidden fl ng-binding">
{{reply_bottom.user.realname}}
</div>
<div class="post-reply-time fr f12">{{reply_bottom.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt5 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div ng-if="has_more">
<div id="more_reply" class="more-events mt10" ng-click="showMoreReply(0,homework);">更多</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>

@ -13,46 +13,46 @@
<img ng-if="issue.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<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="ml40">
<div class="post-dynamic-title c-black fb">{{issue.subject}}</div>
<div class="c-grey4 f13 mt5"><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>
<span class="c-grey f12 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span>
<span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/>
<span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span>
<span class="c-grey f12">完成度:{{issue.done_ratio}}%</span>
<div class="cl"></div>
<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 class="f13 c-black mt5 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey f12 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span>
<span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/>
<span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span>
<span class="c-grey f12">完成度:{{issue.done_ratio}}%</span>
<div class="cl"></div>
<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.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="issue.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;">{{issue.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="mb50" id="all_issue_reply">
<div ng-if="issue.issue_journals == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in issue.issue_journals">
<div class="post-reply-row">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{journal.user.realname}}
<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.created_on}}</div>
<div class="post-reply-time fr f12">{{journal.created_on}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.notes|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>

@ -12,43 +12,60 @@
<img ng-if="message.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="c-grey4 f13 mt10"><span class="mr10">留言</span><span>{{message.created_on}}</span></div>
<div class="ml40">
<div class="c-grey4 f13 mt5"><span class="mr10">留言</span><span>{{message.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="message.notes|safeHtml"></div>
<div class="cl"></div>
<div class="fr f13">
<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 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 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>
<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 class="f13 c-black mt5 text-control post-all-content" ng-bind-html="message.content|safeHtml"></div>
<div class="cl"></div>
<div class="fr f13">
<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 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 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>
<div class="fr mr25 f13">
<a ng-if="!message.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="message.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;">{{message.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="mb50" id="all_message_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-wrap" ng-repeat="journal in message.all_children">
<div class="post-reply-row">
<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-dynamic-author hidden fl">
<div class="post-reply-author hidden fl">
{{journal.user.realname}}
<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="post-reply-time fr f12">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div ng-show="journal.parents_count > 0" class="mult-reply-container ml40 mb5">
<comment-reply i="0" journal="journal" ></comment-reply>
<div ng-click="showMoreReply(1,journal)" ng-show="journal.parents_reply_top.length + journal.parents_reply_bottom.length < journal.parents_count" class="mult-reply-hide"><span class="mult-reply-arrow" >&darr; </span><span class="mult-reply-arrow" style="display:none;" > &uarr;</span>点击展开更多楼层</div>
<div class="mt10 ml5 mr5" ng-repeat="reply_bottom in journal.parents_reply_bottom">
<div class="post-reply-author hidden fl ng-binding">
{{reply_bottom.user.realname}}
</div>
<div class="post-reply-time fr f12">{{reply_bottom.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt5 border-bottom-none" ng-bind-html="reply_bottom.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
<div ng-if="has_more">
<div id="more_reply" class="more-events mt10" ng-click="showMoreReply(0,message);">更多</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap post-box-shadow">
<div class="post-reply-row">
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>

@ -32,15 +32,15 @@
<p ng-show="homeworks_tag == true && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
请登录Trustie网站在PC浏览器中创建作业。</p>
</div>
<div ng-class="{'undis': currentTab!=3}">
<div ng-repeat="r in exercise|filter:{exercise_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,3)" class="fr mr10 link-blue2 undis">发送</a><div class="cl"></div>
<span class="f12 mt5 ml35 c-grey4 other-from-width hidden">题目来源:{{r.coursename}}</span><div class="cl"></div>
</div>
<div ng-if="exercise_has_more">
<div id="more_exercises" class="more-events mt10" ng-click="loadResourceData(3,exercise_page+1);">更多</div>
</div>
<p ng-show="exercises_tag == true && exercise.length<=0" class="class-test-tip">暂无测验,<br />
请登录Trustie网站在PC浏览器中创建测验。</p>
</div>
<!--<div ng-class="{'undis': currentTab!=3}">-->
<!--<div ng-repeat="r in exercise|filter:{exercise_name: searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/test.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.exercise_name}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,3)" class="fr mr10 link-blue2 undis">发送</a><div class="cl"></div>-->
<!--<span class="f12 mt5 ml35 c-grey4 other-from-width hidden">题目来源:{{r.coursename}}</span><div class="cl"></div>-->
<!--</div>-->
<!--<div ng-if="exercise_has_more">-->
<!--<div id="more_exercises" class="more-events mt10" ng-click="loadResourceData(3,exercise_page+1);">更多</div>-->
<!--</div>-->
<!--<p ng-show="exercises_tag == true && exercise.length<=0" class="class-test-tip">暂无测验,<br />-->
<!--请登录Trustie网站在PC浏览器中创建测验。</p>-->
<!--</div>-->
</div>

@ -1,14 +1,14 @@
<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" ng-model="syllabus.title" required placeholder="请输入课程名,如:软件工程" /></div>
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses"><span class="fl ml15 c-grey3">班级</span><input required class="new-class-input ml25" ng-model="course.name" placeholder="请输入班级名,计算机学院A班" /><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 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" ng-model="syllabus.title" required placeholder="如:软件工程" /></div>
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses"><span class="fl ml15 c-grey3">班级名称</span><input required class="new-class-input ml25" ng-model="course.name" placeholder="如:软件工程计算机学院A班" /><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>

@ -0,0 +1,26 @@
<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" ng-model="project.name" required placeholder="如:团队协作方法与机制研究" /></div>
<a ng-click="newProject(classForm, project)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
<div class="f12 c-grey6 tac">
<span class="f13 fb c-grey3">项目功能特性(微信版)</span>
<ul class="project-intro mb15 mt5">
<li>创建项目、加入项目</li>
<li>邀请成员、修改角色</li>
<li>浏览、回复项目动态</li>
<li>点赞、分享项目动态</li>
</ul>
<span class="f13 fb c-grey3">更多项目特性(浏览器版)</span>
<ul class="project-intro mt5">
<li>发布任务、问题跟踪</li>
<li>代码托管、质量分析</li>
<li>资源分享、交流研讨</li>
</ul>
</div>
</form>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
</div>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save