Merge branch 'develop' into rep_quality
This commit is contained in:
commit
190ef75200
2
Gemfile
2
Gemfile
|
@ -51,7 +51,7 @@ gem 'elasticsearch-rails'
|
|||
|
||||
|
||||
### profile
|
||||
# gem 'oneapm_rpm'
|
||||
gem 'oneapm_rpm'
|
||||
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
|
|
|
@ -6,10 +6,17 @@ module Mobile
|
|||
resources :blog_comments do
|
||||
|
||||
desc "get special topic"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
|
||||
blog = BlogComment.find params[:id]
|
||||
present :data, blog, with: Mobile::Entities::BlogComment,user: user
|
||||
present :data, blog, with: Mobile::Entities::BlogComment,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -200,8 +200,13 @@ module Mobile
|
|||
# course = Course.find(params[:id])
|
||||
cs = CoursesService.new
|
||||
course = cs.show_course(params,current_user)
|
||||
present :data, course, with: Mobile::Entities::Course,user: current_user
|
||||
{ status: 0}
|
||||
|
||||
if course[:course][:is_delete] == 1
|
||||
{status:-1, message: '该班级不存在或已被删除啦' }
|
||||
else
|
||||
present :data, course, with: Mobile::Entities::Course,user: current_user
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -212,7 +217,7 @@ module Mobile
|
|||
get "homeworks/:id" do
|
||||
cs = CoursesService.new
|
||||
homeworks = cs.homework_list params,current_user
|
||||
present :data, homeworks, with: Mobile::Entities::Homework
|
||||
present :data, homeworks, with: Mobile::Entities::Homework,user: current_user
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
|
@ -259,7 +264,7 @@ module Mobile
|
|||
post ":course_id/attachments" do
|
||||
cs = CoursesService.new
|
||||
count = cs.course_attachments params
|
||||
present :data, count, with: Mobile::Entities::Attachment
|
||||
present :data, count, with: Mobile::Entities::Attachment,user: current_user
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
|
@ -392,8 +397,8 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
course = Course.find(params[:course_id])
|
||||
exercises = course.exercises.where("exercise_status <> 1").order("created_at desc")
|
||||
present :data,exercises,with:Mobile::Entities::Exercise
|
||||
exercises = course.exercises.where("exercise_status <> 1").reorder("created_at desc")
|
||||
present :data,exercises,with:Mobile::Entities::Exercise,user: current_user
|
||||
present :status,0
|
||||
end
|
||||
|
||||
|
|
|
@ -7,11 +7,17 @@ module Mobile
|
|||
include IssuesHelper
|
||||
|
||||
desc "get special issuse"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
issue = Issue.find params[:id]
|
||||
present :data, issue, with: Mobile::Entities::Issue,user: user
|
||||
present :data, issue, with: Mobile::Entities::Issue,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,18 @@ module Mobile
|
|||
resources :journal_for_messages do
|
||||
|
||||
desc "get special journal"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
|
||||
jour = JournalsForMessage.find params[:id]
|
||||
present :data, jour, with: Mobile::Entities::Jours,user: user
|
||||
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :messages do
|
||||
|
||||
desc "get special topic"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
message = Message.find params[:id]
|
||||
present :data, message, with: Mobile::Entities::Message,user: user
|
||||
present :data, message, with: Mobile::Entities::Message,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :newss do
|
||||
|
||||
desc "get special news"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
news = News.find params[:id]
|
||||
present :data, news, with: Mobile::Entities::News,user: user
|
||||
present :data, news, with: Mobile::Entities::News,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -85,12 +85,26 @@ module Mobile
|
|||
requires :token, type: String
|
||||
requires :course_ids, type: Array[Integer]
|
||||
requires :send_id, type: Integer
|
||||
requires :send_type, type: Integer
|
||||
end
|
||||
post 'send' do
|
||||
authenticate!
|
||||
|
||||
rs = ResourcesService.new
|
||||
ori, flag, save_message = rs.send_resource_to_course(current_user,params)
|
||||
|
||||
ori = nil
|
||||
flag = false
|
||||
save_message = nil
|
||||
|
||||
case params[:send_type]
|
||||
when 1
|
||||
ori, flag, save_message = rs.send_resource_to_course(current_user,params)
|
||||
when 2
|
||||
ori, flag, save_message = rs.send_homework_to_course(current_user,params)
|
||||
when 3
|
||||
ori, flag, save_message = rs.send_exercise_to_course(current_user,params)
|
||||
end
|
||||
|
||||
if flag
|
||||
present :status, 0
|
||||
else
|
||||
|
|
|
@ -6,11 +6,17 @@ module Mobile
|
|||
resources :whomeworks do
|
||||
|
||||
desc "get one homework"
|
||||
get ':id' do
|
||||
post ':id' do
|
||||
authenticate!
|
||||
user = current_user
|
||||
|
||||
#0一级回复的更多 1 二级回复的更多
|
||||
type = params[:type] || 0
|
||||
page = params[:page] || 0
|
||||
homework = HomeworkCommon.find params[:id]
|
||||
present :data, homework, with: Mobile::Entities::Whomework,user: user
|
||||
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page
|
||||
present :type, type
|
||||
present :page, page
|
||||
present :status, 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,10 +25,12 @@ module Mobile
|
|||
elsif ac.act_type == "News"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.comments.count
|
||||
elsif ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.children.count
|
||||
all_comments = []
|
||||
ac.nil? || ac.act.nil? ? 0 : get_all_children(all_comments, ac.act).count
|
||||
elsif ac.act_type == "Issue"
|
||||
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count
|
||||
end
|
||||
|
||||
when :subject
|
||||
if ac.act_type == "HomeworkCommon"
|
||||
ac.act.name unless ac.nil? || ac.act.nil?
|
||||
|
|
|
@ -3,6 +3,7 @@ module Mobile
|
|||
class Attachment < Grape::Entity
|
||||
include Redmine::I18n
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include ApplicationHelper
|
||||
def self.attachment_expose(field)
|
||||
expose field do |f,opt|
|
||||
if f.is_a?(Hash) && f.key?(field)
|
||||
|
@ -22,6 +23,7 @@ module Mobile
|
|||
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
|
||||
when :coursename
|
||||
f.course.nil? ? "" : f.course.name
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -36,6 +38,12 @@ module Mobile
|
|||
attachment_expose :file_dir
|
||||
attachment_expose :attafile_size
|
||||
attachment_expose :coursename #所属班级名
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -25,7 +25,9 @@ module Mobile
|
|||
when :act_id
|
||||
u.id
|
||||
when :comment_count
|
||||
u.children.count
|
||||
# u.children.count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, u).count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -51,7 +53,18 @@ module Mobile
|
|||
blog_comment_expose :praise_count
|
||||
expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
c.children.reverse
|
||||
##自己的父回复为空 才有子回复
|
||||
if !opt[:children]
|
||||
if c.parent.nil? && opt[:type] == 0
|
||||
opt[:children] = true
|
||||
all_comments = []
|
||||
tStart = opt[:page]*5
|
||||
tEnd = (opt[:page]+1)*5 - 1
|
||||
|
||||
all_comments = get_all_children(all_comments, c)[tStart..tEnd]
|
||||
all_comments
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
expose :has_praise, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
|
@ -61,6 +74,63 @@ module Mobile
|
|||
has_praise = obj.empty? ? false : true
|
||||
has_praise
|
||||
end
|
||||
|
||||
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, instance)
|
||||
parents_reply.count
|
||||
end
|
||||
|
||||
expose :parents_reply_bottom, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
#取二级回复的底楼层
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||
if parents_reply.count > 0 && !opt[:bottom]
|
||||
if opt[:type] == 1
|
||||
# opt[:bottom] = true
|
||||
# parents_reply[opt[:page]..opt[:page]]
|
||||
else
|
||||
opt[:bottom] = true
|
||||
parents_reply[0..0]
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
expose :parents_reply_top, using:Mobile::Entities::BlogComment do |c,opt|
|
||||
if c.is_a? (::BlogComment)
|
||||
#取二级回复的顶楼层
|
||||
parents_reply = []
|
||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||
if parents_reply.count > 0 && !opt[:top]
|
||||
if opt[:type] == 1
|
||||
opt[:bottom] = true
|
||||
tStart = (opt[:page]-1)*5+2
|
||||
tEnd = (opt[:page])*5+2 - 1
|
||||
|
||||
if tEnd >= parents_reply.count - 1
|
||||
tEnd = parents_reply.count - 2
|
||||
end
|
||||
|
||||
if tStart <= parents_reply.count - 2
|
||||
parents_reply = parents_reply.reverse[tStart..tEnd]
|
||||
parents_reply.reverse
|
||||
else
|
||||
[]
|
||||
end
|
||||
else
|
||||
opt[:top] = true
|
||||
parents_reply = parents_reply.reverse[0..1]
|
||||
parents_reply.reverse
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -27,6 +27,14 @@ module Mobile
|
|||
expose :exercise_name
|
||||
expose :exercise_description
|
||||
exercise_expose :coursename #所属班级名
|
||||
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -98,6 +98,14 @@ module Mobile
|
|||
|
||||
homework_expose :coursename #所属班级名
|
||||
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
if instance[:current_user_is_teacher].nil?
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -23,7 +23,9 @@ module Mobile
|
|||
when :issue_status
|
||||
IssueStatus.find(issue.status_id).name
|
||||
when :journals_count
|
||||
issue.journals.where("notes is not null and notes != ''").count
|
||||
# issue.journals.where("notes is not null and notes != ''").count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
when :project_name
|
||||
issue.project.name
|
||||
when :praise_count
|
||||
|
|
|
@ -18,7 +18,9 @@ module Mobile
|
|||
when :lasted_comment
|
||||
time_from_now f.created_on
|
||||
when :reply_count
|
||||
f.children.count
|
||||
# f.children.count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
when :praise_count
|
||||
get_activity_praise_num(f)
|
||||
when :act_type
|
||||
|
|
|
@ -30,6 +30,9 @@ module Mobile
|
|||
'Message'
|
||||
when :act_id
|
||||
u.id
|
||||
when :replies_count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, u).count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,9 @@ module Mobile
|
|||
'News'
|
||||
when :act_id
|
||||
f.id
|
||||
when :comments_count
|
||||
all_comments = []
|
||||
get_all_children(all_comments, f).count
|
||||
end
|
||||
end
|
||||
elsif f.is_a?(Hash) && !f.key?(field)
|
||||
|
|
|
@ -507,7 +507,8 @@ class ApplicationController < ActionController::Base
|
|||
# render_404
|
||||
# end
|
||||
|
||||
def self.model_object(model)
|
||||
def self.
|
||||
model_object(model)
|
||||
self.model_object = model
|
||||
end
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ class BlogCommentsController < ApplicationController
|
|||
if params[:parent_id]
|
||||
@blogComment.content = params[:blog_comment][:content]
|
||||
parent = BlogComment.find params[:parent_id]
|
||||
@blogComment.reply_id = params[:reply_id]
|
||||
@blogComment.reply_id = params[:id]
|
||||
parent.children << @blogComment
|
||||
else
|
||||
@quote = params[:quote][:quote] || ""
|
||||
|
|
|
@ -161,6 +161,7 @@ class BoardsController < ApplicationController
|
|||
if @project
|
||||
render :action => 'show', :layout => 'base_projects'
|
||||
elsif @course
|
||||
@left_nav_type = 2
|
||||
@params=params
|
||||
render :action => 'show', :layout => 'base_courses'
|
||||
end
|
||||
|
@ -185,6 +186,7 @@ class BoardsController < ApplicationController
|
|||
@board = @project.boards.build
|
||||
@board.safe_attributes = params[:board]
|
||||
if @project.project_type == 1
|
||||
@left_nav_type = 2
|
||||
render :layout => 'base_courses'
|
||||
end
|
||||
end
|
||||
|
@ -206,6 +208,7 @@ class BoardsController < ApplicationController
|
|||
|
||||
def edit
|
||||
if @project.project_type == 1
|
||||
@left_nav_type = 2
|
||||
render :layout => 'base_courses'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,8 +19,8 @@ class CommentsController < ApplicationController
|
|||
default_search_scope :news
|
||||
include ApplicationHelper
|
||||
model_object News
|
||||
before_filter :find_model_object
|
||||
before_filter :find_project_from_association
|
||||
before_filter :find_model_object, :except => [:reply, :quote]
|
||||
before_filter :find_project_from_association, :except => [:reply, :quote]
|
||||
before_filter :authorize
|
||||
|
||||
def create
|
||||
|
@ -73,7 +73,46 @@ class CommentsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
@news.comments.find(params[:comment_id]).destroy
|
||||
redirect_to news_url(@news)
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
return
|
||||
end
|
||||
else
|
||||
redirect_to news_url(@news)
|
||||
end
|
||||
end
|
||||
|
||||
def quote
|
||||
@comment = Comment.find(params[:id])
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def reply
|
||||
comment = Comment.find(params[:id])
|
||||
@news = News.find comment.commented_id
|
||||
new_comment = @news.comments.build(:author_id => User.current.id, :reply_id => params[:id], :comments => params[:content], :parent_id => comment.id)
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
if new_comment.save
|
||||
update_course_activity(@news.class,@news.id)
|
||||
update_user_activity(@news.class,@news.id)
|
||||
update_org_activity(@news.class,@news.id)
|
||||
if @user_activity_id
|
||||
respond_to do |format|
|
||||
format.js
|
||||
return
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to news_path(@news)
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -87,5 +126,4 @@ class CommentsController < ApplicationController
|
|||
@news
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -301,7 +301,6 @@ class CoursesController < ApplicationController
|
|||
def member
|
||||
## 有角色参数的才是课程,没有的就是项目
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
|
||||
@render_file = 'new_member_list'
|
||||
@score_sort_by = "desc"
|
||||
@sort_type = params[:sort_type] ? params[:sort_type] : "score"
|
||||
|
@ -414,6 +413,9 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def settings
|
||||
#添加成员消息状态
|
||||
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
||||
join_course_messages.update_all(:viewed => true)
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
@select_tab = params[:tab]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
|
@ -905,6 +907,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
@type = params[:type]
|
||||
|
||||
@left_nav_type = 1
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html{render :layout => 'base_courses'}
|
||||
|
@ -936,6 +939,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
@left_nav_type = 6
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
format.api
|
||||
|
@ -1119,6 +1123,14 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#统计
|
||||
def statistics_course
|
||||
@left_nav_type = 9
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def update_quotes attachment
|
||||
if attachment.copy_from
|
||||
|
|
|
@ -29,6 +29,7 @@ class ExerciseController < ApplicationController
|
|||
exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc")
|
||||
end
|
||||
@exercises = paginateHelper exercises,20 #分页
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
@ -72,6 +73,7 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
# @percent = get_percent(@exercise,User.current)
|
||||
@exercise_questions = @exercise.exercise_questions
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -118,6 +120,7 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -159,6 +162,7 @@ class ExerciseController < ApplicationController
|
|||
@exercise = Exercise.find(params[:id])
|
||||
exercise_questions = @exercise.exercise_questions
|
||||
@exercise_questions = paginateHelper exercise_questions, 5
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -379,6 +383,7 @@ class ExerciseController < ApplicationController
|
|||
else
|
||||
@exercise_users_list = []
|
||||
end
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls {
|
||||
|
@ -566,6 +571,7 @@ class ExerciseController < ApplicationController
|
|||
eu = get_exercise_user(@exercise.id, @user.id)
|
||||
eu.update_attributes(:score => score)
|
||||
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
|
||||
@left_nav_type = 8
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
|
|
|
@ -366,6 +366,7 @@ class FilesController < ApplicationController
|
|||
|
||||
@tag_list = attachment_tag_list @all_attachments
|
||||
|
||||
@left_nav_type = 5
|
||||
render :layout => 'base_courses'
|
||||
elsif params[:org_subfield_id]
|
||||
if params[:sort]
|
||||
|
@ -445,6 +446,7 @@ class FilesController < ApplicationController
|
|||
@versions = @project.versions.sort
|
||||
@course_tag = @project.project_type
|
||||
if @project.project_type == 1
|
||||
@left_nav_type = 5
|
||||
render :layout => 'base_courses'
|
||||
end
|
||||
end
|
||||
|
@ -812,6 +814,7 @@ class FilesController < ApplicationController
|
|||
@attachtype = params[:type].to_i
|
||||
@contenttype = params[:contentType].to_s
|
||||
# render layout: 'base_courses'
|
||||
@left_nav_type = 5
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {
|
||||
|
|
|
@ -39,6 +39,7 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
@ -60,6 +61,7 @@ class HomeworkCommonController < ApplicationController
|
|||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
if @is_in_course == 1 || @course_activity == 1
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
|
|
@ -432,15 +432,14 @@ class IssuesController < ApplicationController
|
|||
|
||||
def add_journal
|
||||
if User.current.logged?
|
||||
@jour = Journal.new
|
||||
@jour.user_id = User.current.id
|
||||
@jour.notes = params[:notes]
|
||||
@jour.journalized = @issue
|
||||
@jour.save_attachments(params[:attachments])
|
||||
@jour.save
|
||||
jour = Journal.new
|
||||
jour.user_id = User.current.id
|
||||
jour.notes = params[:notes]
|
||||
jour.journalized = @issue
|
||||
jour.save_attachments(params[:attachments])
|
||||
jour.save
|
||||
update_user_activity(@issue.class,@issue.id)
|
||||
update_forge_activity(@issue.class,@issue.id)
|
||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
if params[:issue_id]
|
||||
|
@ -474,7 +473,6 @@ class IssuesController < ApplicationController
|
|||
def reply
|
||||
@issue = Issue.find(params[:id])
|
||||
@jour = Journal.find(params[:journal_id])
|
||||
@tempContent = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)} <br/>#{@jour.notes.html_safe}</blockquote>".html_safe
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -483,17 +481,17 @@ class IssuesController < ApplicationController
|
|||
#给issue添加journ。回复内容包含 对某个被回复的journ的内容
|
||||
def add_reply
|
||||
if User.current.logged?
|
||||
jour = Journal.new
|
||||
jour.user_id = User.current.id
|
||||
jour.notes = params[:quote]+params[:notes]
|
||||
jour = Journal.find(params[:journal_id])
|
||||
@issue = Issue.find params[:id]
|
||||
jour.journalized = @issue
|
||||
jour.save
|
||||
update_user_activity(@issue.class,@issue.id)
|
||||
update_forge_activity(@issue.class,@issue.id)
|
||||
new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id)
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
if new_jour.save
|
||||
update_user_activity(@issue.class,@issue.id)
|
||||
update_forge_activity(@issue.class,@issue.id)
|
||||
|
||||
respond_to do |format|
|
||||
format.html{redirect_to issue_url(@issue)}
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -502,8 +500,9 @@ class IssuesController < ApplicationController
|
|||
def delete_journal
|
||||
@issue = Issue.find(params[:id])
|
||||
Journal.destroy(params[:journal_id])
|
||||
respond_to do |format|
|
||||
format.html{redirect_to issue_url(@issue)}
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -124,6 +124,7 @@ class MessagesController < ApplicationController
|
|||
|
||||
end
|
||||
else
|
||||
@left_nav_type = 2
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
|
@ -140,15 +141,15 @@ class MessagesController < ApplicationController
|
|||
def reply
|
||||
if params[:parent_id]
|
||||
parent = Message.find params[:parent_id]
|
||||
@topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
|
||||
@reply = Message.new
|
||||
@reply.author = User.current
|
||||
@reply.board = parent.board
|
||||
@reply.content = params[:content]
|
||||
@reply.subject = "RE: #{parent.subject}"
|
||||
@reply.reply_id = params[:reply_id]
|
||||
@reply.subject = "RE: #{@topic.subject}"
|
||||
@reply.reply_id = params[:id]
|
||||
# @reply.reply_id = params[:id]
|
||||
parent.children << @reply
|
||||
@topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
|
||||
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||
@is_course = params[:is_course] if params[:is_course]
|
||||
@is_board = params[:is_board] if params[:is_board]
|
||||
|
@ -241,6 +242,7 @@ class MessagesController < ApplicationController
|
|||
if @project
|
||||
layout_file = 'base_projects'
|
||||
elsif @course
|
||||
@left_nav_type = 2
|
||||
layout_file = 'base_courses'
|
||||
elsif @org_subfield
|
||||
@organization = @org_subfield.organization
|
||||
|
|
|
@ -56,7 +56,7 @@ class NewsController < ApplicationController
|
|||
:order => "#{News.table_name}.created_on DESC",
|
||||
:offset => @page * 10,
|
||||
:limit => 10)
|
||||
|
||||
@left_nav_type = 4
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@news = News.new # for adding news inline
|
||||
|
@ -136,6 +136,7 @@ class NewsController < ApplicationController
|
|||
@newss = paginateHelper @newss,@limit
|
||||
|
||||
#@newss = paginateHelper scope_order,10
|
||||
@left_nav_type = 4
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@news = News.new
|
||||
|
@ -176,6 +177,7 @@ class NewsController < ApplicationController
|
|||
if @news.course_id
|
||||
@course = Course.find(@news.course_id)
|
||||
if @course
|
||||
@left_nav_type = 4
|
||||
render :layout => 'base_courses'
|
||||
end
|
||||
elsif @news.org_subfield_id
|
||||
|
@ -279,6 +281,7 @@ class NewsController < ApplicationController
|
|||
@organization = @org_subfield.organization
|
||||
end
|
||||
if @course
|
||||
@left_nav_type = 4
|
||||
render :layout => "base_courses"
|
||||
elsif @org_subfield
|
||||
render :layout => 'base_org'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class OrgDocumentCommentsController < ApplicationController
|
||||
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply]
|
||||
before_filter :authorize_allowed, :only => [:create, :add_reply, :add_reply_in_doc]
|
||||
helper :attachments,:organizations
|
||||
layout 'base_org'
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ class PollController < ApplicationController
|
|||
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
|
||||
end
|
||||
@polls = paginateHelper polls,20 #分页
|
||||
@left_nav_type = 7
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -25,7 +26,7 @@ class PollController < ApplicationController
|
|||
|
||||
def show
|
||||
@poll = Poll.find params[:id]
|
||||
if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
|
||||
if @poll.polls_status != 2 && !(User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
|
||||
render_403
|
||||
return
|
||||
end
|
||||
|
@ -44,6 +45,7 @@ class PollController < ApplicationController
|
|||
@percent = get_percent(@poll,User.current)
|
||||
poll_questions = @poll.poll_questions
|
||||
@poll_questions = paginateHelper poll_questions,5 #分页
|
||||
@left_nav_type = 7
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -78,6 +80,7 @@ class PollController < ApplicationController
|
|||
|
||||
def edit
|
||||
respond_to do |format|
|
||||
@left_nav_type = 7
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
end
|
||||
|
@ -112,6 +115,7 @@ class PollController < ApplicationController
|
|||
@poll = Poll.find(params[:id])
|
||||
poll_questions = @poll.poll_questions
|
||||
@poll_questions = paginateHelper poll_questions, 5
|
||||
@left_nav_type = 7
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -393,6 +397,7 @@ class PollController < ApplicationController
|
|||
#显示某个学生某份问卷的填写结果
|
||||
def poll_result
|
||||
@poll_questions = paginateHelper @poll.poll_questions,5
|
||||
@left_nav_type = 7
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_courses'}
|
||||
end
|
||||
|
|
|
@ -526,6 +526,7 @@ class StudentWorkController < ApplicationController
|
|||
@is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
|
||||
# 消息传过来的ID
|
||||
@message_student_work_id = params[:student_work_id]
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
@ -918,6 +919,7 @@ class StudentWorkController < ApplicationController
|
|||
ORDER BY absence #{order}")
|
||||
end
|
||||
@order = order == "desc" ? "asc" : "desc"
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
|
|
@ -13,7 +13,6 @@ class SyllabusesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
#@courses = @syllabus.courses
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html{render :layout => 'base_syllabus'}
|
||||
|
@ -109,11 +108,7 @@ class SyllabusesController < ApplicationController
|
|||
sort_name = "updated_on"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
if User.current == @syllabus.user || User.current.admin?
|
||||
@courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
else
|
||||
@courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
end
|
||||
@courses = @syllabus.courses.where("is_delete = ?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
|
||||
#根据 作业+资源数排序
|
||||
if @order.to_i == 2
|
||||
|
|
|
@ -94,6 +94,12 @@ class UsersController < ApplicationController
|
|||
@comment = Message.find params[:comment].to_i
|
||||
when 'BlogComment'
|
||||
@comment = BlogComment.find params[:comment].to_i
|
||||
when 'OrgDocumentComment'
|
||||
@comment = OrgDocumentComment.find params[:comment].to_i
|
||||
when 'Comment'
|
||||
@comment = Comment.find params[:comment].to_i
|
||||
when 'Journal'
|
||||
@comment = Journal.find params[:comment].to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -133,6 +139,16 @@ class UsersController < ApplicationController
|
|||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@type = 'OrgDocumentComment'
|
||||
when 'News'
|
||||
@reply = Comment.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@type = 'News'
|
||||
when 'Issue'
|
||||
@reply = Journal.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@type = 'Issue'
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -709,9 +725,9 @@ class UsersController < ApplicationController
|
|||
@user = User.current
|
||||
@select_course = params[:select_course] ? 1 : 0
|
||||
#@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
|
@ -933,6 +949,7 @@ class UsersController < ApplicationController
|
|||
@student_work = StudentWork.new
|
||||
end
|
||||
@course = @homework.course
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'base_courses'}
|
||||
|
@ -1549,7 +1566,11 @@ class UsersController < ApplicationController
|
|||
when "current_user"
|
||||
@user_activities = UserActivity.where("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}))").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
else
|
||||
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
if @user == User.current
|
||||
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
else
|
||||
blog_ids = "("+@user.blog.id.to_s+")"
|
||||
end
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
|
||||
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
|
@ -1559,8 +1580,12 @@ class UsersController < ApplicationController
|
|||
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
# 减少数据库交互
|
||||
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
if @user == User.current
|
||||
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
else
|
||||
user_ids = "(" + @user.id.to_s + ")"
|
||||
end
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
|
||||
blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
|
||||
|
||||
|
@ -3312,19 +3337,22 @@ class UsersController < ApplicationController
|
|||
when 'News'
|
||||
obj = News.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.comments.reorder("created_on desc")
|
||||
@type = 'News'
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
when 'Syllabus'
|
||||
obj = Syllabus.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.comments.reorder("created_on desc")
|
||||
@journals = obj.journals_for_messages.reorder("created_on desc")
|
||||
when 'JournalsForMessage'
|
||||
obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
|
||||
journals = []
|
||||
@journals = get_all_children(journals, obj)
|
||||
@type = 'JournalsForMessage'
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
@allow_delete = params[:allow_delete]
|
||||
when 'Issue'
|
||||
obj = Issue.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.journals.reorder("created_on desc")
|
||||
@type = 'Issue'
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
when 'BlogComment'
|
||||
obj = BlogComment.where('id = ?', params[:id].to_i).first
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
|
@ -3334,6 +3362,7 @@ class UsersController < ApplicationController
|
|||
@journals = get_all_children(comments, obj)
|
||||
when 'HomeworkCommon'
|
||||
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
|
||||
@type = 'HomeworkCommon'
|
||||
@journals = obj.journals_for_messages.reorder("created_on desc")
|
||||
@is_in_course = params[:is_in_course].to_i if params[:is_in_course]
|
||||
@course_activity = params[:course_activity].to_i if params[:course_activity]
|
||||
|
|
|
@ -78,12 +78,7 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
# When user view URL in the menu button
|
||||
on :view, with: 'http://wechat.somewhere.com/view_url' do |request, view|
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
unless uw
|
||||
sendBind(request)
|
||||
else
|
||||
request.reply.text "#{request[:FromUserName]} view #{view}"
|
||||
end
|
||||
request.reply.text "#{request[:FromUserName]} view #{view}"
|
||||
end
|
||||
|
||||
# When user sent the imsage
|
||||
|
@ -147,6 +142,14 @@ class WechatsController < ActionController::Base
|
|||
default_msg(request)
|
||||
end
|
||||
|
||||
on :click, with: 'PROJECT' do |request, key|
|
||||
request.reply.text "此功能正在开发中,很快就会上线,谢谢!"
|
||||
end
|
||||
|
||||
on :click, with: 'JOIN_PROJECT' do |request, key|
|
||||
request.reply.text "此功能正在开发中,很快就会上线,谢谢!"
|
||||
end
|
||||
|
||||
on :click, with: 'JOIN_CLASS' do |request, key|
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
unless uw
|
||||
|
@ -218,8 +221,8 @@ class WechatsController < ActionController::Base
|
|||
raise CoursesService::JoinCourseError.message(status[:state])
|
||||
end
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称:#{course.name}\n班级名称:#{course.name}\n任课老师:#{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
return request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities#/class?id='+course.id.to_s}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
|
||||
|
@ -274,7 +277,7 @@ class WechatsController < ActionController::Base
|
|||
user: user
|
||||
)
|
||||
ws = WechatService.new
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台!", user.login, format_time(Time.now))
|
||||
render :json => {status:0, msg: "绑定成功"}
|
||||
rescue Exception=>e
|
||||
render :json => {status: -1, msg: e.message}
|
||||
|
|
|
@ -44,6 +44,13 @@ module ApplicationHelper
|
|||
user.nil? ? User.find(2) : user
|
||||
end
|
||||
|
||||
# 历史数据(老版本库数据)处理完则可以修改该放放
|
||||
def get_rep_identifier_by_project project
|
||||
identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier)
|
||||
result = identifier.nil? ? Repository.where(:project_id => project.id).first.try(:identifier) : identifier
|
||||
result
|
||||
end
|
||||
|
||||
# 获取用户单位
|
||||
# 优先获取高校信息,如果改信息不存在则获取occupation
|
||||
def get_occupation_from_user user
|
||||
|
|
|
@ -35,7 +35,7 @@ module CoursesHelper
|
|||
and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
|
||||
default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id }
|
||||
excellent_ids << default_ids.flatten
|
||||
arr_result = excellent_ids.flatten.uniq.first(5)
|
||||
arr_result = excellent_ids.flatten.uniq.first(3)
|
||||
excellent_courses = Course.find(arr_result)
|
||||
return excellent_courses
|
||||
end
|
||||
|
@ -78,18 +78,18 @@ module CoursesHelper
|
|||
#生成课程老师成员链接
|
||||
def course_teacher_link teacher_num
|
||||
if User.current.member_of_course?(@course) || User.current.admin?
|
||||
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue', :id => 'teacher_number'
|
||||
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'sy_cblue', :id => 'teacher_number'
|
||||
else
|
||||
content_tag 'span',teacher_num, :class => 'info_foot_num c_blue'
|
||||
content_tag 'span',teacher_num, :class => 'sy_cblue'
|
||||
end
|
||||
end
|
||||
|
||||
#生成课程学生列表连接
|
||||
def course_student_link student_num
|
||||
if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?
|
||||
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue', :id => "student_number"
|
||||
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'sy_cblue', :id => "student_number"
|
||||
else
|
||||
content_tag 'span',student_num, :class => 'info_foot_num c_blue'
|
||||
content_tag 'span',student_num, :class => 'sy_cblue'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -772,12 +772,12 @@ module CoursesHelper
|
|||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
if joined
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
else
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;")
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "sy_btn_grey fl")
|
||||
end
|
||||
else
|
||||
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
|
||||
link = "<a href='javascript:void(0)' class='sy_btn_grey fl ml10' >#{l(:label_course_join_student)}</a>"
|
||||
end
|
||||
link.html_safe
|
||||
end
|
||||
|
@ -872,7 +872,7 @@ module CoursesHelper
|
|||
desc.html_safe
|
||||
end
|
||||
|
||||
# 学生按作业总分排序,取前8个
|
||||
# 学生按作业总分排序,取前3个
|
||||
def hero_homework_score(course, score_sort_by)
|
||||
sql_select = "SELECT members.*,(
|
||||
SELECT SUM(work_score)
|
||||
|
@ -884,14 +884,14 @@ module CoursesHelper
|
|||
FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 9"
|
||||
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3"
|
||||
homework_scores = Member.find_by_sql(sql_select)
|
||||
end
|
||||
|
||||
def contributor_course_scor(course_id)
|
||||
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
|
||||
(message_num*2 + message_reply_num + news_reply_num + news_num +
|
||||
resource_num*5 + journal_num + homework_journal_num ) desc limit 9;")
|
||||
resource_num*5 + journal_num + homework_journal_num ) desc limit 3;")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#coding=utf-8
|
||||
#
|
||||
|
||||
module WechatsHelper
|
||||
def include_wechat_jsfile
|
||||
if Rails.env.production?
|
||||
javascript_include_tag '/javascripts/wechat/build/app.min.js'
|
||||
else
|
||||
wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")
|
||||
srcs = Rails.application.config.wechat_srcs
|
||||
paths = []
|
||||
srcs.each do |src|
|
||||
Dir.glob(wechat_path+ "/#{src}" ) do |path|
|
||||
paths << path[File.join(Rails.root, "public").to_s.size, path.size]
|
||||
end
|
||||
end
|
||||
javascript_include_tag *paths
|
||||
end
|
||||
end
|
||||
end
|
|
@ -33,10 +33,11 @@ class Comment < ActiveRecord::Base
|
|||
:title=>Proc.new {|o| "RE: #{o.commented.title}" },
|
||||
:url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} }
|
||||
|
||||
acts_as_tree :counter_cache => :comments_count, :order => "#{Comment.table_name}.created_on ASC"
|
||||
belongs_to :commented, :polymorphic => true, :counter_cache => true,:touch => true
|
||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||
validates_presence_of :commented, :author, :comments
|
||||
safe_attributes 'comments'
|
||||
safe_attributes 'comments','parent_id','reply_id','comments_count'
|
||||
after_create :send_mail, :act_as_system_message, :act_as_student_score
|
||||
after_destroy :down_course_score
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class Journal < ActiveRecord::Base
|
|||
has_many :at_messages, as: :at_message, dependent: :destroy
|
||||
acts_as_attachable
|
||||
attr_accessor :indice
|
||||
acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC"
|
||||
|
||||
acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.project_index}#{status}: #{o.issue.subject}" },
|
||||
:description =>:notes,
|
||||
|
|
|
@ -162,7 +162,7 @@ class CoursesService
|
|||
raise '403'
|
||||
end
|
||||
end
|
||||
@comments = @news.comments
|
||||
@comments = @news.comments.reorder("created_on desc")
|
||||
@comments.reverse! if current_user.wants_comments_in_reverse_order?
|
||||
{:news => @news,:comments => @comments}
|
||||
|
||||
|
@ -335,6 +335,7 @@ class CoursesService
|
|||
8, '您已经是该班级的教师了',
|
||||
9, '您已经是该班级的教辅了',
|
||||
10, '您已经是该班级的管理员了',
|
||||
11, '该班级不存在或已被删除啦',
|
||||
'未知错误,请稍后再试'
|
||||
]
|
||||
end
|
||||
|
@ -348,6 +349,8 @@ class CoursesService
|
|||
if course
|
||||
if course_endTime_timeout? course
|
||||
@state = 2
|
||||
elsif course[:is_delete] == 1
|
||||
@state = 11
|
||||
else
|
||||
if current_user.member_of_course?(course) #如果已经是成员
|
||||
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
|
||||
|
@ -392,7 +395,7 @@ class CoursesService
|
|||
def homework_list params,current_user
|
||||
course = Course.find(params[:id])
|
||||
if course.is_public != 0 || current_user.member_of_course?(course)
|
||||
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).order('created_at DESC')
|
||||
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).reorder('created_at DESC')
|
||||
bids = bids.like(params[:name]) if params[:name].present?
|
||||
homeworks = []
|
||||
bids.each do |bid|
|
||||
|
@ -495,7 +498,7 @@ class CoursesService
|
|||
def course_attachments params
|
||||
result = []
|
||||
course = Course.find(params[:course_id])
|
||||
attachments = course.attachments.where("is_publish = 1").order("created_on desc")
|
||||
attachments = course.attachments.where("is_publish = 1").reorder("created_on desc")
|
||||
if !params[:name].nil? && params[:name] != ""
|
||||
attachments.each do |atta|
|
||||
result << atta if atta.filename.include?(params[:name])
|
||||
|
@ -632,7 +635,7 @@ class CoursesService
|
|||
:homework_submit_num => bid.student_works.count,
|
||||
:homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
|
||||
:student_evaluation_part => get_evaluation_part( bid ,3),
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?,:current_user_is_teacher => is_course_teacher}
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -49,6 +49,125 @@ class ResourcesService
|
|||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
def send_homework_to_course user,params
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
@ori = homework
|
||||
course_ids = params[:course_ids]
|
||||
@flag = false
|
||||
unless course_ids.nil?
|
||||
course_ids.each do |course_id|
|
||||
course = Course.find course_id.to_i
|
||||
new_homework = HomeworkCommon.new
|
||||
new_homework.name = homework.name
|
||||
new_homework.user_id = user.id
|
||||
new_homework.description = homework.description
|
||||
new_homework.homework_type = homework.homework_type
|
||||
new_homework.late_penalty = homework.late_penalty
|
||||
new_homework.course_id = course.id
|
||||
new_homework.teacher_priority = homework.teacher_priority
|
||||
new_homework.anonymous_comment = homework.anonymous_comment
|
||||
new_homework.quotes = 0
|
||||
new_homework.is_open = homework.is_open
|
||||
homework.attachments.each do |attachment|
|
||||
att = attachment.copy
|
||||
att.container_id = nil
|
||||
att.container_type = nil
|
||||
att.copy_from = attachment.id
|
||||
att.save
|
||||
new_homework.attachments << att
|
||||
end
|
||||
homework_detail_manual = homework.homework_detail_manual
|
||||
homework_detail_programing = homework.homework_detail_programing
|
||||
homework_detail_group = homework.homework_detail_group
|
||||
if homework_detail_manual
|
||||
new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||
new_homework_detail_manual = new_homework.homework_detail_manual
|
||||
new_homework_detail_manual.ta_proportion = homework_detail_manual.ta_proportion
|
||||
new_homework_detail_manual.comment_status = 0
|
||||
new_homework_detail_manual.evaluation_num = homework_detail_manual.evaluation_num
|
||||
new_homework_detail_manual.absence_penalty = homework_detail_manual.absence_penalty
|
||||
end
|
||||
if homework_detail_programing
|
||||
new_homework.homework_detail_programing = HomeworkDetailPrograming.new
|
||||
new_homework.homework_detail_programing.ta_proportion = homework_detail_programing.ta_proportion
|
||||
new_homework.homework_detail_programing.language = homework_detail_programing.language
|
||||
homework.homework_tests.each_with_index do |homework_test|
|
||||
new_homework.homework_tests << HomeworkTest.new(
|
||||
input: homework_test.input,
|
||||
output: homework_test.output
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
if homework_detail_group
|
||||
new_homework.homework_detail_group = HomeworkDetailGroup.new
|
||||
new_homework.homework_detail_group.min_num = homework_detail_group.min_num
|
||||
new_homework.homework_detail_group.max_num = homework_detail_group.max_num
|
||||
new_homework.homework_detail_group.base_on_project = homework_detail_group.base_on_project
|
||||
end
|
||||
if new_homework.save
|
||||
new_homework_detail_manual.save if new_homework_detail_manual
|
||||
new_homework.homework_detail_programing.save if new_homework.homework_detail_programing
|
||||
new_homework.homework_detail_group.save if new_homework.homework_detail_group
|
||||
@flag = true
|
||||
else
|
||||
@flag = false
|
||||
@save_message = new_homework.errors.full_messages
|
||||
break
|
||||
end
|
||||
homework.update_column(:quotes, homework.quotes+1)
|
||||
end
|
||||
end
|
||||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
def send_exercise_to_course user,params
|
||||
# send_id = params[:send_id]
|
||||
# @ori = Attachment.find_by_id(send_id)
|
||||
# course_ids = params[:course_ids]
|
||||
# @flag = false
|
||||
# unless course_ids.nil?
|
||||
# course_ids.each do |id|
|
||||
# next if @ori.blank?
|
||||
# @exist = false
|
||||
# Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
||||
# if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from
|
||||
# att.created_on = Time.now
|
||||
# att.save
|
||||
# @exist = true
|
||||
# @flag = true
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
# next if @exist
|
||||
# attach_copied_obj = @ori.copy
|
||||
# attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
|
||||
# attach_copied_obj.container = Course.find(id)
|
||||
# attach_copied_obj.created_on = Time.now
|
||||
# attach_copied_obj.author_id = user.id
|
||||
# attach_copied_obj.is_public = 0
|
||||
# attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
|
||||
# if attach_copied_obj.attachtype == nil
|
||||
# attach_copied_obj.attachtype = 4
|
||||
# end
|
||||
# if attach_copied_obj.save
|
||||
# # 更新引用次数
|
||||
# quotes = @ori.quotes.to_i + 1
|
||||
# @ori.update_attribute(:quotes, quotes) unless @ori.nil?
|
||||
# @ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
# @flag = true
|
||||
# else
|
||||
# @flag = false
|
||||
# @save_message = attach_copied_obj.errors.full_messages
|
||||
# break
|
||||
# end
|
||||
#
|
||||
# end
|
||||
# end
|
||||
|
||||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
# 我的资源-课件 已发布的
|
||||
def all_course_attachments user
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ class SyllabusesService
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
title = "恭喜您创建班级成功"
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情"
|
||||
title = "恭喜您创建班级成功。"
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情。"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ class WechatService
|
|||
color:"#707070"
|
||||
},
|
||||
remark:{
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态",
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态。",
|
||||
color:"#707070"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'css/public'%>
|
||||
<div class="homepageContent BgBox">
|
||||
<h2 class="BgBox_h2">关于我们</h2>
|
||||
<div class="AgreementBox">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'css/public'%>
|
||||
<!--<div class="homepageContentContainer mb20" >-->
|
||||
<div class="homepageContent BgBox mt10">
|
||||
<h2 class="BgBox_h2">Trustie服务协议</h2>
|
||||
|
@ -28,24 +28,5 @@
|
|||
|
||||
|
||||
</div><!---BgBox end--->
|
||||
<!--</div><!–-homepageContentContainer end-–>-->
|
||||
<script>
|
||||
$(".resourcesList").mousedown(function(e) {
|
||||
if (3 == e.which) {
|
||||
document.oncontextmenu = function() {return false;}
|
||||
$("#contextMenu").hide();
|
||||
$("#contextMenu").attr("style","display: block; position: fixed; top:"
|
||||
+ e.pageY
|
||||
+ "px; left:"
|
||||
+ e.pageX
|
||||
+ "px; width: 80px;");
|
||||
$("#contextMenu").show();
|
||||
}
|
||||
|
||||
});
|
||||
$(".resourcesList").click(function(e) {
|
||||
$("#contextMenu").hide();
|
||||
document.oncontextmenu = function() {return true;}
|
||||
});
|
||||
</script>
|
||||
<!--</div>-->
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'leftside'%>
|
||||
<%= stylesheet_link_tag 'css/common'%>
|
||||
<%= stylesheet_link_tag 'css/public'%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'css/public'%>
|
||||
|
||||
<div class="homepageContentContainer ">
|
||||
<div class="homepageContent BgBox">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</span>
|
||||
<span class="add_attachment">
|
||||
<% id ="file#{container.id}"%>
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl" style= "<%= ie8? ? 'display:none' : ''%>" onclick="$('#'+'<%= id %>').click();">上传附件</a>
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mr10" style= "<%= ie8? ? 'display:none' : ''%>" onclick="$('#'+'<%= id %>').click();">上传附件</a>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "file#{container.id}",
|
||||
:class => 'file_selector',
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<span class="attachment">
|
||||
<%= link_to truncate(history.filename,length: 35, omission: '...'),
|
||||
download_history_attachment_path(history.id, history.filename),
|
||||
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f_14 f_b link_file_a2 fl" %>
|
||||
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f_14 f_b upload_filename fl" %>
|
||||
<span class="fr">版本号:<%= history.version %></span>
|
||||
<div class="cl"></div>
|
||||
</span>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</li>
|
||||
<li class=" ml90" >
|
||||
<a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="javascript:void(0)"><%= l(:button_create)%></a>
|
||||
<%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%>
|
||||
<%= link_to l(:button_cancel), homework_course_path(@course), :class => "grey_btn fl c_white ml10"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
%>
|
||||
<div class="cl"></div>
|
||||
<p id="message_content_span"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
|
@ -56,4 +58,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
elocalStorage(message_content_editor,'blog_<%=User.current.id %>');
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
|
@ -36,6 +36,8 @@
|
|||
:maxlength => 5000 }%>
|
||||
<div class="cl"></div>
|
||||
<p id="message_content_span"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
|
@ -62,4 +64,4 @@
|
|||
<div class="cl"></div>
|
||||
</li>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -135,13 +135,8 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_on) %>
|
||||
</div>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
|
|
|
@ -51,13 +51,13 @@
|
|||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/blog_comment_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
|
||||
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/blog_comments_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%>
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -184,3 +184,10 @@ function nh_init_board(params){
|
|||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
elocalStorage(message_content_editor,'blog_<%=User.current.id %>');
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<%= render :partial => 'form_project',
|
||||
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
|
||||
<div class="ml55 fl" nhname="toolbar_container"></div>
|
||||
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
|
||||
<a href="javascript:void(0)" nhname='cancelbtn' class="grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
|
||||
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white" ><%= l(:button_submit)%></a>
|
||||
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
|
||||
</ul>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<%= render :partial => 'form_course',
|
||||
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
|
||||
<div class="ml55 fl" nhname="toolbar_container"></div>
|
||||
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
|
||||
<a href="javascript:void(0)" nhname='cancelbtn' class="grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
|
||||
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white"><%= l(:button_submit)%></a>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for @comment, :as => :reply, :url => {:controller => 'comments',:action => 'reply', :id => @comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -0,0 +1,10 @@
|
|||
<% if @user_activity_id %>
|
||||
<% if @news.project_id && @news.project_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.course_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.org_subfield_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "<%=@news.class.to_s%>");
|
|
@ -0,0 +1,8 @@
|
|||
if($("#reply_message_<%= @comment.id%>").length > 0) {
|
||||
$("#reply_message_<%= @comment.id%>").replaceWith("<%= escape_javascript(render :partial => 'comments/simple_ke_reply_form', :locals => {:reply => @comment}) %>");
|
||||
$(function(){
|
||||
sd_create_editor_from_data(<%= @comment.id%>,null,"100%", "<%=@comment.class.to_s%>");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @comment.id %>").length >0) {
|
||||
$("#reply_to_message_<%= @comment.id%>").replaceWith("<p id='reply_message_<%= @comment.id %>'></p>");
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<% if @user_activity_id %>
|
||||
<% if @news.project_id && @news.project_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.course_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.org_subfield_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "<%=@news.class.to_s%>");
|
|
@ -1,13 +1,15 @@
|
|||
<% unless contributor_course_scor(course.id).count == 0 %>
|
||||
<ul class="rankList">
|
||||
<h4>
|
||||
<div>
|
||||
<ul class="rankList">
|
||||
<h3 style="font-size: 14px; font-weight: normal;">
|
||||
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => '' %>
|
||||
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'sy_cblack' %>
|
||||
<% else %>
|
||||
班级活跃度
|
||||
<% end %>
|
||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
||||
</h4>
|
||||
<a class="sy_cmore fr" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
||||
<div class="cl"></div>
|
||||
</h3>
|
||||
<div class="numIntro undis" style="cursor:pointer;">
|
||||
<div class="active-degree-rule">
|
||||
积分规则<br/>
|
||||
|
@ -26,10 +28,11 @@
|
|||
+ contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
|
||||
contributor_score.news_num.to_i * 1 %>
|
||||
<% unless total_score ==0 %>
|
||||
<li><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>
|
||||
<li>
|
||||
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %>
|
||||
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>
|
||||
<p><span class="c_green" style="cursor:pointer">
|
||||
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green">
|
||||
<p><span class="sy_corange" style="cursor:pointer">
|
||||
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="sy_corange">
|
||||
<%=total_score %></a></span></p>
|
||||
<div style="display: none" class="numIntro">
|
||||
<div class="contributor-course-calculate">积分计算</div>
|
||||
|
@ -60,5 +63,6 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,9 +1,9 @@
|
|||
<% hero_homework_scores = hero_homework_score(course, "desc") %>
|
||||
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
||||
<ul class="rankList">
|
||||
<h4>
|
||||
<h4 style="font-size: 14px; font-weight: normal;">
|
||||
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => '' %>
|
||||
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'sy_cblack' %>
|
||||
<% else %>
|
||||
<span>班级英雄榜</span>
|
||||
<% end %>
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
<div nhname='toolbar_container_' ></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
|
||||
<p nhname='contentmsg_'></p>
|
||||
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="new_message_submit_btn_" >留言</a>
|
||||
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10 ml10 mb10">取消</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr mt10" id="new_message_submit_btn_" >留言</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,25 +1,15 @@
|
|||
<% exc_course = excellent_course_recommend(course) %>
|
||||
<% unless exc_course.length == 0 %>
|
||||
<ul class="courseR mb10">
|
||||
<h4 class="mb5" ><%= l(:label_homework_recommendation) %>:</h4>
|
||||
<% exc_course.each do |e_course| %>
|
||||
<li class="mt15"> <%= image_tag(url_to_avatar(e_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %>
|
||||
<div class="fl">
|
||||
<p class="f12 mb5"><%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %><div class="cl"></div> </p>
|
||||
<p class="f12">
|
||||
<% if visable_attachemnts_incourse(e_course).count > 0 %>
|
||||
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts_incourse(e_course).count, course_files_path(e_course), :class => "linkBlue2" %>)</span>
|
||||
<% end %>
|
||||
<% if e_course.homework_commons.where("publish_time <= '#{Date.today}'").count > 0 %>
|
||||
<span class="fl fontGrey4"><%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.where("publish_time <= '#{Date.today}'").count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<ul class="sy_class_lclass">
|
||||
<% exc_course.each_with_index do |e_course, i| %>
|
||||
<li>
|
||||
<span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span>
|
||||
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle fl mb10" %>
|
||||
<p class="sy_cgrey ml20">作业<span class="sy_cir_grey ml5 mr5"><%=e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %></span>
|
||||
资源<span class="sy_cir_grey ml5 mr5"><%=visable_attachemnts_incourse(e_course).count %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,47 +1,53 @@
|
|||
<% course_file_num = visable_attachemnts_incourse(@course).count%>
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
||||
<li>
|
||||
<a href="<%=course_boards_path(@course) %>">问答区</a>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(@course.homework_commons.count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f12 c_blue02 ml10 fn"%>
|
||||
<%= link_to( "", homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
|
||||
</div>
|
||||
<li>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id) %>">作业</a>
|
||||
<%= link_to( "",homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(@course.news.count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to "通知", course_news_index_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
||||
<%= link_to( "", new_course_news_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
|
||||
</div>
|
||||
<li>
|
||||
<a href="<%=course_news_index_path(@course) %>">通知</a>
|
||||
<%= link_to( "",new_course_news_path(@course,:is_new=>1), :class => 'sy_class_add', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(course_file_num) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
||||
<li>
|
||||
<a href="<%=course_files_path(@course) %>">资源库</a>
|
||||
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
|
||||
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
|
||||
<a class="courseMenuSetting" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
|
||||
<a class="sy_class_add" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(course_feedback_count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
||||
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
|
||||
</div>
|
||||
<li>
|
||||
<a href="<%=course_feedback_path(@course) %>">留言</a>
|
||||
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(course_poll_count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
|
||||
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
|
||||
</div>
|
||||
<li>
|
||||
<a href="<%=poll_index_path(:polls_type => "Course", :polls_group_id => @course.id) %>">问卷调查</a>
|
||||
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'sy_class_add', :title =>"#{l(:label_new_poll)}") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f12 c_blue02 ml10 fn"%>
|
||||
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
|
||||
</div>
|
||||
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
|
||||
<% if show_nav?(count) %>
|
||||
<li>
|
||||
<a href="<%=exercise_index_path(:course_id => @course.id) %>">在线测验</a>
|
||||
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if show_nav?(0) %>
|
||||
<li>
|
||||
<a href="<%=statistics_course_course_path(@course) %>">统计</a>
|
||||
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
|
||||
</li>
|
||||
<% end %>
|
|
@ -1,5 +1,7 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
|
||||
<div class="courseRSide fl">
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2>
|
||||
</div>
|
||||
|
@ -9,4 +11,5 @@
|
|||
:locals => { :contest => @contest, :journals => @jour, :state => false}
|
||||
%>
|
||||
|
||||
<% html_title(l(:label_course_feedback)) -%>
|
||||
<% html_title(l(:label_course_feedback)) -%>
|
||||
</div>
|
|
@ -8,11 +8,11 @@
|
|||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<% if @syllabus.nil? %>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
<% else %>
|
||||
<span><%=@syllabus.title %></span>
|
||||
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
||||
<% end %>
|
||||
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
@ -75,7 +75,7 @@
|
|||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
|
||||
<%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %>
|
||||
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<%= stylesheet_link_tag 'org' %>
|
||||
<%= stylesheet_link_tag 'css/org' %>
|
||||
|
||||
<div>
|
||||
<div class="relateOrg fl">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="NewsBannerName">班级动态</div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType">
|
||||
<ul class="homepagePostType" style="width:90px; left:-80px;">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li><%= link_to "全部动态", {:controller => "courses", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%></li>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<div class="sy_class_r ml10">
|
||||
<div class="icons_tishi"><img src="../../images/sy/icons_smile.png" width="110" height="110" alt="" ></div>
|
||||
<p class="sy_tab_con_p">统计功能即将上线,届时我们一起享受教育大数据的红利吧!</p>
|
||||
<div style="height:400px;"></div>
|
||||
</div><!--sy_class_r end-->
|
|
@ -34,7 +34,7 @@
|
|||
<div id="poll_answers_<%=exercise_question.id%>">
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="ur_item">
|
||||
<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>: </label>
|
||||
<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>: </label>
|
||||
<input maxlength="200" type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
//编辑问卷描述之后
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||||
$("#Container").css("width","1000px");
|
||||
var end_time = <%=exercise.end_time.to_i%>;
|
||||
getTime(end_time);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -18,28 +18,28 @@
|
|||
<div class="cl"></div>
|
||||
<div>
|
||||
<li class="ur_item">
|
||||
<label name='select_items' class='w56'>选项A<span class="ur_index"></span>: </label>
|
||||
<label name='select_items' class='w60'>选项A<span class="ur_index"></span>: </label>
|
||||
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
|
||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ur_item">
|
||||
<label name='select_items' class='w56'>选项B<span class="ur_index"></span>: </label>
|
||||
<label name='select_items' class='w60'>选项B<span class="ur_index"></span>: </label>
|
||||
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
|
||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ur_item">
|
||||
<label name='select_items' class='w56'>选项C<span class="ur_index"></span>: </label>
|
||||
<label name='select_items' class='w60'>选项C<span class="ur_index"></span>: </label>
|
||||
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'/>
|
||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ur_item">
|
||||
<label name='select_items' class='w56'>选项D<span class="ur_index"></span>: </label>
|
||||
<label name='select_items' class='w60'>选项D<span class="ur_index"></span>: </label>
|
||||
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'/>
|
||||
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
|
|
|
@ -55,28 +55,28 @@
|
|||
'<input value="<%=score %>" id="question_score" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;"/>分'+
|
||||
'</li><div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label name="select_items" class="w56">选项A<span class="ur_index"></span>: </label>'+
|
||||
'<label name="select_items" class="w60">选项A<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label name="select_items" class="w56">选项B<span class="ur_index"></span>: </label>'+
|
||||
'<label name="select_items" class="w60">选项B<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label name="select_items" class="w56">选项C<span class="ur_index"></span>: </label>'+
|
||||
'<label name="select_items" class="w60">选项C<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label name="select_items" class="w56">选项D<span class="ur_index"></span>: </label>'+
|
||||
'<label name="select_items" class="w60">选项D<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[3]" placeholder="输入选项内容"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").css("width","730px");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#Container").css("width","1000px");
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||||
});
|
||||
function republish_exercise(exercise_id,index)
|
||||
{
|
||||
|
@ -63,6 +61,8 @@
|
|||
}
|
||||
|
||||
</script>
|
||||
<div class="courseRSide fl" id="homework_page_right">
|
||||
<div class="polls_content02" id="exercise" style="width: 730px;">
|
||||
<%= render :partial => 'exercises_list'%>
|
||||
</div><!--问卷内容end-->
|
||||
</div><!--问卷内容end-->
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-47);
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', org_subfields_check_box_tags('org_subfields[org_subfield][]',org_subfield.organization.org_subfields.where("field_type='Resource'"),file), :id => 'org_subfields')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', projects_check_box_tags('projects[project][]', User.current.projects,project,file), :id => 'projects', :class => "hidden")%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'courses'%>
|
||||
<%= stylesheet_link_tag 'css/courses'%>
|
||||
<script>
|
||||
function searchone4reload(fileid){
|
||||
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
|
||||
<%= render :partial => 'files/org_upload_attachment_list', :locals => {:container => org}%>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_org_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
|
||||
<%= render :partial => 'files/org_upload_attachment_list_banner', :locals => {:container => org}%>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_org_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_resource();', :onfocus=>'this.blur()', :id=>'submit_resource', :class=>'sendSourceText fr' %>
|
||||
<% end %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<input type="hidden" name="course_attachment_type" value="<%= course_attachment_type%>">
|
||||
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 fl" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
||||
<% end %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<input type="hidden" name="course_attachment_type" value="<%= project_attachment_type %>">
|
||||
<%= render :partial => 'attachement_list',:locals => {:project => project} %>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 ml10" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
||||
<% end %>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="postDetailReply fr">
|
||||
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
|
||||
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
||||
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
||||
</div>
|
||||
|
||||
<div class="postDetailDes" id = "postDetailDes_<%= topic.id %>"><%= topic.content.html_safe%>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= javascript_include_tag 'new_user' %>
|
||||
<%= stylesheet_link_tag 'public'%>
|
||||
<%= stylesheet_link_tag 'css/common','css/public'%>
|
||||
<script>
|
||||
function add_class(id){
|
||||
if($("#"+id).hasClass("sortArrowActiveD")){
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
:method => 'get',
|
||||
:title => l(:label_version_new),
|
||||
:tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
|
||||
<%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 ", :target => "_blank" %>
|
||||
<%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 fl", :target => "_blank" %>
|
||||
<!--<a href="javascript:viod(0)" class="pic_add mt5 ml5"></a>-->
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
@ -79,4 +79,4 @@
|
|||
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
|
||||
<% end %>
|
||||
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80"> 确定</a>
|
||||
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50" > 取消 </a>
|
||||
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>
|
||||
|
|
|
@ -1,54 +1,55 @@
|
|||
<ul>
|
||||
<% issue.journals.reorder("created_on desc").each do |reply| %>
|
||||
<% issue.journals.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait" >
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%#= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<% if comment.details.any? %>
|
||||
<% details_to_strings(comment.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.html_safe %></P>
|
||||
<P><%= comment.notes.html_safe %></P>
|
||||
</div>
|
||||
<div style="margin-top: 7px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'issues', :action => 'reply', :user_id => reply.user_id, :id => issue.id, :journal_id => reply.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:title => l(:button_reply)) if User.current.logged? %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
|
||||
:method => :get,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.user_id == User.current.id %>
|
||||
<div class="orig_reply mb10 mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%= comment.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'issues', :action => 'reply', :user_id => comment.user_id, :id => issue.id, :journal_id => comment.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>comment.id},
|
||||
:method => :get,
|
||||
:remote=>true,
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if comment.user_id == User.current.id %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
@ -64,17 +65,15 @@
|
|||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= @issue.id %>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f| %>
|
||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||
<!--<div class="cl"></div>-->
|
||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||
<div nhname='toolbar_container_<%= @issue.id %>' ></div>
|
||||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5 fl">
|
||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @jour.nil? ? @issue : @jour} %>
|
||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
|
||||
</div>
|
||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl mt8"></span>
|
||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr mt5" style="display:none;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
@ -82,7 +81,6 @@
|
|||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,30 +1,26 @@
|
|||
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>">
|
||||
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @jour.id%>">
|
||||
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @jour.id%>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
|
||||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post") do |f|%>
|
||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||
<!--<div class="cl"></div>-->
|
||||
<input type="hidden" name="quote" value=""/>
|
||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||
<div nhname='toolbar_container_<%= @issue.id%>' ></div>
|
||||
<div nhname='new_message_<%= @jour.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="journal_id" value="<%=@jour.id%>"/>
|
||||
<div nhname='toolbar_container_<%= @jour.id%>' ></div>
|
||||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @jour.id%>' name="content"></textarea>
|
||||
<div class="cl"></div>
|
||||
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<span nhname='contentmsg_<%= @jour.id%>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @jour.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
||||
<% if @user_activity_id %>
|
||||
$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>");
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>, null, "100%","<%=@issue.class.name%>");
|
||||
<% else %>
|
||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)');
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
||||
<% end %>
|
|
@ -1,3 +1,8 @@
|
|||
<% if @user_activity_id %>
|
||||
$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>");
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>, null, "100%","<%=@issue.class.name%>");
|
||||
<% else %>
|
||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
||||
<% end %>
|
|
@ -57,7 +57,7 @@
|
|||
<div class="problem_search fr" >
|
||||
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" placeholder="请输入问题名称" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
||||
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
||||
<a href="javascript:void(0)" class="grey_btn fl ml10" onclick="nh_reset_form();" >清空</a>
|
||||
<a href="javascript:void(0)" class="grey_btn fl ml10 f14" onclick="nh_reset_form();" >清空</a>
|
||||
</div><!--problem_search end-->
|
||||
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
|
||||
<p class="problem_p fl" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.project_score.issue_num %></a>
|
||||
|
@ -96,13 +96,13 @@
|
|||
<div class="fl"> </div>
|
||||
<div>
|
||||
<input name="issue_create_date_start" nhname="date_val" type="hidden"/>
|
||||
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
|
||||
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
|
||||
<%= calendar_for('issue_create_date_start_show') %>
|
||||
</div>
|
||||
<div style="float:left;"> - </div>
|
||||
<div>
|
||||
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
|
||||
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
|
||||
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
|
||||
<%= calendar_for('issue_create_date_end_show') %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue