Merge branch 'szzh' into develop
This commit is contained in:
commit
caec634e4c
|
@ -4,56 +4,50 @@ module Mobile
|
||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
def self.course_dynamic_expose(field)
|
def self.course_dynamic_expose(field)
|
||||||
expose field do |c,opt|
|
expose field do |c,opt|
|
||||||
if field == :update_time
|
# if field == :news_count
|
||||||
(format_time(c[field]) if (c.is_a?(Hash) && c.key?(field)))
|
# obj = nil
|
||||||
elsif field == :news_count
|
# c[:dynamics].each do |d|
|
||||||
obj = nil
|
# if d[:type] == 1
|
||||||
c[:dynamics].each do |d|
|
# obj = d[:count]
|
||||||
if d[:type] == 1
|
# end
|
||||||
obj = d[:count]
|
# end
|
||||||
end
|
# obj
|
||||||
end
|
# elsif field == :document_count
|
||||||
obj
|
# obj = nil
|
||||||
elsif field == :document_count
|
# c[:dynamics].each do |d|
|
||||||
obj = nil
|
# if d[:type] == 3
|
||||||
c[:dynamics].each do |d|
|
# obj = d[:count]
|
||||||
if d[:type] == 3
|
# end
|
||||||
obj = d[:count]
|
# end
|
||||||
end
|
# obj
|
||||||
end
|
# elsif field == :topic_count
|
||||||
obj
|
# obj = nil
|
||||||
elsif field == :topic_count
|
# c[:dynamics].each do |d|
|
||||||
obj = nil
|
# if d[:type] == 2
|
||||||
c[:dynamics].each do |d|
|
# obj = d[:count]
|
||||||
if d[:type] == 2
|
# end
|
||||||
obj = d[:count]
|
# end
|
||||||
end
|
# obj
|
||||||
end
|
# elsif field == :homework_count
|
||||||
obj
|
# obj = nil
|
||||||
elsif field == :homework_count
|
# c[:dynamics].each do |d|
|
||||||
obj = nil
|
# if d[:type] == 4
|
||||||
c[:dynamics].each do |d|
|
# obj = d[:count]
|
||||||
if d[:type] == 4
|
# end
|
||||||
obj = d[:count]
|
# end
|
||||||
end
|
# obj
|
||||||
end
|
# else
|
||||||
obj
|
|
||||||
else
|
|
||||||
c[field] if (c.is_a?(Hash) && c.key?(field))
|
c[field] if (c.is_a?(Hash) && c.key?(field))
|
||||||
end
|
# end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
course_dynamic_expose :type
|
|
||||||
course_dynamic_expose :count
|
|
||||||
course_dynamic_expose :course_name
|
course_dynamic_expose :course_name
|
||||||
course_dynamic_expose :course_term
|
course_dynamic_expose :course_term
|
||||||
course_dynamic_expose :course_time
|
course_dynamic_expose :course_time
|
||||||
course_dynamic_expose :course_id
|
course_dynamic_expose :course_id
|
||||||
course_dynamic_expose :course_img_url
|
course_dynamic_expose :course_img_url
|
||||||
course_dynamic_expose :message
|
course_dynamic_expose :message
|
||||||
course_dynamic_expose :update_time
|
|
||||||
course_dynamic_expose :count
|
|
||||||
course_dynamic_expose :news_count
|
course_dynamic_expose :news_count
|
||||||
course_dynamic_expose :document_count
|
course_dynamic_expose :document_count
|
||||||
course_dynamic_expose :topic_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_member
|
||||||
course_dynamic_expose :current_user_is_teacher
|
course_dynamic_expose :current_user_is_teacher
|
||||||
|
|
||||||
expose :documents,using:Mobile::Entities::Attachment do |f,opt|
|
# expose :documents,using:Mobile::Entities::Attachment do |f,opt|
|
||||||
obj = nil
|
# obj = nil
|
||||||
f[:dynamics].each do |d|
|
# f[:dynamics].each do |d|
|
||||||
if d[:type] == 3
|
# if d[:type] == 3
|
||||||
obj = d[:documents]
|
# obj = d[:documents]
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
obj
|
# obj
|
||||||
end
|
# end
|
||||||
expose :topics,using:Mobile::Entities::Message do |f,opt|
|
expose :topics,using:Mobile::Entities::Message do |f,opt|
|
||||||
obj = nil
|
f[:topics]
|
||||||
f[:dynamics].each do |d|
|
|
||||||
if d[:type] == 2
|
|
||||||
obj = d[:topics]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
obj
|
|
||||||
end
|
end
|
||||||
expose :homeworks,using:Mobile::Entities::Homework do |f,opt|
|
expose :homeworks,using:Mobile::Entities::Homework do |f,opt|
|
||||||
obj = nil
|
f[:homeworks]
|
||||||
f[:dynamics].each do |d|
|
|
||||||
if d[:type] == 4
|
|
||||||
obj = d[:homeworks]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
obj
|
|
||||||
end
|
end
|
||||||
|
|
||||||
expose :news,using:Mobile::Entities::News do |f,opt|
|
expose :news,using:Mobile::Entities::News do |f,opt|
|
||||||
obj = nil
|
f[:news]
|
||||||
f[:dynamics].each do |d|
|
|
||||||
if d[:type] == 1
|
|
||||||
obj = d[:news]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
obj
|
|
||||||
end
|
end
|
||||||
|
|
||||||
expose :better_students,using:Mobile::Entities::User do |f,opt|
|
expose :better_students,using:Mobile::Entities::User do |f,opt|
|
||||||
obj = nil
|
f[:better_students]
|
||||||
f[:dynamics].each do |d|
|
|
||||||
if d[:type] == 6
|
|
||||||
obj = d[:better_students]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
obj
|
|
||||||
end
|
end
|
||||||
|
|
||||||
expose :active_students,using:Mobile::Entities::User do |f,opt|
|
expose :active_students,using:Mobile::Entities::User do |f,opt|
|
||||||
obj = nil
|
f[:active_students]
|
||||||
f[:dynamics].each do |d|
|
|
||||||
if d[:type] == 7
|
|
||||||
obj = d[:active_students]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
obj
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -604,7 +604,7 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
def toggleCourse
|
def toggleCourse
|
||||||
@course_prefs = Course.find_by_extra(@course.extra)
|
@course_prefs = Course.find_by_extra(@course.extra)
|
||||||
unless (@course_prefs.student != User.current || User.current.admin?)
|
unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?)
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -144,6 +144,8 @@ class HomeworkCommonController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
if homework.save
|
if homework.save
|
||||||
|
homework_detail_programing.save if homework_detail_programing
|
||||||
|
homework_detail_manual.save if homework_detail_manual
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
|
@ -254,7 +256,6 @@ class HomeworkCommonController < ApplicationController
|
||||||
client.request(request)
|
client.request(request)
|
||||||
end
|
end
|
||||||
result = JSON.parse(res.body)
|
result = JSON.parse(res.body)
|
||||||
homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@homework.save_attachments(params[:attachments])
|
@homework.save_attachments(params[:attachments])
|
||||||
|
|
|
@ -71,13 +71,12 @@ class NewsController < ApplicationController
|
||||||
scope = @course ? @course.news.course_visible : News.course_visible
|
scope = @course ? @course.news.course_visible : News.course_visible
|
||||||
|
|
||||||
@news_count = scope.count
|
@news_count = scope.count
|
||||||
#@news_pages = Paginator.new @news_count, @limit, params['page']
|
@q = params[:subject]
|
||||||
#@offset ||= scope_page.offset
|
|
||||||
if params[:subject].nil?
|
if params[:subject].nil?
|
||||||
scope_order = scope.all(:include => [:author, :course],
|
scope_order = scope.all(:include => [:author, :course],
|
||||||
:order => "#{News.table_name}.created_on DESC")
|
:order => "#{News.table_name}.created_on DESC")
|
||||||
else
|
else
|
||||||
scope_order = scope.where("news.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
|
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
|
||||||
:order => "#{News.table_name}.created_on DESC")
|
:order => "#{News.table_name}.created_on DESC")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -459,6 +459,12 @@ update
|
||||||
data = graph_commits_per_month(@repository)
|
data = graph_commits_per_month(@repository)
|
||||||
when "commits_per_author"
|
when "commits_per_author"
|
||||||
data = graph_commits_per_author(@repository)
|
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_qoc_per_author"
|
||||||
|
data = graph_author_qoc_per_author(@repository)
|
||||||
end
|
end
|
||||||
if data
|
if data
|
||||||
headers["Content-Type"] = "image/svg+xml"
|
headers["Content-Type"] = "image/svg+xml"
|
||||||
|
@ -617,6 +623,80 @@ update
|
||||||
)
|
)
|
||||||
graph.burn
|
graph.burn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 用户每月提交次数
|
||||||
|
def graph_author_commits_per_month(repository)
|
||||||
|
@date_to = Date.today
|
||||||
|
@date_from = @date_to << 1
|
||||||
|
@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(40)
|
||||||
|
|
||||||
|
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_per_month),
|
||||||
|
:show_graph_title => true
|
||||||
|
)
|
||||||
|
graph.add_data(
|
||||||
|
:data => commits_data,
|
||||||
|
:title => l(:label_revision_plural)
|
||||||
|
)
|
||||||
|
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(40)
|
||||||
|
|
||||||
|
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_plural)
|
||||||
|
)
|
||||||
|
graph.burn
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def check_hidden_repo
|
def check_hidden_repo
|
||||||
project = Project.find(params[:id])
|
project = Project.find(params[:id])
|
||||||
if !User.current.member_of?(project)
|
if !User.current.member_of?(project)
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module ApiHelper
|
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
|
def get_user_work_unit user
|
||||||
work_unit = ""
|
work_unit = ""
|
||||||
|
@ -163,5 +169,37 @@ module ApiHelper
|
||||||
|
|
||||||
end
|
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
|
end
|
|
@ -38,7 +38,7 @@ module MembersHelper
|
||||||
scope = []
|
scope = []
|
||||||
end
|
end
|
||||||
principals = paginateHelper scope,10
|
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|
|
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
|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,13 +236,14 @@ module RepositoriesHelper
|
||||||
# 判断项目是否有主版本库
|
# 判断项目是否有主版本库
|
||||||
def judge_main_repository(pro)
|
def judge_main_repository(pro)
|
||||||
if pro.repositories.blank?
|
if pro.repositories.blank?
|
||||||
return false
|
status = false
|
||||||
else
|
else
|
||||||
pro.repositories.sort.each do |rep|
|
pro.repositories.each do |rep|
|
||||||
rep.is_default?
|
status = true and break if rep.is_default?
|
||||||
return true
|
status = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
status
|
||||||
end
|
end
|
||||||
# def cvs_field_tags(form, repository)
|
# def cvs_field_tags(form, repository)
|
||||||
# content_tag('p', form.text_field(
|
# content_tag('p', form.text_field(
|
||||||
|
|
|
@ -654,36 +654,42 @@ class CoursesService
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if current_user == @user || current_user.admin?
|
if current_user == @user || current_user.admin?
|
||||||
membership = @user.coursememberships.page(1).per(15)
|
membership = @user.coursememberships
|
||||||
else
|
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
|
end
|
||||||
if membership.nil? || membership.count == 0
|
if membership.nil? || membership.count == 0
|
||||||
raise l(:label_no_courses, :locale => get_user_language(current_user))
|
raise l(:label_no_courses, :locale => get_user_language(current_user))
|
||||||
end
|
end
|
||||||
membership.sort! { |older, newer| newer.created_on <=> older.created_on }
|
#membership.sort! { |older, newer| newer.created_on <=> older.created_on }
|
||||||
|
|
||||||
#定义一个数组集合,存放hash数组,该hash数组包括课程的信息,并包含课程的最新发布的资源,最新的讨论区留言,最新的作业,最新的通知
|
#定义一个数组集合,存放hash数组,该hash数组包括课程的信息,并包含课程的最新发布的资源,最新的讨论区留言,最新的作业,最新的通知
|
||||||
result = []
|
result = []
|
||||||
#对用户所有的课程进行循环,找到每个课程最新发布的资源,最新的讨论区留言,最新的作业,最新的通知,并存进数组
|
#对用户所有的课程进行循环,找到每个课程最新发布的资源,最新的讨论区留言,最新的作业,最新的通知,并存进数组
|
||||||
|
|
||||||
membership.each do |mp|
|
membership.each do |mp|
|
||||||
course = mp.course
|
course = mp.course
|
||||||
latest_course_dynamics = []
|
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")
|
latest_news = course.news.page(1).per(2).order("created_on desc")
|
||||||
unless latest_news.first.nil?
|
unless latest_news.first.nil?
|
||||||
latest_course_dynamics << {:type => 1, :time => latest_news.first.created_on,:count=>course.news.count,
|
notices_count = course.news.count
|
||||||
:news => latest_news.all}
|
notices = latest_news.all
|
||||||
|
latest_course_dynamics << {:time => latest_news.first.created_on }
|
||||||
end
|
end
|
||||||
|
|
||||||
# 课程讨论区
|
# 课程讨论区
|
||||||
latest_message = course.boards.first.topics.page(1).per(2)
|
latest_message = course.boards.first.topics.page(1).per(2)
|
||||||
unless latest_message.first.nil?
|
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,
|
topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count
|
||||||
:topics => latest_message.all}
|
topics = latest_message.all
|
||||||
|
latest_course_dynamics << {:time => latest_message.first.created_on}
|
||||||
end
|
end
|
||||||
|
|
||||||
# 课程资源
|
# 课程资源
|
||||||
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
|
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
|
||||||
# unless latest_attachment.first.nil?
|
# unless latest_attachment.first.nil?
|
||||||
|
@ -694,14 +700,17 @@ class CoursesService
|
||||||
#课程作业 已经交的学生列表(暂定显示6人),未交的学生列表,作业的状态
|
#课程作业 已经交的学生列表(暂定显示6人),未交的学生列表,作业的状态
|
||||||
homeworks = course.homework_commons.page(1).per(2).order('created_at desc')
|
homeworks = course.homework_commons.page(1).per(2).order('created_at desc')
|
||||||
unless homeworks.first.nil?
|
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
|
end
|
||||||
latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] }
|
latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] }
|
||||||
# 课程学霸 学生总分数排名靠前的5个人
|
# 课程学霸 学生总分数排名靠前的5个人
|
||||||
homework_count = course.homework_commons.count
|
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" <<
|
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"
|
" 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)
|
better_students = User.find_by_sql(sql)
|
||||||
|
|
||||||
# 找出在课程讨论区发帖回帖数最多的
|
# 找出在课程讨论区发帖回帖数最多的
|
||||||
active_students = []
|
active_students = []
|
||||||
sql1 = " select users.*,count(author_id)*2 active_count from messages " <<
|
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 " <<
|
" GROUP BY messages.author_id ORDER BY count(author_id) desc " <<
|
||||||
" limit 0,4"
|
" limit 0,4"
|
||||||
active_students = User.find_by_sql(sql1)
|
active_students = User.find_by_sql(sql1)
|
||||||
|
|
||||||
if homework_count != 0 && !better_students.empty?
|
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
|
end
|
||||||
unless active_students.empty?
|
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
|
end
|
||||||
latest_course_dynamic = latest_course_dynamics.first
|
latest_course_dynamic = latest_course_dynamics.first
|
||||||
unless latest_course_dynamic.nil?
|
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,
|
result << {:course_name => course.name,
|
||||||
: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}
|
: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
|
||||||
|
|
||||||
end
|
end
|
||||||
#返回数组集合
|
#返回数组集合
|
||||||
result.sort! { |order, newer| newer[:time] <=> order[:time] }
|
result.sort! { |order, newer| newer[:time] <=> order[:time] }
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<p>
|
<p>
|
||||||
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
|
<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) %>
|
<%= submit_tag l(:button_submit) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
|
<div id="upload_progressbar" style="height:14px; margin-bottom: 10px;display: block"></div>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</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;">
|
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
|
||||||
<span><%= l(:button_upload_photo) %></span>
|
<span><%= l(:button_upload_photo) %></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -71,18 +71,30 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% end%>
|
<div class="cl"></div>
|
||||||
<div class="cl"></div>
|
|
||||||
|
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<% unless homework.attachments.empty?%>
|
<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>
|
<span class="tit_fb" style="width: auto;"> 附件:</span>
|
||||||
<div class="fl mb5">
|
<div class="fl mb5">
|
||||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
|
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
|
||||||
</div>
|
</div>
|
||||||
<% end%>
|
</div>
|
||||||
</div>
|
<div class="cl"></div>
|
||||||
<div class="cl"></div>
|
<% end%>
|
||||||
|
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
|
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
|
||||||
|
|
|
@ -80,11 +80,13 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<% if @project.project_type == 0 %>
|
<% if @project.project_type == 0 %>
|
||||||
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
|
<% unless project_scores(@project) == 0 %>
|
||||||
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
|
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
|
||||||
:action => 'show_projects_score',
|
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
|
||||||
:remote => true,
|
:action => 'show_projects_score',
|
||||||
:id => @project.id}, :class => "c_orange f14" ) %>
|
:remote => true,
|
||||||
|
:id => @project.id}, :class => "c_orange f14" ) %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<div id="LSide" class="fl">
|
<div id="LSide" class="fl">
|
||||||
<div class="users_info">
|
<div class="users_info">
|
||||||
<div class="pic_head">
|
<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 %>
|
<% if @center_flag %>
|
||||||
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
|
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="pic_edit usersphoto_edit"></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
<div class="leftbox mt10">
|
<div class="leftbox mt10">
|
||||||
<ul class="leftbox_ul_left">
|
<ul class="leftbox_ul_left">
|
||||||
<li>加入时间 :</li>
|
<li>最近登录 :</li> <!--加入时间修改为最近登录 -->
|
||||||
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
|
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
|
||||||
<li><%= l(:label_company_name) %> :</li>
|
<li><%= l(:label_company_name) %> :</li>
|
||||||
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
|
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="leftbox_ul_right c_dgrey">
|
<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 %>
|
<% if @user.user_extensions.identity == 0 %>
|
||||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
|
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
<span>48px*48px</span> <br />
|
<span>48px*48px</span> <br />
|
||||||
</div>
|
</div>
|
||||||
<div class="cl mb10"></div>
|
<div class="cl mb10"></div>
|
||||||
<a href="javascript:hideModal();" class=" fr grey_btn mr2"> 取 消</a>
|
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取 消</a>
|
||||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确 定</a>
|
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确 定</a>
|
||||||
|
|
||||||
</div><!--talknew end-->
|
</div><!--talknew end-->
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<% if @project%>
|
<% if @project%>
|
||||||
|
var checked = $("#principals input:checked").size();
|
||||||
|
if(checked > 0)
|
||||||
|
{
|
||||||
|
alert('翻页或搜索后将丢失当前选择的用户数据!');
|
||||||
|
}
|
||||||
<% if @flag == "true"%>
|
<% if @flag == "true"%>
|
||||||
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
||||||
<% else%>
|
<% else%>
|
||||||
|
|
|
@ -540,6 +540,7 @@
|
||||||
$('#my_account_form_btn').click();
|
$('#my_account_form_btn').click();
|
||||||
});
|
});
|
||||||
$('#my_password_form_link').click(function(){
|
$('#my_password_form_link').click(function(){
|
||||||
|
// alert("密码修改成功,请重新登录!");
|
||||||
$('#my_password_form_btn').click();
|
$('#my_password_form_btn').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
$('#ajax-modal').siblings().hide();
|
$('#ajax-modal').siblings().hide();
|
||||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||||
//$('#ajax-modal').parent().css("top","").css("left","");
|
//$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
$('#ajax-modal').parent().addClass("alert_box");
|
$('#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");
|
|
@ -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();
|
hideModal();
|
|
@ -24,8 +24,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="problem_search fr" >
|
<div class="problem_search fr" >
|
||||||
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course },:remote=>'true', :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
|
<%= 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="" onkeypress="" onkeydown="">
|
<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>
|
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_search();" >搜索</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div><!--problem_search end-->
|
</div><!--problem_search end-->
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
<div id="news_list">
|
<div id="news_list">
|
||||||
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
|
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
|
||||||
<div>
|
</div>
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
||||||
<%= stylesheet_link_tag 'scm' %>
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
|
|
@ -69,12 +69,12 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div class="project-search" style="float: right">
|
<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] %>
|
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
<%= 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;" >
|
<!-- <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
|
||||||
<%= l(:label_search)%>
|
<%= l(:label_search)%>
|
||||||
</a>
|
</a> -->
|
||||||
<br />
|
<br />
|
||||||
<span id="project_name_span" style="float: left"></span>
|
<span id="project_name_span" style="float: left"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,23 @@
|
||||||
<%= 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")) %>
|
<%= 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>
|
||||||
<p style="padding-top: 50px;">
|
<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")) %>
|
<%= 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>
|
||||||
|
<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_qoc_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_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_qoc_per_author")) %>
|
||||||
|
</p>
|
||||||
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
|
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
|
||||||
<% html_title(l(:label_repository), l(:label_statistics)) -%>
|
<% html_title(l(:label_repository), l(:label_statistics)) -%>
|
||||||
|
|
|
@ -59,14 +59,6 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li ><span class="tit_fb ">测试结果:</span>
|
|
||||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<% if @is_teacher%>
|
<% if @is_teacher%>
|
||||||
<!-- 编程作业老师才可以评分 -->
|
<!-- 编程作业老师才可以评分 -->
|
||||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||||
|
|
|
@ -55,21 +55,23 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if @is_teacher%>
|
<% if @is_teacher%>
|
||||||
<div class="fr">
|
<div class="fr">
|
||||||
<% if @homework.student_works.empty?%>
|
<% unless @homework.homework_type == 2%>
|
||||||
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
|
<% if @homework.student_works.empty?%>
|
||||||
<% else%>
|
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
|
||||||
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
|
<% else%>
|
||||||
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
|
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
|
||||||
|
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
|
||||||
|
<% end%>
|
||||||
|
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
|
||||||
|
使用
|
||||||
|
<span class="c_red">winzip</span>
|
||||||
|
工具进行解压可能会导致
|
||||||
|
<span class="c_red">下载文件乱码</span>
|
||||||
|
,建议您使用
|
||||||
|
<span class="c_red">winrar</span>
|
||||||
|
工具进行解压
|
||||||
|
</div>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
|
|
||||||
使用
|
|
||||||
<span class="c_red">winzip</span>
|
|
||||||
工具进行解压可能会导致
|
|
||||||
<span class="c_red">下载文件乱码</span>
|
|
||||||
,建议您使用
|
|
||||||
<span class="c_red">winrar</span>
|
|
||||||
工具进行解压
|
|
||||||
</div>
|
|
||||||
<%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
|
<%= 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("缺评", 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'%>
|
<%= 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'%>
|
||||||
|
@ -137,6 +139,14 @@
|
||||||
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
|
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
|
||||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr class="<%= cycle("", "b_grey") %>">
|
||||||
|
<td class="td_tit">
|
||||||
|
输入
|
||||||
|
</td>
|
||||||
|
<td class="td_tit">
|
||||||
|
输出
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<% @homework.homework_tests.each do |test|%>
|
<% @homework.homework_tests.each do |test|%>
|
||||||
<tr class="<%= cycle("", "b_grey") %>">
|
<tr class="<%= cycle("", "b_grey") %>">
|
||||||
<td class="td_tit">
|
<td class="td_tit">
|
||||||
|
@ -149,8 +159,20 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<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%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
|
||||||
|
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<% unless @homework.attachments.empty?%>
|
<% unless @homework.attachments.empty?%>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="courses_list line" id="fans_item_<%=item.id%>">
|
<div class="courses_list line" id="fans_item_<%=item.id%>">
|
||||||
<div class="courses_list_pic fl">
|
<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=>"头像") %>
|
<%= image_tag(url_to_avatar(item), :style=>"width:64px;height:64px;",:alt=>"头像") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -45,10 +45,10 @@
|
||||||
<% if @organization.nil? %>
|
<% if @organization.nil? %>
|
||||||
<% unless @first_page.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>,
|
<!--<span class="font_welcome_trustie"><%#= @first_page.title.html_safe %></span>, -->
|
||||||
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= l(:label_welcome_trustie_project_description)%></span></span>
|
<span class="font_welcome_tdescription"><span class="font_welcome_tdescription"><%= @first_page.description.html_safe %></span></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="font_welcome_school" style="color: #E8770D">
|
<span class="font_welcome_school" style="color: #E8770D">
|
||||||
|
|
|
@ -350,7 +350,7 @@ zh:
|
||||||
label_input_email: 请输入邮箱地址
|
label_input_email: 请输入邮箱地址
|
||||||
|
|
||||||
label_invite_trustie_user: "邀请Trustie注册用户"
|
label_invite_trustie_user: "邀请Trustie注册用户"
|
||||||
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
|
label_invite_trustie_user_tips: "支持姓名、邮箱、昵称搜索!"
|
||||||
label_user_role_null: 用户和角色不能留空!
|
label_user_role_null: 用户和角色不能留空!
|
||||||
label_invite_project: 邀请您加入项目
|
label_invite_project: 邀请您加入项目
|
||||||
label_mail_invite_success: 您已成功加入项目!
|
label_mail_invite_success: 您已成功加入项目!
|
||||||
|
|
|
@ -715,6 +715,9 @@ zh:
|
||||||
|
|
||||||
label_commits_per_month: 每月提交次数
|
label_commits_per_month: 每月提交次数
|
||||||
label_commits_per_author: 每用户提交次数
|
label_commits_per_author: 每用户提交次数
|
||||||
|
label_author_commits_per_month: 用户最近一月的提交次数
|
||||||
|
label_author_commits_six_month: 用户最近六个月的提交次数
|
||||||
|
label_author_commits_year: 最近一年的提交次数
|
||||||
label_view_diff: 查看差别
|
label_view_diff: 查看差别
|
||||||
label_diff_inline: 直列
|
label_diff_inline: 直列
|
||||||
label_diff_side_by_side: 并排
|
label_diff_side_by_side: 并排
|
||||||
|
|
|
@ -454,13 +454,6 @@ ActiveRecord::Schema.define(:version => 20150722015428) do
|
||||||
|
|
||||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||||
|
|
||||||
create_table "discuss_demos", :force => true do |t|
|
|
||||||
t.string "title"
|
|
||||||
t.text "body"
|
|
||||||
t.datetime "created_at", :null => false
|
|
||||||
t.datetime "updated_at", :null => false
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "documents", :force => true do |t|
|
create_table "documents", :force => true do |t|
|
||||||
t.integer "project_id", :default => 0, :null => false
|
t.integer "project_id", :default => 0, :null => false
|
||||||
t.integer "category_id", :default => 0, :null => false
|
t.integer "category_id", :default => 0, :null => false
|
||||||
|
@ -861,6 +854,7 @@ ActiveRecord::Schema.define(:version => 20150722015428) do
|
||||||
t.datetime "created_on"
|
t.datetime "created_on"
|
||||||
t.integer "comments_count", :default => 0, :null => false
|
t.integer "comments_count", :default => 0, :null => false
|
||||||
t.integer "course_id"
|
t.integer "course_id"
|
||||||
|
t.datetime "updated_on"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||||
|
|
|
@ -5104,8 +5104,8 @@ KEditor.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
statusbar.removeClass('statusbar').addClass('ke-statusbar')
|
//statusbar.removeClass('statusbar').addClass('ke-statusbar')
|
||||||
.append('<span class="ke-inline-block ke-statusbar-center-icon"></span>');
|
// .append('<span class="ke-inline-block ke-statusbar-center-icon"></span>');
|
||||||
if (self._fullscreenResizeHandler) {
|
if (self._fullscreenResizeHandler) {
|
||||||
K(window).unbind('resize', self._fullscreenResizeHandler);
|
K(window).unbind('resize', self._fullscreenResizeHandler);
|
||||||
self._fullscreenResizeHandler = null;
|
self._fullscreenResizeHandler = null;
|
||||||
|
|
|
@ -113,7 +113,7 @@ a:hover.c_lgrey{ color:#3ca5c6;}
|
||||||
/* 20150506上传头像*/
|
/* 20150506上传头像*/
|
||||||
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
|
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
|
||||||
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
|
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
|
||||||
.mr2{ margin-right:2px;}
|
.mr15{ margin-right:15px;}
|
||||||
.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
|
.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;}
|
||||||
/* 新建作品*/
|
/* 新建作品*/
|
||||||
.mr8{ margin-right:8px;}
|
.mr8{ margin-right:8px;}
|
||||||
|
|
Loading…
Reference in New Issue