Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/welcome/_search_project.html.erb config/locales/en.yml config/locales/zh.yml
This commit is contained in:
commit
22aae1910b
|
@ -91,10 +91,6 @@ GEM
|
||||||
descendants_tracker (0.0.4)
|
descendants_tracker (0.0.4)
|
||||||
thread_safe (~> 0.3, >= 0.3.1)
|
thread_safe (~> 0.3, >= 0.3.1)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
dnsruby (1.57.0)
|
|
||||||
email_verifier (0.0.7)
|
|
||||||
dnsruby (>= 1.5)
|
|
||||||
rails (>= 3.0.0)
|
|
||||||
equalizer (0.0.9)
|
equalizer (0.0.9)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.2.1)
|
execjs (2.2.1)
|
||||||
|
@ -170,7 +166,6 @@ GEM
|
||||||
mysql2 (0.3.11-x86-mingw32)
|
mysql2 (0.3.11-x86-mingw32)
|
||||||
nenv (0.2.0)
|
nenv (0.2.0)
|
||||||
net-ldap (0.3.1)
|
net-ldap (0.3.1)
|
||||||
newrelic_rpm (3.9.9.275)
|
|
||||||
nokogiri (1.6.3)
|
nokogiri (1.6.3)
|
||||||
mini_portile (= 0.6.0)
|
mini_portile (= 0.6.0)
|
||||||
nokogiri (1.6.3-x86-mingw32)
|
nokogiri (1.6.3-x86-mingw32)
|
||||||
|
@ -320,7 +315,6 @@ DEPENDENCIES
|
||||||
capybara (~> 2.4.1)
|
capybara (~> 2.4.1)
|
||||||
coderay (~> 1.0.6)
|
coderay (~> 1.0.6)
|
||||||
coffee-rails (~> 3.2.1)
|
coffee-rails (~> 3.2.1)
|
||||||
email_verifier
|
|
||||||
factory_girl (~> 4.4.0)
|
factory_girl (~> 4.4.0)
|
||||||
faker
|
faker
|
||||||
fastercsv (~> 1.5.0)
|
fastercsv (~> 1.5.0)
|
||||||
|
@ -336,7 +330,6 @@ DEPENDENCIES
|
||||||
mocha (~> 1.1.0)
|
mocha (~> 1.1.0)
|
||||||
mysql2 (= 0.3.11)
|
mysql2 (= 0.3.11)
|
||||||
net-ldap (~> 0.3.1)
|
net-ldap (~> 0.3.1)
|
||||||
newrelic_rpm
|
|
||||||
nokogiri (~> 1.6.3)
|
nokogiri (~> 1.6.3)
|
||||||
paperclip (~> 3.5.4)
|
paperclip (~> 3.5.4)
|
||||||
rack-mini-profiler!
|
rack-mini-profiler!
|
||||||
|
|
|
@ -6,6 +6,7 @@ module Mobile
|
||||||
require_relative 'apis/watches'
|
require_relative 'apis/watches'
|
||||||
require_relative 'apis/upgrade'
|
require_relative 'apis/upgrade'
|
||||||
require_relative 'apis/homeworks'
|
require_relative 'apis/homeworks'
|
||||||
|
require_relative 'apis/comments'
|
||||||
class API < Grape::API
|
class API < Grape::API
|
||||||
version 'v1', using: :path
|
version 'v1', using: :path
|
||||||
format :json
|
format :json
|
||||||
|
@ -37,6 +38,7 @@ module Mobile
|
||||||
mount Apis::Watches
|
mount Apis::Watches
|
||||||
mount Apis::Upgrade
|
mount Apis::Upgrade
|
||||||
mount Apis::Homeworks
|
mount Apis::Homeworks
|
||||||
|
mount Apis::Comments
|
||||||
|
|
||||||
#add_swagger_documentation ({api_version: 'v1', base_path: 'http://u06.shellinfo.cn/trustie/api'})
|
#add_swagger_documentation ({api_version: 'v1', base_path: 'http://u06.shellinfo.cn/trustie/api'})
|
||||||
#add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?
|
#add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
#coding=utf-8
|
||||||
|
module Mobile
|
||||||
|
module Apis
|
||||||
|
class Comments < Grape::API
|
||||||
|
resource :comments do
|
||||||
|
desc '课程通知评论'
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
requires :comments, type: String
|
||||||
|
end
|
||||||
|
post ':id' do
|
||||||
|
cs = CommentService.new
|
||||||
|
cs_params = {
|
||||||
|
id: params[:id],
|
||||||
|
comment: params.reject{|k,v| [:id].include?(k)}}
|
||||||
|
comments = cs.news_comments cs_params,current_user
|
||||||
|
raise "create comments failed #{comments.errors.full_messages}" if comments.new_record?
|
||||||
|
present :data, comments, with: Mobile::Entities::Comment
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
|
desc '作业留言(教师布置的作业)'
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
requires :message,type: String, desc: '留言'
|
||||||
|
#optional :reference_content, type: String ,desc: '引用的内容'
|
||||||
|
#optional :reference_user_id, type: Integer,desc: '被引用的人'
|
||||||
|
end
|
||||||
|
post ':id/create_homework_message' do
|
||||||
|
cs_params = {
|
||||||
|
id: params[:id],
|
||||||
|
token: params[:token],
|
||||||
|
reference_content: params[:reference_content],
|
||||||
|
bid_message: params.reject{|k,v| [:id,:token,:reference_content].include?(k)}}
|
||||||
|
cs = CommentService.new
|
||||||
|
message = cs.homework_message cs_params,current_user
|
||||||
|
present :data, message, with: Mobile::Entities::Jours
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
|
desc '课程留言'
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
requires :course_message,type: String, desc: '留言'
|
||||||
|
end
|
||||||
|
post ':id/leave_course_message' do
|
||||||
|
cs_params = {
|
||||||
|
id: params[:id],
|
||||||
|
token: params[:token],
|
||||||
|
new_form: params.reject{|k,v| [:id,:token].include?(k)}}
|
||||||
|
cs = CommentService.new
|
||||||
|
message = cs.leave_course_message cs_params,current_user
|
||||||
|
present :data, message, with: Mobile::Entities::Jours
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
|
desc '回复留言'
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
requires :reference_id, type: Integer,desc: '所属留言树的根留言id(最顶层的非回复的留言,留言对象中的m_parent_id)'
|
||||||
|
requires :reference_user_id,type: Integer ,desc: '被回复的留言的作者id'
|
||||||
|
#requires :reference_message_id,type: Integer,desc: '被回复的留言的id'
|
||||||
|
requires :user_notes,type: String,desc: '留言的内容'
|
||||||
|
requires :jour_type,type: String,desc: '等于父留言的jour_type'
|
||||||
|
requires :jour_id,type:Integer, desc: '等于父留言的jour_id'
|
||||||
|
end
|
||||||
|
post ':reference_message_id/create_reply'do
|
||||||
|
cs = CommentService.new
|
||||||
|
message = cs.create_reply params,current_user
|
||||||
|
raise "create reply failed #{message.errors.full_messages}" if message.new_record?
|
||||||
|
present :data, message, with: Mobile::Entities::Jours
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -188,17 +188,18 @@ module Mobile
|
||||||
|
|
||||||
desc "课程通知列表"
|
desc "课程通知列表"
|
||||||
params do
|
params do
|
||||||
|
optional :token, type: String
|
||||||
end
|
end
|
||||||
get ":course_id/news" do
|
get ":course_id/news" do
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
news = cs.course_news_list params
|
news = cs.course_news_list params,current_user.nil? ? User.find(2):current_user
|
||||||
present :data, news, with: Mobile::Entities::News
|
present :data, news, with: Mobile::Entities::News
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "显示课程通知"
|
desc "显示课程通知"
|
||||||
params do
|
params do
|
||||||
|
optional :token, type: String
|
||||||
end
|
end
|
||||||
get "news/:id" do
|
get "news/:id" do
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
|
@ -208,6 +209,16 @@ module Mobile
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc '课程动态'
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
end
|
||||||
|
get "course_dynamic/:id" do
|
||||||
|
cs = CoursesService.new
|
||||||
|
count = cs.course_dynamic(params,current_user)
|
||||||
|
present :data, count, with: Mobile::Entities::CourseDynamic
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -70,6 +70,32 @@ module Mobile
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "作品打分"
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
requires :is_teacher, type: String,desc: '是否为教师(匿评作品详情返回的结果中可获取此参数的值)'
|
||||||
|
requires :is_anonymous_comments, type: String, desc: '是否为匿评(匿评作品详情返回的结果中可获取此参数的值)'
|
||||||
|
optional :stars_value, type: Integer,desc: '用户给出的评分'
|
||||||
|
optional :cur_page,type: Integer,desc: '匿评作品详情返回的结果中可获取此参数的值'
|
||||||
|
optional :cur_type, type: Integer,desc: '匿评作品详情返回的结果中可获取此参数的值'
|
||||||
|
optional :user_message, type: String, desc: '用户评论'
|
||||||
|
end
|
||||||
|
|
||||||
|
post ':homework_id/scoring' do
|
||||||
|
cs_params = {
|
||||||
|
new_form: params.reject{|k,v| [:token,:is_teacher,:is_anonymous_comments,:stars_value,:cur_page,:cur_type,:homework_id].include?(k)},
|
||||||
|
token: params[:token],
|
||||||
|
is_teacher: params[:is_teacher],
|
||||||
|
is_anonymous_comments: params[:is_anonymous_comments],
|
||||||
|
stars_value: params[:stars_value],
|
||||||
|
cur_page: params[:cur_page],
|
||||||
|
cur_type: params[:cur_type],
|
||||||
|
homework_id: params[:homework_id]
|
||||||
|
}
|
||||||
|
Homeworks.get_service.add_score_and_jour cs_params,current_user
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,13 +22,15 @@ module Mobile
|
||||||
|
|
||||||
desc "显示用户"
|
desc "显示用户"
|
||||||
params do
|
params do
|
||||||
|
requires :id, type: Integer
|
||||||
end
|
end
|
||||||
get ':id' do
|
route_param :id do
|
||||||
us = UsersService.new
|
get do
|
||||||
ue = us.show_user params
|
us = UsersService.new
|
||||||
present :data, ue,with: Mobile::Entities::User
|
ue = us.show_user params
|
||||||
present :status, 0
|
present :data, ue,with: Mobile::Entities::User
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "修改用户"
|
desc "修改用户"
|
||||||
|
@ -77,11 +79,12 @@ module Mobile
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "用户搜索"
|
desc "用户搜索"
|
||||||
params do
|
params do
|
||||||
requires :name, type: String, desc: '用户名关键字'
|
requires :name, type: String, desc: '用户名关键字'
|
||||||
|
requires :search_by, type: String,desc: '搜索依据:0 昵称,1 用户名,2 邮箱'
|
||||||
end
|
end
|
||||||
get 'search' do
|
get 'search/search_user' do
|
||||||
us = UsersService.new
|
us = UsersService.new
|
||||||
user = us.search_user params
|
user = us.search_user params
|
||||||
present :data, user, with: Mobile::Entities::User
|
present :data, user, with: Mobile::Entities::User
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
module Mobile
|
||||||
|
module Entities
|
||||||
|
class Comment < Grape::Entity
|
||||||
|
include Redmine::I18n
|
||||||
|
def self.comment_expose(field)
|
||||||
|
expose field do |f,opt|
|
||||||
|
if f.is_a?(Hash) && f.key?(field)
|
||||||
|
f[field]
|
||||||
|
elsif f.is_a?(::Comment)
|
||||||
|
if f.respond_to?(field)
|
||||||
|
if field == :created_on
|
||||||
|
format_time(f.send(field))
|
||||||
|
else
|
||||||
|
f.send(field)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
comment_expose :id
|
||||||
|
expose :author, using: Mobile::Entities::User do |c, opt|
|
||||||
|
if c.is_a? ::Comment
|
||||||
|
c.author
|
||||||
|
end
|
||||||
|
end
|
||||||
|
comment_expose :comments
|
||||||
|
comment_expose :created_on
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,17 @@
|
||||||
|
module Mobile
|
||||||
|
module Entities
|
||||||
|
class CourseDynamic < Grape::Entity
|
||||||
|
def self.course_dynamic_expose(field)
|
||||||
|
expose field do |c,opt|
|
||||||
|
c[field] if (c.is_a?(Hash) && c.key?(field))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
course_dynamic_expose :course_name
|
||||||
|
course_dynamic_expose :need_anonymous_comments_count
|
||||||
|
course_dynamic_expose :student_commit_number
|
||||||
|
course_dynamic_expose :news_count
|
||||||
|
course_dynamic_expose :message_count
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -17,6 +17,8 @@ module Mobile
|
||||||
case field
|
case field
|
||||||
when :homework_times
|
when :homework_times
|
||||||
f.bid.courses.first.homeworks.index(f.bid) + 1 unless (f.bid.nil? || f.bid.courses.nil? || f.bid.courses.first.nil?)
|
f.bid.courses.first.homeworks.index(f.bid) + 1 unless (f.bid.nil? || f.bid.courses.nil? || f.bid.courses.first.nil?)
|
||||||
|
when :comment_status
|
||||||
|
f.bid.comment_status
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -28,6 +30,8 @@ module Mobile
|
||||||
homework_attach_expose :homework_times
|
homework_attach_expose :homework_times
|
||||||
homework_attach_expose :description
|
homework_attach_expose :description
|
||||||
homework_attach_expose :created_at
|
homework_attach_expose :created_at
|
||||||
|
#comment_status 0:所属作业尚未开启匿评,1:匿评中 2:匿评结束
|
||||||
|
homework_attach_expose :comment_status
|
||||||
expose :attachments,using: Mobile::Entities::Attachment do |f, opt|
|
expose :attachments,using: Mobile::Entities::Attachment do |f, opt|
|
||||||
if f.respond_to?(:attachments)
|
if f.respond_to?(:attachments)
|
||||||
f.send(:attachments)
|
f.send(:attachments)
|
||||||
|
|
|
@ -18,12 +18,15 @@ module Mobile
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
jours_expose :id
|
jours_expose :id
|
||||||
|
jours_expose :jour_type
|
||||||
|
jours_expose :jour_id
|
||||||
expose :user,using: Mobile::Entities::User do |f, opt|
|
expose :user,using: Mobile::Entities::User do |f, opt|
|
||||||
f.user
|
f.user
|
||||||
end
|
end
|
||||||
jours_expose :created_on
|
jours_expose :created_on
|
||||||
jours_expose :notes
|
jours_expose :notes
|
||||||
jours_expose :m_reply_id
|
jours_expose :m_reply_id
|
||||||
|
jours_expose :m_parent_id
|
||||||
expose :reply_user,using: Mobile::Entities::User do |f, opt|
|
expose :reply_user,using: Mobile::Entities::User do |f, opt|
|
||||||
f.at_user
|
f.at_user
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,11 @@ module Mobile
|
||||||
#评论数量
|
#评论数量
|
||||||
news_expose :comments_count
|
news_expose :comments_count
|
||||||
#评论
|
#评论
|
||||||
news_expose :comments
|
expose :comments, using: Mobile::Entities::Comment do |f, opt|
|
||||||
|
if f.is_a?(Hash) && f.key?(:comments)
|
||||||
|
f[:comments]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -283,4 +283,43 @@ class AdminController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#企业主页定制
|
||||||
|
def enterprise_page_made
|
||||||
|
@enterprise_page = FirstPage.find_by_page_type('enterprise')
|
||||||
|
if @enterprise_page.nil?
|
||||||
|
@enterprise_page = FirstPage.new
|
||||||
|
@enterprise_page.page_type = 'enterprise'
|
||||||
|
end
|
||||||
|
if request.get?
|
||||||
|
@first_page = FirstPage.find_by_page_type('project')
|
||||||
|
elsif request.post?
|
||||||
|
@first_page = FirstPage.find_by_page_type('project')
|
||||||
|
@first_page.web_title = params[:web_title]
|
||||||
|
@enterprise_page.web_title = params[:web_title]
|
||||||
|
@enterprise_page.title = params[:course_title]
|
||||||
|
@enterprise_page.image_width = params[:image_width]
|
||||||
|
@enterprise_page.image_height = params[:image_height]
|
||||||
|
@enterprise_page.description = params[:course_description]
|
||||||
|
if @first_page.save && @enterprise_page.save
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
redirect_to enterprise_page_made_url
|
||||||
|
}
|
||||||
|
format.api { render_api_ok }
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_to do |format|
|
||||||
|
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@enterprise_page.errors.full_messages[0]}"
|
||||||
|
#flash.now[:error] = "#{l :label_first_page_create_fail}: #{@course_page.errors.full_messages[0]}"
|
||||||
|
format.html {
|
||||||
|
render :action => 'enterprise_page_made'
|
||||||
|
}
|
||||||
|
format.api { render_validation_errors(@first_page) }
|
||||||
|
format.api { render_validation_errors(@enterprise_page) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -254,8 +254,8 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
@result_count = @results.count
|
@result_count = @results.count
|
||||||
@results = paginateHelper @results
|
@results = paginateHelper @results, 10
|
||||||
|
@search_name = q
|
||||||
end
|
end
|
||||||
|
|
||||||
def addgroups
|
def addgroups
|
||||||
|
@ -428,17 +428,34 @@ class CoursesController < ApplicationController
|
||||||
# @results = paginateHelper @results@score_sort_by = "desc"
|
# @results = paginateHelper @results@score_sort_by = "desc"
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
@score_sort_by = params[:sort_by] if params[:sort_by]
|
@score_sort_by = params[:sort_by] if params[:sort_by]
|
||||||
|
@search_name = params[:search_name] if params[:search_name]
|
||||||
group_id = params[:group_id]
|
group_id = params[:group_id]
|
||||||
if group_id == '0'
|
if !@search_name.nil?
|
||||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
if group_id == '0'
|
||||||
@results = student_homework_score(0,page, 10,@score_sort_by)
|
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||||
|
|
||||||
@results = paginateHelper_for_members @results, 10
|
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name)
|
||||||
|
@result_count = @results.count
|
||||||
|
@results = paginateHelper @results, 10
|
||||||
|
else
|
||||||
|
@group = CourseGroup.find(group_id)
|
||||||
|
@results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name)
|
||||||
|
@result_count = @results.count
|
||||||
|
@results = paginateHelper @results, 10
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@group = CourseGroup.find(group_id)
|
if group_id == '0'
|
||||||
@results = student_homework_score(group_id, 0, 0,@score_sort_by)
|
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||||
@results = paginateHelper @results, 10
|
@results = student_homework_score(0,page, 10,@score_sort_by)
|
||||||
|
|
||||||
|
@results = paginateHelper_for_members @results, 10
|
||||||
|
else
|
||||||
|
@group = CourseGroup.find(group_id)
|
||||||
|
@results = student_homework_score(group_id, 0, 0,@score_sort_by)
|
||||||
|
@results = paginateHelper @results, 10
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
# 显示每个学生的作业评分详情
|
# 显示每个学生的作业评分详情
|
||||||
def show_member_score
|
def show_member_score
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
class OrganizationsController < ApplicationController
|
||||||
|
layout 'project_base'
|
||||||
|
def index
|
||||||
|
@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,6 +0,0 @@
|
||||||
class OriginizationsController < ApplicationController
|
|
||||||
layout 'project_base'
|
|
||||||
def index
|
|
||||||
@enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects")
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -20,11 +20,12 @@
|
||||||
class ProjectsController < ApplicationController
|
class ProjectsController < ApplicationController
|
||||||
layout :select_project_layout
|
layout :select_project_layout
|
||||||
|
|
||||||
menu_item :overview
|
menu_item :overview, :only => :show
|
||||||
menu_item :roadmap, :only => :roadmap
|
menu_item :roadmap, :only => :roadmap
|
||||||
menu_item :settings, :only => :settings
|
menu_item :settings, :only => :settings
|
||||||
menu_item :homework, :only => [:homework, :new_homework]
|
menu_item :homework, :only => [:homework, :new_homework]
|
||||||
menu_item :feedback, :only => :feedback
|
menu_item :feedback, :only => :feedback
|
||||||
|
menu_item :share, :only => :share
|
||||||
|
|
||||||
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join,
|
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join,
|
||||||
:course, :enterprise_course, :course_enterprise,:view_homework_attaches]
|
:course, :enterprise_course, :course_enterprise,:view_homework_attaches]
|
||||||
|
|
|
@ -25,17 +25,30 @@ class WelcomeController < ApplicationController
|
||||||
before_filter :entry_select, :only => [:index]
|
before_filter :entry_select, :only => [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
unless params[:originization].nil?
|
# 企业版定制: params[:project]为传过来的参数
|
||||||
@originization = params[:originization]
|
unless params[:organization].nil?
|
||||||
@originization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @originization])
|
@cur_projects = Project.find(params[:organization])
|
||||||
@e_count = @originization_projects.count
|
@organization = @cur_projects.enterprise_name
|
||||||
if @e_count < 10
|
@organization_projects = (current_user.admin? || User.current.member_of?(@cur_projects)) ? Project.where("enterprise_name =? ", @organization) : Project.all_public.where("enterprise_name =? ", @organization)
|
||||||
part_count = 10 -@e_count
|
@e_count = @organization_projects.count
|
||||||
# @part_projects = find_all_hot_project part_count, order
|
@part_projects = []
|
||||||
@part_projects = find_miracle_project(part_count, 3,"score desc")
|
# 取十个
|
||||||
limit = 10 - @e_count
|
@organization_projects.each do |obj|
|
||||||
|
break if(@organization_projects[10] == obj)
|
||||||
|
@part_projects << Project.visible.find_by_id("#{obj.id}") unless obj.id.nil?
|
||||||
end
|
end
|
||||||
|
# 不够十个的用最火项目替代
|
||||||
|
@e_count < 9 ? @part_projects = find_miracle_project( 9 - @e_count, 3,"score desc") : @part_projects
|
||||||
|
# 配置文件首页定制
|
||||||
|
@enterprise_page = FirstPage.find_by_page_type('enterprise')
|
||||||
|
if @enterprise_page.nil?
|
||||||
|
@enterprise_page = FirstPage.new
|
||||||
|
@enterprise_page.page_type = 'enterprise'
|
||||||
|
end
|
||||||
|
# 主页配置部分结束
|
||||||
|
|
||||||
end
|
end
|
||||||
|
# end 企业版定制结束
|
||||||
if @first_page.nil? || @first_page.sort_type.nil?
|
if @first_page.nil? || @first_page.sort_type.nil?
|
||||||
@projects = find_miracle_project(10, 3,"score desc")
|
@projects = find_miracle_project(10, 3,"score desc")
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,6 +7,7 @@ class ZipdownController < ApplicationController
|
||||||
SAVE_FOLDER = "#{Rails.root}/files"
|
SAVE_FOLDER = "#{Rails.root}/files"
|
||||||
OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip"
|
OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip"
|
||||||
|
|
||||||
|
|
||||||
def assort
|
def assort
|
||||||
if params[:obj_class] == "Bid"
|
if params[:obj_class] == "Bid"
|
||||||
bid = Bid.find params[:obj_id]
|
bid = Bid.find params[:obj_id]
|
||||||
|
|
|
@ -37,4 +37,27 @@ module ApiHelper
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#########################################################
|
||||||
|
#sw
|
||||||
|
#获取课程未匿评数量
|
||||||
|
#param: user => "用户", course_id => "查询的课程ID"
|
||||||
|
#return: 作业的数量
|
||||||
|
#########################################################
|
||||||
|
def get_course_anonymous_evaluation user,course
|
||||||
|
count = 0
|
||||||
|
if course
|
||||||
|
is_teacher = is_course_teacher user,course
|
||||||
|
if is_teacher #如果是老师,显示学生提交的作业数
|
||||||
|
course.homeworks.each do |bid|
|
||||||
|
count += bid.homeworks.count
|
||||||
|
end
|
||||||
|
else #如果是学生,显示未匿评的数量
|
||||||
|
course.homeworks.each do |bid|
|
||||||
|
count += get_student_not_batch_homework_list bid,user
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
[count,is_teacher]
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -130,4 +130,22 @@ module HomeworkAttachHelper
|
||||||
WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id} ORDER BY m_score DESC")
|
WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id} ORDER BY m_score DESC")
|
||||||
student_batch_homework_list
|
student_batch_homework_list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#########################################################
|
||||||
|
#sw
|
||||||
|
#获取学生未进行匿评的数量
|
||||||
|
#param: bid => 作业 user => 用户
|
||||||
|
#return 指定用户未进行匿评的作业的数量
|
||||||
|
#user必须是学生用户
|
||||||
|
#######################################################
|
||||||
|
def get_student_not_batch_homework_list bid,user
|
||||||
|
HomeworkAttach.find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
|
||||||
|
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1) AS t_score,
|
||||||
|
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
|
||||||
|
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{user.id} AND is_teacher_score = 0) AS m_score
|
||||||
|
FROM homework_attaches
|
||||||
|
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
|
||||||
|
WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id}) AS table1
|
||||||
|
WHERE table1.m_score IS NULL").count
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -93,7 +93,9 @@ class Bid < ActiveRecord::Base
|
||||||
# 'deadline'
|
# 'deadline'
|
||||||
def add_jour(user, notes, reference_user_id = 0, options = {})
|
def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||||
if options.count == 0
|
if options.count == 0
|
||||||
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
jfm = JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
||||||
|
self.journals_for_messages << jfm
|
||||||
|
jfm
|
||||||
else
|
else
|
||||||
jfm = self.journals_for_messages.build(options)
|
jfm = self.journals_for_messages.build(options)
|
||||||
jfm.save
|
jfm.save
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Forum < ActiveRecord::Base
|
||||||
|
|
||||||
acts_as_taggable
|
acts_as_taggable
|
||||||
scope :by_join_date, order("created_at DESC")
|
scope :by_join_date, order("created_at DESC")
|
||||||
after_create :send_email
|
#after_create :send_email
|
||||||
def reset_counters!
|
def reset_counters!
|
||||||
self.class.reset_counters!(id)
|
self.class.reset_counters!(id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,10 +50,15 @@ class Mailer < ActionMailer::Base
|
||||||
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
|
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
|
||||||
@issue_author_url = url_for(user_activities_url(@author))
|
@issue_author_url = url_for(user_activities_url(@author))
|
||||||
recipients ||= []
|
recipients ||= []
|
||||||
mems = memo.self_and_siblings
|
# if !memo.parent_id.nil?
|
||||||
mems.each do |mem|
|
# mems = memo.self_and_siblings
|
||||||
recipients << mem.author.mail unless recipients.include? mem.author.mail
|
# mems.each do |mem|
|
||||||
end
|
# recipients << mem.author.mail unless recipients.include? mem.author.mail
|
||||||
|
# end
|
||||||
|
# else
|
||||||
|
# recipients << memo.author.mail
|
||||||
|
# end
|
||||||
|
recipients << @author.mail
|
||||||
# cc = wiki_content.page.wiki.watcher_recipients - recipients
|
# cc = wiki_content.page.wiki.watcher_recipients - recipients
|
||||||
|
|
||||||
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
|
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
|
||||||
|
@ -98,10 +103,7 @@ class Mailer < ActionMailer::Base
|
||||||
#收件人邮箱
|
#收件人邮箱
|
||||||
@recipients ||= []
|
@recipients ||= []
|
||||||
@members.each do |teacher|
|
@members.each do |teacher|
|
||||||
|
|
||||||
@recipients << teacher.user.mail
|
@recipients << teacher.user.mail
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
mail :to => @recipients,
|
mail :to => @recipients,
|
||||||
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} "
|
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} "
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Memo < ActiveRecord::Base
|
||||||
"parent_id",
|
"parent_id",
|
||||||
"replies_count"
|
"replies_count"
|
||||||
|
|
||||||
after_create :add_author_as_watcher, :reset_counters!, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
|
after_create :add_author_as_watcher, :reset_counters! #, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分
|
||||||
# after_update :update_memos_forum
|
# after_update :update_memos_forum
|
||||||
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
|
after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分
|
||||||
# after_create :send_notification
|
# after_create :send_notification
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
class CommentService
|
||||||
|
#评论
|
||||||
|
def news_comments params,current_user
|
||||||
|
@news = News.find(params[:id])
|
||||||
|
@course = @news.course
|
||||||
|
if @course.nil?
|
||||||
|
raise 'news in unknown course'
|
||||||
|
end
|
||||||
|
raise Unauthorized unless @news.commentable?(current_user)
|
||||||
|
if current_user.nil? || !(current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course)))
|
||||||
|
raise '403'
|
||||||
|
end
|
||||||
|
@comment = Comment.new
|
||||||
|
@comment.send(:safe_attributes=,params[:comment],current_user)
|
||||||
|
@comment.author = current_user
|
||||||
|
@news.comments << @comment
|
||||||
|
@comment
|
||||||
|
end
|
||||||
|
|
||||||
|
#作业留言
|
||||||
|
def homework_message params,current_user
|
||||||
|
@bid = Bid.find(params[:id], :include => [{:homeworks => :user}])
|
||||||
|
if params[:bid_message][:message].size>0
|
||||||
|
if params[:reference_content]
|
||||||
|
message = params[:bid_message][:message] + "\n" + params[:reference_content]
|
||||||
|
else
|
||||||
|
message = params[:bid_message][:message]
|
||||||
|
@m = message
|
||||||
|
end
|
||||||
|
refer_user_id = params[:bid_message][:reference_user_id].to_i
|
||||||
|
jfm = @bid.add_jour(current_user, message, refer_user_id)
|
||||||
|
end
|
||||||
|
#@user = @bid.author
|
||||||
|
#@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||||
|
#@jour = paginateHelper @jours,10
|
||||||
|
@bid.set_commit(@feedback_count)
|
||||||
|
jfm
|
||||||
|
end
|
||||||
|
#课程留言接口
|
||||||
|
def leave_course_message params,current_user
|
||||||
|
message = params[:new_form][:course_message]
|
||||||
|
feedback = Course.add_new_jour(current_user, message, params[:id])
|
||||||
|
feedback
|
||||||
|
end
|
||||||
|
|
||||||
|
#回复留言接口
|
||||||
|
def create_reply params,current_user
|
||||||
|
# 这里是创建回复所使用的方法,此方法只针对回复,每一个新的留言并不在此方法管理范围内。
|
||||||
|
# 由于多个地方用到了留言,而之前的表设计也有jour_type/jour_id这类信息
|
||||||
|
# 所以在方法 add_reply_adapter 中判断所有调用此方法的来源页面,
|
||||||
|
# 为了保证兼容以往所有的代码,保证以往的方法可以调用,在返回页面中都做了各式各样的判断。
|
||||||
|
# 页面保证 render new_respond/journal_reply
|
||||||
|
# 修改 add_reply_adapter 中可以确保留言创建成功
|
||||||
|
# 删除留言功能要调用destroy,也记得在destroy.js中修改
|
||||||
|
|
||||||
|
# deny api. api useless
|
||||||
|
parent_id = params[:reference_id]
|
||||||
|
author_id = current_user.id
|
||||||
|
reply_user_id = params[:reference_user_id]
|
||||||
|
reply_id = params[:reference_message_id] # 暂时不实现
|
||||||
|
content = params[:user_notes]
|
||||||
|
jour_type = params[:jour_type]
|
||||||
|
jour_id = params[:jour_id]
|
||||||
|
@show_name = params[:show_name] == "true"
|
||||||
|
options = {
|
||||||
|
:jour_id => jour_id,
|
||||||
|
:jour_type => jour_type,
|
||||||
|
:user_id => author_id,
|
||||||
|
:status => true,
|
||||||
|
:m_parent_id => parent_id,
|
||||||
|
:m_reply_id => reply_id,
|
||||||
|
:reply_id => reply_user_id,
|
||||||
|
:notes => content,
|
||||||
|
:is_readed => false}
|
||||||
|
@jfm = ::JournalsForMessage.new(options)
|
||||||
|
#@save_succ = true if @jfm.errors.empty?
|
||||||
|
@jfm.save
|
||||||
|
@jfm
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -2,6 +2,7 @@ class CoursesService
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
include CoursesHelper
|
include CoursesHelper
|
||||||
include HomeworkAttachHelper
|
include HomeworkAttachHelper
|
||||||
|
include ApiHelper
|
||||||
#TODO:尚未整合权限系统
|
#TODO:尚未整合权限系统
|
||||||
#参数school_id为0或不传时返回所有课程,否则返回对应学校的课程
|
#参数school_id为0或不传时返回所有课程,否则返回对应学校的课程
|
||||||
#参数per_page_count分页功能,每页显示的课程数
|
#参数per_page_count分页功能,每页显示的课程数
|
||||||
|
@ -106,11 +107,14 @@ class CoursesService
|
||||||
end
|
end
|
||||||
|
|
||||||
#课程通知列表
|
#课程通知列表
|
||||||
def course_news_list params
|
def course_news_list params,current_user
|
||||||
if params[:course_id] && @course==nil
|
if params[:course_id] && @course==nil
|
||||||
@course = Course.find(params[:course_id])
|
@course = Course.find(params[:course_id])
|
||||||
end
|
end
|
||||||
scope = @course ? @course.news.course_visible : News.course_visible
|
if current_user.nil? || !(current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course)))
|
||||||
|
raise '403'
|
||||||
|
end
|
||||||
|
scope = @course ? @course.news.course_visible(current_user) : News.course_visible(current_user)
|
||||||
news = []
|
news = []
|
||||||
scope.each do |n|
|
scope.each do |n|
|
||||||
news << {:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count}
|
news << {:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count}
|
||||||
|
@ -128,9 +132,16 @@ class CoursesService
|
||||||
#显示课程通知(包括评论) 需验证权限
|
#显示课程通知(包括评论) 需验证权限
|
||||||
def show_course_news params,current_user
|
def show_course_news params,current_user
|
||||||
@news = News.find(params[:id])
|
@news = News.find(params[:id])
|
||||||
|
@course = @news.course
|
||||||
|
if @course
|
||||||
|
if current_user.nil? || !(current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course)))
|
||||||
|
raise '403'
|
||||||
|
end
|
||||||
|
end
|
||||||
@comments = @news.comments
|
@comments = @news.comments
|
||||||
@comments.reverse! if current_user.wants_comments_in_reverse_order?
|
@comments.reverse! if current_user.wants_comments_in_reverse_order?
|
||||||
{:news => @news,:comments => @comments}
|
{:news => @news,:comments => @comments}
|
||||||
|
|
||||||
#comments = []
|
#comments = []
|
||||||
#@comments.each do |comment|
|
#@comments.each do |comment|
|
||||||
# comments << {:author_id => comment.author_id,:author_name => comment.author.name,:commont_content => comment.comments,:time => format_time(comment.created_on)}
|
# comments << {:author_id => comment.author_id,:author_name => comment.author.name,:commont_content => comment.comments,:time => format_time(comment.created_on)}
|
||||||
|
@ -316,6 +327,22 @@ class CoursesService
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def course_dynamic(params,current_user)
|
||||||
|
course = Course.find(params[:id])
|
||||||
|
if current_user.nil? || !(current_user.admin? || course.is_public == 1 || (course.is_public == 0 && current_user.member_of_course?(course)))
|
||||||
|
raise '403'
|
||||||
|
end
|
||||||
|
count,is_teacher = get_course_anonymous_evaluation current_user,course
|
||||||
|
if is_teacher
|
||||||
|
student_commit_number = count
|
||||||
|
else
|
||||||
|
need_anonymous_comments_count = count
|
||||||
|
end
|
||||||
|
news_count = course.news.count
|
||||||
|
message_count = course.journals_for_messages.count
|
||||||
|
{:course_name => course.name,:need_anonymous_comments_count=>need_anonymous_comments_count,:student_commit_number=>student_commit_number,:news_count=> news_count,:message_count=>message_count}
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def show_homework_info course,bid,current_user,is_course_teacher
|
def show_homework_info course,bid,current_user,is_course_teacher
|
||||||
author = bid.author.lastname + bid.author.firstname
|
author = bid.author.lastname + bid.author.firstname
|
||||||
|
@ -351,4 +378,6 @@ class CoursesService
|
||||||
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation}
|
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -141,16 +141,51 @@ class HomeworkService
|
||||||
end
|
end
|
||||||
|
|
||||||
#作品打分/留言
|
#作品打分/留言
|
||||||
def add_score_and_jour params
|
def add_score_and_jour params,current_user
|
||||||
@is_teacher,@is_anonymous_comments,@m_score = params[:is_teacher]=="true",params[:is_anonymous_comments]=="true",params[:stars_value]
|
@is_teacher,@is_anonymous_comments,@m_score = params[:is_teacher]=="true",params[:is_anonymous_comments]=="true",params[:stars_value]
|
||||||
@cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5
|
@cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5
|
||||||
@homework = HomeworkAttach.find(params[:homework_id])
|
@homework = HomeworkAttach.find(params[:homework_id])
|
||||||
|
comment_status = @homework.bid.comment_status
|
||||||
|
if @is_anonymous_comments && comment_status == 0
|
||||||
|
raise '尚未开启匿评!'
|
||||||
|
end
|
||||||
|
if @is_anonymous_comments && ((@m_score.nil? || @m_score.blank?) || !(params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""))
|
||||||
|
raise '您尚未打分或评论!'
|
||||||
|
end
|
||||||
#保存评分
|
#保存评分
|
||||||
@homework.rate(@m_score.to_i,User.current.id,:quality) if @m_score
|
homework = @homework
|
||||||
|
is_teacher = @is_teacher ? 1 : 0
|
||||||
|
#保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0))
|
||||||
|
if @m_score
|
||||||
|
rate = @homework.rates(:quality).where(:rater_id => current_user.id, :is_teacher_score => is_teacher).first
|
||||||
|
if rate
|
||||||
|
rate.stars = @m_score
|
||||||
|
rate.save!
|
||||||
|
else
|
||||||
|
@homework.rates(:quality).new(:stars => @m_score, :rater_id => current_user.id, :is_teacher_score => is_teacher).save!
|
||||||
|
end
|
||||||
|
|
||||||
|
if homework.is_teacher_score == 0
|
||||||
|
if is_teacher == 1
|
||||||
|
homework.score = @m_score
|
||||||
|
homework.is_teacher_score = 1
|
||||||
|
else
|
||||||
|
sql = "SELECT AVG(stars) as stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id}"
|
||||||
|
score= HomeworkAttach.find_by_sql(sql).first.stars
|
||||||
|
homework.score = score
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if is_teacher == 1
|
||||||
|
homework.score = @m_score
|
||||||
|
homework.is_teacher_score = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
homework.save!
|
||||||
|
end
|
||||||
#保存评论
|
#保存评论
|
||||||
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
|
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
|
||||||
if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言
|
if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言
|
||||||
@homework.addjours User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation
|
@homework.addjours current_user.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, class: "#{current_page?(course_page_made_path)? 'selected' : nil }" %></li>
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, class: "#{current_page?(course_page_made_path)? 'selected' : nil }" %></li>
|
||||||
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'}, class: "#{current_page?(contest_page_made_path)? 'selected' : nil }" %></li>
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'}, class: "#{current_page?(contest_page_made_path)? 'selected' : nil }" %></li>
|
||||||
<li><%= link_to l(:label_web_footer_page), {:action => 'web_footer_made'}, class: "#{current_page?(web_footer_made_path)? 'selected' : nil }" %></li>
|
<li><%= link_to l(:label_web_footer_page), {:action => 'web_footer_made'}, class: "#{current_page?(web_footer_made_path)? 'selected' : nil }" %></li>
|
||||||
|
<li><%= link_to l(:label_enterprise_page_made), {:action => 'enterprise_page_made'}, class: "#{current_page?(enterprise_page_made_path)? 'selected' : nil }" %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'enterprise_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<%= render 'tab_partial' %>
|
||||||
|
<h4><%=l(:label_enterprise_page_made)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@enterprise_page} %>
|
||||||
|
</div>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='image_width' style="vertical-align: top"> <%= l(:label_image_width)%>:</label>
|
||||||
|
<%= text_field_tag 'image_width', params[:label_image_width],:value => @enterprise_page.image_width,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='image_height' style="vertical-align: top"> <%= l(:label_imgae_height)%>:</label>
|
||||||
|
<%= text_field_tag 'image_height', params[:label_imgae_height], :value => @enterprise_page.image_height,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'course_title', params[:label_site_title], :value => @enterprise_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'course_description',@enterprise_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -1,14 +1,21 @@
|
||||||
<div class="attachments" style="font-weight:normal;">
|
<div class="attachments" style="font-weight:normal;">
|
||||||
|
<% is_float ||= false %>
|
||||||
<% for attachment in attachments %>
|
<% for attachment in attachments %>
|
||||||
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||||
<span title="<%= attachment.filename%>" id = "attachment_">
|
<%if is_float%>
|
||||||
<% if options[:length] %>
|
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
|
||||||
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
|
<% end%>
|
||||||
<% else %>
|
<span title="<%= attachment.filename%>" id = "attachment_">
|
||||||
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
<% if options[:length] %>
|
||||||
<% end %>
|
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<%if is_float%>
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
</span>
|
|
||||||
<% if attachment.is_text? %>
|
<% if attachment.is_text? %>
|
||||||
<%= link_to image_tag('magnifier.png'),
|
<%= link_to image_tag('magnifier.png'),
|
||||||
:controller => 'attachments',
|
:controller => 'attachments',
|
||||||
|
@ -19,8 +26,9 @@
|
||||||
<span title="<%= attachment.description%>">
|
<span title="<%= attachment.description%>">
|
||||||
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
|
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
|
||||||
</span>
|
</span>
|
||||||
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
<span class="size">(
|
||||||
|
<%= number_to_human_size attachment.filesize %>)
|
||||||
|
</span>
|
||||||
<% if options[:deletable] %>
|
<% if options[:deletable] %>
|
||||||
<% if attachment.container_type == 'HomeworkAttach' %>
|
<% if attachment.container_type == 'HomeworkAttach' %>
|
||||||
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
|
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
|
||||||
|
@ -39,8 +47,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if options[:wrap] %>
|
<% if options[:wrap] %>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if options[:author] %>
|
<% if options[:author] %>
|
||||||
<span class="author" title="<%= attachment.author%>">
|
<span class="author" title="<%= attachment.author%>">
|
||||||
|
|
|
@ -136,34 +136,35 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<span style="color: red"><%= l(:label_noawards_current) %></span>
|
<span style="color: red"><%= l(:label_noawards_current) %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% case get_prize(c_project) %>
|
<% case get_prize(c_project) %>
|
||||||
<% when '-1' %>
|
<% when '-1' %>
|
||||||
<%= image_tag("/images/bid/special_reward.png") %>
|
<%= image_tag("/images/bid/special_reward.png") %>
|
||||||
<% when '0' %>
|
<% when '0' %>
|
||||||
<%= image_tag("/images/bid/first_reward.png") %>
|
<%= image_tag("/images/bid/first_reward.png") %>
|
||||||
<% when '1' %>
|
<% when '1' %>
|
||||||
<%= image_tag("/images/bid/second_reward.png") %>
|
<%= image_tag("/images/bid/second_reward.png") %>
|
||||||
<% when '2' %>
|
<% when '2' %>
|
||||||
<%= image_tag("/images/bid/third_reward.png") %>
|
<%= image_tag("/images/bid/third_reward.png") %>
|
||||||
<% when '3' %>
|
<% when '3' %>
|
||||||
<%= image_tag("/images/bid/forth_reward.png") %>
|
<%= image_tag("/images/bid/forth_reward.png") %>
|
||||||
<% when '4' %>
|
<% when '4' %>
|
||||||
<%= image_tag("/images/bid/fifth_reward.png") %>
|
<%= image_tag("/images/bid/fifth_reward.png") %>
|
||||||
<% when '5' %>
|
<% when '5' %>
|
||||||
<%= image_tag("/images/bid/qualified.png") %>
|
<%= image_tag("/images/bid/qualified.png") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<!-- 评价显隐控制按钮-->
|
<!-- 评价显隐控制按钮-->
|
||||||
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
|
<% if ((User.current.id == @contest.author_id) && (@contest.deadline >= Date.today))||User.current.admin %>
|
||||||
<td valign="top" align="right" width="10%">
|
<td valign="top" align="right" width="10%">
|
||||||
|
|
||||||
<span> <%= toggle_link l(:label_reward), c_project.id.to_s %></span>
|
<span> <%= toggle_link l(:label_reward), c_project.id.to_s %></span>
|
||||||
<!-- 评价应标项目的表单 -->
|
<!-- 评价应标项目的表单 -->
|
||||||
<span style="display: none; vertical-align: top " id='<%= c_project.id %>'>
|
<span style="display: none; vertical-align: top " id='<%= c_project.id %>'>
|
||||||
<%= form_for "set_reward_project", :remote => true, :url => set_reward_project_contest_path do |f| %>
|
<%= form_for "set_reward_project", :remote => true, :url => set_reward_project_contest_path do |f| %>
|
||||||
<%= f.text_field :c_id, :style => "display:none", :value => c_project.id, :size => "0" %>
|
<%= f.text_field :c_id, :style => "display:none", :value => c_project.id, :size => "0" %>
|
||||||
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
|
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
|
||||||
|
@ -176,8 +177,9 @@
|
||||||
<%= f.submit :value => l(:button_submit), :class => "submit" %>
|
<%= f.submit :value => l(:button_submit), :class => "submit" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
|
||||||
<% end %>
|
</td>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -282,7 +284,7 @@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<!-- 评价显隐控制按钮-->
|
<!-- 评价显隐控制按钮-->
|
||||||
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
|
<% if ((User.current.id == @contest.author_id) && (@contest.deadline >= Date.today))||User.current.admin %>
|
||||||
<div style="text-align: right;width: 100%;">
|
<div style="text-align: right;width: 100%;">
|
||||||
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
|
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
|
||||||
<!-- 评价应标项目的表单 -->
|
<!-- 评价应标项目的表单 -->
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<div class="st_box">
|
<div class="st_box">
|
||||||
<ul class="st_box_top" style="margin-left: 17px;">
|
<ul class="st_box_top" style="margin-left: 17px;">
|
||||||
<% if @subPage_title == l(:label_student_list) %>
|
<% if @subPage_title == l(:label_student_list) %>
|
||||||
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0)) ,:result => members,method: 'get', remote: true%>
|
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
|
||||||
<% if @score_sort_by == 'desc' %>
|
<% if @score_sort_by == 'desc' %>
|
||||||
<a id="pic" href="#" class= "st_down"></a>
|
<a id="pic" href="#" class= "st_down"></a>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container" id="content">
|
||||||
<div class="Newwork">
|
<div class="Newwork">
|
||||||
<div id="tb_" class="tb_">
|
<div id="tb_" class="tb_">
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -75,7 +75,6 @@
|
||||||
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
|
||||||
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
|
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
|
||||||
</p>
|
</p>
|
||||||
<div class="cl"></div>
|
|
||||||
<p>
|
<p>
|
||||||
<label style="float: left;">
|
<label style="float: left;">
|
||||||
添加附件 :
|
添加附件 :
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
function submit_homework_form(){if(regexName()&®exDescription()){$('#new_homework_attach').submit();}}
|
function submit_homework_form(){if(regexName()&®exDescription()){$('#new_homework_attach').submit();}}
|
||||||
</script>
|
</script>
|
||||||
<div class="container">
|
<div class="container" id="content">
|
||||||
<div class="Newwork">
|
<div class="Newwork">
|
||||||
<div id="tb_" class="tb_">
|
<div id="tb_" class="tb_">
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -82,9 +82,6 @@
|
||||||
<br />
|
<br />
|
||||||
<span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
<span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
||||||
</p>
|
</p>
|
||||||
<br/> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<p>
|
<p>
|
||||||
<label style="float: left;">
|
<label style="float: left;">
|
||||||
添加附件 :
|
添加附件 :
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
html{ overflow-x:hidden;}
|
html{ overflow-x:hidden;}
|
||||||
.custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;}
|
.custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;}
|
||||||
.scrollsidebar{position:absolute; z-index:999; top:150px;}
|
.scrollsidebar{position:absolute; z-index:999; top:150px;background:none !important;}
|
||||||
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
|
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
|
||||||
.side_content .side_list {width:154px;overflow:hidden;}
|
.side_content .side_list {width:154px;overflow:hidden;}
|
||||||
.show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}
|
.show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
<p>
|
<p>
|
||||||
<% if @memo.attachments.any?%>
|
<% if @memo.attachments.any?%>
|
||||||
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
|
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
|
||||||
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options} %>
|
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
<p>
|
<p>
|
||||||
<% if reply.attachments.any?%>
|
<% if reply.attachments.any?%>
|
||||||
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
|
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
|
||||||
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %>
|
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options, :is_float => true} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<title><%= l(:label_all_enterprises) %></title>
|
||||||
|
<div class="content_syqy">
|
||||||
|
<div class="list"><%= l(:label_all_enterprises) %></div>
|
||||||
|
<div class="syqy_box">
|
||||||
|
<% if @projects.count == 0 %>
|
||||||
|
<h3><%= l(:label_enterprise_nil) %></h3>
|
||||||
|
<% else %>
|
||||||
|
<% @projects.each do |organization| %>
|
||||||
|
<% unless organization.enterprise_name.blank? %>
|
||||||
|
<ul>
|
||||||
|
<li ><img src="/images/organization_logo.jpg" width="30" height="30" alt="#{project.enterprise_name}" />
|
||||||
|
<%= link_to organization.enterprise_name, home_path(:organization => organization) %></li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="clear: both"></div>
|
||||||
|
<div class="school-index">
|
||||||
|
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||||
|
</div>
|
||||||
|
<% html_title(l(:label_enterprise_all)) -%>
|
|
@ -1,25 +0,0 @@
|
||||||
<div class="enterprise_all">
|
|
||||||
<p>
|
|
||||||
<%= link_to l(:label_all_enterprises) %>
|
|
||||||
<p>
|
|
||||||
<p>
|
|
||||||
<% if @enterprises.count == 0 %>
|
|
||||||
<h3><%= l(:label_enterprise_nil) %></h3>
|
|
||||||
<% else %>
|
|
||||||
<% @enterprises.each do |enterprise| %>
|
|
||||||
<% unless enterprise.enterprise_name.blank? %>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<%= link_to enterprise.enterprise_name, home_path(:originization => enterprise.enterprise_name) %>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
<div class="school-index">
|
|
||||||
<ul id="schoollist" style="line-height: 25px"></ul>
|
|
||||||
</div>
|
|
||||||
<% html_title(l(:label_enterprise_all)) -%>
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
function close_alert_form(){hideModal("#alert_form");}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="alert_form">
|
||||||
|
<div class="upload_con">
|
||||||
|
<div class="polls_alert_upload_box">
|
||||||
|
<p class="polls_alert_box_p">
|
||||||
|
<%= message%>
|
||||||
|
</p>
|
||||||
|
<div class="polls_alert_btn_box">
|
||||||
|
<a class="upload_btn" onclick="close_alert_form();">
|
||||||
|
确 定
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% else%>
|
<% else%>
|
||||||
<li class="pollsbtn fl ml10 pollsbtn_grey">
|
<li class="pollsbtn fl ml10 pollsbtn_grey" style="margin-left: 5px;" >
|
||||||
发布问卷
|
发布问卷
|
||||||
</li>
|
</li>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
|
@ -1,2 +1,10 @@
|
||||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||||
alert("发布成功");
|
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||||
|
showModal('ajax-modal', '180px');
|
||||||
|
$('#ajax-modal').css('height','111px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
|
"<a href='#' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -1,2 +1,10 @@
|
||||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||||
alert("取消成功");
|
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||||
|
showModal('ajax-modal', '180px');
|
||||||
|
$('#ajax-modal').css('height','80px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
|
"<a href='#' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -158,14 +158,14 @@
|
||||||
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
|
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block; float: right; margin-top: 0px">
|
<!--<div style="display: inline-block; float: right; margin-top: 0px">-->
|
||||||
<span>
|
<!--<span>-->
|
||||||
<%= link_to l(:label_find_all_comments), respond_path(e.act_id) %>
|
<!--<%#= link_to l(:label_find_all_comments), respond_path(e.act_id) %>-->
|
||||||
</span>
|
<!--</span>-->
|
||||||
<a class="font_lighter">
|
<!--<a class="font_lighter">-->
|
||||||
<%= l(:label_comments_count, :count => e.act.commit) %>
|
<!--<%#= l(:label_comments_count, :count => e.act.commit) %>-->
|
||||||
</a>
|
<!--</a>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% when 'Journal' %>
|
<% when 'Journal' %>
|
||||||
|
|
|
@ -61,6 +61,7 @@ form #search_by
|
||||||
.search_widget{
|
.search_widget{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
.search_widget:hover{
|
.search_widget:hover{
|
||||||
box-shadow: 0px 0px 3px #56B4EF;
|
box-shadow: 0px 0px 3px #56B4EF;
|
||||||
|
@ -87,14 +88,13 @@ form #search_by
|
||||||
</script>
|
</script>
|
||||||
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
|
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
|
||||||
<div class="project-search" style="float: right">
|
<div class="project-search" style="float: right">
|
||||||
|
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil,:style =>"float: right; margin-left:3px;margin-top:2px" %>
|
||||||
<div class='search_widget' >
|
<div class='search_widget' >
|
||||||
|
|
||||||
<%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), style:"float:left;" %>
|
<%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), style:"float:left;" %>
|
||||||
<input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0">
|
<input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0">
|
||||||
<%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %>
|
<%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %>
|
||||||
<%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right" ) %>
|
<%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right" ) %>
|
||||||
</div>
|
</div>
|
||||||
<%#= hidden_field_tag 'project_type', project_type %>
|
<%#= hidden_field_tag 'project_type', project_type %>
|
||||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil,:style =>"float: right; margin-left:3px;margin-top:2px" %>
|
</div>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -31,26 +31,29 @@
|
||||||
<div class="main-content-bar" id="main-content-bar">
|
<div class="main-content-bar" id="main-content-bar">
|
||||||
<div style="float: left;padding-left:15px ">
|
<div style="float: left;padding-left:15px ">
|
||||||
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
||||||
<% if @enterprise.nil? %>
|
<% if @organization.nil? %>
|
||||||
<% if get_avatar?(@first_page) %>
|
<% if get_avatar?(@first_page) %>
|
||||||
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag '/images/avatars/Project/0', width:@first_page.image_width,height: @first_page.image_height %>
|
<%= image_tag(url_to_avatar(@enterprise_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="welcome_left" id="welcome_left">
|
<div class="welcome_left" id="welcome_left">
|
||||||
<% if @enterprise.nil? %>
|
<% if @organization.nil? %>
|
||||||
<% unless @first_page.nil? %>
|
<% unless @first_page.nil? %>
|
||||||
<%= @first_page.description.html_safe %>
|
<%= @first_page.description.html_safe %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<span class="font_welcome_school" style="color: #E8770D">
|
||||||
<span class="font_welcome_school" style="color: #E8770D"> <%= link_to @enterprise, options={:action => 'index', :enterprise => @enterprise}, html_options={ :method => 'get', :style => "color: #E8770D"} %> </span>
|
<%= @organization %>
|
||||||
<br/>
|
</span>
|
||||||
<span class="font_welcome_trustie"> <%= @first_page.title %> </span>
|
<br/>
|
||||||
|
<span class="font_welcome_trustie">
|
||||||
|
<%= @enterprise_page.title %>
|
||||||
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-bar" id="search-bar">
|
<div class="search-bar" id="search-bar">
|
||||||
|
@ -77,22 +80,22 @@
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<!-- 如果企业版参数正确,这进入企业版页面 -->
|
<!-- 如果企业版参数正确,这进入企业版页面 -->
|
||||||
<% if @originization.nil? %>
|
<% if @organization.nil? %>
|
||||||
<% @projects.map do |project| %>
|
<% @projects.map do |project| %>
|
||||||
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
<!-- 企业版项目 -->
|
<!-- 企业版项目 -->
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @e_count == 0 %>
|
<% if @e_count == 0 %>
|
||||||
<p id="errorExplanation"><%= l(:label_enterprise_tips) %></p>
|
<div id="flash_notice" class="flash notice"><%= l(:label_enterprise_tips) %></div>
|
||||||
<% @projects.map do |project| %>
|
<% @projects.map do |project| %>
|
||||||
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif @e_count < 10 %>
|
<% elsif @e_count < 10 %>
|
||||||
<% @originization_projects.map do |project| %>
|
<% @organization_projects.map do |project| %>
|
||||||
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p id="errorExplanation"><%= l(:label_part_enterprise_tips) %></p>
|
<div id="flash_notice" class="flash notice"><%= l(:label_part_enterprise_tips) %></div>
|
||||||
<% @part_projects.map do |project| %>
|
<% @part_projects.map do |project| %>
|
||||||
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -39,7 +39,8 @@ module RedmineApp
|
||||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||||
|
|
||||||
# Activate observers that should always be running.
|
# Activate observers that should always be running.
|
||||||
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
|
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer,
|
||||||
|
:document_observer, :wiki_content_observer, :comment_observer, :forum_observer, :memo_observer
|
||||||
|
|
||||||
config.active_record.store_full_sti_class = true
|
config.active_record.store_full_sti_class = true
|
||||||
config.active_record.default_timezone = :local
|
config.active_record.default_timezone = :local
|
||||||
|
|
|
@ -1549,7 +1549,7 @@ en:
|
||||||
label_project_deposit: Projects
|
label_project_deposit: Projects
|
||||||
label_course_practice: Courses
|
label_course_practice: Courses
|
||||||
label_forum_all: Forums
|
label_forum_all: Forums
|
||||||
label_school_all: Schools
|
# label_school_all: Schools
|
||||||
label_contest_innovate: Competition community
|
label_contest_innovate: Competition community
|
||||||
label_software_user: Users
|
label_software_user: Users
|
||||||
label_requirement_enterprise: Requirements
|
label_requirement_enterprise: Requirements
|
||||||
|
@ -1875,7 +1875,4 @@ en:
|
||||||
label_anonymous: Anonymous
|
label_anonymous: Anonymous
|
||||||
label_submit_comments: Submit_comments
|
label_submit_comments: Submit_comments
|
||||||
label_course_empty_select: You have not selected course!
|
label_course_empty_select: You have not selected course!
|
||||||
|
label_enterprise_page_made: enterprise_page
|
||||||
|
|
||||||
|
|
||||||
field_enterprise_name: enterprise name
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ zh:
|
||||||
label_course_closed_tips: "确定要%{desc}课程?"
|
label_course_closed_tips: "确定要%{desc}课程?"
|
||||||
# end
|
# end
|
||||||
field_name: 名称
|
field_name: 名称
|
||||||
field_enterprise_name: 企业名
|
field_enterprise_name: 组织名称
|
||||||
#added by huang
|
#added by huang
|
||||||
field_tea_name: 教师
|
field_tea_name: 教师
|
||||||
field_couurse_time: 学时
|
field_couurse_time: 学时
|
||||||
|
@ -358,6 +358,7 @@ zh:
|
||||||
label_project_first_page: 项目托管平台首页
|
label_project_first_page: 项目托管平台首页
|
||||||
label_course_first_page: 课程实践平台首页
|
label_course_first_page: 课程实践平台首页
|
||||||
label_contest_first_page: 竞赛实战平台首页
|
label_contest_first_page: 竞赛实战平台首页
|
||||||
|
label_enterprise_page_made: 在线协同开发社区首页
|
||||||
label_web_footer_page: 网站页脚配置
|
label_web_footer_page: 网站页脚配置
|
||||||
label_organizer_name: 主办单位名称
|
label_organizer_name: 主办单位名称
|
||||||
label_web_footer_description: 页脚内容
|
label_web_footer_description: 页脚内容
|
||||||
|
@ -1992,6 +1993,7 @@ zh:
|
||||||
review_assignments: 评审任务
|
review_assignments: 评审任务
|
||||||
label_my_school: 我的学校
|
label_my_school: 我的学校
|
||||||
label_all_schol: 全部学校
|
label_all_schol: 全部学校
|
||||||
|
label_school_all: 中国高校
|
||||||
label_select_province: 请选择省份
|
label_select_province: 请选择省份
|
||||||
label_search_conditions_not_null: 搜索条件不能为空
|
label_search_conditions_not_null: 搜索条件不能为空
|
||||||
|
|
||||||
|
@ -2056,6 +2058,7 @@ zh:
|
||||||
label_poll_result: 问卷调查_问卷统计
|
label_poll_result: 问卷调查_问卷统计
|
||||||
label_answer: 答案:
|
label_answer: 答案:
|
||||||
label_poll_answer_valid_result: 以上为有效问答题答案!
|
label_poll_answer_valid_result: 以上为有效问答题答案!
|
||||||
|
label_poll_republish_success: 取消成功
|
||||||
label_answer_total: 总计:
|
label_answer_total: 总计:
|
||||||
label_join_project: 加入项目
|
label_join_project: 加入项目
|
||||||
label_technical_support: 技术支持:
|
label_technical_support: 技术支持:
|
||||||
|
@ -2113,9 +2116,9 @@ zh:
|
||||||
# 项目企业模块
|
# 项目企业模块
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
label_all_enterprises: 所有企业
|
label_all_enterprises: 所有组织
|
||||||
label_my_enterprise: 我的企业
|
label_my_enterprise: 我的企业
|
||||||
label_enterprise_tips: 暂时还没有该企业对应的项目,系统的其它项目您可能会感兴趣!
|
label_enterprise_tips: 该组织暂时还没创建公开项目,您可能会对系统的其它项目感兴趣!
|
||||||
label_part_enterprise_tips: 系统的其它项目您可能也会感兴趣!
|
label_part_enterprise_tips: 您可能对系统的其它项目感兴趣!
|
||||||
label_enterprise_nil: 该模块为最新上线模块,目前还未有项目关联到企业!
|
label_enterprise_nil: 该模块为最新上线模块,目前还没有创建企业项目!
|
||||||
label_enterprises: 名企
|
label_enterprises: 组织
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
# Example: :via => :get ====> :via => :get
|
# Example: :via => :get ====> :via => :get
|
||||||
|
|
||||||
RedmineApp::Application.routes.draw do
|
RedmineApp::Application.routes.draw do
|
||||||
get "originizations/index"
|
get "organizations/index"
|
||||||
|
|
||||||
#match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index'
|
#match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index'
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
|
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
|
||||||
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
||||||
match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get
|
match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get
|
||||||
match 'originizations', :to => 'originizations#index', :as => 'index', :via => :get
|
match 'organizations', :to => 'organizations#index', :as => 'index', :via => :get
|
||||||
|
|
||||||
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
||||||
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
||||||
|
@ -640,6 +640,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'admin/course_page_made', as: :course_page_made
|
match 'admin/course_page_made', as: :course_page_made
|
||||||
match 'admin/contest_page_made', as: :contest_page_made
|
match 'admin/contest_page_made', as: :contest_page_made
|
||||||
match 'admin/web_footer_made', as: :web_footer_made
|
match 'admin/web_footer_made', as: :web_footer_made
|
||||||
|
match 'admin/enterprise_page_made', as: :enterprise_page_made
|
||||||
match 'admin/search', :via => [:get, :post]
|
match 'admin/search', :via => [:get, :post]
|
||||||
match 'admin/plugins', :via => :get
|
match 'admin/plugins', :via => :get
|
||||||
match 'admin/info', :via => :get
|
match 'admin/info', :via => :get
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3cabcc643f36939939685e6f55273dfbf89da545
|
Subproject commit 222a9bdd72014f197baf2131ab71cc41660111ed
|
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
|
@ -8,6 +8,15 @@ h3, .wiki h2 {font-size: 15px; padding-left: 5px}
|
||||||
h4, .wiki h3 {font-size: 13px;}
|
h4, .wiki h3 {font-size: 13px;}
|
||||||
h4 {border-bottom: 1px dotted #bbb;}
|
h4 {border-bottom: 1px dotted #bbb;}
|
||||||
/*huang*/
|
/*huang*/
|
||||||
|
/*企业版样式*/
|
||||||
|
.content_syqy{ width:940px; height:400px; border:1px;}
|
||||||
|
.content_syqy .list{ font-size:14px; font-weight:normal; margin-left:10px; font-weight:bold; padding-top:10px}
|
||||||
|
.syqy_box{ margin-left:-30px; margin-top:5px;}
|
||||||
|
.syqy_box ul li{ float:left; margin-right:10px; border:1px solid #e3e3e3; width:215px; height:30px; padding:5px; padding-right:0px; margin-bottom:10px; overflow:hidden; text-overflow:ellipsis;font-size:14px; color:#464646;white-space: nowrap; }
|
||||||
|
.syqy_box ul li img{ float:left; margin-right:3px; }
|
||||||
|
.syqy_box ul li a { float:left;font-size:14px; color:#464646; height:30px; padding-top:4px; width: 175px; overflow:hidden; text-overflow:ellipsis;}
|
||||||
|
.syqy_box ul li a:hover{color:#15bccf;}
|
||||||
|
a.syqy_wenzi{ padding-bottom:10px; border:1px solid red;}
|
||||||
/*current position*/
|
/*current position*/
|
||||||
.enterprise_all{
|
.enterprise_all{
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* CSS Document */
|
/* CSS Document */
|
||||||
#content{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
|
#content,#popbox,#popbox02{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
|
||||||
#popbox{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
|
|
||||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
|
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
|
||||||
div,img,tr,td,textarea{ border:0;}
|
div,img,tr,td,textarea{ border:0;}
|
||||||
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||||
|
|
|
@ -145,3 +145,9 @@ a:hover.btn_pu{ background:#3cb761;}
|
||||||
.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||||
.polls_de_grey{ color:#b1b1b1;padding-left: 5px;}
|
.polls_de_grey{ color:#b1b1b1;padding-left: 5px;}
|
||||||
.ml5{ margin-left:5px;}
|
.ml5{ margin-left:5px;}
|
||||||
|
|
||||||
|
/******确定弹框***********/
|
||||||
|
.poll_alert_form{width:140px;height:180px;position:fixed;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||||
|
.polls_alert_btn_box{width: 100%;margin: 0 auto;padding-left: 45px;}
|
||||||
|
.polls_alert_upload_box{ width:120px; margin:15px auto;}
|
||||||
|
.polls_alert_box_p{ font-size:14px; padding-left: 45px;padding-top: 10px;}
|
||||||
|
|
Loading…
Reference in New Issue