Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-09-05 10:38:58 +08:00
commit 0a57f07e29
124 changed files with 2550 additions and 1396 deletions

View File

@ -540,6 +540,7 @@ module Mobile
present :status, 0 present :status, 0
else else
present :status, -1 present :status, -1
present :message, "该用户已不在班级中"
end end
end end
@ -568,17 +569,26 @@ module Mobile
roles_id << 10 roles_id << 10
end end
c = Course.find("#{params[:id]}") c = Course.find("#{params[:id]}")
#7教辅 9教师 10学生 my_member = c.member_principals.where("users.id=#{current_user.id}").first
if c.tea_id == params[:user_id] || c.tea_id != current_user.id || roles_id.length <= 0
present :status, -1
else
rolesids = []
my_member.roles.each do |role|
rolesids << role.id
end
#7教辅 9教师 10学生
if c.tea_id == params[:user_id] || roles_id.length <= 0
present :status, -1
present :message,"修改失败"
elsif rolesids.include?(3) || rolesids.include?(7) || rolesids.include?(9)
cs = CoursesService.new cs = CoursesService.new
status = cs.modify_user_course_role params,roles_id status = cs.modify_user_course_role params,roles_id
present :status, status present :status, status
else
present :status, -1
present :message,"修改失败"
end end
end end
@ -661,6 +671,85 @@ module Mobile
end end
desc "删除班级成员"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
end
post ':id/deletemember' do
authenticate!
status = -1
if(current_user.id != params[:user_id].to_i)
#权限
c = Course.find("#{params[:id]}")
if c.tea_id != params[:user_id].to_i
my_member = c.member_principals.where("users.id=#{current_user.id}").first
roles_ids = []
my_member.roles.each do |role|
roles_ids << role.id
end
if my_member && (roles_ids.include?(3) || roles_ids.include?(7) || roles_ids.include?(9) )
#删除该成员
cs = CoursesService.new
status = cs.delete_course_member(c,params[:user_id].to_i,current_user)
else
status = -2
end
else
status = -3
end
else
status = -4
end
out = {status: status}
message = case status
when 0; "删除成功"
when -1; "您还未登录"
when -2; "对不起您没有权限"
when -3; "不能删除班级管理员"
when -4; "不能删除自己"
when 1; "该用户不在该班级中"
else; "未知错误,请稍后再试"
end
out.merge(message: message)
end
desc "退出班级"
params do
requires :id, type: Integer
requires :token, type: String
end
post ':id/quit' do
authenticate!
#管理员不能退
cs = CoursesService.new
c = Course.find("#{params[:id]}")
user = current_user
if c.tea_id != user.id
status = cs.exit_course({:object_id => params[:id]}, user)
else
status = 3
end
out = {status: status}
message = case status
when 0; "退出班级成功"
when 1; "您不是该班级成员"
when 2; "您还未登录"
when 3; "管理员不能退出班级"
else; "未知错误,请稍后再试"
end
out.merge(message: message)
end
end end
end end
end end

View File

@ -127,6 +127,7 @@ module Mobile
present :status, 0 present :status, 0
else else
present :status, -1 present :status, -1
present :message, "该用户已不在项目中"
end end
end end
@ -268,6 +269,81 @@ module Mobile
present :status, 0 present :status, 0
end end
desc "删除项目成员"
params do
requires :id, type: Integer
requires :token, type: String
requires :user_id, type: Integer
end
post ':id/deletemember' do
authenticate!
status = -1
if(current_user.id != params[:user_id].to_i)
#权限
project = Project.find("#{params[:id]}")
if project.user_id != params[:user_id].to_i
my_member = project.member_principals.where("users.id=#{current_user.id}").first
roles_ids = []
my_member.roles.each do |role|
roles_ids << role.id
end
if my_member && roles_ids.include?(3)
#删除该成员
ps = ProjectsService.new
status = ps.project_delete_member(project,params[:user_id].to_i,current_user)
else
status = -2
end
else
status = -3
end
else
status = -4
end
out = {status: status}
message = case status
when 0; "删除成功"
when 1; "该用户不在该项目中"
when -1; "您还未登录"
when -2; "您没有权限"
when -3; "不能删除项目创建者"
when -4; "不能删除自己"
else; "未知错误,请稍后再试"
end
out.merge(message: message)
end
desc "退出项目"
params do
requires :id, type: Integer
requires :token, type: String
end
post ':id/quit' do
authenticate!
project = Project.find("#{params[:id]}")
ps = ProjectsService.new
status = ps.exit_project(project,current_user)
out = {status: status}
message = case status
when 0; "退出项目成功"
when -3; "您不是该项目成员"
when -1; "您还未登录"
when -2; "项目创建者不能退出项目"
else; "未知错误,请稍后再试"
end
out.merge(message: message)
end
end end
end end
end end

View File

@ -73,6 +73,12 @@ module Mobile
elsif ac.container_type == "Blog" elsif ac.container_type == "Blog"
"发表博客" "发表博客"
end end
when :course_project_id
if ac.container_type == "Course"
ac.container_id
elsif ac.container_type == "Project"
ac.container_id
end
when :activity_type_name when :activity_type_name
if ac.container_type == "Course" if ac.container_type == "Course"
case ac.act_type case ac.act_type
@ -137,6 +143,7 @@ module Mobile
act_expose :subject #标题 act_expose :subject #标题
act_expose :description #描述 act_expose :description #描述
act_expose :latest_update #最新更新时间 act_expose :latest_update #最新更新时间
act_expose :course_project_id #课程/项目ID
act_expose :course_project_name #课程/项目名字 act_expose :course_project_name #课程/项目名字
act_expose :activity_type_name #课程问答区/项目缺陷等 act_expose :activity_type_name #课程问答区/项目缺陷等
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|

View File

@ -52,6 +52,10 @@ module Mobile
time_from_now issue.created_on time_from_now issue.created_on
when :act_id when :act_id
issue.id issue.id
when :act_type
'Journal'
when :praise_count
get_activity_praise_num(issue)
end end
end end
end end

View File

@ -36,6 +36,10 @@ module Mobile
time_from_now f.created_on time_from_now f.created_on
when :act_id when :act_id
f.id f.id
when :praise_count
get_activity_praise_num(f)
when :act_type
'Comment'
end end
elsif f.is_a?(Hash) && !f.key?(field) elsif f.is_a?(Hash) && !f.key?(field)

View File

@ -3,6 +3,7 @@ module Mobile
class Project < Grape::Entity class Project < Grape::Entity
expose :name expose :name
expose :id expose :id
expose :is_public
expose :user_id expose :user_id
expose :invite_code expose :invite_code
expose :qrcode expose :qrcode

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
@ -203,16 +204,51 @@ class AttachmentsController < ApplicationController
@attachment.save @attachment.save
@newfiledense = filedense @newfiledense = filedense
end end
if @project if @attachment.container_type == "Project" || @attachment.container_type == "Course"
tip_attachment_update
elsif @course
end end
respond_to do |format| respond_to do |format|
format.js format.js
end end
end end
def tip_attachment_update
if params[:course_id]
@tip_all_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id])
@tip_all_public_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 1)
@tip_all_private_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 0)
@course = Course.find(params[:course_id])
elsif params[:project_id]
@tip_all_attachments = Attachment.where(:container_type => "Project", :container_id => params[:project_id])
@tip_all_public_attachments = Attachment.where(:container_type => "Project", :container_id => params[:project_id], :is_public => 1)
@tip_all_private_attachments = Attachment.where(:container_type => "Project", :container_id => params[:project_id], :is_public => 0)
@project = Project.find(params[:project_id])
end
@tag_name = params[:tag_name]
@other = params[:other]
unless @tag_name.blank?
if @other
if @project
@tip_all_attachments = @tip_all_attachments.select{|attachment| !attachment.tag_list.include?('软件版本') && !attachment.tag_list.include?('文档') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('论文') }
@tip_all_public_attachments = @tip_all_public_attachments.select{|attachment| !attachment.tag_list.include?('软件版本') && !attachment.tag_list.include?('文档') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('论文') }
@tip_all_private_attachments = @tip_all_private_attachments.select{|attachment| !attachment.tag_list.include?('软件版本') && !attachment.tag_list.include?('文档') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('论文') }
elsif @course
@tip_all_attachments = @tip_all_attachments.select{|attachment| !attachment.tag_list.include?('课件') && !attachment.tag_list.include?('软件') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('论文') }
@tip_all_public_attachments = @tip_all_public_attachments.select{|attachment| !attachment.tag_list.include?('课件') && !attachment.tag_list.include?('软件') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('论文') }
@tip_all_private_attachments = @tip_all_private_attachments.select{|attachment| !attachment.tag_list.include?('课件') && !attachment.tag_list.include?('软件') && !attachment.tag_list.include?('媒体') && !attachment.tag_list.include?('代码') && !attachment.tag_list.include?('论文') }
end
else
@tip_all_attachments = @tip_all_attachments.select{|attachment| attachment.tag_list.include?(@tag_name)}
@tip_all_public_attachments = @tip_all_public_attachments.select{|attachment| attachment.tag_list.include?(@tag_name)}
@tip_all_private_attachments = @tip_all_private_attachments.select{|attachment| attachment.tag_list.include?(@tag_name)}
end
end
@tip_all_attachments = @tip_all_attachments.count
@tip_all_public_attachments = @tip_all_public_attachments.count
@tip_all_private_attachments = @tip_all_private_attachments.count
end
def thumbnail def thumbnail
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size]) if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
if stale?(:etag => thumbnail) if stale?(:etag => thumbnail)
@ -281,6 +317,7 @@ class AttachmentsController < ApplicationController
@attachment.delete @attachment.delete
@flag = true @flag = true
end end
# tip_attachment_update
respond_to do |format| respond_to do |format|
format.js format.js

View File

@ -331,7 +331,7 @@ class CoursesController < ApplicationController
@all_members = searchTeacherAndAssistant(@course) @all_members = searchTeacherAndAssistant(@course)
@members = @all_members @members = @all_members
when '2' when '2'
if @course.open_student == 1 || User.current.member_of_course?(@course) if @course.open_student == 1 || User.current.member_of_course?(@course) || User.current.admin?
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1) page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type) @all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type)

View File

@ -90,6 +90,7 @@ class FilesController < ApplicationController
@tag_list = get_course_tag_list @course @tag_list = get_course_tag_list @course
end end
@all_attachments = @result @all_attachments = @result
get_attachment_for_tip(@all_attachments)
@limit = 10 @limit = 10
@feedback_count = @all_attachments.count @feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@ -164,6 +165,7 @@ class FilesController < ApplicationController
end end
@all_attachments = @project_attachment_result @all_attachments = @project_attachment_result
get_attachment_for_tip(@all_attachments)
@limit = 10 @limit = 10
@feedback_count = @all_attachments.count @feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@ -325,7 +327,7 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)] @containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
show_attachments @containers show_attachments @containers
# get_attachment_for_tip(@all_attachments) get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments @tag_list = attachment_tag_list @all_attachments
@ -378,7 +380,7 @@ class FilesController < ApplicationController
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
show_attachments @containers show_attachments @containers
# get_attachment_for_tip(@all_attachments) get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments @tag_list = attachment_tag_list @all_attachments

View File

@ -196,8 +196,9 @@ class IssuesController < ApplicationController
priority_id = params[:issue][:priority_id] priority_id = params[:issue][:priority_id]
ps = ProjectsService.new ps = ProjectsService.new
if senduser.id != User.current.id
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
end
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format| respond_to do |format|
format.html { format.html {
@ -589,19 +590,19 @@ class IssuesController < ApplicationController
return false return false
end end
end end
@issue.safe_attributes = issue_attributes
senduser = User.find(params[:issue][:assigned_to_id]) senduser = User.find(params[:issue][:assigned_to_id])
if senduser.id != User.current.id if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i
issue_id = @issue.id issue_id = @issue.id
issue_title = params[:issue][:subject] issue_title = params[:issue][:subject]
priority_id = params[:issue][:priority_id] priority_id = params[:issue][:priority_id]
ps = ProjectsService.new ps = ProjectsService.new
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
end end
@issue.safe_attributes = issue_attributes
@priorities = IssuePriority.active @priorities = IssuePriority.active
@allowed_statuses = @issue.new_statuses_allowed_to(User.current) @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
true true

View File

@ -16,8 +16,8 @@ class QualityAnalysisController < ApplicationController
end end
# params 说明:{identifier版本库名} # params 说明:{identifier版本库名}
# type: 1 新的分析 2 重新分析
def create def create
logger.info("11111111111111111111111111111")
begin begin
user_name = User.find(params[:user_id]).try(:login) user_name = User.find(params[:user_id]).try(:login)
identifier = params[:identifier] identifier = params[:identifier]
@ -30,22 +30,26 @@ class QualityAnalysisController < ApplicationController
# 考虑到历史数据有些用户创建类job但是build失败,即sonar没有结果这个时候需要把job删除,并且删掉quality_analyses表数据 # 考虑到历史数据有些用户创建类job但是build失败,即sonar没有结果这个时候需要把job删除,并且删掉quality_analyses表数据
# 如果不要这句则需要迁移数据 # 如果不要这句则需要迁移数据
@sonar_address = Redmine::Configuration['sonar_address'] @sonar_address = Redmine::Configuration['sonar_address']
projects_date = open(@sonar_address + "/api/projects/index").read # projects_date = open(@sonar_address + "/api/projects/index").read
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] # arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
quality_an = QualityAnalysis.where(:sonar_name => sonar_name).first quality_an = QualityAnalysis.where(:sonar_name => sonar_name)
if @client_jenkins.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank? # if @client_jenkins.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank?
aa = @client_jenkins.job.delete("#{job_name}") # aa = @client_jenkins.job.delete("#{job_name}")
quality_an.delete unless quality_an.blank? # quality_an.delete unless quality_an.blank?
end # end
# type 1的时候之所以判断job是否存在为了防止特殊情况正常情况是不会出现的
# 重新分析的时候需要删除以前的分析结果
@client_jenkins.job.delete("#{job_name}") if @client_jenkins.job.exists?(job_name)
quality_an.delete_all unless quality_an.blank?
# Checks if the given job exists in Jenkins. # Checks if the given job exists in Jenkins.
unless @client_jenkins.job.exists?(job_name)
@g = Gitlab.client @g = Gitlab.client
branch = params[:branch] branch = params[:branch]
language = swith_language_type(params[:language]) language = swith_language_type(params[:language])
path = params[:path].blank? ? "./" : params[:path] path = params[:path].blank? ? "./" : params[:path]
# qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first # qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
version = quality_an.nil? ? 1 : quality_an.sonar_version + 1 version = 1
properties = "sonar.projectKey=#{sonar_name} properties = "sonar.projectKey=#{sonar_name}
sonar.projectName=#{sonar_name} sonar.projectName=#{sonar_name}
sonar.projectVersion=#{version} sonar.projectVersion=#{version}
@ -62,13 +66,11 @@ class QualityAnalysisController < ApplicationController
# jenkins job创建 # jenkins job创建
jenkins_job = @client_jenkins.job.create("#{job_name}", @doc.to_xml) jenkins_job = @client_jenkins.job.create("#{job_name}", @doc.to_xml)
logger.info("Jenkins status of create ==> #{jenkins_job}")
# 将地址作为hook值添加到gitlab # 将地址作为hook值添加到gitlab
@g.add_project_hook(@project.gpid, @jenkins_address + "/project/#{job_name}") # @g.add_project_hook(@project.gpid, @jenkins_address + "/project/#{job_name}")
# job创建完成后自动运行job,如果运行成功则返回200 # job创建完成后自动运行job,如果运行成功则返回200
code = @client_jenkins.job.build("#{job_name}") code = @client_jenkins.job.build("#{job_name}")
logger.error("build result ==> #{code}")
# 判断调用sonar分析是否成功 # 判断调用sonar分析是否成功
# 等待启动时间处理, 最长时间为30分钟 # 等待启动时间处理, 最长时间为30分钟
@ -108,8 +110,6 @@ class QualityAnalysisController < ApplicationController
if quality_an.blank? if quality_an.blank?
QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier,
:sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}")
else
qa.update_attribute(:sonar_version, version)
end end
end end
end end
@ -121,7 +121,7 @@ class QualityAnalysisController < ApplicationController
format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name)} format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name)}
end end
end end
end
rescue => e rescue => e
@message = e.message @message = e.message
logger.error("######################====>#{e.message}") logger.error("######################====>#{e.message}")
@ -302,10 +302,8 @@ class QualityAnalysisController < ApplicationController
@jenkins_address = Redmine::Configuration['jenkins_address'] @jenkins_address = Redmine::Configuration['jenkins_address']
jenkins_username = Redmine::Configuration['jenkins_username'] jenkins_username = Redmine::Configuration['jenkins_username']
jenkins_password = Redmine::Configuration['jenkins_password'] jenkins_password = Redmine::Configuration['jenkins_password']
logger.info("22222222222222222222222222222222")
# connect jenkins # connect jenkins
@client_jenkins = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => jenkins_username, :password => jenkins_password) @client_jenkins = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => jenkins_username, :password => jenkins_password)
logger.info("333333333333333333333333333333")
rescue => e rescue => e
logger.error("failed to connect Jenkins ==> #{e}") logger.error("failed to connect Jenkins ==> #{e}")
end end

View File

@ -1704,7 +1704,7 @@ class UsersController < ApplicationController
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))" sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
end end
if User.current != @user if User.current != @user
sql += "and user_id = #{@user.id}" sql += " and user_id = #{@user.id}"
end end
else else
if User.current != @user if User.current != @user
@ -2214,6 +2214,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] @send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -2233,6 +2234,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids @send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -3396,6 +3398,7 @@ class UsersController < ApplicationController
#这里仅仅是传递需要发送的资源id #这里仅仅是传递需要发送的资源id
@send_id = params[:send_id] @send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] @send_ids = params[:checkbox1] || params[:send_ids]
@hidden_unproject = hidden_unproject_infos
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

@ -37,6 +37,13 @@ module ApplicationHelper
# super # super
# end # end
# 隐藏项目以外的信息
# return: true 显示false 不显示
def hidden_unproject_infos
hidden_info = Setting.find_by_name("hidden_non_project")
(hidden_info && hidden_info.value == "1") ? true : false
end
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换 # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail def get_user_by_mail mail
user = User.find_by_mail(mail) user = User.find_by_mail(mail)
@ -830,11 +837,7 @@ module ApplicationHelper
return false if project.gpid.nil? return false if project.gpid.nil?
g = Gitlab.client g = Gitlab.client
count = g.user_static(project.gpid, :rev => "master").count count = g.user_static(project.gpid, :rev => "master").count
if User.current.member_of?(project) && count > 0 count
true
else
false
end
end end
# 判断版本库是否初始为gitlab # 判断版本库是否初始为gitlab
@ -3241,6 +3244,16 @@ def get_all_children result, jour
result result
end end
#获取该节点所在的帖子
def get_root_parent comment
while comment.parent
comment = comment.parent
end
comment
end
#将有置顶属性的提到数组前面 #将有置顶属性的提到数组前面
def sort_by_sticky topics def sort_by_sticky topics
tmpTopics = [] tmpTopics = []

View File

@ -1,6 +1,7 @@
#coding=utf-8 #coding=utf-8
class AtMessage < ActiveRecord::Base class AtMessage < ActiveRecord::Base
include ApplicationHelper
belongs_to :user belongs_to :user
belongs_to :sender, class_name: "User", foreign_key: "sender_id" belongs_to :sender, class_name: "User", foreign_key: "sender_id"
attr_accessible :at_message, :container, :viewed, :user_id, :sender_id attr_accessible :at_message, :container, :viewed, :user_id, :sender_id
@ -10,7 +11,7 @@ class AtMessage < ActiveRecord::Base
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id, :sender_id, :at_message_id, :at_message_type, presence: true validates :user_id, :sender_id, :at_message_id, :at_message_type, presence: true
after_create :add_user_message after_create :add_user_message, :send_wechat_message
scope :unviewed, ->(type, id){ scope :unviewed, ->(type, id){
where(at_message_type: type, at_message_id:id, viewed: false) where(at_message_type: type, at_message_id:id, viewed: false)
@ -34,6 +35,91 @@ class AtMessage < ActiveRecord::Base
end end
end end
#@的时候发微信模版消息通知被@的人
def send_wechat_message
shield_type = ""
container_id = 0
status = 0
type = ""
detail_id = 0
detail_title = ""
if defined? at_message.notes
detail_content = strip_html at_message.notes,30
elsif defined? at_message.content
detail_content = strip_html at_message.content,30
elsif defined? at_message.description
detail_content = strip_html at_message.description,30
end
user = self.user
topic = get_root_parent at_message
case at_message_type
when "Issue"
#新建issue
shield_type = "Project"
container_id = at_message.project.id
type = "issues"
detail_id = topic.id
detail_title = at_message.subject
when "Journal"
#issue回复
topic = get_root_parent at_message.journalized
shield_type = "Project"
container_id = at_message.journalized.project.id
type = "issues"
detail_id = topic.id
detail_title = at_message.journalized.subject
when 'Message'
if at_message.course
shield_type = "Course"
container_id = at_message.course.id
type = "course_discussion"
detail_id = topic.id
detail_title = at_message.subject
elsif at_message.project
shield_type = "Project"
container_id = at_message.project.id
type = "project_discussion"
detail_id = topic.id
detail_title = at_message.subject
else
status = -1
end
when 'JournalsForMessage'
if at_message.jour && at_message.jour.course
#作业回复
shield_type = "Course"
container_id = at_message.jour.course.id
type = "homework"
detail_id = at_message.jour.id
detail_title = at_message.jour.name
else
type = "journal_for_message"
detail_id = topic.id
detail_title = at_message.subject
end
else
status = -1
end
count = 0
detail_title = detail_title.gsub(/RE: /, '')
if container_id != 0
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='#{shield_type}' and shield_id=#{container_id}").count
end
if count == 0 && status == 0
message_title = self.sender.show_name+"@了您"
ws = WechatService.new
ws.at_notice user.id, type, detail_id, message_title, detail_title, format_time(Time.now), detail_content, "点击查看详情。",0
end
end
def subject def subject
case at_message_type case at_message_type
when "Issue" when "Issue"

View File

@ -34,7 +34,7 @@ class Tracker < ActiveRecord::Base
end end
has_and_belongs_to_many :projects has_and_belongs_to_many :projects
has_and_belongs_to_many :courses # has_and_belongs_to_many :courses
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id' has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_list acts_as_list

View File

@ -1162,6 +1162,7 @@ class User < Principal
#为新注册用户发送留言 #为新注册用户发送留言
def add_new_jour def add_new_jour
if Setting.find_by_name("hidden_non_project") && Setting.find_by_name("hidden_non_project").value != "0"
if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any? if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
lead_message1 = Message.find(19292) lead_message1 = Message.find(19292)
notes1 = lead_message1.content notes1 = lead_message1.content
@ -1175,6 +1176,7 @@ class User < Principal
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0) self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
end end
end end
end
# 更新邮箱的同事更新invite_lists表中的邮箱信息 # 更新邮箱的同事更新invite_lists表中的邮箱信息
def update_invite_list def update_invite_list

View File

@ -79,7 +79,8 @@ class CoursesService
else else
c = Course.find(course) c = Course.find(course)
end end
if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c))) # if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
if current_user.nil?
raise '403' raise '403'
end end
#@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1' #@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1'
@ -458,8 +459,8 @@ class CoursesService
joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id]) joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id])
joined.each do |join| joined.each do |join|
join.delete join.delete
@state = 0
end end
@state = 0
@state @state
end end
@ -1284,5 +1285,35 @@ class CoursesService
status status
end end
#删除班级成员
def delete_course_member course,user_id,current_user
if current_user.nil?
state = -1
return state
end
member = course.members.where("user_id=?",user_id).first
if member != nil
member.destroy
user_admin = CourseInfos.where("user_id = ? and course_id = ?", member.user_id, course.id)
if user_admin.size > 0
user_admin.each do |user|
user.destroy
end
end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id)
joined.each do |join|
join.delete
end
roles = Role.givable.all[3..5]
#移出课程发送消息
CourseMessage.create(:user_id => member.user_id, :course_id => course.id, :course_message_type => "RemoveFromCourse", :viewed => false, :course_message_id => current_user.id)
return 0
else
return 1
end
end
end end

View File

@ -355,4 +355,67 @@ class ProjectsService
end end
end end
#删除项目成员
def project_delete_member project,user_id,current_user
if current_user.nil?
state = -1
return state
end
member = project.members.where("user_id=?",user_id).first
if member != nil
member.destroy
# end
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
user_grade = UserGrade.where("user_id = ? and project_id = ?", member.user_id, project.id)
if user_grade.size > 0
user_grade.each do |grade|
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 => current_user.id)
return 0
else
return 1
end
end
def exit_project project,user
if user.nil?
state = -1
return state
end
if project.user_id == user.id
state = -2
return state
end
members = Member.where(:user_id => user.id, :project_id=>project.id).first
if members != nil
members.destroy
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
applied_projects = AppliedProject.where(:project_id => project.id, :user_id => members.user_id).first
unless applied_projects.nil?
applied_projects.delete
end
state = 0
else
state = -3
end
return state
end
end end

View File

@ -432,4 +432,17 @@ class WechatService
end end
end end
def at_notice(user_id, type, id, first, key1, key2,key3,remark="",uid=0)
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = three_keys_template uw.openid,Wechat.config.at_notice, type, id, first, key1, key2, key3, remark,uid
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[at_notice] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
end end

View File

@ -1,16 +1,18 @@
<% if @attachment.container_type == 'Course' %> <% if @attachment.container_type == 'Course' %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), $("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id, :course_id => @attachment.container_id, :tag_name => @tag_name, :other => @other,:newtype=>(@attachment.is_public? ? 0:1)),
:remote=>true,:class=>"postOptionLink",:method => :post) %>"); :remote=>true,:class=>"postOptionLink",:method => :post) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
<% elsif @attachment.container_type == 'Project' %> <% elsif @attachment.container_type == 'Project' %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => @attachment.id, :newtype => (@attachment.is_public? ? 0:1)), $("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => @attachment.id, :project_id => @attachment.container_id, :tag_name => @tag_name, :other => @other ,:newtype => (@attachment.is_public? ? 0:1)),
:remote => true, :class => "postOptionLink", :method => :post) %>"); :remote => true, :class => "postOptionLink", :method => :post) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
<% else %> <% else %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), $("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)),
:remote=>true,:class=>"postOptionLink",:method => :post) %>"); :remote=>true,:class=>"postOptionLink",:method => :post) %>");
<% end %> <% end %>
<% if @attachment.is_public? %> <% if @attachment.is_public? %>
$("#image_private_<%= @attachment.id%>").html('') $("#image_private_<%= @attachment.id%>").html('')
<%else%> <%else%>
$("#image_private_<%= @attachment.id%>").html('<span class="img_private ml5">私有</span>') $("#image_private_<%= @attachment.id%>").html('<span class="img_private ml5">私有</span>')
<% end %> <% end %>

View File

@ -54,11 +54,11 @@
</a> </a>
<ul> <ul>
<li> <li>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %> <%= link_to("#{l(:label_bidding_user_studentname)}<span class='hidden st_info_block'>#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
</li> </li>
<br/> <br/>
<% unless member.user.user_extensions.student_id == ''%> <% unless member.user.user_extensions.student_id == ''%>
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li> <li><%= link_to("#{l(:label_bidding_user_studentcode)}<span class='hidden st_info_block'>#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%> <% end%>
</ul> </ul>
<% unless @course.course_groups.empty? %> <% unless @course.course_groups.empty? %>

View File

@ -115,22 +115,23 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="re_con_top"> <div class="re_con_top">
<!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">--> <p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<!--<%#= render :partial => "files/tip_attachment_count" %>--> <%= render :partial => "files/tip_attachment_count" %>
<!--</p>--> </p>
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080" id="course_filter_order"> <p class="f_r" style="color: #808080" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %> <%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p> </p>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!--<div class="resource_tip_box fontGrey2">--> <% if !User.current.member_of_course?(@course) && show_attachment_tip(@course.id, "Course") %>
<!--<em></em>--> <div class="resource_tip_box fontGrey2">
<!--<span></span>--> <em></em>
<!--<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>--> <span></span>
<!--<p>公共资源:<br/>对所有用户可见</p>--> <p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
<!--</div>--> <p>公共资源:<br/>对所有用户可见</p>
</div>
<% end %>
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>

View File

@ -63,7 +63,11 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %> <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<% else %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li> <li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<% if file.container.try(:organization).try(:is_public?) %> <% if file.container.try(:organization).try(:is_public?) %>
<li> <li>

View File

@ -85,10 +85,9 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="re_con_top"> <div class="re_con_top">
<!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">--> <p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<!--<%#= render :partial => "files/tip_attachment_count" %>--> <%= render :partial => "files/tip_attachment_count" %>
<!--</p>--> </p>
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080"> <p class="f_r" style="color: #808080">
<% if @order == "asc" %> <% if @order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp; 按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
@ -103,14 +102,14 @@
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%# if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %> <% if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %>
<!--<div class="resource_tip_box fontGrey2">--> <div class="resource_tip_box fontGrey2">
<!--<em></em>--> <em></em>
<!--<span></span>--> <span></span>
<!--<p class="mb5">私有资源:<br/>仅对本项目成员可见</p>--> <p class="mb5">私有资源:<br/>仅对本项目成员可见</p>
<!--<p>公共资源:<br/>对所有用户可见</p>--> <p>公共资源:<br/>对所有用户可见</p>
<!--</div>--> </div>
<%# end %> <% end %>
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %> <%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>

View File

@ -70,7 +70,11 @@
<% if @course.is_public? %> <% if @course.is_public? %>
<li> <li>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %> <% if params[:tag_name].blank? %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :course_id => @course.id), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% else %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :course_id => @course.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% end %>
</span> </span>
</li> </li>
<%end%> <%end%>

View File

@ -1,15 +1,18 @@
共有&nbsp;<span id="attachment_count"><%= @tip_all_attachments %></span>&nbsp;个资源 共有&nbsp;<span id="attachment_count"><%= @tip_all_attachments %></span>&nbsp;个资源
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span> <% if @tip_all_private_attachments != 0 %>
<% if @project %> <span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
<% if @project %>
<% if !User.current.member_of?(@project) && params[:tag_name] %> <% if !User.current.member_of?(@project) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span> <span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %> <% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span> <span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %> <% end %>
<% elsif @course %> <% elsif @course %>
<% if !User.current.member_of_course?(@course) && params[:tag_name] %> <% if !User.current.member_of_course?(@course) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span> <span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %> <% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span> <span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %> <% end %>
<% end %>
<% end %> <% end %>

View File

@ -4,12 +4,25 @@
<% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %> <% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %>
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %> <% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li> <% else %>
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
<% if params[:tag_name].blank? %>
<li><%= link_to '更新版本',attachments_versions_path(file, :project_id => project.id), :class => "postOptionLink", :remote => true %></li>
<% else %>
<li><%= link_to '更新版本',attachments_versions_path(file, :tag_name => params[:tag_name].force_encoding("UTF-8"), :project_id => project.id, :other => params[:other]),:class => "postOptionLink",:remote=>true %></li>
<% end %>
<% if project.is_public? %> <% if project.is_public? %>
<li> <li>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1)), :remote=>true,:class=>"postOptionLink",:method => :post %> <% if params[:tag_name].blank? %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :project_id => project.id), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% else %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :project_id => project.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% end %>
</span> </span>
</li> </li>
<% end %> <% end %>
@ -20,7 +33,11 @@
<% end %> <% end %>
<% else %> <% else %>
<ul class="resourceSendO"> <ul class="resourceSendO">
<% if hidden_unproject_infos %>
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<% else %>
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
<% end %>
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,4 @@
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>"); $("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");

View File

@ -1,8 +1,8 @@
<% if @course %> <% if @course %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>"); $("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% else %> <% else %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>"); $("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
// $("#tip_attachment_count").html("<%#= escape_javascript( render :partial => 'files/tip_attachment_count') %>"); $("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% end %> <% end %>

View File

@ -4,7 +4,9 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li> <li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li> <li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li> <li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<% if hidden_unproject_infos %>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li> <li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li> <li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
</ul> </ul>

View File

@ -4,7 +4,9 @@
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li> <li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<% if hidden_unproject_infos %>
<li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li> <li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li> <li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li>
</ul> </ul>

View File

@ -10,12 +10,14 @@
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %> <%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
</li> </li>
<% if hidden_unproject_infos %>
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%> <%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li> </li>
<li class="navHomepageMenu fl mr30"> <li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %> <%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>
<script> <script>

View File

@ -10,12 +10,14 @@
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a>
</li> </li>
<% if hidden_unproject_infos %>
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a>
</li> </li>
<li class="navHomepageMenu fl mr30"> <li class="navHomepageMenu fl mr30">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a> <a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>
<div class="fl" id="navHomepageSearch"> <div class="fl" id="navHomepageSearch">

View File

@ -3,6 +3,7 @@
<div class="scrollsidebar" id="scrollsidebar"> <div class="scrollsidebar" id="scrollsidebar">
<div class="side_content"> <div class="side_content">
<div class="side_list"> <div class="side_list">
<div class="qr-code-border borderBottomNone"><img src="/images/wechat/trustie_QR.jpg" width="150" style="display:block;" /> </div>
<div class="side_title"> <div class="side_title">
<a title="<%= l(:button_hide) %>" class="close_btn"> <a title="<%= l(:button_hide) %>" class="close_btn">
<span> <span>

View File

@ -115,7 +115,7 @@
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%> <%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
</li> </li>
<% end %> <% end %>
<% elsif ma.class == ForgeMessage && ma.forge_message %> <% elsif ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li> <li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "JoinProject" %> <% elsif ma.forge_message_type == "JoinProject" %>
@ -128,7 +128,7 @@
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li> <li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %> <% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li> <li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "Journal" %> <% elsif ma.forge_message_type == "Journal" && ma.forge_message %>
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li> <li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
<% elsif ma.forge_message_type == "Message" %> <% elsif ma.forge_message_type == "Message" %>
<li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li> <li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>

View File

@ -8,7 +8,7 @@
<li > <li >
<%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sy_teachers_img fl mr15"), user_path(teacher), :target => "_blank", :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sy_teachers_img fl mr15"), user_path(teacher), :target => "_blank", :alt => "用户头像" %>
<div class="sy_teachers_txt fl"> <div class="sy_teachers_txt fl">
<%= link_to teacher.show_name, user_path(teacher), :class => "sy_teachers_name", :target => "_blank" %> <%= link_to teacher.show_name, user_path(teacher), :class => "sy_teachers_name hidden", :target => "_blank", :title => teacher.show_name %>
<span class="sy_teachers_span"> <span class="sy_teachers_span">
<% if teacher.user_extensions && teacher.user_extensions.identity %> <% if teacher.user_extensions && teacher.user_extensions.identity %>
<%= get_user_roll teacher %> <%= get_user_roll teacher %>

View File

@ -1,6 +1,6 @@
<%# course_model %> <%# course_model %>
<% course_file_num = visable_attachemnts_incourse(@course).count%> <%# course_file_num = visable_attachemnts_incourse(@course).count%>
<%# course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %> <% course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% homework_num = visable_course_homework @course %> <% homework_num = visable_course_homework @course %>

View File

@ -251,9 +251,10 @@
}); });
</script> </script>
</div> </div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="fade" class="black_overlay">123</div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -38,7 +38,16 @@
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div style="width:1000px; margin: 5px auto;">
<p class="sy_cgrey">
位置:&nbsp;&nbsp;
<%= link_to User.current, user_path(User.current.id), :class => 'sy_cgrey', :target => '_blank' %>
&nbsp;&gt;&nbsp;
<%= link_to '课程', user_courselist_user_path(User.current.id), :class => "sy_cgrey", :target => '_blank' %>
&nbsp;&gt;&nbsp;
<%= link_to @syllabus.title, syllabus_path(@syllabus.id), :class => "sy_cgrey" %>
</p>
</div>
<div class="sy_contanier"> <div class="sy_contanier">
<div class="sy_top"> <div class="sy_top">
<div class="sy_top_con" onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();"> <!-- onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();" --> <div class="sy_top_con" onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();"> <!-- onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();" -->
@ -50,7 +59,7 @@
<div class="sy_con_l fl mb15"> <div class="sy_con_l fl mb15">
<%= yield %> <%= yield %>
</div><!--sy_con_l end--> </div><!--sy_con_l end-->
<div class="sy_con_r fr "> <div class="sy_con_r fr mb10">
<div class="sy_right_box" id="syllabus_base_info"> <div class="sy_right_box" id="syllabus_base_info">
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %> <%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
</div> </div>

View File

@ -298,6 +298,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!--Container end--> </div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %> <%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>

View File

@ -59,7 +59,9 @@
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -159,9 +159,7 @@
</div> </div>
<div class="user_leftnav "> <div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %> <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
@ -224,7 +222,9 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %> <%= render :partial => 'layouts/new_feedback' %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>

View File

@ -152,9 +152,7 @@
</div> </div>
<div class="user_leftnav "> <div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<a href ="javascript:void(0);" disabled="true">课程</a> <a href ="javascript:void(0);" disabled="true">课程</a>
@ -233,7 +231,9 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/forbidden_new_feedback' %> <%= render :partial => 'layouts/forbidden_new_feedback' %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer_show' %> <%= render :partial => 'layouts/footer_show' %>

View File

@ -42,7 +42,6 @@
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if @topic.author.id == User.current.id %>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
@ -59,7 +58,6 @@
:class => 'postOptionLink' :class => 'postOptionLink'
) if @message.course_destroyable_by?(User.current) %> ) if @message.course_destroyable_by?(User.current) %>
</li> </li>
<% end %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li> <li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
</ul> </ul>
</li> </li>

View File

@ -104,19 +104,20 @@
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li> <li>
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %> <%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
</li> </li>
<% if @topic.author.id == User.current.id %>
<li> <li>
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post, <%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink' :class => 'postOptionLink'
) if @message.destroyable_by?(User.current) %> ) if @message.destroyable_by?(User.current) %>
</li> </li>
<% end %> <% if hidden_unproject_infos %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li> <li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
<% else %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -199,7 +200,7 @@
:class => 'fr mr20 undis', :class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %> ) if reply.destroyable_by?(User.current) %>
</span> </span>
<div class="cl"></div> <div class="cl"></div>

View File

@ -82,7 +82,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostReply"> <div class="homepagePostReply">
<%= render :partial => 'news/news_all_replies' %> <%= render :partial => 'news/news_all_replies', :locals => {:object => @course} %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -51,7 +51,7 @@
:class => 'fr mr20 undis', :class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete) :title => l(:button_delete)
) if @news.author == User.current %> ) if User.current.allowed_to?(:manage_news, object) %>
</span> </span>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -26,7 +26,11 @@
<ul> <ul>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if hidden_unproject_infos %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{@news.id}','#{User.current.id}','news')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{@news.id}','#{User.current.id}','news')") %></li>
<% else %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{@news.id}','#{User.current.id}','news')") %></li>
<% end %>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),
@ -82,7 +86,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostReply"> <div class="homepagePostReply">
<%= render :partial => 'news/news_all_replies' %> <%= render :partial => 'news/news_all_replies', :locals => {:object => @project} %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -61,6 +61,7 @@
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %> <%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
</div> </div>
<% when 'course' %> <% when 'course' %>
<% if hidden_unproject_infos %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>"> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
@ -74,6 +75,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<% end %>
<% when 'project' %> <% when 'project' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>"> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">

View File

@ -20,6 +20,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType"> <ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<li class="f14">课程动态</li> <li class="f14">课程动态</li>
@ -33,6 +34,7 @@
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>--> <!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul> </ul>
</li> </li>
<% end %>
<li> <li>
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li> <li class="f14">项目动态</li>

View File

@ -1,3 +1,4 @@
<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %> <%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %> <% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -30,8 +31,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %> <% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %> <%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %> <% unless project_file_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <%= link_to "(#{project_file_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
@ -40,12 +41,14 @@
</div> </div>
<% end %> <% end %>
<div class="subNav"> <% if allow_pull_request(@project) %>
<div class="subNav">
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %> <%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
<% if allow_pull_request(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %> <%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %>
<% end %> <% end %>
</div> </div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %> <% if visible_repository?(@project) %>

View File

@ -1,3 +1,4 @@
<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %> <%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %> <% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -18,8 +19,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %> <% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %> <%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %> <% unless project_file_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <%= link_to "(#{project_file_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %> <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %>

View File

@ -38,7 +38,12 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if hidden_unproject_infos %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<% else %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{activity.id}',#{User.current.id},'news')") %></li>
<% end %>
<li> <li>
<%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %> <%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %>
</li> </li>

View File

@ -1,3 +1,4 @@
<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %> <%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %> <% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -29,8 +30,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %> <% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %> <%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %> <% unless project_file_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <%= link_to "(#{project_file_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %> <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %>

View File

@ -3,7 +3,7 @@
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li> <li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li> <li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li> <li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
<% if allow_pull_request(@project) %> <% if allow_pull_request(@project) && User.current.member_of?(@project) %>
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %> <%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>

View File

@ -127,7 +127,7 @@
<p class="fontBlue2"><%= @ha["functions"].to_i %></p> <p class="fontBlue2"><%= @ha["functions"].to_i %></p>
</div> </div>
</div> </div>
<% unless @user_quality_infos.blank? %> <% if !@user_quality_infos.blank? %>
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div> <div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>
<div class="analysis-block mt10 f12"> <div class="analysis-block mt10 f12">
<ul class="contribute-list"> <ul class="contribute-list">
@ -141,7 +141,7 @@
<% @user_quality_infos.each do |author_info| %> <% @user_quality_infos.each do |author_info| %>
<% user = get_user_by_mail(author_info[:email]) %> <% user = get_user_by_mail(author_info[:email]) %>
<% unless author_info[:changes] == 0 %> <%# unless author_info[:changes] == 0 %>
<ul class="contribute-list"> <ul class="contribute-list">
<li class="fl fontGrey2 contribute-list-avatar contribute-list-height"> <li class="fl fontGrey2 contribute-list-avatar contribute-list-height">
<div class="mt8"> <div class="mt8">
@ -155,7 +155,7 @@
<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height"><%= author_info[:ratio] %></li> <li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height"><%= author_info[:ratio] %></li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% end %> <%# end %>
<% end %> <% end %>
</div> </div>

View File

@ -3,8 +3,12 @@
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div> <div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<% unless @entries.nil? %> <% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a> <a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? && User.current.member_of?(@project) && @project.is_public? %> <% if User.current.member_of?(@project) && @project.is_public? %>
<%= 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" %> <% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %>
<% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<!--quality_analysis--> <!--quality_analysis-->

View File

@ -6,7 +6,7 @@
</p> </p>
<div class="f14 mt5" style="max-width: 425px; color:#808181; max-height:300px; overflow: auto;"> <div class="f14 mt5" style="max-width: 425px; color:#808181; max-height:300px; overflow: auto;">
<div class="fb fl dis">作品描述:</div> <div class="fb fl dis">作品描述:</div>
<div class="upload_img fl" style="max-width: 330px;"><%=@student_work.description.html_safe %></div> <div id="worksDescription" class="upload_img fl" style="max-width: 330px;"><%=@student_work.description.html_safe %></div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<p class="mt5"> <p class="mt5">

View File

@ -10,7 +10,7 @@
<div class="syllabus_class_w "> <div class="syllabus_class_w ">
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a> <a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span> <span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span> <span class="fr sy_p_grey hidden" style="max-width: 120px;">创建老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -33,7 +33,7 @@
:title => l(:button_reply)) %> :title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span> <span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span> </span>
<% if comment.course_destroyable_by?(User.current) %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board), delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),

View File

@ -56,8 +56,9 @@
:title => l(:button_reply)) %> :title => l(:button_reply)) %>
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span> <span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span> </span>
<%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id=>activity_id, :comment_id => comment, :user_activity_id => user_activity_id}, <% news = News.find(activity_id) %>
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) if News.find(activity_id).author == User.current %> <%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id => activity_id, :comment_id => comment, :user_activity_id => user_activity_id},
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) if (User.current.allowed_to?(:manage_news, news.course) || User.current.allowed_to?(:manage_news, news.project)) %>
<% elsif type == 'Issue' %> <% elsif type == 'Issue' %>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">
<%= link_to( <%= link_to(

View File

@ -80,7 +80,7 @@
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div> <div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div> <div class="cl"></div>
<%# 局部刷新修改xissue属性 %> <%# 局部刷新修改xissue属性 %>
<% if User.current.member_of?(activity.project) %> <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
<% unless params[:action] == "index" %> <% unless params[:action] == "index" %>
<div id="div_user_issue_detail_<%=activity.id %>"> <div id="div_user_issue_detail_<%=activity.id %>">
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>

View File

@ -68,7 +68,11 @@
) if activity.destroyable_by?(User.current) %> ) if activity.destroyable_by?(User.current) %>
</li> </li>
<% end %> <% end %>
<% if hidden_unproject_infos %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li> <li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% else %>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -35,7 +35,12 @@
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %> <% if User.current.logged? %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<% if hidden_unproject_infos %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li> <li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
<% else %>
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{activity.id}',#{User.current.id},'news')") %></li>
<% end %>
<li> <li>
<%= link_to( <%= link_to(
l(:button_edit), l(:button_edit),

View File

@ -4,11 +4,18 @@
<% unless send_ids.blank? %> <% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %> <% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %> <% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');"> <% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2">项目</option> <option value="2">项目</option>
<option value="3" selected>组织</option> <option value="3" selected>组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get', <%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -5,11 +5,18 @@
<% unless send_ids.blank? %> <% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %> <% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %> <% end %>
<% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');"> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2" selected>项目</option> <option value="2" selected>项目</option>
<option value="3">组织</option> <option value="3">组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -87,6 +87,33 @@
} }
function show_send_hidden(){
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}
line.children().css("background-color",'white');
id = line.children().last().html();
user_id = line.children().eq(5).html();
allow = line.children().eq(13).html();
if( allow == 0){
alert('您无权发送私有资源')
}else{
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id) %>' + "?send_id=" + id + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id)%>' + "?send_id=" + id + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
}
}
function batch_send(){ function batch_send(){
if($("#resources_list_form").serialize() == ""){ if($("#resources_list_form").serialize() == ""){
alert('暂时不支持多页选择,您当前页没有选择任何资源'); alert('暂时不支持多页选择,您当前页没有选择任何资源');
@ -121,6 +148,35 @@
} }
} }
// 隐藏非项目信息特用
function batch_send_hidden(){
if($("#resources_list_form").serialize() == ""){
alert('暂时不支持多页选择,您当前页没有选择任何资源');
return ;
}
if (lastSendType === '1'){
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else if (lastSendType === '2'){
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
}
function preview(){ function preview(){
$("#contextMenu").hide(); $("#contextMenu").hide();
document.oncontextmenu = function() {return true;} document.oncontextmenu = function() {return true;}

View File

@ -3,6 +3,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType"> <ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<li class="f14"><strong>课程消息</strong></li> <li class="f14"><strong>课程消息</strong></li>
@ -12,7 +13,7 @@
<li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li> <li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
</ul> </ul>
</li> </li>
<% end %>
<li> <li>
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14"><strong>项目消息</strong></li> <li class="f14"><strong>项目消息</strong></li>
@ -23,6 +24,7 @@
</ul> </ul>
</li> </li>
<% if hidden_unproject_infos %>
<div class="cl"></div> <div class="cl"></div>
<li> <li>
<ul class="homepagePostTypeMore"> <ul class="homepagePostTypeMore">
@ -34,7 +36,18 @@
<li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li> <li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
</ul> </ul>
</li> </li>
<% else %>
<li class="fl ml15">
<ul>
<li class="f14"><strong>更多</strong></li>
<li><%= link_to "所有消息",user_message_path(User.current), :class => "resourcesTypeAll postTypeGrey" %></li>
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "homepageTypeUnread postTypeGrey" %></li>
<li><%= link_to "系统消息", user_system_messages_path(User.current, :type => 'system_messages'), :class => "homepageTypeSystem postTypeGrey" %></li>
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "homepageTypePost postTypeGrey" %></li>
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
</ul>
</li>
<% end %>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -0,0 +1,12 @@
<% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option>
<option value="2">项目</option>
<option value="3">组织</option>
</select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">项目</option>
<option value="2">组织</option>
</select>
<% end %>

View File

@ -1,11 +1,18 @@
<div > <div >
<div class="relateText fl mb10 mr5">发送到</div> <div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15"> <div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');"> <% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2">项目</option> <option value="2">项目</option>
<option value="3" selected>组织</option> <option value="3" selected>组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user),:method => 'get', <%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -2,11 +2,18 @@
<div> <div>
<div class="sendText fl mr10" style="width: auto">发送到</div> <div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo"> <div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','message');"> <% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2" selected>项目</option> <option value="2" selected>项目</option>
<option value="3">组织</option> <option value="3">组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,11 +1,18 @@
<div > <div >
<div class="relateText fl mb10 mr5">发送到</div> <div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15"> <div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','news');"> <% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2">项目</option> <option value="2">项目</option>
<option value="3" selected>组织</option> <option value="3" selected>组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" >项目</option>
<option value="2" selected>组织</option>
</select>
<% end %>
</div> </div>
<%= form_tag search_user_org_user_path(user),:method => 'get', <%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %> :remote=>true,:id=>'search_user_org_form' do %>

View File

@ -2,11 +2,18 @@
<div> <div>
<div class="sendText fl mr10" style="width: auto">发送到</div> <div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo"> <div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','news');"> <% if @hidden_unproject %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">班级</option> <option value="1">班级</option>
<option value="2" selected>项目</option> <option value="2" selected>项目</option>
<option value="3">组织</option> <option value="3">组织</option>
</select> </select>
<% else %>
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1" selected>项目</option>
<option value="2">组织</option>
</select>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -23,7 +23,7 @@
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%> :style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
<% teacher = User.where("id=?",course.tea_id).first%> <% teacher = User.where("id=?",course.tea_id).first%>
<span class="fr grayTxt"> <span class="fr grayTxt">
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %> <%='创建老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
</span> </span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,4 @@
<% if ma.class == ForgeMessage && ma.forge_message %> <% if ma.class == ForgeMessage %>
<!--申请加入项目--> <!--申请加入项目-->
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
@ -130,7 +130,7 @@
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>
<% if ma.forge_message_type == "Journal" %> <% if ma.forge_message_type == "Journal" && ma.forge_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a>

View File

@ -23,9 +23,15 @@
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div> <a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="resourcesSelectSend mt10 fl"> <div class="resourcesSelectSend mt10 fl">
<% if hidden_unproject_infos %>
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();"> <div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a> <a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div> </div>
<% else %>
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send_hidden();">
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<% end %>
<div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div> <div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div>
</div> </div>
@ -45,7 +51,11 @@
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li>
<!-- data-remote="true" 这个属性会让ajax请求状态标志就在当前按钮的上方显示就不会滚动浏览器因而弹出框也会在当前窗口中央展示--> <!-- data-remote="true" 这个属性会让ajax请求状态标志就在当前按钮的上方显示就不会滚动浏览器因而弹出框也会在当前窗口中央展示-->
<% if hidden_unproject_infos %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send();" onfocus="this.blur()" >发送</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send();" onfocus="this.blur()" >发送</a></li>
<% else %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send_hidden();" onfocus="this.blur()" >发送</a></li>
<% end %>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)delete_file();" onfocus="this.blur()">删除</a></li> <li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)delete_file();" onfocus="this.blur()">删除</a></li>
</ul> </ul>
</ul> </ul>

View File

@ -4,10 +4,12 @@
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li> </li>
<% if hidden_unproject_infos %>
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %> <%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li> </li>
<% end %>
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %> <%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>

View File

@ -7,9 +7,7 @@
<ul class="homepagePostType"> <ul class="homepagePostType">
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<li class="f14">课程动态</li> <li class="f14">课程动态</li>
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> <li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li> <!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>

View File

@ -8,12 +8,6 @@
function remote_get_resources(user_id,type){ function remote_get_resources(user_id,type){
} }
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
});
function remote_search(){ function remote_search(){
$("#resource_search_form").submit(); $("#resource_search_form").submit();
} }
@ -75,5 +69,10 @@
<div class="cl"></div> <div class="cl"></div>
<script>
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
</script>

View File

@ -22,14 +22,6 @@ button:
- -
name: "更多" name: "更多"
sub_button: sub_button:
-
type: "view"
name: "加入班级"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=join_class#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=join_project#wechat_redirect"
- -
type: "view" type: "view"
name: "历史推文" name: "历史推文"

View File

@ -22,14 +22,6 @@ button:
- -
name: "更多" name: "更多"
sub_button: 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=join_class#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=join_project#wechat_redirect"
- -
type: "view" type: "view"
name: "历史推文" name: "历史推文"

View File

@ -25,6 +25,7 @@ default: &default
project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E" project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E"
join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg" join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg"
project_issue_notice: "HP8JejOnkzmvFopTarc0l1Tp4bU9qnxzdH27x3186lI" project_issue_notice: "HP8JejOnkzmvFopTarc0l1Tp4bU9qnxzdH27x3186lI"
at_notice: "U3kqzgriCaqkPI9qX0NDQOInJ5hiwHCz6wgTsPysSx4"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities" auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state=" auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="

View File

@ -25,6 +25,7 @@ default: &default
project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc" project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc"
join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M" join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M"
project_issue_notice: "HAF2aCta7BtnaOd_cotGvU4tErGWwCd9I9aiClFN7w8" project_issue_notice: "HAF2aCta7BtnaOd_cotGvU4tErGWwCd9I9aiClFN7w8"
at_notice: "p4HfyZQuF8O5bP_44RbbJS30SGojLJAuZEqp34iB4JU"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities" auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state=" auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="

View File

@ -6,6 +6,7 @@ class MergeTwoHomeworks < ActiveRecord::Migration
work.update_column('homework_common_id', 3463) work.update_column('homework_common_id', 3463)
end end
end end
begin
homework = HomeworkCommon.find 3387 homework = HomeworkCommon.find 3387
homework.destroy if homework homework.destroy if homework
stu_works = StudentWork.where("homework_common_id = 3387") stu_works = StudentWork.where("homework_common_id = 3387")
@ -13,6 +14,9 @@ class MergeTwoHomeworks < ActiveRecord::Migration
stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}") stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}")
stu_work_tests.destroy_all if stu_work_tests stu_work_tests.destroy_all if stu_work_tests
stu_works.destroy_all if stu_works stu_works.destroy_all if stu_works
rescue Exception => e
puts e
end
end end
def down def down

View File

@ -40,7 +40,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -75,7 +75,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -111,7 +111,7 @@
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -147,7 +147,7 @@
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<!--<div class="fr f13">--> <!--<div class="fr f13">-->
<!--<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>--> <!--<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>-->
<!--<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>--> <!--<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>-->
@ -236,7 +236,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goProject(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -272,7 +272,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goProject(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -405,7 +405,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -440,7 +440,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -476,7 +476,7 @@
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>--> <!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -492,6 +492,42 @@
</div> </div>
</div> </div>
<div ng-if="act.act_type=='Poll'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span>{{act.author.real_name}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【问卷】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml" 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>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goClass(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<!--<div class="fr f13">-->
<!--<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>赞</span></div>-->
<!--<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>-->
<!--<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>-->
<!--</div>-->
<!--<div class="fr mr25 f13">-->
<!--<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>-->
<!--<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>-->
<!--</div>-->
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Course'"> <div ng-if="act.act_type=='Course'">
<div class="post-container"> <div class="post-container">
@ -536,7 +572,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goProject(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
@ -572,7 +608,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div> <div class="post-dynamic-from hidden fl c-grey3">来源: <span ng-click = "goProject(act.course_project_id)" class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div> <div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>

View File

@ -40,6 +40,7 @@
<script src="/javascripts/wechat/directives/input_focus.js"></script> <script src="/javascripts/wechat/directives/input_focus.js"></script>
<script src="/javascripts/wechat/directives/at_delete_link.js"></script> <script src="/javascripts/wechat/directives/at_delete_link.js"></script>
<script src="/javascripts/wechat/directives/iphone_recognize.js"></script> <script src="/javascripts/wechat/directives/iphone_recognize.js"></script>
<script src="/javascripts/wechat/directives/submit_start.js"></script>
<script src="/javascripts/wechat/controllers/reg.js"></script> <script src="/javascripts/wechat/controllers/reg.js"></script>
<script src="/javascripts/wechat/controllers/login.js"></script> <script src="/javascripts/wechat/controllers/login.js"></script>
<script src="/javascripts/wechat/controllers/activity.js"></script> <script src="/javascripts/wechat/controllers/activity.js"></script>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="blog.act_type == 'BlogComment'"> <div ng-if="blog.act_type == 'BlogComment'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -25,7 +33,7 @@
<div ng-if="blog.praise_count && !blog.has_praise" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div> <div ng-if="blog.praise_count && !blog.has_praise" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
<div ng-if="blog.has_praise" ng-click="decreasePraise(blog);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div> <div ng-if="blog.has_praise" ng-click="decreasePraise(blog);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
</div> </div>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<a ng-if="!blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a> <a ng-if="!blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{blog.comment_count}}</span></a> <a ng-if="blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{blog.comment_count}}</span></a>
</div> </div>
@ -57,9 +65,14 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40"> <div class="post-reply-content c-grey3 ml40">
<div class="mult-reply-content mb15"> <div class="mult-reply-content mb5">
<div ng-bind-html="journal.content|safeHtml"></div> <div ng-bind-html="journal.content|safeHtml"></div>
</div> </div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -217,7 +217,7 @@
<div ng-if="course_has_more" class="mb50"> <div ng-if="course_has_more" class="mb50">
<div id="more_course_activities" class="more-events mt10" ng-click="getClassActivities(course_activities_page+1);">更多</div> <div id="more_course_activities" class="more-events mt10" ng-click="getClassActivities(course_activities_page+1);">更多</div>
</div> </div>
<div class="bottom-tab-wrap mt10"> <div ng-show="course.is_member" class="bottom-tab-wrap mt10">
<a ng-show="isTeacher" ng-click="goPublishNotice()" class="weixin-tab link-blue2 border-top">发布通知</a> <a ng-show="isTeacher" ng-click="goPublishNotice()" class="weixin-tab link-blue2 border-top">发布通知</a>
<a ng-click="goPublishIssue()" class="weixin-tab link-blue2 border-top">发起讨论</a> <a ng-click="goPublishIssue()" class="weixin-tab link-blue2 border-top">发起讨论</a>
</div> </div>
@ -234,12 +234,12 @@
<p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br /> <p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站在PC浏览器中上传课件。</p> 请登录Trustie网站在PC浏览器中上传课件。</p>
</div> </div>
<div ng-class="{'undis': !showClassMate}"> <div class="mb50" ng-class="{'undis': !showClassMate}">
<div class="member-banner f13 c-grey3">授课老师</div> <div class="member-banner f13 c-grey3">授课老师</div>
<div class="class-member-row f13 c-grey3" ng-repeat="teacher in teachers|filter:searchText"> <div class="class-member-row f13 c-grey3" ng-repeat="teacher in teachers|filter:searchText">
<img ng-src="{{teacher.img_url}}" width="30" height="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 ng-src="{{teacher.img_url}}" width="30" height="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)" /> <img src="/images/wechat/setting.png" ng-show = "isTeacher && 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 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> <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 class="cl"></div>
@ -255,9 +255,13 @@
<div class="member-banner f13 mt10 c-grey3">我的同学</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"> <div class="class-member-row f13 c-grey3" ng-repeat="student in students|filter:searchText">
<img ng-src="{{student.img_url}}" width="30" height="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 ng-src="{{student.img_url}}" width="30" height="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)" /> <img src="/images/wechat/setting.png" ng-show = "isTeacher" width="15" class="class-list-setting" ng-click="onSetting(student)" />
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div ng-show="course.is_member" class="bottom-tab-wrap mt10" ng-class="{'undis': !showClassMate}">
<a ng-show="!course.is_creator" ng-click="quit()" class="weixin-tab link-blue2 border-top">退出班级</a>
</div>
</div> </div>
<div ng-class="{'undis': !showHomework}"> <div ng-class="{'undis': !showHomework}">
@ -274,4 +278,5 @@
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
</div> </div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>
@ -24,7 +32,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -57,7 +65,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="news.act_type == 'News'"> <div ng-if="news.act_type == 'News'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -23,7 +31,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -72,7 +80,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -1,19 +1,24 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;"> <div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
<div class="blue-title">角色变更</div> <div class="blue-title">成员管理</div>
<div class="class-detail-row f13 c-grey3"><img ng-src="{{current_edit_member.user.img_url}}" 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="class-detail-row f13 c-grey3"><img ng-src="{{current_edit_member.user.img_url}}" 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> <div class="course-list-row f13 c-grey3 mt10" ng-click="clickChangeRole()"><span class="fl ml10">角色变更</span></div>
<ul class="class-list f13 c-grey3"> <ul class="class-list f13 c-grey3" ng-class="{'undis':current_edit_member.show}">
<li><span class="fl ml10 class-list-name hidden">教师</span><span ng-click="selectRole(9)" ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':assistant,'checked': teacher}]"></span></li> <li><span class="fl ml10 class-list-name hidden">教师</span><span ng-click="selectRole(9)" ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':assistant,'checked': teacher}]"></span></li>
<li><span class="fl ml10 class-list-name hidden">助教</span><span ng-click="selectRole(7)" ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':teacher, 'checked': assistant}]"></span></li> <li><span class="fl ml10 class-list-name hidden">助教</span><span ng-click="selectRole(7)" ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':teacher, 'checked': assistant}]"></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', {'checked': student}]"></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', {'checked': student}]"></span></li>
</ul> </ul>
<div class="course-list-row f13 c-grey3 mt10" ng-click="current_edit_member.show = !current_edit_member.show;buttongrey = false;" id="manageDelete"><span class="fl ml10">删除成员</span></div>
<ul class="class-list f13 c-grey3" ng-class="{'undis':!current_edit_member.show}">
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">删除</span><input type="radio" name="delete" class="fr mr10 mt12" checked="checked" /></li>
</ul>
<div class="bottom-tab-wrap mt10"> <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="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> <a href="javascript:void(0);" ng-click="edit_member_role()" class="weixin-tab border-top" ng-class="[{'bg-grey c-white':buttongrey},{'link-blue2':!buttongrey}]" >确定</a>
</div> </div>
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
</div> </div>

View File

@ -1,21 +1,25 @@
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;"> <div ng-show="current_edit_member" class="post-container" style="padding-bottom:50px;">
<div class="blue-title">角色变更</div> <div class="blue-title">成员管理</div>
<div class="class-detail-row f13 c-grey3"><img ng-src="{{current_edit_member.user.img_url}}" 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="class-detail-row f13 c-grey3"><img ng-src="{{current_edit_member.user.img_url}}" 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> <div class="course-list-row f13 c-grey3 mt10" ng-click="clickChangeRole()"><span class="fl ml10">角色变更</span></div>
<ul class="class-list f13 c-grey3"> <ul class="class-list f13 c-grey3" ng-class="{'undis':current_edit_member.show}">
<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(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><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> <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> </ul>
<div class="course-list-row f13 c-grey3 mt10" ng-click="current_edit_member.show = !current_edit_member.show;buttongrey = false;" id="manageDelete"><span class="fl ml10">删除成员</span></div>
<ul class="class-list f13 c-grey3" ng-class="{'undis':!current_edit_member.show}">
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">删除</span><input type="radio" name="delete" class="fr mr10 mt12" checked="checked" /></li>
</ul>
<div class="bottom-tab-wrap mt10"> <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="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> <a href="javascript:void(0);" ng-click="edit_member_role()" class="weixin-tab border-top" ng-class="[{'bg-grey c-white':buttongrey},{'link-blue2':!buttongrey}]" >确定</a>
</div> </div>
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
</div> </div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="homework.act_type == 'HomeworkCommon'"> <div ng-if="homework.act_type == 'HomeworkCommon'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -28,7 +36,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -61,7 +69,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="issue.act_type == 'Issue'"> <div ng-if="issue.act_type == 'Issue'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -29,7 +37,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -78,7 +86,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -13,6 +13,7 @@
<div class="f12 c-grey6 mt10 ml15"> <div class="f12 c-grey6 mt10 ml15">
<span class="f13 c-grey3">提示</span> <span class="f13 c-grey3">提示</span>
<ul class="mb15 mt5 ml10 new-tip"> <ul class="mb15 mt5 ml10 new-tip">
<li><span class="project-intro-dot"></span>邀请码在创建班级时产生,请向班级老师获取</li>
<li><span class="project-intro-dot"></span>教师、助教角色需要班级管理员审批</li> <li><span class="project-intro-dot"></span>教师、助教角色需要班级管理员审批</li>
<li><span class="project-intro-dot"></span>学生角色无需管理员审批</li> <li><span class="project-intro-dot"></span>学生角色无需管理员审批</li>
</ul> </ul>

View File

@ -12,6 +12,7 @@
<div class="f12 c-grey6 mt10 ml15"> <div class="f12 c-grey6 mt10 ml15">
<span class="f13 c-grey3">提示</span> <span class="f13 c-grey3">提示</span>
<ul class="mb15 mt5 ml10 new-tip"> <ul class="mb15 mt5 ml10 new-tip">
<li><span class="project-intro-dot"></span>邀请码在创建项目时产生,请向项目管理员获取</li>
<li><span class="project-intro-dot"></span>管理人员、开发人员角色需要项目管理员审批</li> <li><span class="project-intro-dot"></span>管理人员、开发人员角色需要项目管理员审批</li>
<li><span class="project-intro-dot"></span>报告人员角色无需管理员审批</li> <li><span class="project-intro-dot"></span>报告人员角色无需管理员审批</li>
</ul> </ul>

View File

@ -1,5 +1,13 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="message.act_type == 'JournalsForMessage'"> <div ng-if="message.act_type == 'JournalsForMessage'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -23,7 +31,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -56,7 +64,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -98,12 +98,12 @@
<div ng-if="project_has_more" class="mb50"> <div ng-if="project_has_more" class="mb50">
<div id="more_project_activities" class="more-events mt10" ng-click="getActivities(project_activities_page+1);">更多</div> <div id="more_project_activities" class="more-events mt10" ng-click="getActivities(project_activities_page+1);">更多</div>
</div> </div>
<div class="bottom-tab-wrap mt10"> <div ng-show="project.is_member" class="bottom-tab-wrap mt10">
<a ng-click="goPublishNote()" class="weixin-tab link-blue2 border-top">发布新帖</a> <a ng-click="goPublishNote()" class="weixin-tab link-blue2 border-top">发布新帖</a>
</div> </div>
</div> </div>
<div ng-show="project" ng-class="{'undis': currentTab != 2}"> <div ng-show="project" class="mb50" ng-class="{'undis': currentTab != 2}">
<div class="class-search-wrap"> <div class="class-search-wrap">
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" /> <div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" /> <input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
@ -138,7 +138,11 @@
<img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting " width="15" class="class-list-setting" ng-click="onSetting(report)" /> <img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting " width="15" class="class-list-setting" ng-click="onSetting(report)" />
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div ng-show="project.is_member" class="bottom-tab-wrap mt10" ng-class="{'undis': currentTab != 2}">
<a ng-show="!project.is_creator" ng-click="quit()" class="weixin-tab link-blue2 border-top">退出项目</a>
</div>
</div> </div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert> <my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
</div> </div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">
@ -24,7 +32,7 @@
<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.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 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>
<div class="fr mr25 f13" input-focus> <div id="replyBlock" class="fr mr25 f13" input-focus>
<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;">回复</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> <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>
@ -57,7 +65,12 @@
</div> </div>
</div> </div>
<div class="post-reply-content c-grey3 ml40 mb15" ng-bind-html="journal.content|safeHtml"></div> <div class="post-reply-content c-grey3 ml40 mb5" ng-bind-html="journal.content|safeHtml"></div>
<div class="fr f13 mb5">
<div ng-if="!journal.praise_count" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="journal.praise_count && !journal.has_praise" ng-click="addPraise(journal);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
<div ng-if="journal.has_praise" ng-click="decreasePraise(journal);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{journal.praise_count}}</span></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

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