Merge branch 'szzh' into develop
This commit is contained in:
commit
e4e683d59b
10
Gemfile
10
Gemfile
|
@ -24,6 +24,8 @@ gem 'acts-as-taggable-on', '2.4.1'
|
||||||
gem 'spreadsheet'
|
gem 'spreadsheet'
|
||||||
gem 'ruby-ole'
|
gem 'ruby-ole'
|
||||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||||
|
gem "rmagick", ">= 2.0.0"
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'grape-swagger'
|
gem 'grape-swagger'
|
||||||
#gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
|
#gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
|
||||||
|
@ -48,14 +50,6 @@ group :test do
|
||||||
gem 'selenium-webdriver', '~> 2.42.0'
|
gem 'selenium-webdriver', '~> 2.42.0'
|
||||||
|
|
||||||
gem "faker"
|
gem "faker"
|
||||||
# platforms :mri, :mingw do
|
|
||||||
# group :rmagick do
|
|
||||||
# # RMagick 2 supports ruby 1.9
|
|
||||||
# # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
|
|
||||||
# # different requirements for the same gem on different platforms
|
|
||||||
# gem "rmagick", ">= 2.0.0"
|
|
||||||
# end
|
|
||||||
#end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
|
|
|
@ -232,6 +232,7 @@ module Mobile
|
||||||
params do
|
params do
|
||||||
requires :token, type: String
|
requires :token, type: String
|
||||||
requires :course_id,type: Integer,desc: '课程id'
|
requires :course_id,type: Integer,desc: '课程id'
|
||||||
|
optional :name,type:String,desc:'课件名称可能包含的字符'
|
||||||
end
|
end
|
||||||
get ":course_id/attachments" do
|
get ":course_id/attachments" do
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
|
@ -240,6 +241,19 @@ module Mobile
|
||||||
present :status, 0
|
present :status, 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc '课程学生'
|
||||||
|
params do
|
||||||
|
requires :token,type:String
|
||||||
|
requires :course_id,type:Integer,desc: '课程id'
|
||||||
|
optional :name,type:String,desc:'学生的姓名或者昵称或者学号可能包含的字符'
|
||||||
|
end
|
||||||
|
get ":course_id/members" do
|
||||||
|
cs = CoursesService.new
|
||||||
|
count = cs.course_members params
|
||||||
|
present :data, count, with: Mobile::Entities::Member
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,6 +46,7 @@ module Mobile
|
||||||
course_expose :term
|
course_expose :term
|
||||||
course_expose :time
|
course_expose :time
|
||||||
course_expose :updated_at
|
course_expose :updated_at
|
||||||
|
course_expose :course_student_num
|
||||||
expose :teacher, using: Mobile::Entities::User do |c, opt|
|
expose :teacher, using: Mobile::Entities::User do |c, opt|
|
||||||
if c.is_a? ::Course
|
if c.is_a? ::Course
|
||||||
c.teacher
|
c.teacher
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
module Mobile
|
||||||
|
module Entities
|
||||||
|
class Member < Grape::Entity
|
||||||
|
include ApplicationHelper
|
||||||
|
include ApiHelper
|
||||||
|
def self.member_expose(f)
|
||||||
|
expose f do |u,opt|
|
||||||
|
if u.is_a?(Hash) && u.key?(f)
|
||||||
|
u[f]
|
||||||
|
elsif u.is_a?(::Member)
|
||||||
|
if u.respond_to?(f)
|
||||||
|
u.send(f)
|
||||||
|
else
|
||||||
|
case f
|
||||||
|
when :student_id
|
||||||
|
u.user.user_extensions.student_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
expose :user, using: Mobile::Entities::User do |c, opt|
|
||||||
|
if c.is_a?(::Member)
|
||||||
|
c.user
|
||||||
|
end
|
||||||
|
end
|
||||||
|
member_expose :student_id
|
||||||
|
member_expose :score
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -31,9 +31,6 @@ class AccountController < ApplicationController
|
||||||
else
|
else
|
||||||
authenticate_user
|
authenticate_user
|
||||||
end
|
end
|
||||||
rescue AuthSourceException => e
|
|
||||||
logger.error "An error occured when authenticating #{params[:username]}: #{e.message}"
|
|
||||||
render_error :message => e.message
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Log out current user and redirect to welcome page
|
# Log out current user and redirect to welcome page
|
||||||
|
@ -47,6 +44,10 @@ class AccountController < ApplicationController
|
||||||
# display the logout form
|
# display the logout form
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def heartbeat
|
||||||
|
render :json => session[:user_id]
|
||||||
|
end
|
||||||
|
|
||||||
# Lets user choose a new password
|
# Lets user choose a new password
|
||||||
def lost_password
|
def lost_password
|
||||||
(redirect_to(home_url); return) unless Setting.lost_password?
|
(redirect_to(home_url); return) unless Setting.lost_password?
|
||||||
|
@ -314,7 +315,7 @@ class AccountController < ApplicationController
|
||||||
#根据home_url生产正则表达式
|
#根据home_url生产正则表达式
|
||||||
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
||||||
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
|
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
|
||||||
redirect_to user_activities_path(user)
|
redirect_to user_activities_path(user,host: Setting.user_domain)
|
||||||
else
|
else
|
||||||
if last_login_on == ''
|
if last_login_on == ''
|
||||||
redirect_to my_account_url
|
redirect_to my_account_url
|
||||||
|
@ -329,7 +330,7 @@ class AccountController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_autologin_cookie(user)
|
def set_autologin_cookie(user)
|
||||||
token = Token.create(:user => user, :action => 'autologin')
|
token = Token.get_or_create_permanent_login_token(user)
|
||||||
cookie_options = {
|
cookie_options = {
|
||||||
:value => token.value,
|
:value => token.value,
|
||||||
:expires => 7.days.from_now,
|
:expires => 7.days.from_now,
|
||||||
|
|
|
@ -156,16 +156,16 @@ class ApplicationController < ActionController::Base
|
||||||
user
|
user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_to_autologin1
|
def try_to_autologin1
|
||||||
|
user = User.try_to_autologin(params[:token])
|
||||||
# auto-login feature starts a new session
|
if user
|
||||||
user = User.try_to_autologin(params[:token])
|
logout_user if User.current.id != user.id
|
||||||
if user
|
start_user_session(user)
|
||||||
start_user_session(user)
|
end
|
||||||
end
|
user
|
||||||
user
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sets the logged in user
|
# Sets the logged in user
|
||||||
def logged_user=(user)
|
def logged_user=(user)
|
||||||
reset_session
|
reset_session
|
||||||
|
@ -200,7 +200,7 @@ class ApplicationController < ActionController::Base
|
||||||
def logout_user
|
def logout_user
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
cookies.delete(autologin_cookie_name)
|
cookies.delete(autologin_cookie_name)
|
||||||
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
# Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
||||||
self.logged_user = nil
|
self.logged_user = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,25 +56,9 @@ class AvatarController < ApplicationController
|
||||||
# self.digest = md5.hexdigest
|
# self.digest = md5.hexdigest
|
||||||
end
|
end
|
||||||
@temp_file = nil
|
@temp_file = nil
|
||||||
# @avatar = Avatar.new(:receive_file => request.raw_post)
|
|
||||||
# @avatar.source_id = User.current.id
|
|
||||||
# @avatar.image_file = params[:filename].presence || Redmine::Utils.random_hex(16)
|
|
||||||
# saved = @avatar.save
|
|
||||||
begin
|
|
||||||
f = Magick::ImageList.new(diskfile)
|
|
||||||
# gif格式不再做大小处理
|
|
||||||
if f.format != 'GIF'
|
|
||||||
width = 300.0
|
|
||||||
proportion = (width/f[0].columns)
|
|
||||||
height = (f[0].rows*proportion)
|
|
||||||
f.resize_to_fill!(width,height)
|
|
||||||
f.write(diskfile)
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue Exception => e
|
|
||||||
logger.error "[Error] avatar : avatar_controller#upload ===> #{e}"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
image = Trustie::Utils::Image.new(diskfile,true)
|
||||||
|
image.compress(300)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -490,7 +490,7 @@ class BidsController < ApplicationController
|
||||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
|
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,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 AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
|
||||||
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
|
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
|
||||||
WHERE table1.t_score IS NULL OR table1.t_score = 0")
|
WHERE table1.t_score IS NULL")
|
||||||
@not_batch_homework = true
|
@not_batch_homework = true
|
||||||
@cur_type = 1
|
@cur_type = 1
|
||||||
else
|
else
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
class DiscussDemosController < ApplicationController
|
||||||
|
def index
|
||||||
|
|
||||||
|
@discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@discuss_demo = DiscussDemo.create
|
||||||
|
@discuss_demo.save!
|
||||||
|
@discuss_demo
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@discuss_demo = DiscussDemo.find(params[:id])
|
||||||
|
@discuss_demo.update_attributes(:title => params[:discuss_demo][:title],:body => params[:discuss_demo][:body])
|
||||||
|
redirect_to :controller=> 'discuss_demos',:action => 'show',:id => params[:id]
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
asset = Kindeditor::Asset.find_by_owner_id(params[:id])
|
||||||
|
if !asset.nil?
|
||||||
|
filepath = File.join(Rails.root,"public","files","uploads",
|
||||||
|
asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s,
|
||||||
|
asset[:asset].to_s)
|
||||||
|
File.delete(filepath) if File.exist?filepath
|
||||||
|
end
|
||||||
|
DiscussDemo.destroy(params[:id])
|
||||||
|
redirect_to :controller=> 'discuss_demos',:action => 'index'
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@discuss_demo = DiscussDemo.find(params[:id])
|
||||||
|
end
|
||||||
|
end
|
|
@ -51,7 +51,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
order_by = "created_at #{direction}"
|
order_by = "created_at #{direction}"
|
||||||
end
|
end
|
||||||
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
|
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
|
||||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
|
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,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 AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
|
||||||
FROM homework_attaches WHERE bid_id = #{@bid.id}
|
FROM homework_attaches WHERE bid_id = #{@bid.id}
|
||||||
ORDER BY #{order_by}) AS table1
|
ORDER BY #{order_by}) AS table1
|
||||||
|
@ -445,7 +445,8 @@ class HomeworkAttachController < ApplicationController
|
||||||
is_teacher = @is_teacher ? 1 : 0
|
is_teacher = @is_teacher ? 1 : 0
|
||||||
#保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0))
|
#保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0))
|
||||||
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
|
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
|
||||||
if @m_score && (@is_teacher || @is_anonymous_comments)
|
if @is_teacher || @is_anonymous_comments
|
||||||
|
@m_score ||= 0
|
||||||
rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first
|
rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first
|
||||||
if rate
|
if rate
|
||||||
rate.stars = @m_score
|
rate.stars = @m_score
|
||||||
|
@ -502,7 +503,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
get_not_batch_homework_list params[:cur_sort] || "s_socre",params[:cur_direction] || "desc",@homework.bid_id
|
get_not_batch_homework_list params[:cur_sort] || "s_socre",params[:cur_direction] || "desc",@homework.bid_id
|
||||||
elsif @cur_type == "2" #老师已批列表
|
elsif @cur_type == "2" #老师已批列表
|
||||||
@result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
|
@result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
|
||||||
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
|
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,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 AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
|
||||||
FROM homework_attaches WHERE id = #{@homework.id}").first
|
FROM homework_attaches WHERE id = #{@homework.id}").first
|
||||||
elsif @cur_type == "3" #全部作业列表
|
elsif @cur_type == "3" #全部作业列表
|
||||||
|
@ -629,7 +630,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
(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 AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
|
||||||
FROM homework_attaches WHERE bid_id = #{bid_id}
|
FROM homework_attaches WHERE bid_id = #{bid_id}
|
||||||
ORDER BY #{order_by}) AS table1
|
ORDER BY #{order_by}) AS table1
|
||||||
WHERE table1.t_score IS NULL OR table1.t_score = 0 ")
|
WHERE table1.t_score IS NULL ")
|
||||||
@all_homework_list = search_homework_member(@all_homework_list,@search_name.to_s.downcase) if @search_name
|
@all_homework_list = search_homework_member(@all_homework_list,@search_name.to_s.downcase) if @search_name
|
||||||
# @homework_list = paginateHelper @all_homework_list,10
|
# @homework_list = paginateHelper @all_homework_list,10
|
||||||
@homework_list = @all_homework_list
|
@homework_list = @all_homework_list
|
||||||
|
|
|
@ -75,7 +75,11 @@ class IssuesController < ApplicationController
|
||||||
else
|
else
|
||||||
@limit = 10#per_page_option
|
@limit = 10#per_page_option
|
||||||
end
|
end
|
||||||
|
@assign_to_id = params[:assigned_to_id]
|
||||||
|
@author_id = params[:author_id]
|
||||||
|
@priority_id = params[:priority_id]
|
||||||
|
@status_id = params[:status_id]
|
||||||
|
@subject = params[:subject]
|
||||||
@issue_count = @query.issue_count
|
@issue_count = @query.issue_count
|
||||||
@issue_pages = Paginator.new @issue_count, @limit, params['page']
|
@issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||||
@offset ||= @issue_pages.offset
|
@offset ||= @issue_pages.offset
|
||||||
|
|
|
@ -123,13 +123,13 @@ class MessagesController < ApplicationController
|
||||||
#@topic.update_attribute(:updated_on, Time.now)
|
#@topic.update_attribute(:updated_on, Time.now)
|
||||||
if !@reply.new_record?
|
if !@reply.new_record?
|
||||||
if params[:asset_id]
|
if params[:asset_id]
|
||||||
ids = params[:asset_id].split(',')
|
ids = params[:asset_id].split(',')
|
||||||
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
||||||
end
|
end
|
||||||
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
||||||
attachments = Attachment.attach_files(@reply, params[:attachments])
|
attachments = Attachment.attach_files(@reply, params[:attachments])
|
||||||
render_attachment_warning_if_needed(@reply)
|
render_attachment_warning_if_needed(@reply)
|
||||||
else
|
else
|
||||||
#render file: 'messages#show', layout: 'base_courses'
|
#render file: 'messages#show', layout: 'base_courses'
|
||||||
end
|
end
|
||||||
redirect_to board_message_url(@board, @topic, :r => @reply)
|
redirect_to board_message_url(@board, @topic, :r => @reply)
|
||||||
|
@ -202,7 +202,7 @@ class MessagesController < ApplicationController
|
||||||
render :partial => 'common/preview'
|
render :partial => 'common/preview'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def find_message
|
def find_message
|
||||||
return unless find_board
|
return unless find_board
|
||||||
@message = @board.messages.find(params[:id], :include => :parent)
|
@message = @board.messages.find(params[:id], :include => :parent)
|
||||||
|
|
|
@ -95,76 +95,46 @@ class MyController < ApplicationController
|
||||||
@pref = @user.pref
|
@pref = @user.pref
|
||||||
diskfile = disk_filename('User', @user.id)
|
diskfile = disk_filename('User', @user.id)
|
||||||
diskfile1 = diskfile + 'temp'
|
diskfile1 = diskfile + 'temp'
|
||||||
if request.post?
|
begin
|
||||||
@user.safe_attributes = params[:user]
|
if request.post?
|
||||||
@user.pref.attributes = params[:pref]
|
@user.safe_attributes = params[:user]
|
||||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
@user.pref.attributes = params[:pref]
|
||||||
@user.login = params[:login]
|
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||||
unless @user.user_extensions.nil?
|
@user.login = params[:login]
|
||||||
if @user.user_extensions.identity == 2
|
unless @user.user_extensions.nil?
|
||||||
@user.firstname = params[:enterprise_name]
|
if @user.user_extensions.identity == 2
|
||||||
end
|
@user.firstname = params[:enterprise_name]
|
||||||
end
|
|
||||||
|
|
||||||
@se = @user.extensions
|
|
||||||
if params[:occupation].to_i.to_s == params[:occupation]
|
|
||||||
@se.school_id = params[:occupation]
|
|
||||||
else
|
|
||||||
@se.occupation = params[:occupation]
|
|
||||||
end
|
|
||||||
@se.gender = params[:gender]
|
|
||||||
@se.location = params[:province] if params[:province]
|
|
||||||
@se.location_city = params[:city] if params[:city]
|
|
||||||
@se.identity = params[:identity].to_i if params[:identity]
|
|
||||||
@se.technical_title = params[:technical_title] if params[:technical_title]
|
|
||||||
@se.student_id = params[:no] if params[:no]
|
|
||||||
|
|
||||||
if @user.save && @se.save
|
|
||||||
# 头像保存
|
|
||||||
if File.exist?(diskfile1)
|
|
||||||
if File.exist?(diskfile)
|
|
||||||
File.delete(diskfile)
|
|
||||||
end
|
|
||||||
File.open(diskfile1, "rb") do |f|
|
|
||||||
buffer = f.read(10)
|
|
||||||
if buffer != "DELETE"
|
|
||||||
File.open(diskfile1, "rb") do |f1|
|
|
||||||
File.open(diskfile, "wb") do |f|
|
|
||||||
buffer = ""
|
|
||||||
while (buffer = f1.read(8192))
|
|
||||||
f.write(buffer)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# File.rename(diskfile + 'temp',diskfile);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# 确保文件被删除
|
@se = @user.extensions
|
||||||
if File.exist?(diskfile1)
|
if params[:occupation].to_i.to_s == params[:occupation]
|
||||||
File.delete(diskfile1)
|
@se.school_id = params[:occupation]
|
||||||
|
else
|
||||||
|
@se.occupation = params[:occupation]
|
||||||
end
|
end
|
||||||
|
@se.gender = params[:gender]
|
||||||
|
@se.location = params[:province] if params[:province]
|
||||||
|
@se.location_city = params[:city] if params[:city]
|
||||||
|
@se.identity = params[:identity].to_i if params[:identity]
|
||||||
|
@se.technical_title = params[:technical_title] if params[:technical_title]
|
||||||
|
@se.student_id = params[:no] if params[:no]
|
||||||
|
|
||||||
@user.pref.save
|
if @user.save && @se.save
|
||||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
# 头像保存
|
||||||
set_language_if_valid @user.language
|
FileUtils.mv diskfile1, diskfile, force: true
|
||||||
flash[:notice] = l(:notice_account_updated)
|
@user.pref.save
|
||||||
redirect_to user_url(@user)
|
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||||
return
|
set_language_if_valid @user.language
|
||||||
else
|
flash[:notice] = l(:notice_account_updated)
|
||||||
# 确保文件被删除
|
redirect_to user_url(@user)
|
||||||
if File.exist?(diskfile1)
|
return
|
||||||
File.delete(diskfile1)
|
else
|
||||||
|
@user.login = lg
|
||||||
end
|
end
|
||||||
@user.login = lg
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# 确保文件被删除
|
|
||||||
if File.exist?(diskfile1)
|
|
||||||
File.delete(diskfile1)
|
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -200,31 +170,20 @@ class MyController < ApplicationController
|
||||||
@user = us.change_password params.merge(:current_user_id => @user.id)
|
@user = us.change_password params.merge(:current_user_id => @user.id)
|
||||||
if @user.errors.full_messages.count <= 0
|
if @user.errors.full_messages.count <= 0
|
||||||
flash.now[:notice] = l(:notice_account_password_updated)
|
flash.now[:notice] = l(:notice_account_password_updated)
|
||||||
redirect_to my_account_url
|
# 修改完密码,让其重新登录,并更新Token
|
||||||
|
Token.delete_user_all_tokens(@user)
|
||||||
|
logout_user
|
||||||
|
redirect_to signin_url(back_url: my_account_path)
|
||||||
|
else
|
||||||
|
flash.now[:error] = l(:notice_account_wrong_password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
if e.message == 'wrong password'
|
if e.message == 'wrong password'
|
||||||
flash.now[:error] = l(:notice_account_wrong_password)
|
flash.now[:error] = l(:notice_account_wrong_password)
|
||||||
|
else
|
||||||
|
flash.now[:error] = e.message
|
||||||
end
|
end
|
||||||
# @user = User.current
|
|
||||||
# unless @user.change_password_allowed?
|
|
||||||
# flash.now[:error] = l(:notice_can_t_change_password)
|
|
||||||
# redirect_to my_account_url
|
|
||||||
# return
|
|
||||||
# end
|
|
||||||
# if request.post?
|
|
||||||
# if @user.check_password?(params[:password])
|
|
||||||
# @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
|
||||||
#
|
|
||||||
# if @user.save
|
|
||||||
# flash.now[:notice] = l(:notice_account_password_updated)
|
|
||||||
# redirect_to my_account_url
|
|
||||||
# end
|
|
||||||
# else
|
|
||||||
# flash.now[:error] = l(:notice_account_wrong_password)
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create a new feeds key
|
# Create a new feeds key
|
||||||
|
|
|
@ -247,10 +247,9 @@ class ProjectsController < ApplicationController
|
||||||
# 1、自动注册
|
# 1、自动注册
|
||||||
# 2、加入项目、创建角色
|
# 2、加入项目、创建角色
|
||||||
# 3、用户得分
|
# 3、用户得分
|
||||||
if params[:login]
|
if params[:email]
|
||||||
# 自动激活用户
|
user = User.find_by_mail(params[:email].to_s)
|
||||||
user.status = 1
|
Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id)
|
||||||
user.save
|
|
||||||
end
|
end
|
||||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||||
return
|
return
|
||||||
|
|
|
@ -38,12 +38,13 @@ class TrackersController < ApplicationController
|
||||||
@tracker ||= Tracker.new(params[:tracker])
|
@tracker ||= Tracker.new(params[:tracker])
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
@projects = Project.where("project_type = #{Project::ProjectType_project}").all
|
@projects = Project.where("project_type = #{Project::ProjectType_project}").all
|
||||||
@courses = Course.all
|
# 去掉原因,这块代码已经没有用到
|
||||||
@course_activity_count=Hash.new
|
# @courses = Course.all
|
||||||
@courses.each do |course|
|
# @course_activity_count=Hash.new
|
||||||
@course_activity_count[course.id]=0
|
# @courses.each do |course|
|
||||||
end
|
# @course_activity_count[course.id]=0
|
||||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
# end
|
||||||
|
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -58,12 +58,18 @@ class WelcomeController < ApplicationController
|
||||||
else
|
else
|
||||||
case @first_page.sort_type
|
case @first_page.sort_type
|
||||||
when 0
|
when 0
|
||||||
|
@my_projects = find_my_projects
|
||||||
|
@other_projects = @my_projects.count < 9 ? find_miracle_project( 9 - @my_projects.count, 3,"score desc") : []
|
||||||
@projects = find_miracle_project(10, 3,"created_on desc")
|
@projects = find_miracle_project(10, 3,"created_on desc")
|
||||||
#@projects = @projects_all.order("created_on desc")
|
#@projects = @projects_all.order("created_on desc")
|
||||||
when 1
|
when 1
|
||||||
|
@my_projects = find_my_projects
|
||||||
|
@other_projects = @my_projects.count < 9 ? find_miracle_project( 9 - @my_projects.count, 3,"score desc") : []
|
||||||
@projects = find_miracle_project(10, 3,"score desc")
|
@projects = find_miracle_project(10, 3,"score desc")
|
||||||
#@projects = @projects_all.order("grade desc")
|
#@projects = @projects_all.order("grade desc")
|
||||||
when 2
|
when 2
|
||||||
|
@my_projects = find_my_projects
|
||||||
|
@other_projects = @my_projects.count < 9 ? find_miracle_project( 9 - @my_projects.count, 3,"score desc") : []
|
||||||
@projects = find_miracle_project(10, 3,"watchers_count desc")
|
@projects = find_miracle_project(10, 3,"watchers_count desc")
|
||||||
#@projects = @projects_all.order("watchers_count desc")
|
#@projects = @projects_all.order("watchers_count desc")
|
||||||
|
|
||||||
|
|
|
@ -329,12 +329,12 @@ module ApplicationHelper
|
||||||
imagesize = attachment.thumbnail(:size => "200*200")
|
imagesize = attachment.thumbnail(:size => "200*200")
|
||||||
imagepath = named_attachment_path(attachment, attachment.filename)
|
imagepath = named_attachment_path(attachment, attachment.filename)
|
||||||
if imagesize
|
if imagesize
|
||||||
link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', name: 'issue_attachment_picture'),
|
link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', class: 'issue_attachment_picture'),
|
||||||
imagepath,
|
imagepath,
|
||||||
:title => attachment.filename
|
:title => attachment.filename
|
||||||
|
|
||||||
else
|
else
|
||||||
link_to image_tag(imagepath , height: '73', width: '100', name: 'issue_attachment_picture'),
|
link_to image_tag(imagepath , height: '73', width: '100', class: 'issue_attachment_picture'),
|
||||||
imagepath,
|
imagepath,
|
||||||
:title => attachment.filename
|
:title => attachment.filename
|
||||||
end
|
end
|
||||||
|
|
|
@ -797,4 +797,17 @@ module CoursesHelper
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def zh_course_role role
|
||||||
|
if role == "TeachingAsistant"
|
||||||
|
result = l(:label_TA)
|
||||||
|
elsif role == "Teacher"
|
||||||
|
result = l(:label_teacher)
|
||||||
|
elsif role == "Student"
|
||||||
|
result = l(:label_student)
|
||||||
|
elsif role == "Manager"
|
||||||
|
result = l(:field_admin)
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -243,15 +243,15 @@ module QueriesHelper
|
||||||
|
|
||||||
# Retrieve query from session or build a new query
|
# Retrieve query from session or build a new query
|
||||||
def retrieve_query
|
def retrieve_query
|
||||||
if !params[:query_id].blank?
|
# if !params[:query_id].blank?
|
||||||
cond = "project_id IS NULL"
|
# cond = "project_id IS NULL"
|
||||||
cond << " OR project_id = #{@project.id}" if @project
|
# cond << " OR project_id = #{@project.id}" if @project
|
||||||
@query = IssueQuery.find(params[:query_id], :conditions => cond)
|
# @query = IssueQuery.find(params[:query_id], :conditions => cond)
|
||||||
raise ::Unauthorized unless @query.visible?
|
# raise ::Unauthorized unless @query.visible?
|
||||||
@query.project = @project
|
# @query.project = @project
|
||||||
session[:query] = {:id => @query.id, :project_id => @query.project_id}
|
# session[:query] = {:id => @query.id, :project_id => @query.project_id}
|
||||||
sort_clear
|
# sort_clear
|
||||||
elsif api_request? || params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
|
# elsif api_request? || params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
|
||||||
# Give it a name, required to be valid
|
# Give it a name, required to be valid
|
||||||
@query = IssueQuery.new(:name => "_")
|
@query = IssueQuery.new(:name => "_")
|
||||||
@query.project = @project
|
@query.project = @project
|
||||||
|
@ -268,12 +268,12 @@ module QueriesHelper
|
||||||
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
|
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
|
||||||
@query.build_from_params(params)
|
@query.build_from_params(params)
|
||||||
#session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
|
#session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
|
||||||
else
|
# else
|
||||||
# retrieve from session
|
# # retrieve from session
|
||||||
@query = IssueQuery.find_by_id(session[:query][:id]) if session[:query][:id]
|
# @query = IssueQuery.find_by_id(session[:query][:id]) if session[:query][:id]
|
||||||
@query ||= IssueQuery.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
|
# @query ||= IssueQuery.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
|
||||||
@query.project = @project
|
# @query.project = @project
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
def retrieve_query_from_session
|
def retrieve_query_from_session
|
||||||
|
|
|
@ -443,6 +443,10 @@ module WelcomeHelper
|
||||||
resultSet.take(limit)
|
resultSet.take(limit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_my_projects
|
||||||
|
my_projects = User.current.memberships.all(conditions: "projects.project_type = 0")
|
||||||
|
end
|
||||||
|
|
||||||
def sort_project_by_hot_rails project_type=0, order_by='score DESC', limit=15
|
def sort_project_by_hot_rails project_type=0, order_by='score DESC', limit=15
|
||||||
# Project.find_by_sql("
|
# Project.find_by_sql("
|
||||||
# SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
# SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
||||||
|
|
|
@ -71,14 +71,14 @@ class Mailer < ActionMailer::Base
|
||||||
|
|
||||||
# 邀请已注册的用户加入项目
|
# 邀请已注册的用户加入项目
|
||||||
def request_member_to_project(email, project, invitor)
|
def request_member_to_project(email, project, invitor)
|
||||||
|
@subject = "#{invitor.name} #{l(:label_invite_project)}: #{project.name} "
|
||||||
user = User.find_by_mail(email.to_s)
|
user = User.find_by_mail(email.to_s)
|
||||||
Member.create(:role_ids => [4], :user_id => user.id,:project_id => project.id)
|
@invitor_name = "#{invitor.name}"
|
||||||
@invitor_name = "#{invitor.name}"
|
@project_name = "#{project.name}"
|
||||||
@project_name = "#{project.name}"
|
@user = user
|
||||||
@user = user
|
@token = Token.get_token_from_user(user, 'autologin')
|
||||||
@token = Token.get_token_from_user(user, 'autologin')
|
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :email => email, :token => @token.value)
|
||||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,:user => user, :token => @token.value)
|
mail :to => email, :subject => @subject
|
||||||
mail :to => email, :invitor_name => "#{@invitor_name}", :project_name => "#{@project_name}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# author: alan
|
# author: alan
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#coding=utf-8
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||||
#
|
#
|
||||||
|
@ -14,7 +15,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
class Token < ActiveRecord::Base
|
class Token < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
validates_uniqueness_of :value
|
validates_uniqueness_of :value
|
||||||
|
@ -27,6 +28,14 @@ class Token < ActiveRecord::Base
|
||||||
self.value = Token.generate_token_value
|
self.value = Token.generate_token_value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.get_or_create_permanent_login_token(user)
|
||||||
|
token = Token.get_token_from_user(user, 'autologin')
|
||||||
|
unless token
|
||||||
|
token = Token.create(:user => user, :action => 'autologin')
|
||||||
|
end
|
||||||
|
token
|
||||||
|
end
|
||||||
|
|
||||||
def self.get_token_from_user(user, action)
|
def self.get_token_from_user(user, action)
|
||||||
token = Token.where(:action => action, :user_id => user).first
|
token = Token.where(:action => action, :user_id => user).first
|
||||||
unless token
|
unless token
|
||||||
|
@ -42,7 +51,7 @@ class Token < ActiveRecord::Base
|
||||||
|
|
||||||
# Delete all expired tokens
|
# Delete all expired tokens
|
||||||
def self.destroy_expired
|
def self.destroy_expired
|
||||||
Token.delete_all ["action NOT IN (?) AND created_on < ?", ['feeds', 'api'], Time.now - @@validity_time]
|
Token.delete_all ["action NOT IN (?) AND created_on < ?", ['feeds', 'api', 'autologin'], Time.now - @@validity_time]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the active user who owns the key for the given action
|
# Returns the active user who owns the key for the given action
|
||||||
|
@ -80,6 +89,10 @@ class Token < ActiveRecord::Base
|
||||||
Redmine::Utils.random_hex(20)
|
Redmine::Utils.random_hex(20)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.delete_user_all_tokens(user)
|
||||||
|
Token.delete_all(user_id: user.id)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Removes obsolete tokens (same user and action)
|
# Removes obsolete tokens (same user and action)
|
||||||
|
|
|
@ -86,7 +86,7 @@ class CoursesService
|
||||||
gender = m.user.user_extensions.gender.nil? ? 0 : m.user.user_extensions.gender
|
gender = m.user.user_extensions.gender.nil? ? 0 : m.user.user_extensions.gender
|
||||||
work_unit = get_user_work_unit m.user
|
work_unit = get_user_work_unit m.user
|
||||||
location = get_user_location m.user
|
location = get_user_location m.user
|
||||||
users << {:id => m.user.id, :img_url => img_url, :nickname => m.user.login, :gender => gender, :work_unit => work_unit, :mail => m.user.mail, :location => location, :brief_introduction => m.user.user_extensions.brief_introduction}
|
users << {:id => m.user.id, :img_url => img_url, :nickname => m.user.login, :gender => gender, :work_unit => work_unit, :mail => m.user.mail, :location => location, :brief_introduction => m.user.user_extensions.brief_introduction,:realname=>m.user.realname}
|
||||||
end
|
end
|
||||||
users
|
users
|
||||||
end
|
end
|
||||||
|
@ -169,7 +169,7 @@ class CoursesService
|
||||||
unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
|
unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
|
||||||
raise '403'
|
raise '403'
|
||||||
end
|
end
|
||||||
{:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)}
|
{:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0}
|
||||||
end
|
end
|
||||||
|
|
||||||
#创建课程
|
#创建课程
|
||||||
|
@ -433,13 +433,48 @@ class CoursesService
|
||||||
result = []
|
result = []
|
||||||
@course = Course.find(params[:course_id])
|
@course = Course.find(params[:course_id])
|
||||||
@attachments = @course.attachments.order("created_on desc")
|
@attachments = @course.attachments.order("created_on desc")
|
||||||
@attachments.each do |atta|
|
if !params[:name].nil? && params[:name] != ""
|
||||||
result << {:filename => atta.filename,:description => atta.description,:downloads => atta.downloads,:quotes => atta.quotes.nil? ? 0 :atta.quotes }
|
@attachments.each do |atta|
|
||||||
|
result << {:filename => atta.filename,
|
||||||
|
:description => atta.description,
|
||||||
|
:downloads => atta.downloads,
|
||||||
|
:quotes => atta.quotes.nil? ? 0 :atta.quotes } if atta.filename.include?(params[:name])
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@attachments.each do |atta|
|
||||||
|
result << {:filename => atta.filename,
|
||||||
|
:description => atta.description,
|
||||||
|
:downloads => atta.downloads,
|
||||||
|
:quotes => atta.quotes.nil? ? 0 :atta.quotes }
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 课程学生列表
|
||||||
|
def course_members params
|
||||||
|
@all_members = searchmember_by_name(student_homework_score(0,params[:course_id], 10,"desc"),params[:name])
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def searchmember_by_name members, name
|
||||||
|
#searchPeopleByRoles(project, StudentRoles)
|
||||||
|
mems = []
|
||||||
|
if name != ""
|
||||||
|
name = name.to_s.downcase
|
||||||
|
members.each do |m|
|
||||||
|
username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
|
||||||
|
if(m.user[:login].to_s.downcase.include?(name) || m.user.user_extensions[:student_id].to_s.downcase.include?(name) || username.include?(name))
|
||||||
|
mems << m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
mems = members
|
||||||
|
end
|
||||||
|
mems
|
||||||
|
end
|
||||||
def show_homework_info course,bid,current_user,is_course_teacher
|
def show_homework_info course,bid,current_user,is_course_teacher
|
||||||
author_real_name = bid.author.lastname + bid.author.firstname
|
author_real_name = bid.author.lastname + bid.author.firstname
|
||||||
many_times = course.homeworks.index(bid) + 1
|
many_times = course.homeworks.index(bid) + 1
|
||||||
|
@ -476,5 +511,52 @@ class CoursesService
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def student_homework_score(groupid,course_id, nums, score_sort_by)
|
||||||
|
#teachers = find_course_teachers(@course)
|
||||||
|
#start_from = start_from * nums
|
||||||
|
sql_select = ""
|
||||||
|
if groupid == 0
|
||||||
|
if nums == 0
|
||||||
|
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||||
|
WHERE members.course_id = #{course_id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{course_id}) AND members.user_id = homework_attaches.user_id
|
||||||
|
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id}) GROUP BY members.user_id
|
||||||
|
UNION all
|
||||||
|
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{course_id} AND
|
||||||
|
students_for_courses.course_id = #{course_id} and members.user_id = students_for_courses.student_id AND
|
||||||
|
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id} )
|
||||||
|
)
|
||||||
|
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||||
|
else
|
||||||
|
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||||
|
WHERE members.course_id = #{course_id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{course_id}) AND members.user_id = homework_attaches.user_id
|
||||||
|
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id}) GROUP BY members.user_id
|
||||||
|
UNION all
|
||||||
|
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{course_id} AND
|
||||||
|
students_for_courses.course_id = #{course_id} and members.user_id = students_for_courses.student_id AND
|
||||||
|
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id} )
|
||||||
|
)
|
||||||
|
GROUP BY members.user_id ORDER BY score #{score_sort_by} " #limit #{start_from}, #{nums}"
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
|
||||||
|
WHERE members.course_id = #{course_id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{course_id}) AND members.user_id = homework_attaches.user_id
|
||||||
|
and members.course_group_id = #{groupid} AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id})
|
||||||
|
GROUP BY members.user_id
|
||||||
|
UNION all
|
||||||
|
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{course_id}
|
||||||
|
and members.course_group_id = #{groupid} AND
|
||||||
|
students_for_courses.course_id = #{course_id} and members.user_id = students_for_courses.student_id AND
|
||||||
|
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{course_id} )
|
||||||
|
)
|
||||||
|
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
|
||||||
|
end
|
||||||
|
sql = ActiveRecord::Base.connection()
|
||||||
|
homework_scores = Member.find_by_sql(sql_select)
|
||||||
|
sql.close()
|
||||||
|
|
||||||
|
homework_scores
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,62 +1,28 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.addEventListener('DOMContentLoaded',function(){
|
|
||||||
var img = document.getElementsByName('issue_attachment_picture');
|
|
||||||
|
|
||||||
|
|
||||||
function getImgNaturalStyle(img, callback) {
|
|
||||||
var nWidth, nHeight;
|
|
||||||
if (typeof img.naturalWidth == "undefined"|| img.naturalWidth == 0) {
|
|
||||||
var image = new Image();
|
|
||||||
image.src = img.src;
|
|
||||||
if (image.complete) {
|
|
||||||
callback(image);
|
|
||||||
} else {
|
|
||||||
image.onload = function () {
|
|
||||||
callback(image);
|
|
||||||
image.onload = null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
jQuery(window).load(function () {
|
||||||
|
jQuery(".issue_attachment_picture").each(function () {
|
||||||
|
DrawImage(this, 100, 73);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
function DrawImage(ImgD, FitWidth, FitHeight) {
|
||||||
|
var image = new Image();
|
||||||
|
image.src = ImgD.src;
|
||||||
|
if (image.width > 100 || image.height > 73)
|
||||||
|
{
|
||||||
|
rateWidth = image.width / 100;
|
||||||
|
rateHeight = image.height / 73;
|
||||||
|
if (rateWidth > rateHeight) {
|
||||||
|
ImgD.width = 100;
|
||||||
|
ImgD.height = Math.round(image.height/rateWidth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (img.complete) {
|
ImgD.width = Math.round(image.width/rateHeight);
|
||||||
nWidth = img.naturalWidth;
|
ImgD.height = 73;
|
||||||
nHeight = img.naturalHeight;
|
|
||||||
} else {
|
|
||||||
img.onload = function () {
|
|
||||||
nWidth = img.naturalWidth;
|
|
||||||
nHeight = img.naturalHeight;
|
|
||||||
image.onload = null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
return [nWidth, nHeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function UpdateImageInformation(image) {
|
|
||||||
return [image.width,image.height];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for(i=0;i<img.length;i++)
|
|
||||||
{
|
|
||||||
imgNatural = getImgNaturalStyle(img[i],UpdateImageInformation);
|
|
||||||
var width = imgNatural[0];
|
|
||||||
var height = imgNatural[1];
|
|
||||||
if (width<100)
|
|
||||||
{
|
|
||||||
img[i].width = width;
|
|
||||||
}
|
|
||||||
if (height<73) {
|
|
||||||
img[i].height = height;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="attachments" style="font-weight:normal;">
|
<div class="attachments" style="font-weight:normal;">
|
||||||
|
|
|
@ -74,3 +74,6 @@
|
||||||
<%= javascript_include_tag 'avatars' %>
|
<%= javascript_include_tag 'avatars' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
<style type="text/css">
|
||||||
|
#preview{width:360px;height:360px;border:1px solid #000;overflow:hidden;}
|
||||||
|
#imghead {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function previewImage(file)
|
||||||
|
{
|
||||||
|
var MAXWIDTH = 360;
|
||||||
|
var MAXHEIGHT = 360;
|
||||||
|
var div = document.getElementById('preview');
|
||||||
|
if (file.files && file.files[0])
|
||||||
|
{
|
||||||
|
div.innerHTML = '<img id=imghead>';
|
||||||
|
var img = document.getElementById('imghead');
|
||||||
|
img.onload = function(){
|
||||||
|
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
||||||
|
img.width = rect.width;
|
||||||
|
img.height = rect.height;
|
||||||
|
img.style.marginLeft = rect.left+'px';
|
||||||
|
img.style.marginTop = rect.top+'px';
|
||||||
|
}
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(evt){img.src = evt.target.result;}
|
||||||
|
reader.readAsDataURL(file.files[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
|
||||||
|
file.select();
|
||||||
|
var src = document.selection.createRange().text;
|
||||||
|
div.innerHTML = '<img id=imghead>';
|
||||||
|
var img = document.getElementById('imghead');
|
||||||
|
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
|
||||||
|
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
|
||||||
|
status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
|
||||||
|
div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;margin-left:"+rect.left+"px;"+sFilter+src+"\"'></div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function clacImgZoomParam( maxWidth, maxHeight, width, height ){
|
||||||
|
var param = {top:0, left:0, width:width, height:height};
|
||||||
|
if( width>maxWidth || height>maxHeight )
|
||||||
|
{
|
||||||
|
rateWidth = width / maxWidth;
|
||||||
|
rateHeight = height / maxHeight;
|
||||||
|
|
||||||
|
if( rateWidth > rateHeight )
|
||||||
|
{
|
||||||
|
param.width = maxWidth;
|
||||||
|
param.height = Math.round(height / rateWidth);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
param.width = Math.round(width / rateHeight);
|
||||||
|
param.height = maxHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
param.left = Math.round((maxWidth - param.width) / 2);
|
||||||
|
param.top = Math.round((maxHeight - param.height) / 2);
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div id="preview">
|
||||||
|
<img id="imghead" width=100 height=100 border=0 src="file:///C:/Users/whimlex/Downloads/1.jpg">
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<input type="file" onchange="previewImage(this)" />
|
|
@ -1,4 +1,4 @@
|
||||||
var imgSpan = $('#avatar_image');
|
var imgSpan = $('#avatar_image');
|
||||||
|
|
||||||
imgSpan.attr({"src":'<%= @urlfile.to_s << "?" << Time.now.to_s%>'});
|
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,55 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $(window).scroll(function(){
|
||||||
|
// //获取窗口的滚动条的垂直位置
|
||||||
|
// var s = $(window).scrollTop();
|
||||||
|
// //当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐
|
||||||
|
// if( s > 600){
|
||||||
|
// $("#gotoTop").fadeIn(100);
|
||||||
|
// }else{
|
||||||
|
// $("#gotoTop").fadeOut(200);
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
$(function(){goTopEx();});
|
||||||
|
|
||||||
|
var Sys = {};
|
||||||
|
var ua = navigator.userAgent.toLowerCase();
|
||||||
|
var s;
|
||||||
|
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
|
||||||
|
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
|
||||||
|
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
|
||||||
|
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
|
||||||
|
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
||||||
|
|
||||||
|
function goTopEx() {
|
||||||
|
var obj = document.getElementById("goTopBtn");
|
||||||
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||||
|
function getScrollTop() {
|
||||||
|
var xsun = document.documentElement.scrollTop;
|
||||||
|
if (Sys.chrome) {
|
||||||
|
xsun=document.body.scrollTop;
|
||||||
|
}
|
||||||
|
return xsun;
|
||||||
|
}
|
||||||
|
function setScrollTop(value) {
|
||||||
|
if (Sys.chrome) {
|
||||||
|
document.body.scrollTop = value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.documentElement.scrollTop = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.onscroll = function () { getScrollTop() > 0 ? obj.style.display = "" : obj.style.display = "none"; };
|
||||||
|
obj.onclick = function () {
|
||||||
|
var goTop = setInterval(scrollMove, 10);
|
||||||
|
function scrollMove() {
|
||||||
|
setScrollTop(getScrollTop() / 1.1);
|
||||||
|
if (getScrollTop() < 1) clearInterval(goTop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<div id='bidding_project_list'>
|
<div id='bidding_project_list'>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="ml9" id="bid_evaluation_num_li" style="display: <%= bid.open_anonymous_evaluation == 1 ? 'block' : 'none'%>;">
|
<li class="ml9" id="bid_evaluation_num_li" style="display: <%= bid.open_anonymous_evaluation == 1 ? 'block' : 'none'%>;">
|
||||||
<label><span class="c_red">*</span> <%= l(:field_evaluation_num)%> :</label>
|
<label><span class="c_red">*</span> <%= l(:field_evaluation_num)%> :</label>
|
||||||
<input type="text" name="bid[evaluation_num]" id="bid_evaluation_num" class="hwork_input02" onkeyup="regex_evaluation_num();" value="<%= bid.evaluation_num%>">
|
<input type="text" name="bid[evaluation_num]" id="bid_evaluation_num" class="hwork_input02" onkeyup="regex_evaluation_num();" value="<%= bid.evaluation_num%>" maxlength="3">
|
||||||
<span><%= l(:label_evaluation_description)%></span>
|
<span><%= l(:label_evaluation_description)%></span>
|
||||||
<p id="bid_evaluation_num_span" class="c_red" style="padding-left: 90px;"></p>
|
<p id="bid_evaluation_num_span" class="c_red" style="padding-left: 90px;"></p>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
|
||||||
|
<%= render :partial => 'form_course', :locals => {:f => f} %>
|
||||||
|
<li>
|
||||||
|
<%= link_to l(:button_cancel), course_boards_path(@course), :class => 'grey_btn fr ml10' %>
|
||||||
|
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
|
@ -10,7 +10,7 @@
|
||||||
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
||||||
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
||||||
<p>
|
<p>
|
||||||
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
||||||
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -42,14 +42,14 @@
|
||||||
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% if @topics.any? %>
|
<% if @topics.any? %>
|
||||||
<% @topics.each do |topic| %>
|
<% @topics.each do |topic| %>
|
||||||
<div class="problem_main">
|
<div class="problem_main">
|
||||||
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
||||||
<div class="talk_txt fl">
|
<div class="talk_txt fl">
|
||||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
|
<%= link_to h(topic.subject), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
|
||||||
<% if topic.sticky? %>
|
<% if topic.sticky? %>
|
||||||
<a href="javascript:void(0)" class="talk_up fr c_red">置顶</a>
|
<a href="javascript:void(0)" class="talk_up fr c_red">置顶</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<br/>
|
<br/>
|
||||||
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
|
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
|
||||||
|
@ -58,17 +58,17 @@
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div><!--讨论主类容 end-->
|
</div><!--讨论主类容 end-->
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p class="nodata">
|
<p class="nodata">
|
||||||
<%= l(:label_no_data) %>
|
<%= l(:label_no_data) %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<ul class="wlist">
|
<ul class="wlist">
|
||||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||||
</ul>
|
</ul>
|
||||||
<%# other_formats_links do |f| %>
|
<%# other_formats_links do |f| %>
|
||||||
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
|
|
||||||
<% html_title @board.name %>
|
<% html_title @board.name %>
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
|
||||||
|
<% if topic.project %>
|
||||||
|
<%#= board_breadcrumb(@message) %>
|
||||||
|
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
||||||
|
<div class="talk_new ml15">
|
||||||
|
<ul>
|
||||||
|
<%= form_for topic, { :as => :message,
|
||||||
|
:url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
|
||||||
|
:html => {:multipart => true,
|
||||||
|
:id => 'message-form' + topic.id.to_s,
|
||||||
|
:method => :post}
|
||||||
|
} do |f| %>
|
||||||
|
<%= render :partial => 'form_project',
|
||||||
|
:locals => {:f => f, :replying => !topic.parent.nil?} %>
|
||||||
|
<a href="#" onclick="$('#message-form<%= topic.id%>').submit();"class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
|
||||||
|
<%= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% elsif topic.course %>
|
||||||
|
<%#= course_board_breadcrumb(@message) %>
|
||||||
|
<div class="talk_new ml15">
|
||||||
|
<ul>
|
||||||
|
<%= form_for topic, {
|
||||||
|
:as => :message,
|
||||||
|
:url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
|
||||||
|
:html => {:multipart => true,
|
||||||
|
:id => 'message-form' + topic.id.to_s,
|
||||||
|
:method => :post}
|
||||||
|
} do |f| %>
|
||||||
|
<%= render :partial => 'form_course',
|
||||||
|
:locals => {:f => f, :replying => !topic.parent.nil?} %>
|
||||||
|
<a href="javascript:void(0)" onclick="$('#message-form<%= topic.id%>').submit();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
||||||
|
<%= link_to l(:button_cancel), board_message_url(topic.board,topic.root, :r => (topic.parent_id &&topic.id)), :class => "blue_btn grey_btn fl c_white" %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="preview" class="wiki"></div>
|
|
@ -0,0 +1,60 @@
|
||||||
|
<%= error_messages_for 'message' %>
|
||||||
|
<% replying ||= false %>
|
||||||
|
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||||
|
<% if replying %>
|
||||||
|
<li style="display: none">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||||
|
|
||||||
|
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||||
|
|
||||||
|
|
||||||
|
<p id="subject_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||||
|
|
||||||
|
|
||||||
|
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||||
|
|
||||||
|
<p id="subject_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<li class="ml60 mb5">
|
||||||
|
<% unless replying %>
|
||||||
|
<% if @message.safe_attribute? 'sticky' %>
|
||||||
|
<%= f.check_box :sticky %>
|
||||||
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||||
|
<% end %>
|
||||||
|
<% if @message.safe_attribute? 'locked' %>
|
||||||
|
<%= f.check_box :locked %>
|
||||||
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||||
|
<% unless replying %>
|
||||||
|
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
|
<% end %>
|
||||||
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
|
<% if replying%>
|
||||||
|
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
|
||||||
|
<% else %>
|
||||||
|
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="message_content_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li>
|
||||||
|
<% unless replying %>
|
||||||
|
<div class="fl ml3" style="padding-left: 52px;">
|
||||||
|
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li >
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
|
@ -0,0 +1,60 @@
|
||||||
|
<%= error_messages_for 'message' %>
|
||||||
|
<% replying ||= false %>
|
||||||
|
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||||
|
<% if replying %>
|
||||||
|
<li style="display: none">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||||
|
|
||||||
|
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||||
|
|
||||||
|
|
||||||
|
<p id="subject_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||||
|
|
||||||
|
|
||||||
|
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||||
|
|
||||||
|
<p id="subject_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<li class="ml60 mb5">
|
||||||
|
<% unless replying %>
|
||||||
|
<% if @message.safe_attribute? 'sticky' %>
|
||||||
|
<%= f.check_box :sticky %>
|
||||||
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||||
|
<% end %>
|
||||||
|
<% if @message.safe_attribute? 'locked' %>
|
||||||
|
<%= f.check_box :locked %>
|
||||||
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||||
|
<% unless replying %>
|
||||||
|
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
|
<% end %>
|
||||||
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
|
<% if replying%>
|
||||||
|
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
|
||||||
|
<% else %>
|
||||||
|
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="message_content_span" class="ml55"></p>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li>
|
||||||
|
<% unless replying %>
|
||||||
|
<div class="fl ml3" style="padding-left: 52px;">
|
||||||
|
<%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li >
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
|
||||||
|
<%= render :partial => 'form_project', :locals => {:f => f} %>
|
||||||
|
<li>
|
||||||
|
<%= link_to l(:button_cancel), project_boards_path(@project), :class => 'grey_btn fr ml10' %>
|
||||||
|
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
|
@ -11,49 +11,49 @@
|
||||||
<!--display the board-->
|
<!--display the board-->
|
||||||
<% if !User.current.logged? %>
|
<% if !User.current.logged? %>
|
||||||
<div class="c_grey f14">
|
<div class="c_grey f14">
|
||||||
<%= l(:label_user_login_project_board) %>
|
<%= l(:label_user_login_project_board) %>
|
||||||
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- 内容显示部分 -->
|
<!-- 内容显示部分 -->
|
||||||
<div class="talk_top">
|
<div class="talk_top">
|
||||||
<div class="fl"><span><%= l(:label_project_board_count , :count => @topic_count)%></span></div>
|
<div class="fl"><span><%= l(:label_project_board_count , :count => @topic_count)%></span></div>
|
||||||
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
|
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
|
||||||
<span><%= link_to l(:project_module_boards_post), new_board_message_path(@board),
|
<span><%= link_to l(:project_module_boards_post), new_board_message_path(@board),
|
||||||
:class => 'problem_new_btn fl c_dorange',
|
:class => 'problem_new_btn fl c_dorange',
|
||||||
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span>
|
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span>
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<!-- 帖子内容显示 -->
|
|
||||||
<% if @topics.any? %>
|
|
||||||
<% @topics.each do |topic| %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
|
||||||
<div class="talk_txt fl">
|
|
||||||
<%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
|
|
||||||
<% if topic.sticky? %>
|
|
||||||
<a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a>
|
|
||||||
<% end %>
|
|
||||||
<br/>
|
|
||||||
<%= l(:label_post_by)%><%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
|
|
||||||
<%= l(:label_post_by_time)%><%= format_time topic.created_on %>
|
|
||||||
</div>
|
|
||||||
<%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div><!--讨论主类容 end-->
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<!-- 帖子内容显示 -->
|
||||||
|
<% if @topics.any? %>
|
||||||
|
<% @topics.each do |topic| %>
|
||||||
|
<div class="problem_main">
|
||||||
|
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
||||||
|
<div class="talk_txt fl">
|
||||||
|
<%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
|
||||||
|
<% if topic.sticky? %>
|
||||||
|
<a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a>
|
||||||
|
<% end %>
|
||||||
|
<br/>
|
||||||
|
<%= l(:label_post_by)%><%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
|
||||||
|
<%= l(:label_post_by_time)%><%= format_time topic.created_on %>
|
||||||
|
</div>
|
||||||
|
<%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!--讨论主类容 end-->
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||||
|
<% end %>
|
||||||
<ul class="wlist">
|
<ul class="wlist">
|
||||||
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
||||||
</ul>
|
</ul>
|
||||||
<!--讨论主类容 end-->
|
<!--讨论主类容 end-->
|
||||||
|
|
||||||
<%# other_formats_links do |f| %>
|
<%# other_formats_links do |f| %>
|
||||||
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
|
|
||||||
<% html_title @board.name %>
|
<% html_title @board.name %>
|
||||||
|
|
|
@ -1,4 +1,41 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
//头部导航
|
||||||
|
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
||||||
|
function buildsubmenus(){
|
||||||
|
for (var i=0; i<menuids.length; i++){
|
||||||
|
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
|
||||||
|
for (var t=0; t<ultags.length; t++){
|
||||||
|
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
|
||||||
|
ultags[t].parentNode.onmouseover=function(){
|
||||||
|
this.getElementsByTagName("ul")[0].style.display="block"
|
||||||
|
}
|
||||||
|
ultags[t].parentNode.onmouseout=function(){
|
||||||
|
this.getElementsByTagName("ul")[0].style.display="none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.addEventListener)
|
||||||
|
window.addEventListener("load", buildsubmenus, false)
|
||||||
|
else if (window.attachEvent)
|
||||||
|
window.attachEvent("onload", buildsubmenus)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">//侧导航
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function show_newtalk()
|
||||||
|
{
|
||||||
|
$("#about_newtalk").toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_newtalk1(id)
|
||||||
|
{
|
||||||
|
$(id).toggle();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<% if @project %>
|
<% if @project %>
|
||||||
<%= render :partial => 'project_show', locals: {project: @project} %>
|
<%= render :partial => 'project_show', locals: {project: @project} %>
|
||||||
<% elsif @course %>
|
<% elsif @course %>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) do |f| %>
|
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) do |f| %>
|
||||||
<div class="member_search">
|
<div class="member_search">
|
||||||
<input hidden="hidden" value="true" name="flag">
|
<input hidden="hidden" value="true" name="flag">
|
||||||
<input id="principal_search" class="member_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
|
<input id="principal_search" class="member_search_input fl" type="text" placeholder="<%= l(:label_invite_trustie_user_tips)%>">
|
||||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@course, :format => 'js',:flag => true) }')" %>
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@course, :format => 'js',:flag => true) }')" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<% @roles.each do |role| %>
|
<% @roles.each do |role| %>
|
||||||
<li>
|
<li>
|
||||||
<%= radio_button_tag 'membership[role_ids][]', role.id, role.name == "学生" || role.name == "Student" %>
|
<%= radio_button_tag 'membership[role_ids][]', role.id, role.name == "学生" || role.name == "Student" %>
|
||||||
<label ><%= h role %></label>
|
<label ><%= zh_course_role(h role) %></label>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<div class="st_list">
|
<div class="st_list">
|
||||||
<div class="st_box">
|
<div class="st_box">
|
||||||
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
|
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
|
||||||
|
<a href="javascript:void(0)" class="fr fb mb5 mr70" >角色</a>
|
||||||
<div class="cl"></div><!--st_box_top end-->
|
<div class="cl"></div><!--st_box_top end-->
|
||||||
|
|
||||||
<% members.each do |member| %>
|
<% members.each do |member| %>
|
||||||
|
@ -9,8 +10,9 @@
|
||||||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||||
</a>
|
</a>
|
||||||
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
||||||
<%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %>
|
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %>
|
||||||
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
|
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
|
||||||
|
<span class="fr c_grey mr30 w45"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||||
<%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
|
<%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
|
||||||
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
|
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
|
||||||
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10">取 消</a>
|
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" onclick="KindEditor.instances[0].html('');">取 消</a>
|
||||||
<a href="javascript:void(0)" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr mt10">
|
<a href="javascript:void(0)" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr mt10">
|
||||||
<%= l(:button_leave_meassge)%>
|
<%= l(:button_leave_meassge)%>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
<li >
|
<li >
|
||||||
<%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
|
<%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
|
||||||
<span class="w150 fl">
|
<span class="w150 fl">
|
||||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
|
||||||
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||||
:method => :put,
|
:method => :put,
|
||||||
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
||||||
) do |f| %>
|
) do |f| %>
|
||||||
<% @roles.each do |role| %>
|
<% @roles.each do |role| %>
|
||||||
<ul style="text-align: left;" class="ml20">
|
<ul style="text-align: left;" class="ml45">
|
||||||
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||||
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
||||||
<label ><%= h role %></label>
|
<label ><%= zh_course_role(h role) %></label>
|
||||||
</ul>
|
</ul>
|
||||||
<!--<br/>-->
|
<!--<br/>-->
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
||||||
<div class="ml20">
|
<div class="ml45">
|
||||||
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
|
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
|
||||||
<%= l(:button_change)%>
|
<%= l(:button_change)%>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||||
|
|
||||||
<% if manage_allowed && file.container_id == project.id && file.container_type == "Project" %>
|
<% if manage_allowed && file.container_id == project.id && file.container_type == "Project" %>
|
||||||
<span id="is_public_<%= file.id %>">
|
<span id="is_public_<%= file.id %>">
|
||||||
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
|
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
|
|
||||||
function submit_jours(is_teacher)
|
function submit_jours(is_teacher)
|
||||||
{
|
{
|
||||||
if(!is_teacher&&$("#stars_value").val() == "0"){alert("您还没有打分");return;}
|
// if(("#stars_value").val() == "0"){
|
||||||
|
// if(confirm('是否确定评分为0分?')){}else{return;}
|
||||||
|
// }
|
||||||
if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;}
|
if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;}
|
||||||
$('#new_form_user_message').parent().submit();
|
$('#new_form_user_message').parent().submit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<% unless is_student_batch_homework %>
|
<% unless is_student_batch_homework %>
|
||||||
<%= l(:label_teacher_score)%>:
|
<%= l(:label_teacher_score)%>:
|
||||||
<span class="c_red">
|
<span class="c_red">
|
||||||
<%= (homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)%>
|
<%= (homework.t_score.nil?) ? l(:label_without_score) : format("%.2f",homework.t_score)%>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -34,7 +34,11 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="to_top" id="goTopBtn" style="display: none;">
|
||||||
|
返<br/>回<br/>顶<br/>部
|
||||||
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<% unless homeworks.nil? %>
|
<% unless homeworks.nil? %>
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<span style="color:#a6a6a6; margin-right:30px; margin-left:10px;">
|
<span style="color:#a6a6a6; margin-right:20px; margin-left:10px;">
|
||||||
<%= format_time(review.created_at) %>
|
<%= format_time(review.created_at) %>
|
||||||
</span>
|
</span>
|
||||||
<span style="font-weight:bold; color:#a6a6a6; float: right;">
|
<span style="font-weight:bold; color:#a6a6a6; float: right;">
|
||||||
<% if review.stars && review.stars.to_i > 0%>
|
<% if review.stars%>
|
||||||
<span style="float:left">
|
<span style="float:left">
|
||||||
<%= l(:label_work_rating) %>:
|
<%= l(:label_work_rating) %>:
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -11,6 +11,14 @@
|
||||||
for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");}
|
for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");}
|
||||||
$("#stars_value").val(num);
|
$("#stars_value").val(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ChoseZero()
|
||||||
|
{
|
||||||
|
if(confirm('是否确定评分为0分?'))
|
||||||
|
{
|
||||||
|
ChoseStars(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<div id="popbox">
|
<div id="popbox">
|
||||||
<div class="ping_con">
|
<div class="ping_con">
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseZero();">零分</a>
|
||||||
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||||
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||||
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
|
||||||
|
|
|
@ -3,7 +3,7 @@ showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').css('height','569px');
|
$('#ajax-modal').css('height','569px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||||
"<a href='#' onclick='hidden_homework_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
"<a href='javascript:void(0)' onclick='hidden_homework_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
$('#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");
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
|
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
|
||||||
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):</span>
|
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):</span>
|
||||||
<div class="problem_tit_div fl">
|
<div class="problem_tit_div fl">
|
||||||
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word" %>
|
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -34,31 +34,31 @@
|
||||||
<%#= form_tag({:controller => 'issues', :action => 'index', :project_id => @project}, :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
|
<%#= form_tag({:controller => 'issues', :action => 'index', :project_id => @project}, :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
|
||||||
<%= hidden_field_tag 'set_filter', '1' %>
|
<%= hidden_field_tag 'set_filter', '1' %>
|
||||||
<div class="problem_search" >
|
<div class="problem_search" >
|
||||||
<input class="problem_search_input fl" id="v_subject" type="text" name="v[subject]" value="" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
<input class="problem_search_input fl" id="v_subject" type="text" name="v[subject]" value="<%= @subject ? @subject : ""%>" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
||||||
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
||||||
</div><!--problem_search end-->
|
</div><!--problem_search end-->
|
||||||
|
|
||||||
<div id="filter_form" class="fr" >
|
<div id="filter_form" class="fr" >
|
||||||
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给",0]),
|
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给",0]),
|
||||||
{ :include_blank => false,:selected=>0
|
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
|
||||||
},
|
},
|
||||||
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"}
|
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"}
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
|
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
|
||||||
{ :include_blank => false,:selected=>0
|
{ :include_blank => false,:selected=>@priority_id ? @priority_id : 0
|
||||||
},
|
},
|
||||||
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"v[priority_id]",:class=>"w90"}
|
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"v[priority_id]",:class=>"w90"}
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
|
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
|
||||||
{ :include_blank => false,:selected=>0
|
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
|
||||||
},
|
},
|
||||||
{:onchange=>"remote_function();",:id=>"status_id",:name=>"v[status_id]",:class=>"w90"}
|
{:onchange=>"remote_function();",:id=>"status_id",:name=>"v[status_id]",:class=>"w90"}
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
|
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
|
||||||
{ :include_blank => false,:selected=>0
|
{ :include_blank => false,:selected=>@author_id ? @author_id : 0
|
||||||
},
|
},
|
||||||
{:onchange=>"remote_function();",:id=>"author_id",:name=>"v[author_id]",:class=>"w90"}
|
{:onchange=>"remote_function();",:id=>"author_id",:name=>"v[author_id]",:class=>"w90"}
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
|
<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
|
||||||
<div class="pro_page_box">
|
<div class="pro_page_box">
|
||||||
<div class="pro_page_top break_word">
|
<div class="pro_page_top break_word">
|
||||||
<a href="javascript:void(0)"><%= @issue.project.name %></a> >
|
<%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %>
|
||||||
<a href="javascript:void(0)"><%= "#" + @issue.project_index %></a>
|
<a href="javascript:void(0)"><%= "#" + @issue.project_index %></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="problem_main">
|
<div class="problem_main">
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.member_of?(@project) %>
|
<% if User.current.member_of?(@project) %>
|
||||||
<%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
|
<%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<% end %><!--meny end -->
|
<% end %><!--meny end -->
|
||||||
|
|
||||||
<!-- more -->
|
<!-- more -->
|
||||||
<div class="subNav subNav_jiantou" onclick="expand_tools_expand();" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
<div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||||
<ul class="navContent">
|
<ul class="navContent" id="navContent">
|
||||||
<%= render 'projects/tools_expand' %>
|
<%= render 'projects/tools_expand' %>
|
||||||
</ul>
|
</ul>
|
|
@ -23,7 +23,7 @@
|
||||||
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.member_of?(@project) %>
|
<% if User.current.member_of?(@project) %>
|
||||||
<%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
|
<%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<%= javascript_heads %>
|
<%= javascript_heads %>
|
||||||
<%= heads_for_theme %>
|
<%= heads_for_theme %>
|
||||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
|
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
|
||||||
<%= javascript_include_tag 'project', 'header','select_list_move' %>
|
<%= javascript_include_tag 'cookie','project', 'header','select_list_move' %>
|
||||||
<%= call_hook :view_layouts_base_html_head %>
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
<!-- page specific tags -->
|
<!-- page specific tags -->
|
||||||
<%= yield :header_tags -%>
|
<%= yield :header_tags -%>
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
<%=l(:label_project_hosting_platform) %>
|
<%=l(:label_project_hosting_platform) %>
|
||||||
</a>
|
</a>
|
||||||
>
|
>
|
||||||
<%= link_to @project.name, nil %>
|
<%= link_to @project.name, project_path(@project.id) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="search fl">
|
<div class="search fl">
|
||||||
|
@ -122,13 +122,12 @@
|
||||||
<!-- 项目得分 -->
|
<!-- 项目得分 -->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<a class="pr_info_name fl c_dark fb break_word" href="javascript:void(0)" target="_blank" >
|
<%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||||
<%= l(:label_project_name) %><%= @project.name %>
|
|
||||||
<% if @project.is_public? %>
|
<% if @project.is_public? %>
|
||||||
<span class="img_private"><%= l(:label_public)%></span>
|
<span class="img_private"><%= l(:label_public)%></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="img_private"><%= l(:label_private)%></span>
|
<span class="img_private"><%= l(:label_private)%></span>
|
||||||
<% end %></a>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -158,8 +157,8 @@
|
||||||
<!--邀请加入-->
|
<!--邀请加入-->
|
||||||
<div class="subNavBox">
|
<div class="subNavBox">
|
||||||
<% if User.current.member_of?(@project) %>
|
<% if User.current.member_of?(@project) %>
|
||||||
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" onclick="expand_tools_expand('invit');"><%= l(:label_invite)%></div>
|
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" onclick="$('#navContent_invit').toggle(500);"><%= l(:label_invite)%></div>
|
||||||
<ul class="navContent " style="display:block">
|
<ul class="navContent " style="display:block" id="navContent_invit">
|
||||||
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
|
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
|
||||||
<% if User.current.allowed_to?(:manage_members, @project) %>
|
<% if User.current.allowed_to?(:manage_members, @project) %>
|
||||||
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
|
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
|
||||||
|
|
|
@ -28,11 +28,6 @@
|
||||||
添加于<%= format_time(@topic.created_on) %>
|
添加于<%= format_time(@topic.created_on) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<%= link_to(
|
|
||||||
l(:button_edit),
|
|
||||||
{:action => 'edit', :id => @topic},
|
|
||||||
:class => 'talk_edit fr'
|
|
||||||
) if @message.course_editable_by?(User.current) %>
|
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
{:action => 'destroy', :id => @topic},
|
{:action => 'destroy', :id => @topic},
|
||||||
|
@ -40,6 +35,11 @@
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:class => 'talk_edit fr'
|
:class => 'talk_edit fr'
|
||||||
) if @message.course_destroyable_by?(User.current) %>
|
) if @message.course_destroyable_by?(User.current) %>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_edit),
|
||||||
|
{:action => 'edit', :id => @topic},
|
||||||
|
:class => 'talk_edit fr'
|
||||||
|
) if @message.course_editable_by?(User.current) %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="talk_info mb10 upload_img break_word"><%= @topic.content.html_safe %></div>
|
<div class="talk_info mb10 upload_img break_word"><%= @topic.content.html_safe %></div>
|
||||||
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
|
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
|
||||||
|
@ -105,6 +105,7 @@
|
||||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
||||||
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
||||||
<%= link_to l(:button_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
|
<%= link_to l(:button_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
|
||||||
|
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fl c_white" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||||
<%= error_messages_for 'message' %>
|
<%= error_messages_for 'message' %>
|
||||||
<% replying ||= false %>
|
<% replying ||= false %>
|
||||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
<div style="display:<%= replying ? 'none' : 'block'%>;" class="fl"><label><span class="c_red">*</span> <%= l(:field_subject) %> :</label></div>
|
||||||
<% if replying %>
|
<% if replying %>
|
||||||
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
|
<div style="display: none;"><%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585 fl" }.merge(extra_option) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
<p id="subject_span" class="ml55"></p>
|
<p id="subject_span" class="ml55"></p>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml60 mb5">
|
<li class="ml60 mb5">
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||||
<label class="fl" >
|
<label class="fl" >
|
||||||
<span class="c_red">*</span>
|
<span class="c_red">*</span>
|
||||||
<%= l(:field_description) %> :
|
<%= l(:field_description) %> :
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<p id="subject_span" class="ml55"></p>
|
<p id="subject_span" class="ml55"></p>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml60 mb5">
|
<li class="ml55 mb5">
|
||||||
<% unless replying %>
|
<% unless replying %>
|
||||||
<% if @message.safe_attribute? 'sticky' %>
|
<% if @message.safe_attribute? 'sticky' %>
|
||||||
<%= f.check_box :sticky %>
|
<%= f.check_box :sticky %>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||||
<label class="fl ml3" > <%= l(:field_description) %> :</label>
|
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<% if @message.project %>
|
<% if @message.project %>
|
||||||
<%#= board_breadcrumb(@message) %>
|
<%#= board_breadcrumb(@message) %>
|
||||||
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
||||||
<div class="talk_new ml15">
|
<div class="ml15">
|
||||||
<ul>
|
<ul>
|
||||||
<%= form_for @message, { :as => :message,
|
<%= form_for @message, { :as => :message,
|
||||||
:url => {:action => 'edit'},
|
:url => {:action => 'edit'},
|
||||||
|
|
|
@ -5,3 +5,4 @@ $('#quote_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||||
|
|
||||||
showAndScrollTo("reply", "message_content");
|
showAndScrollTo("reply", "message_content");
|
||||||
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
||||||
|
$("img").removeAttr("align");
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!-- 昵称 -->
|
<!-- 昵称 -->
|
||||||
<p style="width:630px;padding-left: 40px;">
|
<p style="width:730px;padding-left: 40px;">
|
||||||
<%= f.text_field :login, :required => true, :size => 25, :name => "login", :style => 'border:1px solid #d3d3d3;'%>
|
<%= f.text_field :login, :required => true, :size => 25, :name => "login", :style => 'border:1px solid #d3d3d3;'%>
|
||||||
<span class='font_lighter'><%= l(:label_max_number) %></span>
|
<span class='font_lighter'><%= l(:label_max_number) %></span>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
<script>
|
|
||||||
function clearMessage()
|
|
||||||
{
|
|
||||||
$("#news_comment").html("<%= escape_javascript(hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none') %><%= escape_javascript(kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字")%>");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
||||||
|
@ -39,7 +33,7 @@
|
||||||
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
||||||
</div>
|
</div>
|
||||||
<p class="mt10">
|
<p class="mt10">
|
||||||
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="clearMessage();">
|
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="KindEditor.instances[0].html('');">
|
||||||
<%= l(:label_cancel_with_space) %>
|
<%= l(:label_cancel_with_space) %>
|
||||||
</a>
|
</a>
|
||||||
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
|
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||||
<div class="member_search">
|
<div class="member_search">
|
||||||
<input hidden="hidden" value="true" name="flag">
|
<input hidden="hidden" value="true" name="flag">
|
||||||
<input id="principal_search" class="member_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
|
<input id="principal_search" class="member_search_input fl" type="text" placeholder="<%= l(:label_invite_trustie_user_tips)%>">
|
||||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@project, :format => 'js',:flag => true) }')" %>
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@project, :format => 'js',:flag => true) }')" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,18 @@
|
||||||
</li>
|
</li>
|
||||||
<% roles.each do |role| %>
|
<% roles.each do |role| %>
|
||||||
<li class="fl mr5">
|
<li class="fl mr5">
|
||||||
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||||
<%= h role %>
|
<% if User.current.language == "zh" %>
|
||||||
|
<% if role.id == 3 %>
|
||||||
|
<label >管理人员</label>
|
||||||
|
<% elsif role.id == 4 %>
|
||||||
|
<label >开发人员</label>
|
||||||
|
<% else %>
|
||||||
|
<label >报告人员</label>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<label ><%= h role %></label>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
<%
|
<%
|
||||||
roles = Role.givable.all
|
roles = Role.givable.all
|
||||||
if @project.project_type == Project::ProjectType_course
|
if @project.project_type == Project::ProjectType_course
|
||||||
roles = roles[3..5]
|
if User.current.language == "zh"
|
||||||
|
roles = ["管理人员","开发者","报告人员"]
|
||||||
|
else
|
||||||
|
roles = ["管理人员","开发者","报告人员"]
|
||||||
|
# roles = roles[3..5]
|
||||||
|
end
|
||||||
else
|
else
|
||||||
roles = roles[0..2]
|
roles = roles[0..2]
|
||||||
end
|
end
|
||||||
|
@ -18,7 +23,23 @@
|
||||||
<li >
|
<li >
|
||||||
<%= link_to_user_header member.principal,false,:class => "w140_h c_setting_blue fl" %>
|
<%= link_to_user_header member.principal,false,:class => "w140_h c_setting_blue fl" %>
|
||||||
<span class="w180_h fl">
|
<span class="w180_h fl">
|
||||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
<!--区分中英文角色显示的不同-->
|
||||||
|
<% if User.current.language == "zh" %>
|
||||||
|
<% zh_roles = [] %>
|
||||||
|
<% member.roles.each do |role| %>
|
||||||
|
<% if role.id == 3
|
||||||
|
zh_roles << "管理人员"
|
||||||
|
elsif role.id == 4
|
||||||
|
zh_roles << "开发人员"
|
||||||
|
else
|
||||||
|
zh_roles << "报告人员"
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
<% end %>
|
||||||
|
<%= h zh_roles.sort.reverse.collect(&:to_s).join(', ') %>
|
||||||
|
<% else %>
|
||||||
|
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
||||||
|
<% end %>
|
||||||
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||||
:method => :put,
|
:method => :put,
|
||||||
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
||||||
|
@ -27,7 +48,18 @@
|
||||||
<ul style="text-align: left;" >
|
<ul style="text-align: left;" >
|
||||||
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||||
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
||||||
<label ><%= h role %></label>
|
<!--编辑时候显示成员,中英文切换后面需从数据库的角度优化-->
|
||||||
|
<% if User.current.language == "zh" %>
|
||||||
|
<% if role.id == 3 %>
|
||||||
|
<label >管理人员</label>
|
||||||
|
<% elsif role.id == 4 %>
|
||||||
|
<label >开发人员</label>
|
||||||
|
<% else %>
|
||||||
|
<label >报告人员</label>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<label ><%= h role %></label>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<!--<br/>-->
|
<!--<br/>-->
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -91,7 +123,7 @@
|
||||||
<p class="c_blue fb mt10 mb5"><%= l(:label_member_new) %></p>
|
<p class="c_blue fb mt10 mb5"><%= l(:label_member_new) %></p>
|
||||||
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||||
<div class="member_search">
|
<div class="member_search">
|
||||||
<input id="principal_search" class="member_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
|
<input id="principal_search" class="member_search_input fl" type="text" placeholder="<%= l(:label_invite_trustie_user_tips)%>">
|
||||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
@ -107,7 +139,17 @@
|
||||||
<% roles.each do |role| %>
|
<% roles.each do |role| %>
|
||||||
<li>
|
<li>
|
||||||
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||||
<label ><%= h role %></label>
|
<% if User.current.language == "zh" %>
|
||||||
|
<% if role.id == 3 %>
|
||||||
|
<label >管理人员</label>
|
||||||
|
<% elsif role.id == 4 %>
|
||||||
|
<label >开发人员</label>
|
||||||
|
<% else %>
|
||||||
|
<label >报告人员</label>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<label ><%= h role %></label>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -30,13 +30,13 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="repos_more"><a id="showgithelp" value="hide_help" onclick ="showhelpAndScrollTo('repos_git_more','repos_git_more'); return false;" class="c_dblue lh23">收起Git操作指南</a></div>
|
<div class="repos_more"><a id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more'); " class="c_dblue lh23">展开Git操作指南</a></div>
|
||||||
<div id="repos_git_more">
|
<div id="repos_git_more">
|
||||||
<br>
|
<br>
|
||||||
<div class=" c_dark f14">
|
<div class=" c_dark f14">
|
||||||
<p>项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码</p>
|
<p>项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码。</p>
|
||||||
|
<p>通过cmd命令提示符进入代码对应文件夹的根目录,假设当前用户的登录名为user,版本库名称为demo,需要操作的版本库分支为branch。
|
||||||
<p>建立版本库文件夹,打开命令行执行如下:</p>
|
如果是首次提交代码,执行如下命令:</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="repos_explain">
|
<div class="repos_explain">
|
||||||
<p>git init</p>
|
<p>git init</p>
|
||||||
|
@ -46,19 +46,19 @@
|
||||||
<p>git commit -m "first commit"</p>
|
<p>git commit -m "first commit"</p>
|
||||||
|
|
||||||
<p>git remote add origin
|
<p>git remote add origin
|
||||||
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
|
http://user_demo@repository.trustie.net/user/demo.git
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
||||||
|
|
||||||
<p>git push -u origin master:master</p>
|
<p>git push -u origin branch:branch</p>
|
||||||
</div>
|
</div>
|
||||||
<!--repos_explain end-->
|
<!--repos_explain end-->
|
||||||
<div class="c_dark f14">
|
<div class="c_dark f14">
|
||||||
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
|
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="repos_explain">
|
<div class="repos_explain">
|
||||||
<p>git remote add origin http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
|
<p>git remote add origin http://user_demo@repository.trustie.net/user/demo.git</p>
|
||||||
|
|
||||||
<p>git add .</p>
|
<p>git add .</p>
|
||||||
|
|
||||||
|
@ -66,14 +66,14 @@
|
||||||
|
|
||||||
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
||||||
|
|
||||||
<p>git push -u origin master:master</p>
|
<p>git push -u origin branch:branch</p>
|
||||||
</div>
|
</div>
|
||||||
<!--repos_explain end-->
|
<!--repos_explain end-->
|
||||||
<div class="c_dark f14">
|
<div class="c_dark f14">
|
||||||
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
|
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="repos_explain">
|
<div class="repos_explain">
|
||||||
<p>git clone http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
|
<p>git clone http://user_demo@repository.trustie.net/user/demo.git</p>
|
||||||
|
|
||||||
<p>git push</p>
|
<p>git push</p>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="repos_explain">
|
<div class="repos_explain">
|
||||||
<p>git remote add trustie
|
<p>git remote add trustie
|
||||||
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
|
http://user_demo@repository.trustie.net/user/demo.git
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>git add .</p>
|
<p>git add .</p>
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
||||||
|
|
||||||
<p>git push -u trustie master:master</p>
|
<p>git push -u trustie branch:branch</p>
|
||||||
|
|
||||||
<p><a href="/users/646" class="c_orange">李海</a>提供</p>
|
<p><a href="/users/646" class="c_orange">李海</a>提供</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
(<%= course.members.count %>人)
|
(<%= course.members.count %>人)
|
||||||
<% files_count = course.attachments.count %>
|
<% files_count = course.attachments.count %>
|
||||||
<% if files_count > 0%>
|
<% if files_count > 0%>
|
||||||
(<%= link_to "#{files_count.to_s}份", course_files_path(course) %>资料)
|
(<%= link_to "#{files_count.to_s}份", course_files_path(course) %>公开资料)
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Rails.application.config.session_store ActionDispatch::Session::CacheStore, :expire_after => 20.minutes, :key => '_trustie_session', :domain => :all
|
Rails.application.config.session_store ActionDispatch::Session::CacheStore, :expire_after => 90.minutes, :key => '_trustie_session', :domain => :all
|
||||||
|
|
|
@ -11,7 +11,7 @@ zh:
|
||||||
#
|
#
|
||||||
# 公共变量
|
# 公共变量
|
||||||
#
|
#
|
||||||
label_max_number: "登录名是在网站中显示的您的公开标识,只能为英文和数字。"
|
label_max_number: "登录名是在网站中显示的您的公开标识,只能为下划线、@、.以及英文和数字。"
|
||||||
field_login: 登录名
|
field_login: 登录名
|
||||||
|
|
||||||
field_password: 密码
|
field_password: 密码
|
||||||
|
|
|
@ -351,7 +351,7 @@ zh:
|
||||||
# 意见反馈
|
# 意见反馈
|
||||||
#
|
#
|
||||||
label_feedback: 意见反馈
|
label_feedback: 意见反馈
|
||||||
label_feedback_tips: "有什么想说的,尽管来咆哮吧~~"
|
label_feedback_tips: "欢迎反馈网站问题,课程中遇到的问题请反馈给相关老师!"
|
||||||
label_technical_support: "技术支持:"
|
label_technical_support: "技术支持:"
|
||||||
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
|
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
|
||||||
label_feedback_value: "该帖来自用户反馈:)"
|
label_feedback_value: "该帖来自用户反馈:)"
|
||||||
|
|
|
@ -15,8 +15,8 @@ zh:
|
||||||
label_forum_all: 公共贴吧
|
label_forum_all: 公共贴吧
|
||||||
label_school_all: 中国高校
|
label_school_all: 中国高校
|
||||||
label_contest_innovate: 创新竞赛
|
label_contest_innovate: 创新竞赛
|
||||||
#label_software_user: 软件创客
|
label_software_user: 软件创客
|
||||||
#label_requirement_enterprise: 软件众包
|
label_requirement_enterprise: 软件众包
|
||||||
label_stores_index: 资源搜索
|
label_stores_index: 资源搜索
|
||||||
label_login: 登录
|
label_login: 登录
|
||||||
|
|
||||||
|
|
|
@ -338,7 +338,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_invite_success: 邀请成功
|
label_invite_success: 邀请成功
|
||||||
|
@ -415,3 +415,4 @@ zh:
|
||||||
#
|
#
|
||||||
field_sharing: 共享
|
field_sharing: 共享
|
||||||
label_title_code_review: 代码评审
|
label_title_code_review: 代码评审
|
||||||
|
label_home_non_project: 您还没有创建项目,您可以查看系统的其它项目!
|
|
@ -227,6 +227,8 @@ RedmineApp::Application.routes.draw do
|
||||||
match '/projects/search', :via => [:get, :post]
|
match '/projects/search', :via => [:get, :post]
|
||||||
match '/users/search', :via => [:get, :post]
|
match '/users/search', :via => [:get, :post]
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
match 'account/heartbeat', to: 'account#heartbeat', :via => :get
|
||||||
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
||||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||||
match 'account/register', :via => [:get, :post], :as => 'register'
|
match 'account/register', :via => [:get, :post], :as => 'register'
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIndexToHomeworkattachBidId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index(:homework_attaches,:bid_id)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIndexToStudentforcourseStudentId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index(:students_for_courses,:student_id)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIndexToStudentforcourseCourseId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index(:students_for_courses,:course_id)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIndexToHomeworkforcourseCourseId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index(:homework_for_courses,:course_id)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIndexToHomeworkforcourseBidId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index(:homework_for_courses,:bid_id)
|
||||||
|
end
|
||||||
|
end
|
27
db/schema.rb
27
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20150428021035) do
|
ActiveRecord::Schema.define(:version => 20150505025537) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -438,13 +438,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) 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
|
||||||
|
@ -541,6 +534,8 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
||||||
t.integer "is_teacher_score", :default => 0
|
t.integer "is_teacher_score", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
||||||
|
|
||||||
create_table "homework_evaluations", :force => true do |t|
|
create_table "homework_evaluations", :force => true do |t|
|
||||||
t.string "user_id"
|
t.string "user_id"
|
||||||
t.string "homework_attach_id"
|
t.string "homework_attach_id"
|
||||||
|
@ -553,6 +548,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
||||||
t.integer "bid_id"
|
t.integer "bid_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
|
||||||
|
add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
|
||||||
|
|
||||||
create_table "homework_users", :force => true do |t|
|
create_table "homework_users", :force => true do |t|
|
||||||
t.string "homework_attach_id"
|
t.string "homework_attach_id"
|
||||||
t.string "user_id"
|
t.string "user_id"
|
||||||
|
@ -654,16 +652,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
||||||
|
|
||||||
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
||||||
|
|
||||||
create_table "journal_details_copy", :force => true do |t|
|
|
||||||
t.integer "journal_id", :default => 0, :null => false
|
|
||||||
t.string "property", :limit => 30, :default => "", :null => false
|
|
||||||
t.string "prop_key", :limit => 30, :default => "", :null => false
|
|
||||||
t.text "old_value"
|
|
||||||
t.text "value"
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
|
|
||||||
|
|
||||||
create_table "journal_replies", :id => false, :force => true do |t|
|
create_table "journal_replies", :id => false, :force => true do |t|
|
||||||
t.integer "journal_id"
|
t.integer "journal_id"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
@ -1169,6 +1157,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
|
||||||
|
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
|
||||||
|
|
||||||
create_table "taggings", :force => true do |t|
|
create_table "taggings", :force => true do |t|
|
||||||
t.integer "tag_id"
|
t.integer "tag_id"
|
||||||
t.integer "taggable_id"
|
t.integer "taggable_id"
|
||||||
|
|
|
@ -55,7 +55,7 @@ module RailsKindeditor
|
||||||
}"
|
}"
|
||||||
else
|
else
|
||||||
"KindEditor.ready(function(K){
|
"KindEditor.ready(function(K){
|
||||||
#{editor_id}K.create('##{dom_id}', #{get_options(options).to_json});
|
#{editor_id}K.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste');
|
||||||
});"
|
});"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
desc "compress and backup avatar"
|
||||||
|
task :compress_avatar => :environment do
|
||||||
|
path = File.join(Rails.root, "public/images/avatars/User")
|
||||||
|
Dir.foreach(path) do |f|
|
||||||
|
if f.to_s =~ /^\d+$/
|
||||||
|
puts f
|
||||||
|
image = Trustie::Utils::Image.new(File.join(path,f), true)
|
||||||
|
image.compress(300)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1 +1,2 @@
|
||||||
require 'trustie/utils'
|
require 'trustie/utils'
|
||||||
|
require 'trustie/utils/image'
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
module Trustie
|
||||||
|
module Utils
|
||||||
|
class Image
|
||||||
|
def initialize(file, bak)
|
||||||
|
@file = file
|
||||||
|
@bak = bak
|
||||||
|
end
|
||||||
|
|
||||||
|
def compress(size=300)
|
||||||
|
backup if @bak
|
||||||
|
begin
|
||||||
|
f = Magick::ImageList.new(@file)
|
||||||
|
if f.format != 'GIF'
|
||||||
|
width = size
|
||||||
|
if f[0].columns > width
|
||||||
|
proportion = (width/f[0].columns.to_f)
|
||||||
|
height = (f[0].rows*proportion)
|
||||||
|
f.resize_to_fill!(width,height.to_i)
|
||||||
|
f.write(@file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
logger.error "[Error] compress : ===> #{e}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def backup
|
||||||
|
FileUtils.cp @file, "#{@file}.bak"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,37 @@
|
||||||
|
KindEditor.plugin('paste', function(K) {
|
||||||
|
var editor = this,
|
||||||
|
name = 'paste';
|
||||||
|
var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow;
|
||||||
|
contentWindow.document.getElementsByTagName('body')[0].onpaste = function(event) {
|
||||||
|
// use event.originalEvent.clipboard for newer chrome versions
|
||||||
|
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||||
|
console.log(JSON.stringify(items)); // will give you the mime types
|
||||||
|
// find pasted image among pasted items
|
||||||
|
var blob = null;
|
||||||
|
for (var i = 0; i < items.length; i++) {
|
||||||
|
if (items[i].type.indexOf("image") === 0) {
|
||||||
|
blob = items[i].getAsFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// load image if there is a pasted image
|
||||||
|
if (blob !== null) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(event) {
|
||||||
|
console.log(event.target.result); // data url!
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("imgFile", blob, "imageFilename.png");
|
||||||
|
$.ajax({
|
||||||
|
url: '/kindeditor/upload?dir=image',
|
||||||
|
contentType: false,
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
processData: false,
|
||||||
|
success: function(data) {
|
||||||
|
editor.exec('insertimage', JSON.parse(data).url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(blob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
|
@ -571,10 +571,16 @@ function warnLeavingUnsaved(message) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setupHeartBeat(){
|
||||||
|
var time = 60*1000*30; // 30 mins
|
||||||
|
setInterval(function(){$.getJSON('/account/heartbeat');},time);
|
||||||
|
}
|
||||||
|
|
||||||
function setupAjaxIndicator() {
|
function setupAjaxIndicator() {
|
||||||
|
|
||||||
$('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) {
|
$('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) {
|
||||||
|
if(settings && settings.url && settings.url.endsWith('account/heartbeat')){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {
|
if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {
|
||||||
$('#ajax-indicator').show();
|
$('#ajax-indicator').show();
|
||||||
}
|
}
|
||||||
|
@ -622,6 +628,7 @@ function transpotUrl (scope) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(setupAjaxIndicator);
|
$(document).ready(setupAjaxIndicator);
|
||||||
|
$(document).ready(setupHeartBeat);
|
||||||
$(document).ready(hideOnLoad);
|
$(document).ready(hideOnLoad);
|
||||||
$(document).ready(addFormObserversForDoubleSubmit);
|
$(document).ready(addFormObserversForDoubleSubmit);
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,9 @@ function dragOutHandler(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupFileDrop() {
|
function setupFileDrop() {
|
||||||
|
$('#avatar_image').on('click', function(){
|
||||||
|
console.log("click");
|
||||||
|
});
|
||||||
if (window.File && window.FileList && window.ProgressEvent && window.FormData) {
|
if (window.File && window.FileList && window.ProgressEvent && window.FormData) {
|
||||||
|
|
||||||
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
|
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
//保存cookie
|
||||||
|
//n:cookie的名字
|
||||||
|
//v:cookie的值
|
||||||
|
//mins:时间(分钟)
|
||||||
|
//dn:
|
||||||
|
//path:保存路径
|
||||||
|
function cookiesave(n, v, mins, dn, path)
|
||||||
|
{
|
||||||
|
if(n)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!mins) mins = 365 * 24 * 60;
|
||||||
|
if(!path) path = "/";
|
||||||
|
var date = new Date();
|
||||||
|
|
||||||
|
date.setTime(date.getTime() + (mins * 60 * 1000));
|
||||||
|
|
||||||
|
var expires = "; expires=" + date.toGMTString();
|
||||||
|
|
||||||
|
if(dn) dn = "domain=" + dn + "; ";
|
||||||
|
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取cookie
|
||||||
|
function cookieget(n)
|
||||||
|
{
|
||||||
|
var name = n + "=";
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for(var i=0;i<ca.length;i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||||
|
if (c.indexOf(name) == 0){
|
||||||
|
return c.substring(name.length,c.length);}
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
|
@ -8,6 +8,10 @@ function course_setting(id)
|
||||||
$('#tbc_0'+(3-id)).removeClass().addClass("undis");
|
$('#tbc_0'+(3-id)).removeClass().addClass("undis");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$("img").removeAttr("align");
|
||||||
|
});
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
//添加分班
|
//添加分班
|
||||||
function add_group(url,course_id) {
|
function add_group(url,course_id) {
|
||||||
|
@ -266,6 +270,13 @@ function course_board_submit_message_replay()
|
||||||
$("#message_form").submit();
|
$("#message_form").submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function course_board_canel_message_replay()
|
||||||
|
{
|
||||||
|
$("#reply").hide(200);
|
||||||
|
$("#message_quote").html("");
|
||||||
|
}
|
||||||
|
|
||||||
function MessageReplayVevify() {
|
function MessageReplayVevify() {
|
||||||
var content = message_content_editor.html();//$.trim($("#message_content").val());
|
var content = message_content_editor.html();//$.trim($("#message_content").val());
|
||||||
if (content.length == 0) {
|
if (content.length == 0) {
|
||||||
|
@ -527,3 +538,44 @@ function search_tag_attachment(url,tag_name,q,course_id,sort)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 课程讨论区
|
||||||
|
function showhelpAndScrollToMessage(id, id1, count) {
|
||||||
|
$('#' + id).toggle();
|
||||||
|
if(cookieget("repositories_visiable") == "true")
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", false,'','','');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", true,'','','');
|
||||||
|
}
|
||||||
|
var information = $(id1);
|
||||||
|
var val = information.attr("value");
|
||||||
|
if(val=="show_help")
|
||||||
|
{
|
||||||
|
$(id1).text("收起回复(" + count + ")" );
|
||||||
|
information.attr("value", "hide_help");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(id1).text("展开回复(" + count + ")");
|
||||||
|
information.attr("value", "show_help");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function show_more_reply(contentid, id2, id3) {
|
||||||
|
$(contentid).toggleClass("course_description_none");
|
||||||
|
var information = $(id2);
|
||||||
|
var arrow = $(id3);
|
||||||
|
var val = information.attr("value");
|
||||||
|
if (val == "show_more") {
|
||||||
|
$(id2).text("[收起]");
|
||||||
|
information.attr("value", "hide_more");
|
||||||
|
arrow.attr("src", "/images/jiantouup.jpg")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(id2).text("[展开]");
|
||||||
|
information.attr("value", "show_more");
|
||||||
|
arrow.attr("src", "/images/jiantou.jpg")
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,292 @@
|
||||||
|
// Generated by CoffeeScript 1.9.0
|
||||||
|
|
||||||
|
/*
|
||||||
|
paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
|
||||||
|
|
||||||
|
https://github.com/layerssss/paste.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var $, Paste, createHiddenEditable, dataURLtoBlob;
|
||||||
|
|
||||||
|
$ = window.jQuery;
|
||||||
|
|
||||||
|
$.paste = function(pasteContainer) {
|
||||||
|
var pm;
|
||||||
|
if (typeof console !== "undefined" && console !== null) {
|
||||||
|
console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead.");
|
||||||
|
}
|
||||||
|
pm = Paste.mountNonInputable(pasteContainer);
|
||||||
|
return pm._container;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.pastableNonInputable = function() {
|
||||||
|
var el, _i, _len;
|
||||||
|
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
||||||
|
el = this[_i];
|
||||||
|
Paste.mountNonInputable(el);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.pastableTextarea = function() {
|
||||||
|
var el, _i, _len;
|
||||||
|
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
||||||
|
el = this[_i];
|
||||||
|
Paste.mountTextarea(el);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.pastableContenteditable = function() {
|
||||||
|
var el, _i, _len;
|
||||||
|
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
||||||
|
el = this[_i];
|
||||||
|
Paste.mountContenteditable(el);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
dataURLtoBlob = function(dataURL, sliceSize) {
|
||||||
|
var b64Data, byteArray, byteArrays, byteCharacters, byteNumbers, contentType, i, m, offset, slice, _ref;
|
||||||
|
if (sliceSize == null) {
|
||||||
|
sliceSize = 512;
|
||||||
|
}
|
||||||
|
if (!(m = dataURL.match(/^data\:([^\;]+)\;base64\,(.+)$/))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
_ref = m, m = _ref[0], contentType = _ref[1], b64Data = _ref[2];
|
||||||
|
byteCharacters = atob(b64Data);
|
||||||
|
byteArrays = [];
|
||||||
|
offset = 0;
|
||||||
|
while (offset < byteCharacters.length) {
|
||||||
|
slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||||
|
byteNumbers = new Array(slice.length);
|
||||||
|
i = 0;
|
||||||
|
while (i < slice.length) {
|
||||||
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
byteArray = new Uint8Array(byteNumbers);
|
||||||
|
byteArrays.push(byteArray);
|
||||||
|
offset += sliceSize;
|
||||||
|
}
|
||||||
|
return new Blob(byteArrays, {
|
||||||
|
type: contentType
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
createHiddenEditable = function() {
|
||||||
|
return $(document.createElement('div')).attr('contenteditable', true).css({
|
||||||
|
width: 1,
|
||||||
|
height: 1,
|
||||||
|
position: 'fixed',
|
||||||
|
left: -100,
|
||||||
|
overflow: 'hidden'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Paste = (function() {
|
||||||
|
Paste.prototype._target = null;
|
||||||
|
|
||||||
|
Paste.prototype._container = null;
|
||||||
|
|
||||||
|
Paste.mountNonInputable = function(nonInputable) {
|
||||||
|
var paste;
|
||||||
|
paste = new Paste(createHiddenEditable().appendTo(nonInputable), nonInputable);
|
||||||
|
$(nonInputable).on('click', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return paste._container.focus();
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
paste._container.on('focus', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(nonInputable).addClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
return paste._container.on('blur', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(nonInputable).removeClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
};
|
||||||
|
|
||||||
|
Paste.mountTextarea = function(textarea) {
|
||||||
|
var ctlDown, paste;
|
||||||
|
if (-1 !== navigator.userAgent.toLowerCase().indexOf('chrome')) {
|
||||||
|
return this.mountContenteditable(textarea);
|
||||||
|
}
|
||||||
|
paste = new Paste(createHiddenEditable().insertBefore(textarea), textarea);
|
||||||
|
ctlDown = false;
|
||||||
|
$(textarea).on('keyup', function(ev) {
|
||||||
|
var _ref;
|
||||||
|
if ((_ref = ev.keyCode) === 17 || _ref === 224) {
|
||||||
|
return ctlDown = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(textarea).on('keydown', function(ev) {
|
||||||
|
var _ref;
|
||||||
|
if ((_ref = ev.keyCode) === 17 || _ref === 224) {
|
||||||
|
ctlDown = true;
|
||||||
|
}
|
||||||
|
if (ctlDown && ev.keyCode === 86) {
|
||||||
|
return paste._container.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(paste._target).on('pasteImage', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(textarea).focus();
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
$(paste._target).on('pasteText', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(textarea).focus();
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
$(textarea).on('focus', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(textarea).addClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
return $(textarea).on('blur', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(textarea).removeClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
};
|
||||||
|
|
||||||
|
Paste.mountContenteditable = function(contenteditable) {
|
||||||
|
var paste;
|
||||||
|
paste = new Paste(contenteditable, contenteditable);
|
||||||
|
$(contenteditable).on('focus', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(contenteditable).addClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
return $(contenteditable).on('blur', (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return $(contenteditable).removeClass('pastable-focus');
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
};
|
||||||
|
|
||||||
|
function Paste(_at__container, _at__target) {
|
||||||
|
this._container = _at__container;
|
||||||
|
this._target = _at__target;
|
||||||
|
this._container = $(this._container);
|
||||||
|
this._target = $(this._target).addClass('pastable');
|
||||||
|
this._container.on('paste', (function(_this) {
|
||||||
|
return function(ev) {
|
||||||
|
var clipboardData, file, item, reader, text, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _results;
|
||||||
|
if (((_ref = ev.originalEvent) != null ? _ref.clipboardData : void 0) != null) {
|
||||||
|
clipboardData = ev.originalEvent.clipboardData;
|
||||||
|
if (clipboardData.items) {
|
||||||
|
_ref1 = clipboardData.items;
|
||||||
|
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||||
|
item = _ref1[_i];
|
||||||
|
if (item.type.match(/^image\//)) {
|
||||||
|
reader = new FileReader();
|
||||||
|
reader.onload = function(event) {
|
||||||
|
return _this._handleImage(event.target.result);
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(item.getAsFile());
|
||||||
|
}
|
||||||
|
if (item.type === 'text/plain') {
|
||||||
|
item.getAsString(function(string) {
|
||||||
|
return _this._target.trigger('pasteText', {
|
||||||
|
text: string
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (-1 !== Array.prototype.indexOf.call(clipboardData.types, 'text/plain')) {
|
||||||
|
text = clipboardData.getData('Text');
|
||||||
|
_this._target.trigger('pasteText', {
|
||||||
|
text: text
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_this._checkImagesInContainer(function(src) {
|
||||||
|
return _this._handleImage(src);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clipboardData = window.clipboardData) {
|
||||||
|
if ((_ref2 = (text = clipboardData.getData('Text'))) != null ? _ref2.length : void 0) {
|
||||||
|
return _this._target.trigger('pasteText', {
|
||||||
|
text: text
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_ref3 = clipboardData.files;
|
||||||
|
_results = [];
|
||||||
|
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
|
||||||
|
file = _ref3[_j];
|
||||||
|
_this._handleImage(URL.createObjectURL(file));
|
||||||
|
_results.push(_this._checkImagesInContainer(function() {}));
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
Paste.prototype._handleImage = function(src) {
|
||||||
|
var loader;
|
||||||
|
loader = new Image();
|
||||||
|
loader.onload = (function(_this) {
|
||||||
|
return function() {
|
||||||
|
var blob, canvas, ctx, dataURL;
|
||||||
|
canvas = document.createElement('canvas');
|
||||||
|
canvas.width = loader.width;
|
||||||
|
canvas.height = loader.height;
|
||||||
|
ctx = canvas.getContext('2d');
|
||||||
|
ctx.drawImage(loader, 0, 0, canvas.width, canvas.height);
|
||||||
|
dataURL = null;
|
||||||
|
try {
|
||||||
|
dataURL = canvas.toDataURL('image/png');
|
||||||
|
blob = dataURLtoBlob(dataURL);
|
||||||
|
} catch (_error) {}
|
||||||
|
if (dataURL) {
|
||||||
|
return _this._target.trigger('pasteImage', {
|
||||||
|
blob: blob,
|
||||||
|
dataURL: dataURL,
|
||||||
|
width: loader.width,
|
||||||
|
height: loader.height
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})(this);
|
||||||
|
return loader.src = src;
|
||||||
|
};
|
||||||
|
|
||||||
|
Paste.prototype._checkImagesInContainer = function(cb) {
|
||||||
|
var img, timespan, _i, _len, _ref;
|
||||||
|
timespan = Math.floor(1000 * Math.random());
|
||||||
|
_ref = this._container.find('img');
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
img = _ref[_i];
|
||||||
|
img["_paste_marked_" + timespan] = true;
|
||||||
|
}
|
||||||
|
return setTimeout((function(_this) {
|
||||||
|
return function() {
|
||||||
|
var _j, _len1, _ref1, _results;
|
||||||
|
_ref1 = _this._container.find('img');
|
||||||
|
_results = [];
|
||||||
|
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||||
|
img = _ref1[_j];
|
||||||
|
if (!img["_paste_marked_" + timespan]) {
|
||||||
|
cb(img.src);
|
||||||
|
}
|
||||||
|
_results.push($(img).remove());
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
|
};
|
||||||
|
})(this), 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
return Paste;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
}).call(this);
|
|
@ -33,9 +33,10 @@ function expand_tools_expand(content) {
|
||||||
$("#expand_tools_expand_invit").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
$("#expand_tools_expand_invit").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
|
// $("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
|
||||||
$("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
|
// $("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
|
||||||
$("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
// $("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
||||||
|
$("#navContent").toggle(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改数字控制速度, slideUp(500)控制卷起速度
|
// 修改数字控制速度, slideUp(500)控制卷起速度
|
||||||
|
@ -58,28 +59,87 @@ function show_more_msg() {
|
||||||
arrow.attr("src", "/images/jiantou.jpg")
|
arrow.attr("src", "/images/jiantou.jpg")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function show_more_reply(contentid, id2, id3) {
|
||||||
|
$(contentid).toggleClass("course_description_none");
|
||||||
//项目版本库git帮助文档显示
|
var information = $(id2);
|
||||||
function showhelpAndScrollTo(id, focus) {
|
var arrow = $(id3);
|
||||||
var information = $("#showgithelp");
|
|
||||||
var val = information.attr("value");
|
var val = information.attr("value");
|
||||||
if (val == "show_help") {
|
if (val == "show_more") {
|
||||||
$("#showgithelp").text("收起Git操作指南");
|
$(id2).text("[收起]");
|
||||||
information.attr("value", "hide_help");
|
information.attr("value", "hide_more");
|
||||||
$('#' + id).show();
|
arrow.attr("src", "/images/jiantouup.jpg")
|
||||||
if (focus !== null) {
|
|
||||||
$('#' + focus).focus();
|
|
||||||
}
|
|
||||||
$('html, body').animate({scrollTop: $('#' + id).offset().top}, 400);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#showgithelp").text("显示Git操作指南");
|
$(id2).text("[展开]");
|
||||||
information.attr("value", "show_help");
|
information.attr("value", "show_more");
|
||||||
$('#' + id).hide();
|
arrow.attr("src", "/images/jiantou.jpg")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//项目版本库git帮助文档显示
|
||||||
|
function showhelpAndScrollTo(id) {
|
||||||
|
$('#' + id).toggle();
|
||||||
|
if(cookieget("repositories_visiable") == "true")
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", false,'','','');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", true,'','','');
|
||||||
|
}
|
||||||
|
var information = $("#showgithelp");
|
||||||
|
var val = information.attr("value");
|
||||||
|
if(val=="show_help")
|
||||||
|
{
|
||||||
|
$("#showgithelp").text("收起Git操作指南");
|
||||||
|
information.attr("value", "hide_help");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#showgithelp").text("展开Git操作指南");
|
||||||
|
information.attr("value", "show_help");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function showhelpAndScrollToMessage(id, id1, count) {
|
||||||
|
$('#' + id).toggle();
|
||||||
|
if(cookieget("repositories_visiable") == "true")
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", false,'','','');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cookiesave("repositories_visiable", true,'','','');
|
||||||
|
}
|
||||||
|
var information = $(id1);
|
||||||
|
var val = information.attr("value");
|
||||||
|
if(val=="show_help")
|
||||||
|
{
|
||||||
|
$(id1).text("收起回复(" + count + ")" );
|
||||||
|
information.attr("value", "hide_help");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(id1).text("展开回复(" + count + ")");
|
||||||
|
information.attr("value", "show_help");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
var information = $("#showgithelp");
|
||||||
|
var val = information.attr("value");
|
||||||
|
if(cookieget("repositories_visiable") == "true")
|
||||||
|
{
|
||||||
|
$('#repos_git_more').hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#repos_git_more').show();
|
||||||
|
$("#showgithelp").text("收起Git操作指南");
|
||||||
|
information.attr("value", "hide_help");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -174,7 +174,7 @@ a:hover.work_edit{color: #fff; background: #64bdd9;}
|
||||||
.wzan a{ display: block;}
|
.wzan a{ display: block;}
|
||||||
a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;}
|
a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;}
|
||||||
a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
|
a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
|
||||||
.msg_box{ width:670px; height:205px; border-bottom:1px dashed #CCC; padding-top:10px;}
|
.msg_box{ width:670px; height:225px; border-bottom:1px dashed #CCC; padding-top:10px;}
|
||||||
.msg_box h4{ }
|
.msg_box h4{ }
|
||||||
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
|
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
|
||||||
|
|
||||||
|
@ -437,6 +437,7 @@ a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !impor
|
||||||
|
|
||||||
/*上传图片处理*/
|
/*上传图片处理*/
|
||||||
.upload_img img{max-width: 100%;}
|
.upload_img img{max-width: 100%;}
|
||||||
|
blockquote img{max-width: 100%;}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
||||||
|
@ -530,6 +531,41 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
|
||||||
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
|
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
|
||||||
a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
|
a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
|
||||||
|
|
||||||
|
/* 20150505讨论区*/
|
||||||
|
.w664{ width:664px;}
|
||||||
|
.w140{ width:140px;}
|
||||||
|
.talklist_box{ }
|
||||||
|
.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; margin-bottom:20px; margin-top: 10px;}
|
||||||
|
.talkmain_pic{}
|
||||||
|
a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
|
||||||
|
a:hover.talkmain_pic{border:1px solid #64bdd9;}
|
||||||
|
.talkmain_txt{ width:610px; margin-left:10px; color:#333;}
|
||||||
|
a.talkmain_name{ color:#ff5722;}
|
||||||
|
a:hover.talkmain_name{ color:#d33503;}
|
||||||
|
.talkmain_tit{ color:#0781b4; width:450px; display:block; }
|
||||||
|
.talklist_main{ }
|
||||||
|
.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||||
|
.talkConIpt{ background:#f2f2f2; }
|
||||||
|
.talkWrapBox{ width:610px; margin-left:60px; }
|
||||||
|
.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
|
||||||
|
.inputFeint02{ border:1px solid #d9d9d9; background:#fff; width:535px; height:30px; margin:5px 0 5px 50px; color:#666;}
|
||||||
|
.inputFeint03{ border:1px solid #d9d9d9; background:#fff; width:490px; height:30px; margin:5px 0 5px 0px; color:#666;}
|
||||||
|
.talkWrapMsg{ background:#f2f2f2; padding:10px;}
|
||||||
|
a.Msg_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3; float:left;}
|
||||||
|
a:hover.Msg_pic{border:1px solid #64bdd9;}
|
||||||
|
a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px solid #e3e3e3; float:left;}
|
||||||
|
a:hover.Reply_pic{border:1px solid #64bdd9;}
|
||||||
|
.Msg_txt{ float:left; width:540px; margin-left:10px;}
|
||||||
|
.Msg_txt p{ }
|
||||||
|
.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||||
|
.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
|
||||||
|
.Replybox{ float:left; width:495px; margin-left:5px;}
|
||||||
|
.talk_nextpage{ border:none; width:410px; margin:0 auto;}
|
||||||
|
.newtalk { margin-top:8px; margin-right:8px;}
|
||||||
|
/*.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}*/
|
||||||
|
#about_newtalk{ display:none;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
|
||||||
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
|
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
|
||||||
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
|
||||||
.ping_con p span a{ color:#777777;}
|
.ping_con p span a{ color:#777777;}
|
||||||
.ping_star{ width:165px; color:#333; font-weight:bold; margin-bottom:5px;}
|
.ping_star{ width:185px; color:#333; font-weight:bold; margin-bottom:5px;}
|
||||||
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;}
|
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;}
|
||||||
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
|
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
|
||||||
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}
|
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}
|
||||||
|
@ -175,6 +175,7 @@ a.member_search {width: 43px;height: 22px;background: #15bccf;color: #fff;text-a
|
||||||
/*上传图片处理*/
|
/*上传图片处理*/
|
||||||
.upload_img img{max-width: 100%;}
|
.upload_img img{max-width: 100%;}
|
||||||
|
|
||||||
|
.to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ a:hover.subnav_green{ background:#14ad5a;}
|
||||||
/*简介*/
|
/*简介*/
|
||||||
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
|
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
|
||||||
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
|
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
|
||||||
|
.project_board_content{overflow: hidden;max-height: 50px;word-break: break-all;word-wrap: break-word;}
|
||||||
.course_description_none{max-height: none;}
|
.course_description_none{max-height: none;}
|
||||||
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
|
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
|
||||||
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
|
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
|
||||||
|
|
|
@ -76,7 +76,7 @@ a.problem_name{ color:#ff5722; }
|
||||||
a:hover.problem_name{ color:#d33503;}
|
a:hover.problem_name{ color:#d33503;}
|
||||||
a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||||
a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;}
|
a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;}
|
||||||
.problem_tit_div{ color:#0781b4; font-weight:bold;width:400px; }
|
.problem_tit_div{ color:#0781b4; font-weight:bold;max-width:400px; }
|
||||||
a.problem_tit_a{ color:#0781b4; }
|
a.problem_tit_a{ color:#0781b4; }
|
||||||
.problem_tit_a:hover{ color:#09658c; }
|
.problem_tit_a:hover{ color:#09658c; }
|
||||||
a:hover.problem_tit,a:hover.problem_tit02{ color:#09658c; }
|
a:hover.problem_tit,a:hover.problem_tit02{ color:#09658c; }
|
||||||
|
@ -87,7 +87,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
|
||||||
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
|
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
|
||||||
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
|
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
|
||||||
.pro_pic_box{ margin-left:60px; }
|
.pro_pic_box{ margin-left:60px; }
|
||||||
.pro_pic{ width:100px; height:73px;line-height:73px;border:2px solid #CCC; margin:10px 0;}
|
.pro_pic{ width:100px; height:75px;line-height:73px;border:2px solid #CCC; margin:10px 0; text-align: center;}
|
||||||
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
|
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
|
||||||
.pro_info_box ul{}
|
.pro_info_box ul{}
|
||||||
.pro_info_box ul li{ margin-bottom:10px;}
|
.pro_info_box ul li{ margin-bottom:10px;}
|
||||||
|
@ -180,6 +180,7 @@ a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; col
|
||||||
/* 版本库展示Git操作文档 */
|
/* 版本库展示Git操作文档 */
|
||||||
.repos_more{height:23px; width:100%; border:1px solid #CCC; background:#F6F6F6; text-align:center; font-size:12px; padding-top:2px;}
|
.repos_more{height:23px; width:100%; border:1px solid #CCC; background:#F6F6F6; text-align:center; font-size:12px; padding-top:2px;}
|
||||||
.lh23{line-height: 23px;}
|
.lh23{line-height: 23px;}
|
||||||
|
.repos_git_more{display: none;}
|
||||||
|
|
||||||
/* 弹框 新样式还没设计出来,暂时用的课程那边的样式 */
|
/* 弹框 新样式还没设计出来,暂时用的课程那边的样式 */
|
||||||
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}
|
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}
|
||||||
|
@ -691,3 +692,38 @@ tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);
|
||||||
.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
|
.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
|
||||||
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
|
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
|
||||||
.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
|
.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
|
||||||
|
|
||||||
|
/* 20150505讨论区*/
|
||||||
|
.w664{ width:664px;}
|
||||||
|
.w140{ width:140px;}
|
||||||
|
.talklist_box{ }
|
||||||
|
.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; margin-bottom:20px; margin-top: 10px;}
|
||||||
|
.talkmain_pic{}
|
||||||
|
a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
|
||||||
|
a:hover.talkmain_pic{border:1px solid #64bdd9;}
|
||||||
|
.talkmain_txt{ width:610px; margin-left:10px; color:#333;}
|
||||||
|
a.talkmain_name{ color:#ff5722;}
|
||||||
|
a:hover.talkmain_name{ color:#d33503;}
|
||||||
|
.talkmain_tit{ color:#0781b4; width:450px; display:block; }
|
||||||
|
.talklist_main{ }
|
||||||
|
.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
|
||||||
|
.talkConIpt{ background:#f2f2f2; }
|
||||||
|
.talkWrapBox{ width:610px; margin-left:60px; }
|
||||||
|
.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
|
||||||
|
.inputFeint02{ border:1px solid #d9d9d9; background:#fff; width:535px; height:30px; margin:5px 0 5px 50px; color:#666;}
|
||||||
|
.inputFeint03{ border:1px solid #d9d9d9; background:#fff; width:490px; height:30px; margin:5px 0 5px 0px; color:#666;}
|
||||||
|
.talkWrapMsg{ background:#f2f2f2; padding:10px;}
|
||||||
|
a.Msg_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3; float:left;}
|
||||||
|
a:hover.Msg_pic{border:1px solid #64bdd9;}
|
||||||
|
a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px solid #e3e3e3; float:left;}
|
||||||
|
a:hover.Reply_pic{border:1px solid #64bdd9;}
|
||||||
|
.Msg_txt{ float:left; width:540px; margin-left:10px;}
|
||||||
|
.Msg_txt p{ }
|
||||||
|
.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||||
|
.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
|
||||||
|
.Replybox{ float:left; width:495px; margin-left:5px;}
|
||||||
|
.talk_nextpage{ border:none; width:410px; margin:0 auto;}
|
||||||
|
.newtalk { margin-top:8px; margin-right:8px;}
|
||||||
|
.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
|
||||||
|
#about_newtalk{ display:none;}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ h4{ font-size:14px; color:#3b3b3b;}
|
||||||
.ml10{ margin-left:10px;}
|
.ml10{ margin-left:10px;}
|
||||||
.ml15{ margin-left:15px;}
|
.ml15{ margin-left:15px;}
|
||||||
.ml20{ margin-left:20px;}
|
.ml20{ margin-left:20px;}
|
||||||
.ml25{ margin-left:25px;}
|
|
||||||
.ml40{ margin-left:40px;}
|
.ml40{ margin-left:40px;}
|
||||||
.ml45{ margin-left:45px;}
|
.ml45{ margin-left:45px;}
|
||||||
.ml55{ margin-left:55px;}
|
.ml55{ margin-left:55px;}
|
||||||
|
@ -64,23 +63,28 @@ h4{ font-size:14px; color:#3b3b3b;}
|
||||||
.ml60{ margin-left:60px;}
|
.ml60{ margin-left:60px;}
|
||||||
.ml80{ margin-left:80px;}
|
.ml80{ margin-left:80px;}
|
||||||
.ml90{ margin-left:90px;}
|
.ml90{ margin-left:90px;}
|
||||||
|
.ml100{ margin-left:100px;}
|
||||||
.ml110{ margin-left:110px;}
|
.ml110{ margin-left:110px;}
|
||||||
.mr5{ margin-right:5px;}
|
.mr5{ margin-right:5px;}
|
||||||
.mr10{ margin-right:10px;}
|
.mr10{ margin-right:10px;}
|
||||||
.mr20{ margin-right:20px;}
|
.mr20{ margin-right:20px;}
|
||||||
.mr30{ margin-right:30px;}
|
.mr30{ margin-right:30px;}
|
||||||
.mr40{ margin-right:40px;}
|
.mr40{ margin-right:40px;}
|
||||||
|
.mr50{margin-right: 50px;}
|
||||||
|
.mr55{margin-right: 55px;}
|
||||||
|
.mr70{margin-right: 70px;}
|
||||||
.mt3{ margin-top:3px;}
|
.mt3{ margin-top:3px;}
|
||||||
.mt5{ margin-top:5px;}
|
.mt5{ margin-top:5px;}
|
||||||
.mt8{ margin-top:8px;}
|
.mt8{ margin-top:8px;}
|
||||||
.mt10{ margin-top:10px;}
|
.mt10{ margin-top:10px;}
|
||||||
.mt13{ margin-top:13px;}
|
|
||||||
.mt43{ margin-top:43px;}
|
|
||||||
.mt40{ margin-top:40px;}
|
|
||||||
.mb5{ margin-bottom:5px;}
|
.mb5{ margin-bottom:5px;}
|
||||||
.mb10{ margin-bottom:10px;}
|
.mb10{ margin-bottom:10px;}
|
||||||
.mb13{ margin-bottom:13px;}
|
.mb20{ margin-bottom:20px;}
|
||||||
.pl15{ padding-left:15px;}
|
.pl15{ padding-left:15px;}
|
||||||
|
.w20{ width:20px;}
|
||||||
|
.w45{ width: 45px;}
|
||||||
|
.w60{ width:60px;}
|
||||||
|
.w70{ width:70px;}
|
||||||
.w90{ width:90px;}
|
.w90{ width:90px;}
|
||||||
.w210{ width:210px;}
|
.w210{ width:210px;}
|
||||||
.w150{ width:150px;}
|
.w150{ width:150px;}
|
||||||
|
@ -93,8 +97,10 @@ h4{ font-size:14px; color:#3b3b3b;}
|
||||||
.w350{ width:350px;}
|
.w350{ width:350px;}
|
||||||
.w610{ width:610px;}
|
.w610{ width:610px;}
|
||||||
.w600{ width:600px;}
|
.w600{ width:600px;}
|
||||||
|
.h22{ height:22px;}
|
||||||
.h26{ height:26px;}
|
.h26{ height:26px;}
|
||||||
.h50{ height:50px;}
|
.h50{ height:50px;}
|
||||||
|
.h70{ height:70px;}
|
||||||
.h150{ height:150px;}
|
.h150{ height:150px;}
|
||||||
|
|
||||||
/* Font & background Color */
|
/* Font & background Color */
|
||||||
|
|
Loading…
Reference in New Issue