Merge remote-tracking branch 'origin/szzh' into gitlab_guange

This commit is contained in:
guange 2015-08-01 09:41:01 +08:00
commit 909521df54
115 changed files with 2304 additions and 1482 deletions

View File

@ -4,56 +4,50 @@ module Mobile
include Redmine::I18n
def self.course_dynamic_expose(field)
expose field do |c,opt|
if field == :update_time
(format_time(c[field]) if (c.is_a?(Hash) && c.key?(field)))
elsif field == :news_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 1
obj = d[:count]
end
end
obj
elsif field == :document_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 3
obj = d[:count]
end
end
obj
elsif field == :topic_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 2
obj = d[:count]
end
end
obj
elsif field == :homework_count
obj = nil
c[:dynamics].each do |d|
if d[:type] == 4
obj = d[:count]
end
end
obj
else
# if field == :news_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 1
# obj = d[:count]
# end
# end
# obj
# elsif field == :document_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 3
# obj = d[:count]
# end
# end
# obj
# elsif field == :topic_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 2
# obj = d[:count]
# end
# end
# obj
# elsif field == :homework_count
# obj = nil
# c[:dynamics].each do |d|
# if d[:type] == 4
# obj = d[:count]
# end
# end
# obj
# else
c[field] if (c.is_a?(Hash) && c.key?(field))
end
# end
end
end
course_dynamic_expose :type
course_dynamic_expose :count
course_dynamic_expose :course_name
course_dynamic_expose :course_term
course_dynamic_expose :course_time
course_dynamic_expose :course_id
course_dynamic_expose :course_img_url
course_dynamic_expose :message
course_dynamic_expose :update_time
course_dynamic_expose :count
course_dynamic_expose :news_count
course_dynamic_expose :document_count
course_dynamic_expose :topic_count
@ -63,62 +57,32 @@ module Mobile
course_dynamic_expose :current_user_is_member
course_dynamic_expose :current_user_is_teacher
expose :documents,using:Mobile::Entities::Attachment do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 3
obj = d[:documents]
end
end
obj
end
# expose :documents,using:Mobile::Entities::Attachment do |f,opt|
# obj = nil
# f[:dynamics].each do |d|
# if d[:type] == 3
# obj = d[:documents]
# end
# end
# obj
# end
expose :topics,using:Mobile::Entities::Message do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 2
obj = d[:topics]
end
end
obj
f[:topics]
end
expose :homeworks,using:Mobile::Entities::Homework do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 4
obj = d[:homeworks]
end
end
obj
f[:homeworks]
end
expose :news,using:Mobile::Entities::News do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 1
obj = d[:news]
end
end
obj
f[:news]
end
expose :better_students,using:Mobile::Entities::User do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 6
obj = d[:better_students]
end
end
obj
f[:better_students]
end
expose :active_students,using:Mobile::Entities::User do |f,opt|
obj = nil
f[:dynamics].each do |d|
if d[:type] == 7
obj = d[:active_students]
end
end
obj
f[:active_students]
end
end

View File

@ -337,6 +337,19 @@ class AdminController < ApplicationController
format.html
end
end
#学校列表
def schools
@school_name = params[:school_name]
if @school_name
@schools = School.where("name like '%#{@school_name}%'")
else
@schools = School.all
end
respond_to do |format|
format.html
end
end
#移动端版本管理
def mobile_version
@versions = PhoneAppVersion.reorder('created_at desc')

View File

@ -20,11 +20,10 @@ class CoursesController < ApplicationController
menu_item l(:label_sort_by_influence), :only => :index
before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :logged_user_by_apptoken,:only => [:show,:feedback]
before_filter :find_course, :except => [ :index, :search, :new,:join,:unjoin, :create, :new_join, :course,:join_private_courses]
before_filter :authorize_course, :only => [:show, :settings, :update, :course]
before_filter :authorize_course_global, :only => [:new,:create]
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
before_filter :require_login, :only => [:join, :unjoin]
@ -605,7 +604,7 @@ class CoursesController < ApplicationController
def toggleCourse
@course_prefs = Course.find_by_extra(@course.extra)
unless (@course_prefs.teacher == User.current || User.current.admin?)
unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?)
render_403
end
end
@ -809,6 +808,12 @@ class CoursesController < ApplicationController
end
end
#删除课程
#删除课程只是将课程的is_delete状态改为falseis_delete为false状态的课程只有管理员可以看到
def destroy
end
private
def allow_join course
if course_endTime_timeout? course

View File

@ -1,6 +1,7 @@
class HomeworkCommonController < ApplicationController
require 'net/http'
require 'json'
require "base64"
layout "base_courses"
before_filter :find_course, :only => [:index,:new,:create,:next_step]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy]
@ -18,28 +19,28 @@ class HomeworkCommonController < ApplicationController
end
def new
@homework_type = "1"
@homework = HomeworkCommon.new
@homework.safe_attributes = params[:homework_common]
@homework.late_penalty = 0
@homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.publish_time = Time.now.strftime('%Y-%m-%d')
if @homework_type == "1"
#匿评作业相关属性
@homework_detail_manual = HomeworkDetailManual.new
@homework_detail_manual.ta_proportion = 0.6
@homework_detail_manual.absence_penalty = 0
@homework_detail_manual.evaluation_num = 3
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.homework_detail_manual = @homework_detail_manual
elsif @homework_type == "2"
#编程作业相关属性
@homework_detail_programing = HomeworkDetailPrograming.new
@homework.homework_detail_programing = @homework_detail_programing
end
# @homework_type = "1"
#
# @homework = HomeworkCommon.new
# @homework.safe_attributes = params[:homework_common]
# @homework.late_penalty = 0
# @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
# @homework.publish_time = Time.now.strftime('%Y-%m-%d')
#
# if @homework_type == "1"
# #匿评作业相关属性
# @homework_detail_manual = HomeworkDetailManual.new
# @homework_detail_manual.ta_proportion = 0.6
# @homework_detail_manual.absence_penalty = 0
# @homework_detail_manual.evaluation_num = 3
# @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
# @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
# @homework.homework_detail_manual = @homework_detail_manual
# elsif @homework_type == "2"
# #编程作业相关属性
# @homework_detail_programing = HomeworkDetailPrograming.new
# @homework.homework_detail_programing = @homework_detail_programing
# end
respond_to do |format|
format.html
end
@ -99,12 +100,13 @@ class HomeworkCommonController < ApplicationController
question = {title:homework.name,content:homework.description}
question[:input] = []
question[:output] = []
if params[:input] && params[:output]
if params[:input] && params[:output] && params[:result]
params[:input].each do |k,v|
if params[:output].include? k
homework_test = HomeworkTest.new
homework_test.input = v
homework_test.output = params[:output][k]
homework_test.result = params[:result][k]
homework.homework_tests << homework_test
question[:input] << homework_test.input
question[:output] << homework_test.output
@ -144,6 +146,8 @@ class HomeworkCommonController < ApplicationController
end
if homework.save
homework_detail_programing.save if homework_detail_programing
homework_detail_manual.save if homework_detail_manual
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)
@ -209,7 +213,7 @@ class HomeworkCommonController < ApplicationController
end
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
@homework_detail_programing.language = "C++"
@homework_detail_programing.language = params[:language]
@homework_detail_programing.standard_code = params[:standard_code]
@homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
homework_tests = @homework.homework_tests
@ -236,6 +240,24 @@ class HomeworkCommonController < ApplicationController
end
end
end
#发送修改作业的请求
question = {title:@homework.name,content:@homework.description}
question[:input] = []
question[:output] = []
@homework.homework_tests.each do |test|
question[:input] << test.input
question[:output] << test.output
end
uri = URI("http://192.168.80.21:8080/api/questions/#{@homework_detail_programing.question_id}.json")
body = question.to_json
res = Net::HTTP.new(uri.host, uri.port).start do |client|
request = Net::HTTP::Put.new(uri.path)
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
result = JSON.parse(res.body)
end
@homework.save_attachments(params[:attachments])
@ -331,6 +353,23 @@ class HomeworkCommonController < ApplicationController
end
end
def programing_test
test = {language:params[:language],src:Base64.encode64(params[:src]),input:[params[:input]],output:[params[:output]]}
@index = params[:index]
uri = URI('http://192.168.80.21:8080/api/realtime.json')
body = test.to_json
res = Net::HTTP.new(uri.host, uri.port).start do |client|
request = Net::HTTP::Post.new(uri.path)
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
result = JSON.parse(res.body)
result["results"].each do |re|
@result = re["status"]
end
end
private
#获取课程
def find_course

View File

@ -71,10 +71,15 @@ class NewsController < ApplicationController
scope = @course ? @course.news.course_visible : News.course_visible
@news_count = scope.count
#@news_pages = Paginator.new @news_count, @limit, params['page']
#@offset ||= scope_page.offset
@q = params[:subject]
if params[:subject].nil?
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
else
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
end
# :offset => @offset,
# :limit => @limit)
@newss = paginateHelper scope_order,10
@ -83,6 +88,7 @@ class NewsController < ApplicationController
@news = News.new
render :layout => 'base_courses'
}
format.js
format.api
format.atom { render_feed(@newss, :title => (@course ? @course.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end
@ -141,7 +147,7 @@ class NewsController < ApplicationController
ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
end
# 与我相关动态的记录add start
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
teachers = searchTeacherAndAssistant(@course)
for teacher in teachers
if(teacher.user_id != User.current.id)
@ -155,7 +161,7 @@ class NewsController < ApplicationController
notify.save()
end
end
# 与我相关动态的记录add end
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)
redirect_to course_news_index_url(@course)

View File

@ -136,12 +136,20 @@ class PollController < ApplicationController
}
@poll_questions.poll_answers.new question_option
end
end
# 如果是插入的话那么从插入的这个id以后的question_num都将要+1
if params[:quest_id]
@is_insert = true
@poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1")
@poll_question_num = params[:quest_num].to_i
@poll_questions.question_number = params[:quest_num].to_i + 1
end
if @poll_questions.save
respond_to do |format|
format.js
end
end
end
#修改题目
@ -328,6 +336,37 @@ class PollController < ApplicationController
end
end
def import_poll
@poll = Poll.find(params[:to_id])
question_num = @poll.poll_questions.select("max(question_number) question_number").first.question_number
import_poll = Poll.find(params[:import_id])
import_poll.poll_questions.each_with_index do |question,index|
option = {
:is_necessary => question.is_necessary,
:question_title => question.question_title,
:question_type => question.question_type,
:question_number => question_num + index+1
}
poll_questions = @poll.poll_questions.new option
for i in 1..question.poll_answers.count
answer = question.poll_answers[i-1][:answer_text]
question_option = {
:answer_position => i,
:answer_text => answer
}
poll_questions.poll_answers.new question_option
end
@poll.poll_questions << poll_questions
end
if @poll.save
@poll = Poll.find(params[:to_id])
respond_to do |format|
format.js
end
end
end
#重新发布问卷
def republish_poll
@poll.poll_questions.each do |poll_question|

View File

@ -150,11 +150,15 @@ class ProjectsController < ApplicationController
end
def new
if User.current.login?
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
render :layout => 'base'
else
redirect_to signin_url
end
end
def share
@ -167,6 +171,10 @@ class ProjectsController < ApplicationController
end
def create
unless User.current.login?
redirect_to signin_url
return
end
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@ -280,11 +288,11 @@ class ProjectsController < ApplicationController
# 根据私密性,取出符合条件的所有数据
if User.current.member_of?(@project) || User.current.admin?
@events_pages = ForgeActivity.where("project_id = ?",@project).order("created_at desc").page(params['page'|| 1]).per(20);
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20);
#events = @activity.events(@date_from, @date_to)
else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
= ?",@project,1).order("created_at desc")
= ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc")
.page(params['page'|| 1]).per(10);
# @events = @activity.events(@date_from, @date_to, :is_public => 1)
end

View File

@ -449,6 +449,8 @@ update
def stats
@project_id = params[:id]
@repository_id = @repository.identifier
# 提交次数统计
@status_commit_count = Changeset.count(:conditions => ["#{Changeset.table_name}.repository_id = ?", @repository.id])
render :layout => 'base_projects'
end
@ -459,6 +461,12 @@ update
data = graph_commits_per_month(@repository)
when "commits_per_author"
data = graph_commits_per_author(@repository)
when "author_commits_per_month"
data = graph_author_commits_per_month(@repository)
when "author_commits_six_month"
data = author_commits_six_month(@repository)
when "author_code_six_months"
data = author_code_six_month(@repository)
end
if data
headers["Content-Type"] = "image/svg+xml"
@ -483,9 +491,20 @@ update
@project = Project.find(params[:id])
if params[:repository_id].present?
@repository = @project.repositories.find_by_identifier_param(params[:repository_id])
else
# 多版本库,如果一个版本库为空则去下一个
rep_count = @project.repositories.count
if @project.repository.nil?
for i in 0..rep_count
unless @project.repositories[i].nil?
@repository = @project.repositories[i]
break
end
end
else
@repository = @project.repository
end
end
(render_404; return false) unless @repository
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip
@ -606,6 +625,123 @@ update
)
graph.burn
end
# 用户最近一年的提交次数
def graph_author_commits_per_month(repository)
@date_to = Date.today
@date_from = @date_to << 12
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:all, :group => :committer,
:conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25)
fields = commits_by_author.collect {|r| r.first}
commits_data = commits_by_author.collect {|r| r.last}
fields = fields + [""]*(10 - fields.length) if fields.length<10
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 400,
:width => 600,
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_author_commits_year),
:show_graph_title => true,
:no_css => true
)
graph.add_data(
:data => commits_data,
:title => l(:label_revision_commit_count)
)
graph.burn
end
# 用户最近六个月的提交次数
def author_commits_six_month(repository)
@date_to = Date.today
@date_from = @date_to << 6
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:all, :group => :committer,
:conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25)
fields = commits_by_author.collect {|r| r.first}
commits_data = commits_by_author.collect {|r| r.last}
fields = fields + [""]*(10 - fields.length) if fields.length<10
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 400,
:width => 600,
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_author_commits_six_month),
:show_graph_title => true
)
graph.add_data(
:data => commits_data,
:title => l(:label_revision_commit_count)
)
graph.burn
end
# 最近六个月代码量统计
def author_code_six_month(repository)
@date_to = Date.today
@date_from = @date_to << 6
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40)
all_author = []
commits_by_author.each do |cba|
all_author << cba.first
end
# all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') }
all_author = all_author.collect {|c| c.split.first }
commits_by_author = repository.commits(all_author, "#{@date_from}", "#{@date_to}", repository.id == 150 ? "szzh" : 'master')
fields = commits_by_author.collect {|r| r.first}
commits_data = commits_by_author.collect {|r| r.last}
fields = fields + [""]*(10 - fields.length) if fields.length<10
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
# Remove email adress in usernames
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
:height => 400,
:width => 600,
:fields => fields,
:stack => :side,
:scale_integers => true,
:show_data_values => true,
:rotate_y_labels => false,
:graph_title => l(:label_author_code_six_month),
:show_graph_title => true
)
graph.add_data(
:data => commits_data,
:title => l(:lable_revision_code_count)
)
graph.burn
end
def check_hidden_repo
project = Project.find(params[:id])
if !User.current.member_of?(project)

View File

@ -4,28 +4,21 @@ class SchoolController < ApplicationController
def upload
uploaded_io = params[:logo]
school_id = 0
schools = School.where("name = ?", params[:school])
schools.each do |s|
school_id = s.id
end
school_id ||= params[:id]
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
s1 = School.find(school_id)
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
s1.save
end
redirect_to admin_schools_url(:school_name => params[:school_name])
end
def upload_logo
@school = School.find params[:id]
@school_name = params[:school_name]
end
#获取制定学校开设的课程数

View File

@ -157,7 +157,7 @@ class StudentWorkController < ApplicationController
end
def edit
if @homework.homework_type == 2 #编程作业不能修改作业
if !User.current.admin? && @homework.homework_type == 2 #编程作业不能修改作业
render_403
else
respond_to do |format|
@ -396,6 +396,7 @@ class StudentWorkController < ApplicationController
if student_work_test.result == 0
student_score_count += 1
end
student_work_test.error_msg = params[:compile_error_msg]
student_work_test.save!
end
end
@ -444,7 +445,7 @@ class StudentWorkController < ApplicationController
#判断是不是当前作品的提交者
#提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品
def author_of_work
render_403 unless (User.current.id == @work.user_id || User.current.admin?) && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
render_403 unless User.current.admin? || (User.current.id == @work.user_id && @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
end
def teacher_of_course
@ -467,6 +468,25 @@ class StudentWorkController < ApplicationController
sheet1 = book.create_worksheet :name => "homework"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
if @homework.homework_type == 0 #普通作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
# sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,9] = format_time(homework.created_at)
count_row += 1
end
elsif @homework.homework_type == 1 #匿评作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
@ -484,6 +504,25 @@ class StudentWorkController < ApplicationController
sheet1[count_row,10] = format_time(homework.created_at)
count_row += 1
end
elsif @homework.homework_type == 2 #编程作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,10] = format_time(homework.created_at)
count_row += 1
end
end
book.write xls_report
xls_report.string
end

View File

@ -112,39 +112,20 @@ class UsersController < ApplicationController
#added by young
def user_projects
#add by huang
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
render_404
return
end
end
#end
# if User.current.admin?
# @memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
# else
# cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
# @memberships = @user.memberships.all(:conditions => cond)
# end
#events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
#@events_by_day = events.group_by(&:event_date)
# @state = 0
limit = 10;
query = Project.joins("join members m on #{Project.table_name}.id=m.project_id")
query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project)
projects = @user.projects.visible.order("updated_on desc")
if(params[:status] == '1')
query = query.where("#{Project.table_name}.user_id = ?",@user.id);
projects = projects.where("projects.user_id = ?",@user.id)
elsif(params[:status] == '2')
query = query.where("#{Project.table_name}.user_id <> ?",@user.id);
projects = projects.where("projects.user_id <> ?",@user.id)
end
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Project.table_name}.updated_on desc,#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
@list = paginateHelper projects,10
@params = params[:status]
respond_to do |format|
format.html{render :layout=>'base_users_new'}
format.api
@ -262,75 +243,33 @@ class UsersController < ApplicationController
def user_courses
unless User.current.admin?
if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?)
if !@user.active?
render_404
return
end
end
#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
limit = 10;
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
courses = @user.courses.visible.order("created_at desc")
if(params[:status] == '1')
query = query.where("endup_time >= ? or endup_time is null or endup_time=''",Time.now);
courses = courses.where("endup_time >= ? or endup_time is null or endup_time=''",Time.now)
elsif(params[:status] == '2')
query = query.where("endup_time < ?",Time.now);
courses = courses.where("endup_time < ?",Time.now)
end
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@params = params
@list = paginateHelper courses,10
@params = params[:status]
render :layout=>'base_users_new'
# if User.current == @user || User.current.admin?
# membership = @user.coursememberships.all
# else
# membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
# end
#
# membership.sort! {|older, newer| newer.created_on <=> older.created_on }
# @memberships = []
# membership.collect { |e|
# @memberships.push(e)
# }
# ## 判断课程是否过期 [需封装]
# @memberships_doing = []
# @memberships_done = []
# #now_time = Time.now.year
# @memberships.map { |e|
# #end_time = e.course.get_time.year
# isDone = course_endTime_timeout?(e.course)
# if isDone
# @memberships_done.push e
# else
# @memberships_doing.push e
# end
# }
# respond_to do |format|
# format.html
# format.api
# end
end
# modified by fq
def user_newfeedback
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@jours.update_all(:is_readed => true, :status => false)
@jours.each do |journal|
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
jours.update_all(:is_readed => true, :status => false)
jours.each do |journal|
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
#@limit = 10
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@jour = paginateHelper jours,10
@state = false
render :layout=>'base_users_new'
end
# end
def user_comments
@ -448,7 +387,7 @@ class UsersController < ApplicationController
def user_courses4show
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
query = query.where("m.user_id = ?",@user.id).order("#{Course.table_name}.id desc")
if User.current == @user #看自己
else
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
@ -456,13 +395,12 @@ class UsersController < ApplicationController
query = query.where("r.role_id in(3,7,9)")
end
query = query.where(Course.table_name+".is_public = 1")
# or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("( (#{Course.table_name}.updated_at=? and #{Course.table_name}.id < ?) or #{Course.table_name}.updated_at<?)",params[:lasttime],params[:lastid],params[:lasttime])
query = query.where(" #{Course.table_name}.id < ?",params[:lastid],)
end
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(8).all
@list = query.limit(8)
render :layout=>nil
end
@ -483,95 +421,6 @@ class UsersController < ApplicationController
render :layout=>nil
end
# def user_course_activities
# @list = []
# lastid = nil
# if params[:lastid]!=nil && !params[:lastid].empty?
# lastid = params[:lastid];
# end
#
# user_ids = []
# if @user == User.current
# watcher = User.watched_by(@user)
# watcher.push(User.current)
# user_ids = watcher.map{|x| x.id}
# else
# user_ids << @user.id
# end
#
# query_rec_count = 8
# query_times = 10 #query_times次没查到query_rec_count条记录就不查了
# query_i = 0;
# while( true )
# query_i = query_i+1
# if(query_i>query_times)
# break
# end
# query = Activity.where(user_id: user_ids)
# if(lastid != nil)
# query = query.where("id < ?",lastid)
# end
# lastid,item_list = query_activities(query,'course');
# for item in item_list
# @list << item
# if @list.count() >= query_rec_count
# break
# end
# end
# if @list.count() >= query_rec_count
# break
# end
# if lastid == nil
# break
# end
# end
# render :layout=>nil
# end
#
# def user_project_activities
# @list = []
# lastid = nil
# if params[:lastid]!=nil && !params[:lastid].empty?
# lastid = params[:lastid];
# end
#
# user_ids = []
# if @user == User.current
# watcher = User.watched_by(@user)
# watcher.push(User.current)
# user_ids = watcher.map{|x| x.id}
# else
# user_ids << @user.id
# end
#
# query_rec_count = 8
# query_times = 10 #query_times次没查到query_rec_count条记录就不查了
# query_i = 0;
# while( true )
# query_i = query_i+1
# if(query_i>query_times)
# break
# end
# query = Activity.where(user_id: user_ids)
# if(lastid != nil)
# query = query.where("id < ?",lastid)
# end
# lastid,item_list = query_activities(query,'project');
# for item in item_list
# @list << item
# if @list.count() >= query_rec_count
# break
# end
# end
# if @list.count() >= query_rec_count
# break
# end
# if lastid == nil
# break
# end
# end
# render :action=>'user_course_activities',:layout=>nil
# end
def user_course_activities
lastid = nil
if params[:lastid]!=nil && !params[:lastid].empty?
@ -630,7 +479,7 @@ class UsersController < ApplicationController
query = query.where("#{Activity.table_name}.id < ?",lastid)
end
query = query.order("#{Activity.table_name}.id desc")
@list = query_activities(query);
@list = query_activities(query)
render :action=>'user_course_activities',:layout=>nil
end

View File

@ -100,44 +100,6 @@ class WelcomeController < ApplicationController
@course_page = FirstPage.find_by_page_type('course')
@school_id = params[:school_id] || User.current.user_extensions.school.try(:id) || 117
@logoLink ||= logolink()
##3-8月份为查找春季课程9-2月份为查找秋季课程
#month_now = Time.now.strftime("%m").to_i
#year_now = Time.new.strftime("%Y").to_i
#(month_now >= 3 && month_now < 9) ? course_term = l(:label_spring) : course_term = l(:label_autumn)
##year_now -= 1 if year_now < 3
#@school_id.nil? ? @cur_school_course = [] : @cur_school_course = find_miracle_course(10,7,@school_id, year_now, course_term)
##未登录或者当前学校未开设课程
#if @cur_school_course.empty?
# @has_course = false
# User.current.logged? ? course_count = 9 : course_count = 10
# @cur_school_course += find_all_new_hot_course(course_count, @school_id, year_now, course_term)
# while @cur_school_course.count < 9 do
# if course_term == l(:label_spring)
# course_term = l(:label_autumn)
# year_now -= 1
# else
# course_term = l(:label_spring)
# end
# @cur_school_course += find_all_new_hot_course((10-@cur_school_course.count), nil, year_now, course_term)
# end
#else
# if @cur_school_course.count < 9
# @has_course = false
# @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, @school_id, year_now, course_term)
# if @cur_school_course.count < 9
# if course_term == l(:label_spring)
# course_term = l(:label_autumn)
# year_now -= 1
# else
# course_term = l(:label_spring)
# end
# @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, nil, year_now, course_term)
# end
# else
# @has_course = true
# end
#end
end
def logolink()

View File

@ -4,7 +4,7 @@ class WordsController < ApplicationController
include ApplicationHelper
before_filter :find_user, :only => [:new, :create, :destroy, :more, :back]
def create
if params[:new_form][:user_message].size>0
if params[:new_form][:user_message].size>0 && User.current.logged?
unless params[:user_id].nil?
if params[:reference_content]
message = params[:new_form][:user_message] + "\n" + params[:reference_content]
@ -18,22 +18,13 @@ class WordsController < ApplicationController
list = User.find(refer_user_id).add_jour(User.current, message, refer_user_id)
end
@jour = list.last
# @user.count_new_jour
# if a_message.size > 5
# @message = a_message[-5, 5]
# else
# @message = a_message
# end
# @message_count = a_message.count
end
end
# @jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
# @jour = paginateHelper @jours,10
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@jour = paginateHelper jours,10
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
format.js
#format.api { render_api_ok }
end
end
@ -93,7 +84,6 @@ class WordsController < ApplicationController
end
respond_to do |format|
format.js
#format.api { render_api_ok }
end
end
@ -206,7 +196,15 @@ class WordsController < ApplicationController
flash[:error] = feedback.errors.full_messages[0]
redirect_to project_feedback_url(params[:id])
end
end
#给用户留言
def leave_user_message
@user = User.find(params[:id])
if params[:new_form][:user_message].size>0 && User.current.logged? && @user
@user.add_jour(User.current, params[:new_form][:user_message])
end
redirect_to feedback_path(@user)
end
# add by nwb

View File

@ -1,5 +1,11 @@
# encoding: utf-8
module ApiHelper
ONE_MINUTE = 60 * 1000
ONE_HOUR = 60 * ONE_MINUTE
ONE_DAY = 24 * ONE_HOUR
ONE_MONTH = 30 * ONE_DAY
ONE_YEAR = 12 * ONE_MONTH
#获取用户的工作单位
def get_user_work_unit user
work_unit = ""
@ -163,5 +169,37 @@ module ApiHelper
end
# 获取当前时间
def time_from_now time
lastUpdateTime = time.to_i*1000
currentTime = Time.now.to_i*1000
timePassed = currentTime - lastUpdateTime;
timeIntoFormat = 0
updateAtValue = ""
if timePassed < 0
updateAtValue = "时间有问题"
elsif timePassed < ONE_MINUTE
updateAtValue = "一分钟前"
elsif timePassed < ONE_HOUR
timeIntoFormat = timePassed / ONE_MINUTE
updateAtValue = timeIntoFormat.to_s + "分钟前"
elsif (timePassed < ONE_DAY)
timeIntoFormat = timePassed / ONE_HOUR
updateAtValue = timeIntoFormat.to_s + "小时前"
elsif (timePassed < ONE_MONTH)
timeIntoFormat = timePassed / ONE_DAY
updateAtValue = timeIntoFormat.to_s + "天前"
elsif (timePassed < ONE_YEAR)
timeIntoFormat = timePassed / ONE_MONTH
updateAtValue = timeIntoFormat.to_s + "个月前"
else
timeIntoFormat = timePassed / ONE_YEAR
updateAtValue = timeIntoFormat.to_s + "年前"
end
updateAtValue
end
end

View File

@ -38,7 +38,7 @@ module MembersHelper
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5')
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
}

View File

@ -20,7 +20,7 @@ module PraiseTreadHelper
# when 0
# return @record.tread_num.nil? ? 0 : @record.tread_num
# end
return (@record.praise_num.to_i-@record.tread_num.to_i)
return ((@record.praise_num.nil? ? 0 : @record.praise_num.to_i)-(@record.tread_num.nil? ? 0 : @record.tread_num.to_i))
else
return 0
end

View File

@ -236,13 +236,14 @@ module RepositoriesHelper
# 判断项目是否有主版本库
def judge_main_repository(pro)
if pro.repositories.blank?
return false
status = false
else
pro.repositories.sort.each do |rep|
rep.is_default?
return true
pro.repositories.each do |rep|
status = true and break if rep.is_default?
status = false
end
end
status
end
# def cvs_field_tags(form, repository)
# content_tag('p', form.text_field(

View File

@ -328,109 +328,55 @@ module UsersHelper
return [0,[]]
end
list = query.order("updated_on desc").limit(10).all
return [count,list];
return [count,list]
end
def get_create_course_count(user)
return Course.where("tea_id = ?",user.id).count()
if user == User.current
user.courses.count
else
user.courses.where("is_public = 1").count
end
end
def get_join_course_count(user)
return user.coursememberships.count() - get_create_course_count(user)
user.coursememberships.count - get_create_course_count(user)
end
def get_homework_commons_count(user)
return HomeworkCommon.where("user_id = ?",user.id).count()
HomeworkCommon.where("user_id = ?",user.id).count
end
def get_projectandcourse_attachment_count(user)
return Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count()
Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count
end
def get_create_project_count(user)
return Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count()
Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count
end
def get_join_project_count(user)
return user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
end
def get_create_issue_count(user)
return Issue.where("author_id = ?",user.id).count()
Issue.where("author_id = ?",user.id).count
end
def get_resolve_issue_count(user)
return Issue.where("assigned_to_id = ? and status_id=3",user.id).count()
Issue.where("assigned_to_id = ? and status_id=3",user.id).count
end
def get_anonymous_evaluation_count(user)
return StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count()
StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count
end
# def query_activities(query,type)
# query_rec_count = 8
# # query = query.where("act_type='JournalsForMessage'")
# #query = query.where("act_type not in (?)", ['JournalsForMessage','Message','HomeworkCommon','News','Issue','Journal','Poll'])
# list = query.order("id desc").limit(query_rec_count).all
#
# result = [];
# for item in list
# container = get_activity_container(item,type)
# if( activity_is_show(item,container) )
# result << { :item=>item,:e=>container }
# end
# end
# return [lastid,result]
# end
# def get_activity_container activity,type
# e = nil;
# if type == 'Project'
# if activity.act_type == 'Poll'
# # 项目没有问卷
# # e = Project.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.project if activity.act.respond_to?('project')
# end
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# e = Course.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.course if activity.act.respond_to?('course')
# end
# end
#
# return e;
# end
def query_activities(query)
list = query.limit(8).all
result = [];
list = query.limit(13).all
result = []
for item in list
container = get_activity_container(item)
result << { :item=>item,:e=>container }
end
return result
end
def get_activity_container activity
return activity.activity_container
# if type == 'Project'
# return activity.act.project if activity.act.respond_to?('project')
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# return Course.find_by_id(activity.act.polls_group_id)
# end
# return activity.act.course if activity.act.respond_to?('course')
# end
# return nil;
result
end
def get_activity_container activity
return activity.activity_container
end
# def activity_is_show(activity,e)
# if(!e)
# return false
# end
#
# if activity.user_id == User.current.id
# return true
# end
# if( e.visible? )
# return true
# end
# return false
# end
def get_activity_act_showname_htmlclear(activity)
str = get_activity_act_showname(activity)
str = str.gsub(/<.*>/,'')
@ -529,14 +475,14 @@ module UsersHelper
when "Issue"
return '发表了问题'
when "Journal"
return '回复了问题'
return '更新了问题'
when "JournalsForMessage"
return e.class.to_s == 'Course' ? '发表了留言' : '提交了反馈'
#return ( activity.act.reply_id == nil || activity.act.reply_id == 0 ) ? '' : ''
when "Message"
return ( activity.act.parent_id == nil || activity.act.parent_id == '' ) ? '发布了帖子' : '回复了帖子'
when "Poll"
return '发布了问卷'
return '创建了问卷'
else
return '有了新动态'
end

View File

@ -2,5 +2,5 @@ class HomeworkTest < ActiveRecord::Base
attr_accessible :input, :output, :homework_common_id
belongs_to :homework_common
has_one :student_work_test
has_many :student_work_test
end

View File

@ -388,7 +388,8 @@ class Mailer < ActionMailer::Base
@user = applied.user
recipients = @project.manager_recipients
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
@token = Token.get_token_from_user(@user, 'autologin')
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value)
mail :to => recipients,
:subject => s
end

View File

@ -38,6 +38,12 @@ class Repository::Git < Repository
'Git'
end
def commits(authors, start_date, end_date, branch='master')
scm.commits(authors, start_date, end_date,branch).map {|commit|
[commit[:author], commit[:num]]
}
end
def report_last_commit
extra_report_last_commit
end

View File

@ -1,6 +1,6 @@
# encoding: utf-8
class StudentWorkTest < ActiveRecord::Base
attr_accessible :student_work_id, :homework_test_id, :result
attr_accessible :student_work_id, :homework_test_id, :result, :error_msg
belongs_to :homework_test
belongs_to :student_work

View File

@ -654,36 +654,42 @@ class CoursesService
return
end
if current_user == @user || current_user.admin?
membership = @user.coursememberships.page(1).per(15)
membership = @user.coursememberships
else
membership = @user.coursememberships.page(1).per(15).all(:conditions => Course.visible_condition(current_user))
membership = @user.coursememberships.all(:conditions => Course.visible_condition(current_user))
end
if membership.nil? || membership.count == 0
raise l(:label_no_courses, :locale => get_user_language(current_user))
end
membership.sort! { |older, newer| newer.created_on <=> older.created_on }
#membership.sort! { |older, newer| newer.created_on <=> older.created_on }
#定义一个数组集合存放hash数组该hash数组包括课程的信息并包含课程的最新发布的资源最新的讨论区留言最新的作业最新的通知
result = []
#对用户所有的课程进行循环,找到每个课程最新发布的资源,最新的讨论区留言,最新的作业,最新的通知,并存进数组
membership.each do |mp|
course = mp.course
latest_course_dynamics = []
notices_count = 0
topic_count = 0
topics = nil
homeworkss = nil
notices = nil
# 课程通知
latest_news = course.news.page(1).per(2).order("created_on desc")
unless latest_news.first.nil?
latest_course_dynamics << {:type => 1, :time => latest_news.first.created_on,:count=>course.news.count,
:news => latest_news.all}
notices_count = course.news.count
notices = latest_news.all
latest_course_dynamics << {:time => latest_news.first.created_on }
end
# 课程讨论区
latest_message = course.boards.first.topics.page(1).per(2)
unless latest_message.first.nil?
latest_course_dynamics << {:type => 2, :time => latest_message.first.created_on, :count =>course.boards.nil? ? 0 : course.boards.first.topics.count,
:topics => latest_message.all}
topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count
topics = latest_message.all
latest_course_dynamics << {:time => latest_message.first.created_on}
end
# 课程资源
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
# unless latest_attachment.first.nil?
@ -694,14 +700,17 @@ class CoursesService
#课程作业 已经交的学生列表暂定显示6人未交的学生列表作业的状态
homeworks = course.homework_commons.page(1).per(2).order('created_at desc')
unless homeworks.first.nil?
latest_course_dynamics << {:type => 4, :time => homeworks.first.updated_at, :count=>course.homework_commons.count , :homeworks => homeworks}
homeworkss = homeworks
latest_course_dynamics << {:time => homeworks.first.updated_at}
end
latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] }
# 课程学霸 学生总分数排名靠前的5个人
homework_count = course.homework_commons.count
sql = "select users.*,ROUND(sum(student_works.final_score),2) score from student_works left outer join users on student_works.user_id = users.id" <<
" where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{course.id}) GROUP BY student_works.user_id ORDER BY score desc limit 0,4"
better_students = User.find_by_sql(sql)
# 找出在课程讨论区发帖回帖数最多的
active_students = []
sql1 = " select users.*,count(author_id)*2 active_count from messages " <<
@ -710,20 +719,41 @@ class CoursesService
" GROUP BY messages.author_id ORDER BY count(author_id) desc " <<
" limit 0,4"
active_students = User.find_by_sql(sql1)
if homework_count != 0 && !better_students.empty?
latest_course_dynamics <<{:type=> 6,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:better_students=> better_students}
latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"}
end
unless active_students.empty?
latest_course_dynamics <<{:type=> 7,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:active_students=>active_students}
latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"}
end
latest_course_dynamic = latest_course_dynamics.first
unless latest_course_dynamic.nil?
result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => "", :dynamics => latest_course_dynamics,
:course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "",:time=>latest_course_dynamic[:time].to_time}
result << {:course_name => course.name,
:current_user_is_member => current_user.member_of_course?(course),
:current_user_is_teacher => is_course_teacher(current_user,course),
:course_id => course.id,
:course_img_url => url_to_avatar(course),
:course_time => course.time,
:course_term => course.term,
:news_count => notices_count,
:homework_count => homework_count,
:topic_count => topic_count,
:news => notices,
:homeworks => homeworkss,
:topics => topics,
:better_students => better_students,
:active_students => active_students,
:message => "",
:course_student_num=>course ? course.members.count : 0,
#:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",
:time_from_now=>time_from_now(latest_course_dynamic[:time].to_time), #.strftime('%Y-%m-%d %H:%M:%S').to_s,
:time=>latest_course_dynamic[:time].to_time}
end
end
#返回数组集合
result.sort! { |order, newer| newer[:time] <=> order[:time] }
result
end

View File

@ -9,7 +9,7 @@
<div class="box tabular">
<p>
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40 %>
<%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱'%>
<%= submit_tag l(:button_submit) %>
</p>
</div>

View File

@ -0,0 +1,50 @@
<h3 style="float: left">
<%=l(:label_school_plural)%>
</h3>
<%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %>
<%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%>
<input style="float: right;margin-right: 10px;" id="v_subject" placeholder="学校名称" type="text" name="school_name" value="<%= @school_name%>">
<% end %>
<div class="cl"></div>
<div class="autoscroll" style="margin-top: 40px;">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 50px;">
序号
</th>
<th style="width: 100px;">
LOGO
</th>
<th>
学校名称
</th>
<th style="width: 100px;"></th>
</tr>
</thead>
<tbody>
<% @schools.each do |school|%>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align:center;vertical-align: middle;">
<%= school.id %>
</td>
<td align="center">
<%= image_tag(school.logo_link,width:40,height:40) %>
</td>
<td style="text-align:center;vertical-align: middle;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=school.name%>'>
<span>
<%= link_to school.name,"http://#{Setting.host_course}/?school_id=#{school.id}" %>
</span>
</td>
<td class="buttons" style="vertical-align: middle;">
<%= link_to("修改", upload_logo_school_path(school.id,:school_name => @school_name), :class => 'icon icon-copy') %>
<%#= link_to(l(:button_delete), organization_path(school.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
</td>
</tr>
<% end%>
</tbody>
</table>
</div>
<% html_title(l(:label_project_plural)) -%>

View File

@ -17,6 +17,8 @@ if (window.Messenger) {
Messenger().post({
id: "label_apply_project_waiting",
message: "<%= l(:label_apply_project_waiting) %>",
showCloseButton: true,
showCloseButton: true
});
};
$("#applied_project_link_<%= @project.id%>").replaceWith("<%= escape_javascript(link_to "加入项目",appliedproject_path(:user_id => User.current.id,:project_id => @project.id,:project_join => true),:class => "blue_n_btn fr mt20", :remote => "true",:method => "post",:id => "applied_project_link_#{@project.id}") %>");

View File

@ -6,6 +6,7 @@
<% elsif @status == 2%>
alert("<%= l('project.join.tips.success') %>");
hideModal($("#popbox"));
$("#applied_project_link_<%= @project.id%>").replaceWith("<%=escape_javascript(link_to '取消申请',appliedproject_applied_path(:project_id => @project.id,:user_id => User.current.id),:class => "blue_n_btn fr mt20", :remote => "true",:method => "delete",:id => "applied_project_link_#{@project.id}")%>");
<% elsif @status == 3%>
alert("<%= l('project.join.tips.has') %>");
<%else%>

View File

@ -37,7 +37,7 @@
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%>
<% end %>
</span>
<%if is_float%>
@ -66,6 +66,16 @@
:class => 'delete delete-homework-icon',
:remote => true,
:title => l(:button_delete) %>
<% elsif attachment.container_type == 'Issue' %>
<% if User.current == attachment.author %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
#:remote => true,
#:id => "attachments_" + attachment.id.to_s,
:title => l(:button_delete) %>
<% end %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},

View File

@ -43,7 +43,7 @@
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
</div>
</span>
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %>
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
<span><%= l(:button_upload_photo) %></span>
</a>

View File

@ -61,7 +61,7 @@
<!--gcm-->
<p class="stats">
<%= content_tag('span', link_to("#{@course_activity_count[@course.id]}", course_path(@course)), :class => "info") %>
<%= content_tag('span', link_to("#{course_activity_count @course}", course_path(@course)), :class => "info") %>
<%= content_tag('span', l(:label_x_activity, :count => @course_activity_count[@course.id])) %>
</p>
<!--gcm-->

View File

@ -31,7 +31,7 @@
<% if @canShowCode%>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %>
<span id="edit_group_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
<input type="text" id="group_name_<%= group.id%>" name="group_name" size="20" class="isTxt w90 f_l" maxlength="100" />
<input type="text" id="group_name_<%= group.id%>" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="edit_group('group_name_<%= group.id%>','<%= valid_ajax_course_path%>','<%= @course.id%>','<%= group.id%>');"/>
</span>
<% end %>
@ -47,7 +47,7 @@
<li >
<span id="new_group_name" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
<input type="text" id="group_name" name="group_name" size="20" class="isTxt w90 f_l" maxlength="100" />
<input type="text" id="group_name" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');"/>
<% end %>
</span>

View File

@ -63,7 +63,7 @@
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red' %>
<span class="ml65 c_grey"><%= format_date(member.created_on)%></span>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<div class="cl"></div>

View File

@ -1,10 +1,11 @@
<% if object_id%>
$("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(course, user)) %>");
$("#try_join_course_link").replaceWith("<a href='<%=url_for(:controller => 'homework_common', :action => 'index',:course=>course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品</a>");
<% end %>
<% if @state %>
<% if @state == 0 %>
alert("加入成功");
hideModal($("#popbox"));
hideModal($("#popbox02"));
<% elsif @state == 1 %>
alert("密码错误");
<% elsif @state == 2 %>

View File

@ -56,7 +56,7 @@
<ul>
<li >
<label class="label02">&nbsp;开发语言:&nbsp;</label>
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language), {:class => "fl mb10 h26 w70"} %>
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language.to_i), {:class => "fl mb10 h26 w70"} %>
<div class="cl"></div>
</li>
@ -87,16 +87,17 @@
<div>
<li>
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w200 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
<input type="text" class="fl h26 w190 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
</li>
<li >
<label class=" fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w200 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
<input type="text" class="fl h26 w190 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
</li>
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<!--span class="green_btn fl ml5 mt1">测试</span-->
<a class="blue_btn fl ml5 mt1" onclick="programing_test('<%= homework_test.id%>')" id="test_send_<%= homework_test.id%>">测试</a>
<input type="hidden" id="test_result_<%= homework_test.id%>" name="result[<%= homework_test.id%>]" />
</li>
<div class="cl"></div>
</div>
@ -105,19 +106,40 @@
<div>
<li>
<label class="label02">&nbsp;测试输入:&nbsp;</label>
<input type="text" class="fl h26 w200 mb10" name="input[0]" />
<input type="text" class="fl h26 w190 mb10" name="input[0]" />
</li>
<li >
<label class=" fl f14 ml10">&nbsp;输出:&nbsp;</label>
<input type="text" class="fl h26 w200 mb10" name="output[0]" />
<input type="text" class="fl h26 w190 mb10" name="output[0]" />
</li>
<li>
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
<!--span class="green_btn fl ml5 mt1">测试</span-->
<a class="blue_btn fl ml5 mt1" onclick="programing_test('0')" id="test_send_0">测试</a>
<input type="hidden" id="test_result_0" name="result[0]" />
</li>
<div class="cl"></div>
</div>
<% end %>
</ul>
</div>
<script type="text/javascript">
//点击测试,发送
function programing_test(obj) {
$.post(
'<%= programing_test_homework_common_index_path%>',
{
src: $("textarea[name='standard_code']").val(),
input: $("input[name='input[" + obj +"]']").val(),
output: $("input[name='output[" + obj + "]']").val(),
language: $("select[name='language']").val(),
index: obj
},
function (data) {
}
);
}
</script>

View File

@ -49,6 +49,7 @@
<div class="cl"></div>
<% if homework.homework_type == 2 && homework.homework_detail_programing%>
<% if @is_teacher%>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<tr class="<%= cycle("", "b_grey") %>">
@ -71,18 +72,31 @@
<% end%>
</tbody>
</table>
<% end%>
<div class="cl"></div>
<% end%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
</div>
</div>
<div class="cl"></div>
<% end%>
<% unless homework.attachments.empty?%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 附件:</span>
<div class="fl mb5">
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
</div>
<% end%>
</div>
<div class="cl"></div>
<% end%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>

View File

@ -11,7 +11,7 @@
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
</div><!--hwork_new end-->
@ -22,7 +22,7 @@
<%= hidden_field_tag "homework_common[homework_type]","2"%>
<%= render :partial => 'homework_common/homework_detail_programing_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
</div><!--hwork_new end-->

View File

@ -0,0 +1,2 @@
$("#test_send_<%= @index%>").replaceWith("<a class='<%= @result == 0 ? 'green_btn' : 'red_btn'%> fl ml5 mt1' onclick='programing_test(<%= @index%>)' id='test_send_<%= @index%>'><%= @result == 0 ? '正确' : '错误'%></a>");
$("#test_result_<%= @index%>").val("<%= @result%>");

View File

@ -34,7 +34,7 @@
</li>
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')',
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user },
{:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user},
{:class => 'my-message'} if User.current.logged?%>
</li>
</ul>

View File

@ -1,8 +1,11 @@
<% if(User.current.logged? && User.current!=target)%>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=>
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
<% if User.current.logged?%>
<% if User.current == target%>
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end%>
<% end %>

View File

@ -1,5 +1,5 @@
<% watcher_count,watcher_list = get_watcher_users(user) %>
<div id="watcher_nav_list" class="leftbox mt10" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<div id="watcher_nav_list" class="leftbox" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<h4 class="fl">关注</h4><a href="<%=url_for(:controller => 'users', :action => 'user_watchlist', :id=>user.id)%>" data-count="<%= watcher_count %>" style="display:<%= watcher_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">

View File

@ -80,12 +80,14 @@
<div class="cl"></div>
<div>
<% if @project.project_type == 0 %>
<% unless project_scores(@project) == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
<% end %>
</div>
<!--参数-->

View File

@ -17,79 +17,11 @@
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "avatars"%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心st</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
<link href="css/users.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
</script>
<script type="text/javascript">
//头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<script type="text/javascript">//侧导航
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
</script>
<script type="text/javascript">
function show_window () {
$('#light').css('display','block');
$('#fade').css('display','block');
}
function close_window(){
$('#light').css('display','none');
$('#fade').css('display','none');
}
//弹框l
</script> -->
</head>
@ -103,12 +35,6 @@ $(".subNav").click(function(){
<%=link_to l(:field_homepage), home_path %> &gt; <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> &gt; <%=link_to @user.name, user_path(@user) %>
</p>
</div>
<!--<div class="search fl">-->
<!--<form class="search">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
<!--</form>-->
<!--</div>-->
</div><!--TopBar end-->
<div class="cl"></div>
@ -116,7 +42,7 @@ $(".subNav").click(function(){
<div id="LSide" class="fl">
<div class="users_info">
<div class="pic_head">
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>
<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>
<% if @center_flag %>
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
<% end %>
@ -144,14 +70,16 @@ $(".subNav").click(function(){
<% end %>
</div><!--uers_info end-->
<div class="leftbox mt10">
<div class="leftbox">
<ul class="leftbox_ul_left">
<li>加入时间&nbsp;:</li>
<li>最近登录&nbsp;:</li> <!--加入时间修改为最近登录 -->
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
<li><%= l(:label_company_name) %>&nbsp;:</li>
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
<% if @user.user_extensions.identity == 0 %>
<li>真实姓名&nbsp;:</li>
<% end %>
<% end %>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li>职称&nbsp;:</li>
@ -172,8 +100,10 @@ $(".subNav").click(function(){
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<li><%= format_date(@user.created_on) %></li>
<li><%= format_date(@user.last_login_on) %></li> <!-- 加入时间修改为最近登录时间-->
<% if @user.user_extensions.identity == 0 %>
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
<% end %>
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 %>
<li><%= get_technical_title @user %></li>
@ -197,66 +127,132 @@ $(".subNav").click(function(){
<div class="cl"></div>
</div>
<% if @center_flag %>
<div class="subNavBox ">
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
</div><!--侧导航 end-->
<div class="subNav ">
<a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">
动态
</a>
</div>
<% if @center_flag %>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
我的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
我的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
</a>
</div>
<% else%>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
TA的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.visible.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
TA的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.visible.count%>)</span>
</a>
</div>
<% end %>
<div class="subNav ">
<%= link_to "留言",feedback_path(@user),:class => "f14 c_blue02"%>
</div>
</div><!--侧导航 end-->
<div class="cl"></div>
<div class="leftbox mt10">
<div class="leftbox">
<ul class="leftbox_ul_left">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<% if(get_create_course_count(@user)) == 0 %>
<li>创建课程&nbsp;:</li>
<% end %>
<% if(get_homework_commons_count(@user)) == 0 %>
<li>发布作业&nbsp;:</li>
<% end %>
<% end %>
<% if (get_join_course_count(@user) != 0) %>
<li>加入课程&nbsp;:</li>
<% end %>
<% if @user.user_extensions.identity == 1 %>
<li>参加匿评&nbsp;:</li>
<% end %>
<% if (get_projectandcourse_attachment_count(@user) != 0) %>
<li>发布资源&nbsp;:</li>
<% end %>
<% if (get_create_project_count(@user) != 0) %>
<li>创建项目&nbsp;:</li>
<% end %>
<% if (get_join_project_count(@user) != 0) %>
<li>加入项目&nbsp;:</li>
<% end %>
<% if (get_create_issue_count(@user) != 0) %>
<li>发布缺陷&nbsp;:</li>
<% end %>
<% if (get_resolve_issue_count(@user) != 0) %>
<li>解决缺陷&nbsp;:</li>
<% end %>
</ul>
<ul class="leftbox_ul_right c_dgrey">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<% if(get_create_course_count(@user)) == 0 %>
<li><%= get_create_course_count(@user) %></li>
<% end %>
<% if(get_homework_commons_count(@user)) == 0 %>
<li><%= get_homework_commons_count(@user) %></li>
<% end %>
<% end %>
<% if (get_join_course_count(@user) != 0) %>
<li><%= get_join_course_count(@user) %></li>
<% end %>
<% if @user.user_extensions.identity == 1 %>
<li><%= get_anonymous_evaluation_count(@user) %></li>
<% end %>
<% if (get_projectandcourse_attachment_count(@user) != 0) %>
<li><%= get_projectandcourse_attachment_count(@user) %></li>
<% end %>
<% if (get_create_project_count(@user) != 0) %>
<li><%= get_create_project_count(@user) %></li>
<% end %>
<% if (get_join_project_count(@user) != 0) %>
<li><%= get_join_project_count(@user) %></li>
<% end %>
<% if (get_create_issue_count(@user) != 0) %>
<li><%= get_create_issue_count(@user) %></li>
<% end %>
<% if (get_resolve_issue_count(@user) != 0) %>
<li><%= get_resolve_issue_count(@user) %></li>
<% end %>
</ul>
<div class="cl"></div>
</div>
<div class="cl"></div>
<!-- tag模块 -->
<div class="project_Label">
<h4 class="mb5"><%= l(:label_tag)%>:</h4>
<div class="tag_h">
<div id="tags">
<%= render :partial => 'tags/project_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<%= render :partial => 'layouts/user_watch_list', :locals => {:user => @user} %>
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
<% visitor_count,visitor_list = get_visitor_users(@user) %>
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<% if(User.current.admin?) %>
<div class="leftbox" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">
@ -266,6 +262,7 @@ $(".subNav").click(function(){
<div class="cl"></div>
</div>
</div>
<% end %>
</div><!--LSide end-->
@ -281,7 +278,9 @@ $(".subNav").click(function(){
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div>
<%= javascript_include_tag '/javascripts/avatars.js' %>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
@ -320,7 +319,7 @@ $(".subNav").click(function(){
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr2"> 取&nbsp;&nbsp;消</a>
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
@ -328,5 +327,17 @@ $(".subNav").click(function(){
</div><!--floatbox end-->
</div>
<script type="text/javascript">
$(function(){
if($(".top_new").length==0){
$("#RSide").css("min-height",$("#LSide").height()-30);
}
else{
$("#RSide").css("min-height",$("#LSide").height()-87);
}
});
</script>
</body>
</html>

View File

@ -8,7 +8,8 @@
<% if @message.project %>
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
<% elsif @message.course %>
<%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
<%=h @message.board.course.name %> - <%=h @message.board.name %>:
<%= link_to(h(@message.subject), @message_url + "?topic_id=#{@message.id}&&parent_id=#{@message.parent_id ? @message.parent_id : @message.id}",:style=>'color:#1b55a7; font-weight:bold;') %>
<% end %>
</span><%= l(:mail_issue_title_active)%></p>
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">

View File

@ -225,7 +225,7 @@
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_issue_update) %></span>
<% if issues_journal.notes.blank? || issues_journal.notes.nil? %>
<%= link_to truncate(l(:label_isuue_mail_status),length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
<%= link_to truncate(issues_journal.issue.subject.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% else %>
<%= link_to truncate(issues_journal.notes.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),

View File

@ -1,4 +1,9 @@
<% if @project%>
var checked = $("#principals input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
<% if @flag == "true"%>
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
<% else%>

View File

@ -7,7 +7,9 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="lz">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="lz-left">
<div>
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>

View File

@ -5,3 +5,4 @@
$('#ajax-modal').parent().removeClass("alert_praise");
//$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().css("border", "2px solid #15bccf").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");

View File

@ -1,2 +1,2 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>');
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>');
hideModal();

View File

@ -2,10 +2,16 @@
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
%>
<script>
function remote_search(){
$("#news_query_form").submit();
}
</script>
<div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2>
</div>
<div class="talk_top">
<div class="fl">
<p class="fl">
<%= l(:label_total_news) %>
<span><%= @news_count %></span>
@ -16,56 +22,19 @@
<div class="cl"></div>
<% end %>
<div class="cl"></div>
</div>
<div>
<% if @newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% @newss.each do |news| %>
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w" %>
<br />
<div class="cl mb5"></div>
<script>
$(function(){if($("#news_description_<%= news.id%>_content").height()>360){$("#news_foot_<%= news.id%>").show();}});
</script>
<div id="news_description_<%= news.id%>" class="news_description mt5">
<div id="news_description_<%= news.id%>_content" class="upload_img">
<%= news.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div class="news_foot currentDd fr" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
[展开]
</div>
<div class="cl mb5"></div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
<div class="cl"></div>
<%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<% end %>
<div class="problem_search fr" >
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course }, :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="<%= @q%>" onkeypress="" onkeydown="">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_search();" >搜索</a>
<% end %>
</div><!--problem_search end-->
<div class="cl"></div>
</div>
<!--end-->
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div id="news_list">
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>

View File

@ -0,0 +1,47 @@
<div>
<% if newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% newss.each do |news| %>
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w" %>
<br />
<div class="cl mb5"></div>
<script>
$(function(){if($("#news_description_<%= news.id%>_content").height()>360){$("#news_foot_<%= news.id%>").show();}});
</script>
<div id="news_description_<%= news.id%>" class="news_description mt5">
<div id="news_description_<%= news.id%>_content" class="upload_img">
<%= news.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div class="news_foot currentDd fr" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
[展开]
</div>
<div class="cl mb5"></div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
<div class="cl"></div>
<%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<% end %>
<% end %>
</div>
<!--end-->
<ul class="wlist">
<%= pagination_links_full obj_pages, obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>

View File

@ -0,0 +1 @@
$("#news_list").html("<%= escape_javascript(render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count})%>");

View File

@ -1,5 +1,6 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
<!--新建单选start-->
<% insert_begin = insert_begin %>
<div class="ur_editor radio">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>

View File

@ -2,27 +2,262 @@
<script type="text/javascript">
//编辑问卷描述之后
var popWindow ; //弹出框的引用
var importPollPopWindow; //选择导入的弹出框引用
function edit_head(){
$("#polls_description").val($("#polls_description_div").html());
}
$(function(){
//点击空白处
$(document).bind('click',function(e){
//弹出框非空 不是a标签 点击的不是弹出框 ,那么弹出框就会隐藏
if(popWindow && e.target.nodeName != 'A' && !popWindow.is(e.target) && popWindow.has(e.target).length === 0){ // Mark 1
popWindow.css('display', 'none');
}
if(importPollPopWindow && e.target.nodeName != 'A' && !importPollPopWindow.is(e.target) && importPollPopWindow.has(e.target).length === 0){
importPollPopWindow.css('display', 'none');
}
});
})
function dismiss(quest_type,quest_id){
popWindow = $("#div_"+quest_type+"_"+quest_id);
if(popWindow){
popWindow.css('display', 'none');
}
}
function chooseQuestionType(quest_type,quest_id){
//quest_type 分为 mc mcq single multi
//quest_id 是quetion的id 下同
if(popWindow){
popWindow.css('display', 'none');
}
popWindow = $("#div_"+quest_type+"_"+quest_id);
$("#div_"+quest_type+"_"+quest_id).click(function(e){
e.stopPropagation(); //组织冒泡到document.body中去
});
$("#div_"+quest_type+"_"+quest_id).css("position", "absolute");
$("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30);
$("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10);
if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') {
$("#div_"+quest_type+"_"+quest_id).css('display', 'none');
}
else{
$("#div_"+quest_type+"_"+quest_id).css('display', 'block');
}
}
function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();
}
function insert_MC(quest_type,quest_num,quest_id){
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
' <div class="ur_editor radio"> '+
'<div class="ur_editor_title"> '+
'<label>问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="1"/>'+
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
'<label>必答</label>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
'<li class="ur_item">'+
'<label>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>'+
'</ul>'+
'</div>'+
'<div class="ur_editor_footer">'+
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
'<%= l(:label_button_ok)%>'+
'</a>'+
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
'<%= l(:button_cancel)%>'+
'</a>'+
'</div>'+
'<div class="cl"></div>'+
'</div>'+
'<% end%>'
);
$("#poll_questions_title").focus();
}
function add_MCQ(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
$("#poll_questions_title").focus();
}
function insert_MCQ(quest_type,quest_num,quest_id){
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
'<div class="ur_editor checkbox">'+
'<div class="ur_editor_title">'+
'<label>问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="2"/>'+
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题标题"/>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
'<label>必答</label>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
'<li class="ur_item">'+
'<label>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>选项<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</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>'+
'</ul>'+
'</div>'+
'<div class="ur_editor_footer">'+
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
'<%= l(:label_button_ok)%>'+
'</a>'+
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
'<%= l(:button_cancel)%>'+
'</a>'+
'</div>'+
'<div class="cl"></div>'+
'</div>'+
'<% end%>'
);
$("#poll_questions_title").focus();
}
function add_single(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
$("#poll_questions_title").focus();
}
function insert_SINGLE(quest_type,quest_num,quest_id){
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
'<div class="ur_editor text ">'+
'<div class="ur_editor_title">'+
'<label for="ur_question_title">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="3"/>'+
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观标题"/>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
'<label for="ur_question_require">必答</label>'+
'</div>'+
'<div class="ur_editor_footer">'+
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
'<%= l(:label_button_ok)%>'+
'</a>'+
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
'<%= l(:button_cancel)%>'+
'</a>'+
'</div>'+
'<div class="cl"></div>'+
'</div>'+
'<% end%>'
);
$("#poll_questions_title").focus();
}
function add_mulit(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
$("#poll_questions_title").focus();
}
function insert_MULIT(quest_type,quest_num,quest_id){
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
'<div class="ur_editor textarea">'+
'<div class="ur_editor_title">'+
'<label for="ur_question_title">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="4"/>'+
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观标题"/>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
'<label>必答</label>'+
'</div>'+
'<div class="ur_editor_toolbar">'+
'</div>'+
'<div class="ur_editor_footer">'+
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
'<%= l(:label_button_ok)%>'+
'</a>'+
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
'<%= l(:button_cancel)%>'+
'</a>'+
'</div>'+
'<div class="cl"></div>'+
'</div>'+
'<% end%>'
);
$("#poll_questions_title").focus();
}
//选择导入调查问卷
function importPoll(){
importPollPopWindow = $("#import_poll");
$("#import_poll").css("position", "absolute");
$("#import_poll").css("top", $("#import_btn").offset().top+30);
$("#import_poll").css("left", $("#import_btn").offset().left-65);
$("#import_poll").css("display","block")
}
function remote_import(){
importPollPopWindow.css('display', 'none');
if($("#import_poll").val() === 0){
return;
}else{
if(confirm("确认导入问卷"+$("#import_poll").find("option:selected").text()+"?")){
$("#import_form").submit();
}else{
return;
}
}
}
//添加标题时确定按钮
function add_poll_question(doc)
{
@ -147,5 +382,16 @@ function edit_head(){
</div>
</div>
<div class="cl"></div>
<!-- 新增问题 -->
<div id="import_poll" style="display: none">
<%= form_tag({:controller => 'poll', :action => 'import_poll', :to_id => @poll.id},:remote=>'true', :method => :get,:id=>"import_form") do %>
<%= select( :poll, :id, Poll.where("polls_group_id = #{@poll.polls_group_id} and polls_type='course' and id != #{@poll.id}").map{|c| [c.polls_name, c.id]}.unshift(["选择要导入的问卷",0]),
{ :include_blank => false,:selected=> 0,:class=>"w90"
},
{:onchange=>"remote_import();",:id=>"import_id",:name=>"import_id"}
)
%>
<% end%>
</select>
</div>
</div><!--编辑end-->

View File

@ -1,3 +1,6 @@
<script>
</script>
<div class="ur_question_item radio ur_editor02">
<div class="ur_title">
<span class="title_index">
@ -9,9 +12,11 @@
<span class="ur_required" title="必答">*</span>
<%end%>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mc_<%=poll_question.id%>" onclick="chooseQuestionType('mc',<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" >
@ -30,3 +35,14 @@
</table>
</div>
</div><!--单选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mc_<%=poll_question.id%>">
</div>
<div id="div_mc_<%=poll_question.id%>" style="width: 50px;border: 1px solid #cbcbcb; display:none;position: absolute;padding: 5px;background: white">
<ul>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MC('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MCQ('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_SINGLE('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">单行主观</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mc',<%=poll_question.id%>);insert_MULIT('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);">多行主观</a></li>
</ul>
</div>

View File

@ -12,6 +12,7 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mcq_<%=poll_question.id%>" onclick="chooseQuestionType('mcq',<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table">
@ -30,3 +31,14 @@
</table>
</div>
</div><!--多选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mcq_<%=poll_question.id%>">
</div>
<div id="div_mcq_<%=poll_question.id%>" style="width: 50px;border: 1px solid #cbcbcb; display:none;position: absolute;padding: 5px;background: white">
<ul>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MC('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MCQ('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_SINGLE('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">单行主观</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mcq',<%=poll_question.id%>);insert_MULIT('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);">多行主观</a></li>
</ul>
</div>

View File

@ -1,5 +1,8 @@
<div class="ur_page_head ur_editor02" ><!--头部显示 start-->
<a href="javascript:" class="ur_icon_edit" title="编辑" onclick="pollsEdit();"></a>
<!-- <a class='ur_icon_add' title='导入' id="import_btn" onclick="importPoll();"></a> -->
<h1 class="ur_page_title" id="polls_name_h"><%= poll.polls_name%></h1>
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
<div class="cl"></div>

View File

@ -13,9 +13,21 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mulit_<%=poll_question.id%>" onclick="chooseQuestionType('mulit',<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<textarea class="ur_textbox" rows="5" cols="60"></textarea>
</div>
</div>
</div><!--多行展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mulit_<%=poll_question.id%>">
</div>
<div id="div_mulit_<%=poll_question.id%>" style="width: 50px;border: 1px solid #cbcbcb; display:none;position: absolute;padding: 5px;background: white">
<ul>
<li><a href="javascript:void(0);" onclick=" dismiss('mulit',<%=poll_question.id%>);insert_MC('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mulit',<%=poll_question.id%>);insert_MCQ('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mulit',<%=poll_question.id%>);insert_SINGLE('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);">单行主观</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('mulit',<%=poll_question.id%>);insert_MULIT('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);">多行主观</a></li>
</ul>
</div>

View File

@ -12,8 +12,20 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_single_<%=poll_question.id%>" onclick="chooseQuestionType('single',<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<input class="ur_text ur_textbox" type="text" size="" maxlength=""value="">
</div>
</div><!--单行文字展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_single_<%=poll_question.id%>">
</div>
<div id="div_single_<%=poll_question.id%>" style="width: 50px;border: 1px solid #cbcbcb; display:none;position: absolute;padding: 5px;background: white">
<ul>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MC('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">单选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MCQ('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">多选</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_SINGLE('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">单行主观</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('single',<%=poll_question.id%>);insert_MULIT('single',<%=poll_question.question_number%>,<%=poll_question.id%>);">多行主观</a></li>
</ul>
</div>

View File

@ -1,4 +1,8 @@
<% if @is_insert %>
$("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
<% else %>
$("#new_poll_question").html("");
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<% if @poll_questions.question_type == 1%>" +
@ -23,4 +27,4 @@ $("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<% end%>" +
"</div>" +
"</div>");
<% end %>

View File

@ -0,0 +1,4 @@
/**
* Created by lizanle on 2015/7/29.
*/
$("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');

View File

@ -22,14 +22,14 @@
<hr/>
</div>
<% else %>
<%= form_for('new_form', :method => :post,
<%= form_for('new_form', :method => :post, :html => {:id => 'project_feedback_form', :multipart => true},
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
<p nhname="contentmsg"></p>
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<%= link_to l(:button_leave_meassge), "javascript:void(0)", :onclick => 'submitProjectFeedback();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fr mt10 mb10' %>
<% end %>
<% end %>

View File

@ -41,99 +41,71 @@
<%= link_to l(:label_project_dts_yun) ,yun_dep_project_path(@project), data: { confirm:'你确定要对本项目进行云化部署吗?' } %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/KnowledgeBaseDC/semantic-search.jsp?projectName=jena
" target="_Blank">软件知识库</a>
<%#= link_to l(:label_project_soft_knowledge) ,soft_knowledge_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/home.action" target="_Blank">软件资源库</a>
<%#= link_to l(:label_project_soft_file) ,soft_file_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<%= link_to l(:label_project_dts_new) ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/pop-php/" target="_Blank">在线开发平台</a>
<%#= link_to l(:label_project_online_dev) ,online_dev_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/sase/" target="_Blank">软工服务平台</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">形式验证工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS评估工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS证据采集工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信度评估工具 SAS
</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信评估工具 Evaluator</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">软件测试工具 SSCC-Web</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<!--<li>-->
<!--<%# unless @project.enabled_modules.where("name = 'dts'").empty? %>-->
<!--<%#= link_to l(:project_module_dts) ,share_show_path(@project) %>-->
<!--<%# end %>-->
<!--</li>-->
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS证据评估统计分析工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">在线验证工具 BACH-Online</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<%= link_to "代码缺陷测试工具(DTS)" ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/sase/" target="_Blank">软工服务平台(SASSP)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/home.action" target="_Blank">软件知识库(KnowledgeBase)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信评估工具(Evaluator)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">在线验证工具(BACH-Online)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">软件测试工具(SSCC-Web)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn/servicexchange/" target="_Blank">服务资源共享平台(ServiceXchange)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn/repository/ServiceCloud/MyServiceContainer.jsp" target="_Blank">在线服务开发平台(ServiceFoundry)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn" target="_Blank">组合开发和运行演化平台(Service4All)</a>
<% end %>
</li>

View File

@ -69,12 +69,12 @@
}
</script>
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => "regexName();" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <!--修改项目搜索按钮的样式 -->
<!-- <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
</a> -->
<br />
<span id="project_name_span" style="float: left"></span>
</div>

View File

@ -93,21 +93,7 @@
</div>
<div class="cl"></div>
</div>
<!--Document-->
<% elsif e.forge_act_type == "Document" %>
<div class="problem_main">
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
<div class="problem_txt fl mt5 break_word">
<a class="problem_name fl ">
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
</div>
<!--Attachment -->
<% elsif e.forge_act_type == "Attachment" %>
<div class="problem_main">

View File

@ -5,27 +5,27 @@
<!--JS进度条-->
<style type="text/css">
#out{}
#in{width:10px; height:20px;background:#15BCCF;color:white;text-align:center;}
#in{}
#font_color{background:yellow;text-align:center;color:white;}
</style>
<div style="padding-left: 200px;">
<div id='out'>
<p style="padding-left: 120px;padding-bottom: 10px;font-size: 14px;">云化部署中...</p>
<div style="width:300px;height:20px;background:#EEE;">
<div id="in" style="width:1%">0%</div>
<p style="padding-left: 100px;padding-bottom: 10px;font-size: 14px;padding-top: 10px;">云化部署中....</p>
<div>
<div id="in" style="width:0%"></div>
<div>
<script type="text/javascript">
i=0;
$(function(){
ba=setInterval("begin()",50);//setInterval 返回的是一个全局变量,一个间隔数值.这个数值是表示调用setInterval的次数
ba=setInterval("begin()",60);//setInterval 返回的是一个全局变量,一个间隔数值.这个数值是表示调用setInterval的次数
});
function begin()
{
i+=1;
if(i<=100)
{
document.getElementById("in").style.width=i+"%";
document.getElementById("in").innerHTML=i+"%";}
document.getElementById("in").style.width="";
document.getElementById("in").innerHTML="";}
else
{
clearInterval(ba);

View File

@ -1,11 +1,30 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_statistics) %></h2>
</div>
<p>
<% if @status_commit_count ==0 %>
<div class="flash notice">该项目目前还没有提交过代码!</div>
<% else %>
<div class="riviseRed fl"></div><div class="fl">修订 是版本库的提交次数, 显示为橘红色。</div><br>
<div class="changeBlue fl"></div><div class="fl">变更 是对版本库中文件的修改次数, 显示为蓝色。</div>
<p style="padding-top:35px;">
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
</p>
<p style="padding-top: 50px;">
<%# 用户每月提交代码次数 %>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
</p>
<p style="padding-top: 50px;">
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %>
</p>
<p style="padding-top: 50px;">
<%# 用户最近六个月的提交次数 %>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %>
</p>
<p style="padding-top: 50px;">
<%# 用户最近六个月的代码量 %>
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%>
<% end %>

View File

@ -1,5 +1,28 @@
<%= form_tag({action: :upload},method: "post", multipart: true) do %>
<%= text_field_tag 'school'%>
<%= file_field_tag 'logo' %>
<%= submit_tag('Upload') %>
<script>
function showPreview(source) {
var file = source.files[0];
if(window.FileReader) {
var fr = new FileReader();
fr.onloadend = function(e) {
document.getElementById("avatar_image").src = e.target.result;
};
fr.readAsDataURL(file);
}
}
</script>
<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true) do %>
<%#= text_field_tag 'school'%>
<div style="margin: 20px;">
<input type="hidden" value="<%= @school_name%>" name="school_name">
<%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%>
<a type="button" onclick="$('#file').click();" style="margin: 90px 0 0 10px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 55px;">上传图片</a>
<%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
<div style="clear: both;"></div>
<div style="margin-top: 10px;">
<%= submit_tag('上传') %>
<%= submit_tag('取消') %>
</div>
</div>
<% end %>

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>

View File

@ -18,7 +18,8 @@
<% end%>
</li>
<li class=" hwork_tit_e" style="width: 410px">
<%= link_to student_work.name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
</li>
<% my_score = student_work_score(student_work,User.current) %>
<li class=" hwork_code <%= my_score.nil? ? 'c_grey' : 'c_red'%>">

View File

@ -23,32 +23,35 @@
</div>
<div class="cl"></div>
</li>
<% if @is_teacher%>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<!--<%#@work.student_work_test.each do |test|%>-->
<!--<tr class="<%#= cycle("", "b_grey") %>">-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.input%>-->
<!--</td>-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.output%>-->
<!--</td>-->
<!--<td class="td_50 c_red"><%#= test.status_to_s%></td>-->
<!--<td class="td_50 "><%#= test.test_score%></td>-->
<!--</tr>-->
<!--<%# end%>-->
<tr class=" b_lblue fb c_w">
<td class="td_tit ">输入</td>
<td class="td_tit border_l ">输出</td>
<td class="td_50 border_l ">测试结果</td>
</tr>
<%@homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<td class="td_tit hidden">
<%= test.input%>
</td>
<td class="td_tit">
<td class="td_tit border_l hidden">
<%= test.output%>
</td>
<td class="td_50 c_red"><%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%></td>
<input type="hidden" value="<%= test.student_work_test.result if test.student_work_test%>">
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
<td class="td_50 c_red border_l"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
</tr>
<% end%>
<% student_work_test = @work.student_work_test.first%>
<% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
<tr class="border_t" >
<td colspan="3" class="td_end" >
<%= student_work_test.error_msg%>
</td>
</tr>
<% end%>
@ -56,7 +59,6 @@
</table>
<div class="cl"></div>
</li>
<% if @is_teacher%>
<!-- 编程作业老师才可以评分 -->
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>

View File

@ -36,7 +36,7 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="show_hwork_p break_word">
<%= text_format @work.description%>
<%= text_format(@work.description) if @work.description%>
</div>
<div class="cl"></div>
</li>

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit_une">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>

View File

@ -55,6 +55,7 @@
<% end%>
<% if @is_teacher%>
<div class="fr">
<% unless @homework.homework_type == 2%>
<% if @homework.student_works.empty?%>
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
<% else%>
@ -70,6 +71,7 @@
<span class="c_red">winrar</span>
工具进行解压
</div>
<% end%>
<%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%>
@ -135,9 +137,18 @@
<div class="cl"></div>
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
<% if @is_teacher%>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<% @homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
输入
</td>
<td class="td_tit">
输出
</td>
</tr>
<% homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<%=test.input%>
@ -149,8 +160,21 @@
<% end%>
</tbody>
</table>
<% end%>
<div class="cl"></div>
<% end%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if @homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif @homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
</div>
</div>
<div class="cl"></div>
<% end%>
<div class="mt5">
<% unless @homework.attachments.empty?%>

View File

@ -1,15 +1,6 @@
<div id="tags">
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
<%= render :partial => "tags/tag_project_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
</div>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="button" class="submit f_l" onclick="$('#tags_name').parent().submit();" />
<% end %>
</span>
<% end%>

View File

@ -42,7 +42,7 @@
</span>
<% else %>
<div id="tag">
<span class="tag_show">
<span class="re_tag f_l">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% case object_flag %>

View File

@ -0,0 +1,30 @@
<% @tags = obj.reload.tag_list %>
<% if non_list_all && @tags.size > 0 %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<span class="re_tag f_l " id="tag">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
<span class="del">
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
</span>
</span>
<% end %>
<% end %>
<% end %>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag02').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag02" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote => true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name2",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="button" class="submit f_l" onclick="$('#tags_name2').parent().submit();" />
<% end %>
</span>
<% end%>

View File

@ -2,6 +2,9 @@
<% if @object_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',

View File

@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_name2').val("");
<% elsif @obj_flag == '6'%>
<%if @course%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();

View File

@ -30,7 +30,10 @@
<td>学生人数:</td>
<td><a href="<%= url_for(:controller => 'courses', :action=>"member", :id=>item.id,:role=>2, :host=>Setting.host_course) %>"><%= studentCount(item) %></a></td>
<td>开课学期:</td>
<td><%= item.time %><%= get_course_term_locales item %></td>
<td>
<%= item.time %>
<%= get_course_term_locales item %>
</td>
</tr>
</tbody></table>
</div>
@ -39,8 +42,10 @@
<span class="grey_n_btn fr mt20">课程结束</span>
<% elsif(can_edit_flag) %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'new',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">发布作业</a>
<% else %>
<% elsif User.current.member_of_course? item %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">提交作品</a>
<% elsif User.current.logged?%>
<%= link_to "加入课程",try_join_path(:object_id => item.id), :class => "blue_n_btn fr mt20", :remote => "true",:id => "try_join_course_link"%>
<% end %>
<div class="cl"></div>
</div>

View File

@ -1,6 +1,6 @@
<div class="courses_list line" id="fans_item_<%=item.id%>">
<div class="courses_list_pic fl">
<a href="javascirpt:void();">
<a href="<%= user_path(item) %>">
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
</a>
</div>

View File

@ -0,0 +1,40 @@
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
<% if parent_jour%>
<div class="mes_box02" id = '<%= reply.id %>'>
<%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %>
<div class=" mes_box02_info fl">
<%= link_to "#{reply.user.login}&nbsp;".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%>
<span class="fl c_grey">&nbsp;回复&nbsp;</span>
<%= link_to "#{parent_jour.user.login}&nbsp;:&nbsp;".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%>
<div class="cl">
<%= reply.notes.html_safe %>
</div>
</div>
<span class="c_grey fr">
<%= time_tag(reply.created_on).html_safe%>
</span>
<div class="fr cr">
<%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"sub_reply_btn", :class => "ml5 c_purple" %>
<% if User.current.admin? || reply.user == User.current%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %>
<% end %>
</div>
<div class="cl"></div>
<div nhname='sub_div_form' class="mt10 ml40" style="display:none;">
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
<input id="reference_id" name="reference_id" type="hidden" value="<%= (reply.m_parent_id.nil? || reply.m_parent_id==0 ) ? reply.id : reply.m_parent_id %>">
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= reply.user.id %>">
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= reply.id %>">
<input id="show_name" name="show_name" type="hidden" value="true">
<textarea name='user_notes' style="display:none;"></textarea>
<p nhname='sub_contentmsg'></p>
<div nhname='sub_toolbar_container' style="float:left;padding-top:3px;"></div>
<a nhname="sub_cancel_btn" href="javascript:void(0);" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
<a nhname="sub_submit_btn" href="javascript:void(0);" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
</form>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div><!--mes_box02 end-->
<% end%>

View File

@ -0,0 +1,44 @@
<div class="message_list" id="<%= jour.id %>" nhname="rec" data-id="<%= jour.id %>">
<%= link_to image_tag(url_to_avatar(jour.user),:width => '46',:height => '46'), user_path(jour.user),:class => "users_pic fl" %>
<div class="fl ml5 mes_box mb10" >
<div>
<%= link_to "#{jour.user.login}&nbsp;:&nbsp;".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%>
</div>
<div class="cl"></div>
<div>
<%= jour.notes.html_safe %>
</div>
</div><!--mes_box end-->
<span class="c_grey fr mb10">
<%= time_tag(jour.created_on).html_safe %>
</span>
<div class="fr cr">
<%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %>
<% if User.current.admin? || jour.user == User.current%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %>
<% end %>
</div>
<div class="cl"></div>
<div nhname='div_form' class="mt10 ml80" style="display:none;">
<form action="<%= url_for(:controller => 'words', :action => 'create_reply') %>" data-remote="true" method="post">
<input id="reference_id" name="reference_id" type="hidden" value="<%= (jour.m_parent_id.nil? || jour.m_parent_id==0 ) ? jour.id : jour.m_parent_id %>">
<input id="reference_user_id" name="reference_user_id" type="hidden" value="<%= jour.user.id %>">
<input id="reference_message_id" name="reference_message_id" type="hidden" value="<%= jour.id %>">
<input id="show_name" name="show_name" type="hidden" value="true">
<textarea name='user_notes' style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a nhname="cancel_btn" href="javascript:;" class="grey_n_btn fr" style="margin-top:3px;">取消</a>
<a nhname="submit_btn" href="javascript:;" class="blue_n_btn fr mr5" style="margin-top:3px;">发布</a>
</form>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div nhname="reply_list">
<% fetch_user_leaveWord_reply(jour).each do |reply|%>
<%= render :partial => 'user_jour_reply', :locals => {:reply => reply} %>
<% end %>
</div>
</div><!--message_list end-->

View File

@ -1,15 +1,5 @@
<style type="text/css">
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
<% @center_flag = (User.current == @user) %>
<% if @center_flag %>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
@ -26,52 +16,8 @@
<% end %>
<div class="cl"></div>
</div>
<% end %>
<div id="RSide" class="fl">
<div class="message_box mb10">
<div nhname='new_message' style="display:none;">
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">留言</a>
</form>
</div>
<div class="cl"></div>
<div class="message_list_box" nhname="list_more_div" id="nh_messages" style="display:none;">
<div nhname="container" data-nodatamsg="暂无留言" data-pagesize="3" data-url="<%= url_for(:controller => 'users', :action => 'user_feedback4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="message_list_more" style="width:700px">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr mr10">收起</a>
<div class="cl"></div>
</div>
</div>
</div>
<% if !@center_flag %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<div class="users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的课程' : 'TA的课程' %></a>
<% if @center_flag %>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',:host=>Setting.host_course) %>" class=" green_u_btn fr mt8 mr8" target="_blank">新建课程</a>
<% else %>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入课程</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-nodatamsg="暂无课程" data-url="<%= url_for(:controller => 'users', :action => 'user_courses4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<h4 class="users_h4">课程动态</h4>
@ -82,29 +28,6 @@
</div>
</div>
<% if !@center_flag %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<div class=" users_top">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的项目' : 'TA的项目' %></a>
<% if @center_flag %>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new',:host=>Setting.host_name) %>" class=" green_u_btn fr mt8 mr8" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class=" green_u_btn fr mt8 mr8">加入项目</a>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<div nhname="container" data-nodatamsg="暂无项目" data-url="<%= url_for(:controller => 'users', :action => 'user_projects4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
<div class="cl"></div>
<div class="message_list_more mt10">
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
<h4 class="users_h4">项目动态</h4>
<div nhname="container" data-nodatamsg="暂无动态" data-url="<%= url_for(:controller => 'users', :action => 'user_project_activities') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
@ -115,234 +38,3 @@
</div>
</div>
<script type="text/javascript">
$(function(){
function init_editor(params){
params.textarea.removeAttr('placeholder');
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
items:['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
}).loadPlugin('paste');
return editor;
}
function nh_check_field(params){
var result=true;
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
params.content.sync();
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function init_form(params){
params.form.submit(function(){
var flag = false;
if(params.form.attr('data-remote') != undefined ){
flag = true
}
var is_checked = nh_check_field({
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
if(flag){
return true;
}else{
$(this)[0].submit();
return false;
}
}
return false;
});
}
function nh_reset_form(params){
params.form[0].reset();
params.textarea.empty();
if(params.editor != undefined){
params.editor.html(params.textarea.html());
}
params.contentmsg.hide();
}
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
params.kindutil = K;
params.container = $(this).parent('div');
params.div_form = $("div[nhname='div_form']",params.container);
params.form = $("form",params.div_form);
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form);
params.submit_btn = $("a[nhname='submit_btn']",params.div_form);
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
toggleAndSettingWordsVal(params.div_form, params.textarea);
});
params.submit_btn.click(function(){
params.form.submit();
});
params.textarea.data('init',1);
}
params.cancel_btn.click();
setTimeout(function(){
if(!params.div_form.is(':hidden')){
params.textarea.show();
params.textarea.focus();
params.textarea.hide();
}
},300);
});
$("div[nhname='new_message']").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.form = $("form",params.div_form);
if(params.form==undefined || params.form.length==0){
return;
}
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.cancel_btn = $("#new_message_cancel_btn");
params.submit_btn = $("#new_message_submit_btn");
if(params.textarea.data('init') == undefined){
params.editor = init_editor(params);
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
});
params.submit_btn.click(function(){
params.form.submit();
});
params.textarea.data('init',1);
$(this).show();
}
});
});
});
</script>
<script type="text/javascript">
function init_list_more_div(params){
var p=params;
p.exbtn.click(function(){
var isclose = p.container.data('isclose');
var hasmore = p.container.data('hasmore');
if(isclose == '1'){
$("div[nhname='rec']",p.container).show();
p.container.data('isclose','0');
change_status_4_list_more_div(params);
return;
}
if(hasmore == '0'){
change_status_4_list_more_div(params,'get');
return;
}
var url = p.container.data('url');
if($("div[nhname='rec']",p.container).length > 0){
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
url += "?lastid="+lastid;
var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time');
if(lasttime != undefined){
url += "&lasttime="+lasttime;
}
}
$.ajax( {url:url,dataType:'text',success:function(data){
var html = $("<div>"+data+"</div>");
var lens = $("div[nhname='rec']",html).length;
if(lens < p.size){
p.container.data('hasmore','0');
}
if(lens>0){
var currpage = parseInt(p.container.data('currpage'))+1;
p.container.data('currpage',currpage);
p.container.append(html.html())
}
change_status_4_list_more_div(params,'get');
p.div.show();
}} );
});
p.clbtn.click(function(){
var i=0;
$("div[nhname='rec']",p.container).each(function(){
i++;
if(i> p.size){
$(this).hide();
}
});
p.container.data('isclose','1');
change_status_4_list_more_div(params);
});
p.exbtn.click();
}
function change_status_4_list_more_div(params,opt){
var p=params;
if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){
p.exbtn.click();
return;
}
var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length;
if( show_lens > p.size ){
p.clbtn.show();
}else{
p.clbtn.hide();
}
if($("div[nhname='rec']",p.container).length == 0){
p.exbtn.html(p.nodatamsg);
}else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){
p.exbtn.html('点击展开更多');
}else{
p.exbtn.html('没有更多了');
}
}
function init_list_more_div_params(div){
var params = {};
params.div = div;
params.container = $("div[nhname='container']",div);
params.exbtn = $("a[nhname='expand']",div);
params.clbtn = $("a[nhname='close']",div);
params.size = params.container.data('pagesize');
params.nodatamsg = params.container.data('nodatamsg');
if( params.size == undefined ){
params.size = 8;
}
return params;
}
$(function(){
$("div[nhname='list_more_div']").each(function(){
var params = init_list_more_div_params($(this));
init_list_more_div(params)
});
});
</script>

View File

@ -2,8 +2,6 @@
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
<% else %>
<a href="<%= join_private_courses_courses_path %>" data-remote ="true" class="green_n_btn fr mt2">加入课程</a>
<% end %>
<div class="cl"></div>
</div>
@ -13,9 +11,9 @@
<div class="courses_top mb10">
<h2 class="courses_h2 fl">所有课程</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_courses')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">正在进行</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 已经结束</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses')%>" class="select_btn <%= (@params!='1' && @params!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'1')%>" class="select_btn <%= (@params=='1') ? 'select_btn_select' : '' %> fl ">正在进行</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_courses', :status=>'2')%>" class="select_btn <%= (@params=='2') ? 'select_btn_select' : '' %> fl "> 已经结束</a>
</div>
<div class="cl"></div>
</div>

View File

@ -1,7 +1,40 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<div class="top_new">
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %>
<a href="<%= url_for(:controller => 'courses', :action => 'new',) %>" class="green_n_btn fr mt2" target="_blank">新建课程</a>
<% end %>
<div class="cl"></div>
</div>
<%= render :partial => 'user_jours',
:locals => { :journals => @jour, :state => false}
%>
<% html_title(l(:label_responses)) -%>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %>
<div id="RSide" class="fl">
<!--<div class="users_r_top">-->
<!--<h2 class="users_r_h2">用户留言</h2>-->
<!--</div>-->
<div class="message_box mb10">
<div nhname='new_message' style="display:none;">
<%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea' name="new_form[user_message]"></textarea>
<p nhname='contentmsg'></p>
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">留言</a>
<% end%>
</div>
<div class="cl"></div>
<div class="message_list_box " id="user_jour_list">
<%if @jour%>
<% @jour.each do |jour|%>
<%= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<%end%>
<% end%>
<ul class="wlist" style=" border:none;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div><!--message_box end-->
</div>

View File

@ -2,8 +2,6 @@
<span class="<%= (@user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true)) ? 'top_new_bg' : 'top_newcourses_bg'%> fl"></span>
<% if @user.allowed_to?(:add_project, nil, :global => true) %>
<a href="<%= url_for(:controller => 'projects', :action => 'new') %>" class="bgreen_n_btn fr ml10 mt2" target="_blank">新建项目</a>
<% else %>
<a href="<%= join_project_projects_path %>" data-remote ="true" class="green_n_btn fr mt2">加入项目</a>
<% end %>
<div class="cl"></div>
</div>
@ -13,9 +11,16 @@
<div class="courses_top mb10">
<h2 class="courses_h2 fl">全部项目</h2>
<div class="courses_select fr">
<a href="<%= url_for(:controller => 'users', :action => 'user_projects')%>" class="select_btn <%= (@params['status']!='1' && @params['status']!='2') ? 'select_btn_select' : '' %> fl "> 全部</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'1')%>" class="select_btn <%= (@params['status']=='1') ? 'select_btn_select' : '' %> fl ">我创建</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'2')%>" class="select_btn <%= (@params['status']=='2') ? 'select_btn_select' : '' %> fl "> 我参与</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects')%>" class="select_btn <%= (@params!='1' && @params!='2') ? 'select_btn_select' : '' %> fl ">
全部
</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'1')%>" class="select_btn <%= (@params=='1') ? 'select_btn_select' : '' %> fl ">
<%= User.current == @user ? "我创建" : "TA创建"%>
</a>
<a href="<%= url_for(:controller => 'users', :action => 'user_projects', :status=>'2')%>" class="select_btn <%= (@params=='2') ? 'select_btn_select' : '' %> fl ">
<%= User.current == @user ? "我参与" : "TA参与"%>
</a>
</div>
<div class="cl"></div>
</div>
@ -43,7 +48,16 @@
</tbody></table>
</div>
</div>
<% if User.current.member_of? item%>
<a href="<%= url_for(:controller => 'issues', :action=>"new", :project_id=>item.id, :host=>Setting.host_name) %>" target="_blank" class="blue_n_btn fr mt20">发布问题</a>
<% elsif User.current.logged?%>
<% if item.applied_projects.find_by_user_id(User.current.id)%>
<%= link_to '取消申请',appliedproject_applied_path(:project_id => item.id,:user_id => User.current.id),:class => "blue_n_btn fr mt20", :remote => "true",:method => "delete",:id => "applied_project_link_#{item.id}"%>
<% else%>
<%= link_to "加入项目",appliedproject_path(:user_id => User.current.id,:project_id => item.id,:project_join => true),:class => "blue_n_btn fr mt20", :remote => "true",:method => "post",:id => "applied_project_link_#{item.id}" %>
<% end%>
<% end%>
<div class="cl"></div>
</div>
<% end %>

View File

@ -56,21 +56,11 @@
<% end %>
</span>
<span class="font_welcome_trustie">
<!--
@course_page.title存储在first_page表中的title字段
原本代码
<%= @course_page.title %>
!-->
<%= l(:label_welcome_trustie_course) %>
</span>
<% else %>
<% unless @course_page.nil? %>
<span class="font_welcome_trustie">
<!--
@course_page.title存储在first_page表中的title字段
原本代码
<%= @course_page.title %>
!-->
<%= l(:label_welcome_trustie_course) %>
</span>
<span class="font_welcome_tdescription">,
@ -112,7 +102,6 @@
course_term = "春季学期"
end
%>
<%# (month_now >= 3 && month_now < 9) ? course_term = "春季学期" : course_term = "秋季学期" %>
<% cur_school_course = @school_id.nil? ? [] : find_miracle_course(10,7,@school_id, year_now, course_term) %>
<% if cur_school_course.count == 0 %>

View File

@ -45,10 +45,10 @@
<% if @organization.nil? %>
<% unless @first_page.nil? %>
<!-- 改为国际化后无法通过后台配置
<%= @first_page.description.html_safe %>
<%#= @first_page.description.html_safe %>
-->
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie_project)%></span>,&nbsp;
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= l(:label_welcome_trustie_project_description)%></span></span>
<!--<span class="font_welcome_trustie"><%#= @first_page.title.html_safe %></span>,&nbsp;-->
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= @first_page.description.html_safe %></span></span>
<% end %>
<% else %>
<span class="font_welcome_school" style="color: #E8770D">

View File

@ -74,11 +74,11 @@
<% end %>
<br/><br/>
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
<%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
<%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
<%# other_formats_links do |f| %>
<%#= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
<%#= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
<%#= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
<%# end if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
<% end %>

View File

@ -1,11 +1,10 @@
<% if @save_succ %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
var html = $("<div>"+"<%= escape_javascript( render(:template => 'users/user_feedback4show',:locals => {:feed_list=>[@jfm]} )) %>"+"</div>");
$("div[nhname='container']",$("#nh_messages")).prepend(html.html());
// $('#new_message_cancel_btn').click();
$("a[nhname='reply_btn']",$("#nh_jours_<%= @jfm.m_reply_id %>")).click();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
$("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>");
div_1 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='div_form']");
div_1.hide();
div_2 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='sub_div_form']");
div_2.hide();
<% else %>
var pre_append = $('<%= j(

View File

@ -2,9 +2,10 @@
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
<% if @is_user%>
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
var destroyedItem = $('#<%=@journal_destroyed.id%>');
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
<% else %>
<% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>");

View File

@ -7,6 +7,7 @@ RedmineApp::Application.configure do
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
config.log_level =:debug
config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly
# Show full error reports and disable caching
config.consider_all_requests_local = true

View File

@ -92,7 +92,7 @@ zh:
label_project_dts_new: DTS缺陷测试
label_project_dts_statics: DTS缺陷报告
label_project_dts_yun: 云化部署
label_project_dts_yun: 云化部署工具
label_project_soft_knowledge: 软件知识库
label_project_soft_file: 软件资源库
label_project_online_dev: 在线开发平台
@ -350,7 +350,7 @@ zh:
label_input_email: 请输入邮箱地址
label_invite_trustie_user: "邀请Trustie注册用户"
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
label_invite_trustie_user_tips: "支持姓名、邮箱、昵称搜索!"
label_user_role_null: 用户和角色不能留空!
label_invite_project: 邀请您加入项目
label_mail_invite_success: 您已成功加入项目!

View File

@ -381,6 +381,7 @@ zh:
label_organization_choose: --请选择组织--
label_organization_name: 组织名称
label_organization_list: 组织列表
label_school_plural: 学校列表
label_organization_new: 新建组织
label_organization_edit: 修改组织
label_project_plural: 项目列表
@ -669,6 +670,8 @@ zh:
label_tag: 标签
label_revision: 修订
label_revision_plural: 修订
lable_revision_code_count: 代码量
label_revision_commit_count: 提交次数
label_revision_id: 修订 %{value}
label_associated_revisions: 相关修订版本
label_added: 已添加
@ -715,6 +718,11 @@ zh:
label_commits_per_month: 每月提交次数
label_commits_per_author: 每用户提交次数
label_author_commits_per_month: 用户最近一月的提交次数
label_author_commits_six_month: 用户最近六个月提交次数
label_author_commits_year: 最近一年的提交次数
label_author_code_six_month: 用户最近六个月代码量
label_author_code_year: 用户最近一年代码量
label_view_diff: 查看差别
label_diff_inline: 直列
label_diff_side_by_side: 并排
@ -1835,6 +1843,7 @@ zh:
excel_t_score: 教师评分
excel_ta_score: 教辅评分
excel_n_score: 匿名评分
excel_s_score: 系统评分
excel_f_score: 成绩
excel_commit_time: 提交时间
excel_homework_score: 作业积分

View File

@ -39,6 +39,17 @@ RedmineApp::Application.routes.draw do
end
resources :school do
collection do
end
member do
get 'upload_logo'
post 'upload'
end
end
resources :homework_attach do
collection do
get 'get_homework_member_list'
@ -71,6 +82,7 @@ RedmineApp::Application.routes.draw do
get 'poll_result'
get 'close_poll'
get 'export_poll'
get 'import_poll'
end
collection do
delete 'delete_poll_question'
@ -86,6 +98,7 @@ RedmineApp::Application.routes.draw do
end
collection do
post 'next_step'
post 'programing_test'
end
end
@ -293,7 +306,7 @@ RedmineApp::Application.routes.draw do
match 'user_projects_index', :to => 'users#user_projects_index', :via => :get
match 'user_projects', :to => 'users#user_projects', :via => :get
match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities"
match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
# match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
@ -670,6 +683,7 @@ RedmineApp::Application.routes.draw do
match 'admin/test_email', :via => :get
match 'admin/default_configuration', :via => :post
get 'admin/organization'
get 'admin/schools'
resources :auth_sources do
member do
@ -779,6 +793,7 @@ RedmineApp::Application.routes.draw do
match 'words/:id/leave_project_message', :to => 'words#leave_project_message'
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
@ -808,9 +823,6 @@ RedmineApp::Application.routes.draw do
post 'school/search_school/', :to => 'school#search_school'
get 'school/search_school/', :to => 'school#search_school'
post 'school/upload', :to => 'school#upload'
get 'school/upload_logo', :to => 'school#upload_logo'
######added by nie
match 'tags/show_projects_tags'
########### added by liuping

View File

@ -0,0 +1,9 @@
class AddErrormsgToStudenWorkTest < ActiveRecord::Migration
def up
add_column :student_work_tests,:error_msg,:text
end
def down
remove_column :student_work_tests,:error_msg
end
end

View File

@ -0,0 +1,9 @@
class AddResultToTest < ActiveRecord::Migration
def up
add_column :homework_tests, :result, :integer,default: 0
end
def down
remove_column :homework_tests,:result
end
end

View File

@ -0,0 +1,9 @@
class AddErrormsgToTest < ActiveRecord::Migration
def up
add_column :homework_tests,:error_msg,:text
end
def down
remove_column :homework_tests,:error_msg
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150719092427) do
ActiveRecord::Schema.define(:version => 20150730130816) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -634,6 +634,8 @@ ActiveRecord::Schema.define(:version => 20150719092427) do
t.integer "homework_common_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "result", :default => 0
t.text "error_msg"
end
create_table "homework_users", :force => true do |t|
@ -1248,6 +1250,7 @@ ActiveRecord::Schema.define(:version => 20150719092427) do
t.integer "result"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "error_msg"
end
create_table "student_works", :force => true do |t|

View File

@ -369,6 +369,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural

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