Merge branch 'szzh' into develop
This commit is contained in:
commit
e4e683d59b
|
@ -1,30 +1,30 @@
|
|||
*.swp
|
||||
/.project
|
||||
/.idea
|
||||
/.bundle
|
||||
*.swp
|
||||
/config/database.yml
|
||||
/config/configuration.yml
|
||||
/config/additional_environment.rb
|
||||
/files/*
|
||||
/log/*
|
||||
/public/tmp/*
|
||||
/tmp/*
|
||||
/public/cache/*
|
||||
.gitignore
|
||||
/config/newrelic.yml
|
||||
/public/images/avatars/*
|
||||
/Gemfile
|
||||
/Gemfile.lock
|
||||
/db/schema.rb
|
||||
/Gemfile.lock
|
||||
/lib/plugins/acts_as_versioned/test/debug.log
|
||||
.rbenv-gemsets
|
||||
.DS_Store
|
||||
public/api_doc/
|
||||
/.metadata
|
||||
vendor/cache
|
||||
/files
|
||||
/public/images/avatars
|
||||
/public/files
|
||||
/tags
|
||||
*.swp
|
||||
/.project
|
||||
/.idea
|
||||
/.bundle
|
||||
*.swp
|
||||
/config/database.yml
|
||||
/config/configuration.yml
|
||||
/config/additional_environment.rb
|
||||
/files/*
|
||||
/log/*
|
||||
/public/tmp/*
|
||||
/tmp/*
|
||||
/public/cache/*
|
||||
.gitignore
|
||||
/config/newrelic.yml
|
||||
/public/images/avatars/*
|
||||
/Gemfile
|
||||
/Gemfile.lock
|
||||
/db/schema.rb
|
||||
/Gemfile.lock
|
||||
/lib/plugins/acts_as_versioned/test/debug.log
|
||||
.rbenv-gemsets
|
||||
.DS_Store
|
||||
public/api_doc/
|
||||
/.metadata
|
||||
vendor/cache
|
||||
/files
|
||||
/public/images/avatars
|
||||
/public/files
|
||||
/tags
|
||||
|
|
10
Gemfile
10
Gemfile
|
@ -24,6 +24,8 @@ gem 'acts-as-taggable-on', '2.4.1'
|
|||
gem 'spreadsheet'
|
||||
gem 'ruby-ole'
|
||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||
gem "rmagick", ">= 2.0.0"
|
||||
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
#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 "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
|
||||
|
||||
# Gems used only for assets and not required
|
||||
|
|
|
@ -232,6 +232,7 @@ module Mobile
|
|||
params do
|
||||
requires :token, type: String
|
||||
requires :course_id,type: Integer,desc: '课程id'
|
||||
optional :name,type:String,desc:'课件名称可能包含的字符'
|
||||
end
|
||||
get ":course_id/attachments" do
|
||||
cs = CoursesService.new
|
||||
|
@ -240,6 +241,19 @@ module Mobile
|
|||
present :status, 0
|
||||
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
|
||||
|
|
|
@ -46,6 +46,7 @@ module Mobile
|
|||
course_expose :term
|
||||
course_expose :time
|
||||
course_expose :updated_at
|
||||
course_expose :course_student_num
|
||||
expose :teacher, using: Mobile::Entities::User do |c, opt|
|
||||
if c.is_a? ::Course
|
||||
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
|
||||
authenticate_user
|
||||
end
|
||||
rescue AuthSourceException => e
|
||||
logger.error "An error occured when authenticating #{params[:username]}: #{e.message}"
|
||||
render_error :message => e.message
|
||||
end
|
||||
|
||||
# Log out current user and redirect to welcome page
|
||||
|
@ -47,6 +44,10 @@ class AccountController < ApplicationController
|
|||
# display the logout form
|
||||
end
|
||||
|
||||
def heartbeat
|
||||
render :json => session[:user_id]
|
||||
end
|
||||
|
||||
# Lets user choose a new password
|
||||
def lost_password
|
||||
(redirect_to(home_url); return) unless Setting.lost_password?
|
||||
|
@ -314,7 +315,7 @@ class AccountController < ApplicationController
|
|||
#根据home_url生产正则表达式
|
||||
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
||||
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
|
||||
if last_login_on == ''
|
||||
redirect_to my_account_url
|
||||
|
@ -329,7 +330,7 @@ class AccountController < ApplicationController
|
|||
end
|
||||
|
||||
def set_autologin_cookie(user)
|
||||
token = Token.create(:user => user, :action => 'autologin')
|
||||
token = Token.get_or_create_permanent_login_token(user)
|
||||
cookie_options = {
|
||||
:value => token.value,
|
||||
:expires => 7.days.from_now,
|
||||
|
|
|
@ -156,16 +156,16 @@ class ApplicationController < ActionController::Base
|
|||
user
|
||||
end
|
||||
end
|
||||
|
||||
def try_to_autologin1
|
||||
|
||||
# auto-login feature starts a new session
|
||||
user = User.try_to_autologin(params[:token])
|
||||
if user
|
||||
start_user_session(user)
|
||||
end
|
||||
user
|
||||
|
||||
user = User.try_to_autologin(params[:token])
|
||||
if user
|
||||
logout_user if User.current.id != user.id
|
||||
start_user_session(user)
|
||||
end
|
||||
user
|
||||
end
|
||||
|
||||
# Sets the logged in user
|
||||
def logged_user=(user)
|
||||
reset_session
|
||||
|
@ -200,7 +200,7 @@ class ApplicationController < ActionController::Base
|
|||
def logout_user
|
||||
if User.current.logged?
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
|
@ -56,25 +56,9 @@ class AvatarController < ApplicationController
|
|||
# self.digest = md5.hexdigest
|
||||
end
|
||||
@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|
|
||||
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 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
|
||||
WHERE table1.t_score IS NULL OR table1.t_score = 0")
|
||||
WHERE table1.t_score IS NULL")
|
||||
@not_batch_homework = true
|
||||
@cur_type = 1
|
||||
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}"
|
||||
end
|
||||
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
|
||||
FROM homework_attaches WHERE bid_id = #{@bid.id}
|
||||
ORDER BY #{order_by}) AS table1
|
||||
|
@ -445,7 +445,8 @@ class HomeworkAttachController < ApplicationController
|
|||
is_teacher = @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) #判断当前评论是老师评论?匿评?留言
|
||||
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
|
||||
if rate
|
||||
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
|
||||
elsif @cur_type == "2" #老师已批列表
|
||||
@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
|
||||
FROM homework_attaches WHERE id = #{@homework.id}").first
|
||||
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
|
||||
FROM homework_attaches WHERE bid_id = #{bid_id}
|
||||
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
|
||||
# @homework_list = paginateHelper @all_homework_list,10
|
||||
@homework_list = @all_homework_list
|
||||
|
|
|
@ -75,7 +75,11 @@ class IssuesController < ApplicationController
|
|||
else
|
||||
@limit = 10#per_page_option
|
||||
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_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
@offset ||= @issue_pages.offset
|
||||
|
|
|
@ -123,13 +123,13 @@ class MessagesController < ApplicationController
|
|||
#@topic.update_attribute(:updated_on, Time.now)
|
||||
if !@reply.new_record?
|
||||
if params[:asset_id]
|
||||
ids = params[:asset_id].split(',')
|
||||
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
||||
ids = params[:asset_id].split(',')
|
||||
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
||||
end
|
||||
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
||||
attachments = Attachment.attach_files(@reply, params[:attachments])
|
||||
render_attachment_warning_if_needed(@reply)
|
||||
else
|
||||
else
|
||||
#render file: 'messages#show', layout: 'base_courses'
|
||||
end
|
||||
redirect_to board_message_url(@board, @topic, :r => @reply)
|
||||
|
@ -202,7 +202,7 @@ class MessagesController < ApplicationController
|
|||
render :partial => 'common/preview'
|
||||
end
|
||||
|
||||
private
|
||||
private
|
||||
def find_message
|
||||
return unless find_board
|
||||
@message = @board.messages.find(params[:id], :include => :parent)
|
||||
|
|
|
@ -95,76 +95,46 @@ class MyController < ApplicationController
|
|||
@pref = @user.pref
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
diskfile1 = diskfile + 'temp'
|
||||
if request.post?
|
||||
@user.safe_attributes = params[:user]
|
||||
@user.pref.attributes = params[:pref]
|
||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||
@user.login = params[:login]
|
||||
unless @user.user_extensions.nil?
|
||||
if @user.user_extensions.identity == 2
|
||||
@user.firstname = params[:enterprise_name]
|
||||
end
|
||||
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
|
||||
begin
|
||||
if request.post?
|
||||
@user.safe_attributes = params[:user]
|
||||
@user.pref.attributes = params[:pref]
|
||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||
@user.login = params[:login]
|
||||
unless @user.user_extensions.nil?
|
||||
if @user.user_extensions.identity == 2
|
||||
@user.firstname = params[:enterprise_name]
|
||||
end
|
||||
end
|
||||
|
||||
# 确保文件被删除
|
||||
if File.exist?(diskfile1)
|
||||
File.delete(diskfile1)
|
||||
@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]
|
||||
|
||||
@user.pref.save
|
||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||
set_language_if_valid @user.language
|
||||
flash[:notice] = l(:notice_account_updated)
|
||||
redirect_to user_url(@user)
|
||||
return
|
||||
else
|
||||
# 确保文件被删除
|
||||
if File.exist?(diskfile1)
|
||||
File.delete(diskfile1)
|
||||
if @user.save && @se.save
|
||||
# 头像保存
|
||||
FileUtils.mv diskfile1, diskfile, force: true
|
||||
@user.pref.save
|
||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||
set_language_if_valid @user.language
|
||||
flash[:notice] = l(:notice_account_updated)
|
||||
redirect_to user_url(@user)
|
||||
return
|
||||
else
|
||||
@user.login = lg
|
||||
end
|
||||
@user.login = lg
|
||||
end
|
||||
else
|
||||
# 确保文件被删除
|
||||
if File.exist?(diskfile1)
|
||||
File.delete(diskfile1)
|
||||
end
|
||||
ensure
|
||||
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -200,31 +170,20 @@ class MyController < ApplicationController
|
|||
@user = us.change_password params.merge(:current_user_id => @user.id)
|
||||
if @user.errors.full_messages.count <= 0
|
||||
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
|
||||
rescue Exception => e
|
||||
if e.message == 'wrong password'
|
||||
flash.now[:error] = l(:notice_account_wrong_password)
|
||||
else
|
||||
flash.now[:error] = e.message
|
||||
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
|
||||
|
||||
# Create a new feeds key
|
||||
|
|
|
@ -247,10 +247,9 @@ class ProjectsController < ApplicationController
|
|||
# 1、自动注册
|
||||
# 2、加入项目、创建角色
|
||||
# 3、用户得分
|
||||
if params[:login]
|
||||
# 自动激活用户
|
||||
user.status = 1
|
||||
user.save
|
||||
if params[:email]
|
||||
user = User.find_by_mail(params[:email].to_s)
|
||||
Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id)
|
||||
end
|
||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
|
|
|
@ -38,12 +38,13 @@ class TrackersController < ApplicationController
|
|||
@tracker ||= Tracker.new(params[:tracker])
|
||||
@trackers = Tracker.sorted.all
|
||||
@projects = Project.where("project_type = #{Project::ProjectType_project}").all
|
||||
@courses = Course.all
|
||||
@course_activity_count=Hash.new
|
||||
@courses.each do |course|
|
||||
@course_activity_count[course.id]=0
|
||||
end
|
||||
@course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
# 去掉原因,这块代码已经没有用到
|
||||
# @courses = Course.all
|
||||
# @course_activity_count=Hash.new
|
||||
# @courses.each do |course|
|
||||
# @course_activity_count[course.id]=0
|
||||
# end
|
||||
# @course_activity_count=get_course_activity @courses,@course_activity_count
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -58,12 +58,18 @@ class WelcomeController < ApplicationController
|
|||
else
|
||||
case @first_page.sort_type
|
||||
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 = @projects_all.order("created_on desc")
|
||||
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 = @projects_all.order("grade desc")
|
||||
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 = @projects_all.order("watchers_count desc")
|
||||
|
||||
|
|
|
@ -329,12 +329,12 @@ module ApplicationHelper
|
|||
imagesize = attachment.thumbnail(:size => "200*200")
|
||||
imagepath = named_attachment_path(attachment, attachment.filename)
|
||||
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,
|
||||
:title => attachment.filename
|
||||
|
||||
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,
|
||||
:title => attachment.filename
|
||||
end
|
||||
|
|
|
@ -797,4 +797,17 @@ module CoursesHelper
|
|||
end
|
||||
result
|
||||
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
|
||||
|
|
|
@ -243,15 +243,15 @@ module QueriesHelper
|
|||
|
||||
# Retrieve query from session or build a new query
|
||||
def retrieve_query
|
||||
if !params[:query_id].blank?
|
||||
cond = "project_id IS NULL"
|
||||
cond << " OR project_id = #{@project.id}" if @project
|
||||
@query = IssueQuery.find(params[:query_id], :conditions => cond)
|
||||
raise ::Unauthorized unless @query.visible?
|
||||
@query.project = @project
|
||||
session[:query] = {:id => @query.id, :project_id => @query.project_id}
|
||||
sort_clear
|
||||
elsif api_request? || params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
|
||||
# if !params[:query_id].blank?
|
||||
# cond = "project_id IS NULL"
|
||||
# cond << " OR project_id = #{@project.id}" if @project
|
||||
# @query = IssueQuery.find(params[:query_id], :conditions => cond)
|
||||
# raise ::Unauthorized unless @query.visible?
|
||||
# @query.project = @project
|
||||
# session[:query] = {:id => @query.id, :project_id => @query.project_id}
|
||||
# sort_clear
|
||||
# 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
|
||||
@query = IssueQuery.new(:name => "_")
|
||||
@query.project = @project
|
||||
|
@ -268,12 +268,12 @@ module QueriesHelper
|
|||
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
|
||||
@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}
|
||||
else
|
||||
# retrieve from session
|
||||
@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.project = @project
|
||||
end
|
||||
# else
|
||||
# # retrieve from session
|
||||
# @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.project = @project
|
||||
# end
|
||||
end
|
||||
|
||||
def retrieve_query_from_session
|
||||
|
|
|
@ -443,6 +443,10 @@ module WelcomeHelper
|
|||
resultSet.take(limit)
|
||||
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
|
||||
# Project.find_by_sql("
|
||||
# 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)
|
||||
@subject = "#{invitor.name} #{l(:label_invite_project)}: #{project.name} "
|
||||
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}"
|
||||
@project_name = "#{project.name}"
|
||||
@user = user
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,:user => user, :token => @token.value)
|
||||
mail :to => email, :invitor_name => "#{@invitor_name}", :project_name => "#{@project_name}"
|
||||
@invitor_name = "#{invitor.name}"
|
||||
@project_name = "#{project.name}"
|
||||
@user = user
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :email => email, :token => @token.value)
|
||||
mail :to => email, :subject => @subject
|
||||
end
|
||||
|
||||
# author: alan
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#coding=utf-8
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
|
@ -14,7 +15,7 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#
|
||||
class Token < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
validates_uniqueness_of :value
|
||||
|
@ -27,6 +28,14 @@ class Token < ActiveRecord::Base
|
|||
self.value = Token.generate_token_value
|
||||
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)
|
||||
token = Token.where(:action => action, :user_id => user).first
|
||||
unless token
|
||||
|
@ -42,7 +51,7 @@ class Token < ActiveRecord::Base
|
|||
|
||||
# Delete all expired tokens
|
||||
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
|
||||
|
||||
# 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)
|
||||
end
|
||||
|
||||
def self.delete_user_all_tokens(user)
|
||||
Token.delete_all(user_id: user.id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Removes obsolete tokens (same user and action)
|
||||
|
|
|
@ -1,86 +1,86 @@
|
|||
# encoding: utf-8
|
||||
=begin
|
||||
identity字段含义
|
||||
0 教师教授
|
||||
1 学生
|
||||
2 企业
|
||||
3 开发者
|
||||
=end
|
||||
class UserExtensions < ActiveRecord::Base
|
||||
validate :school, presence: true
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :school, :class_name => 'School', :foreign_key => :school_id
|
||||
attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code,:identity, :technical_title,:student_id
|
||||
TEACHER = 0
|
||||
STUDENT = 1
|
||||
ENTERPRISE = 2
|
||||
DEVELOPER = 3
|
||||
#this method was used to update the table user_extensions
|
||||
def update_user_extensions(birthday=nil,brief_introduction=nil,
|
||||
gender=nil,location=nil,occupation=nil,work_experience=nil,zip_code=nil)
|
||||
self.birthday = birthday
|
||||
self.brief_introduction = brief_introduction
|
||||
self.gender = gender
|
||||
self.location = location
|
||||
self.occupation = occupation
|
||||
self.work_experience = work_experience
|
||||
self.zip_code = zip_code
|
||||
self.save
|
||||
end
|
||||
|
||||
def get_brief_introduction
|
||||
return self.brief_introduction
|
||||
end
|
||||
|
||||
|
||||
# added by meng
|
||||
def show_identity
|
||||
if User.current.language == 'zh'||User.current.language == ''
|
||||
case self.identity
|
||||
when 0
|
||||
user_identity = l(:label_account_identity_teacher)
|
||||
when 1
|
||||
user_identity = l(:label_account_identity_student)
|
||||
when 2
|
||||
user_identity = l(:label_account_identity_enterprise)
|
||||
when 3
|
||||
user_identity = l(:label_account_identity_developer)
|
||||
else
|
||||
user_identity = ''
|
||||
end
|
||||
else
|
||||
case self.identity
|
||||
when 0
|
||||
user_identity = l(:label_account_identity_teacher)
|
||||
when 1
|
||||
user_identity = l(:label_account_identity_student)
|
||||
when 2
|
||||
user_identity = l(:label_account_identity_enterprise)
|
||||
when 3
|
||||
user_identity = l(:label_account_identity_developer)
|
||||
else
|
||||
user_identity = ''
|
||||
end
|
||||
end
|
||||
return user_identity
|
||||
end
|
||||
# end
|
||||
|
||||
|
||||
def self.introduction(user, message)
|
||||
unless user.user_extensions.nil?
|
||||
info = user.user_extensions
|
||||
info.brief_introduction = message
|
||||
info.save
|
||||
else
|
||||
info = UserExtensions.new
|
||||
info.user_id = user.id
|
||||
info.brief_introduction = message
|
||||
info.save
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
# encoding: utf-8
|
||||
=begin
|
||||
identity字段含义
|
||||
0 教师教授
|
||||
1 学生
|
||||
2 企业
|
||||
3 开发者
|
||||
=end
|
||||
class UserExtensions < ActiveRecord::Base
|
||||
validate :school, presence: true
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :school, :class_name => 'School', :foreign_key => :school_id
|
||||
attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code,:identity, :technical_title,:student_id
|
||||
TEACHER = 0
|
||||
STUDENT = 1
|
||||
ENTERPRISE = 2
|
||||
DEVELOPER = 3
|
||||
#this method was used to update the table user_extensions
|
||||
def update_user_extensions(birthday=nil,brief_introduction=nil,
|
||||
gender=nil,location=nil,occupation=nil,work_experience=nil,zip_code=nil)
|
||||
self.birthday = birthday
|
||||
self.brief_introduction = brief_introduction
|
||||
self.gender = gender
|
||||
self.location = location
|
||||
self.occupation = occupation
|
||||
self.work_experience = work_experience
|
||||
self.zip_code = zip_code
|
||||
self.save
|
||||
end
|
||||
|
||||
def get_brief_introduction
|
||||
return self.brief_introduction
|
||||
end
|
||||
|
||||
|
||||
# added by meng
|
||||
def show_identity
|
||||
if User.current.language == 'zh'||User.current.language == ''
|
||||
case self.identity
|
||||
when 0
|
||||
user_identity = l(:label_account_identity_teacher)
|
||||
when 1
|
||||
user_identity = l(:label_account_identity_student)
|
||||
when 2
|
||||
user_identity = l(:label_account_identity_enterprise)
|
||||
when 3
|
||||
user_identity = l(:label_account_identity_developer)
|
||||
else
|
||||
user_identity = ''
|
||||
end
|
||||
else
|
||||
case self.identity
|
||||
when 0
|
||||
user_identity = l(:label_account_identity_teacher)
|
||||
when 1
|
||||
user_identity = l(:label_account_identity_student)
|
||||
when 2
|
||||
user_identity = l(:label_account_identity_enterprise)
|
||||
when 3
|
||||
user_identity = l(:label_account_identity_developer)
|
||||
else
|
||||
user_identity = ''
|
||||
end
|
||||
end
|
||||
return user_identity
|
||||
end
|
||||
# end
|
||||
|
||||
|
||||
def self.introduction(user, message)
|
||||
unless user.user_extensions.nil?
|
||||
info = user.user_extensions
|
||||
info.brief_introduction = message
|
||||
info.save
|
||||
else
|
||||
info = UserExtensions.new
|
||||
info.user_id = user.id
|
||||
info.brief_introduction = message
|
||||
info.save
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -86,7 +86,7 @@ class CoursesService
|
|||
gender = m.user.user_extensions.gender.nil? ? 0 : m.user.user_extensions.gender
|
||||
work_unit = get_user_work_unit 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
|
||||
users
|
||||
end
|
||||
|
@ -169,7 +169,7 @@ class CoursesService
|
|||
unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
|
||||
raise '403'
|
||||
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
|
||||
|
||||
#创建课程
|
||||
|
@ -433,13 +433,48 @@ class CoursesService
|
|||
result = []
|
||||
@course = Course.find(params[:course_id])
|
||||
@attachments = @course.attachments.order("created_on desc")
|
||||
@attachments.each do |atta|
|
||||
result << {:filename => atta.filename,:description => atta.description,:downloads => atta.downloads,:quotes => atta.quotes.nil? ? 0 :atta.quotes }
|
||||
if !params[:name].nil? && params[:name] != ""
|
||||
@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
|
||||
result
|
||||
end
|
||||
|
||||
# 课程学生列表
|
||||
def course_members params
|
||||
@all_members = searchmember_by_name(student_homework_score(0,params[:course_id], 10,"desc"),params[:name])
|
||||
end
|
||||
|
||||
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
|
||||
author_real_name = bid.author.lastname + bid.author.firstname
|
||||
many_times = course.homeworks.index(bid) + 1
|
||||
|
@ -476,5 +511,52 @@ class CoursesService
|
|||
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
|
|
@ -1,62 +1,28 @@
|
|||
<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
|
||||
{
|
||||
if (img.complete) {
|
||||
nWidth = img.naturalWidth;
|
||||
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;
|
||||
ImgD.width = Math.round(image.width/rateHeight);
|
||||
ImgD.height = 73;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="attachments" style="font-weight:normal;">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
||||
var count=$('#attachments_fields>span').length;
|
||||
if(count<=0){
|
||||
$("#upload_file_count").text(<%= l(:label_no_file_uploaded)%>);
|
||||
$(".remove_all").remove();
|
||||
}else{
|
||||
$("#upload_file_count").html("已上传"+"<span id=\"count\">"+count+"</span>"+"个文件");
|
||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
||||
var count=$('#attachments_fields>span').length;
|
||||
if(count<=0){
|
||||
$("#upload_file_count").text(<%= l(:label_no_file_uploaded)%>);
|
||||
$(".remove_all").remove();
|
||||
}else{
|
||||
$("#upload_file_count").html("已上传"+"<span id=\"count\">"+count+"</span>"+"个文件");
|
||||
}
|
|
@ -73,4 +73,7 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'avatars' %>
|
||||
<% 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');
|
||||
|
||||
imgSpan.attr({"src":'<%= @urlfile.to_s << "?" << Time.now.to_s%>'});
|
||||
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||
|
||||
|
|
|
@ -1,201 +1,201 @@
|
|||
<!--modified by huang-->
|
||||
<script type="text/javascript">
|
||||
function ShowCountDown(year,month,day,divname)
|
||||
{
|
||||
var now = new Date();
|
||||
var endDate = new Date(year, month-1, day);
|
||||
var leftTime=endDate.getTime()-now.getTime();
|
||||
var leftsecond = parseInt(leftTime/1000);
|
||||
var day1=Math.floor(leftsecond/(60*60*24));
|
||||
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
|
||||
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
|
||||
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
|
||||
$("#"+divname).html("<span style='color: #acaeb1;'>作品提交还剩 :</span> <span style='color: red;'>"
|
||||
+day1+" </span><span style='color: #acaeb1;'>天</span><span style='color: red;'> "
|
||||
+hour+" </span><span style='color: #acaeb1;'>时</span><span style='color: red;'> "
|
||||
+minute+" </span><span style='color: #acaeb1;'>分</span><span style='color: red;'> "
|
||||
+second+" </span><span style='color: #acaeb1;'>秒</span>");
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.span_wping{}
|
||||
.span_wping a{
|
||||
margin-top: 18px;
|
||||
margin-bottom: 3px;
|
||||
width: 43px;
|
||||
height: 23px;
|
||||
background: #15bccf;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 5px !important;
|
||||
}
|
||||
.span_wping a:hover{ background-color:#03a1b3;}
|
||||
</style>
|
||||
|
||||
<% if bids.blank? %>
|
||||
<%#= l(:label_uncommit_homework) %>
|
||||
暂无作业!
|
||||
<% else %>
|
||||
<% bids.each do |bid|%>
|
||||
<table class="content-text-list">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" >
|
||||
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
|
||||
</td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>
|
||||
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
|
||||
</strong>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_user_create_project_homework) %>
|
||||
</span>
|
||||
<span>
|
||||
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 150px;">
|
||||
<span style="float: right">
|
||||
<% if User.current.logged? && is_cur_course_student(@course) %>
|
||||
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||
<span class="span_wping">
|
||||
<% if bid.open_anonymous_evaluation == 1 %>
|
||||
<% case bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<a>未开启匿评</a>
|
||||
<% when 1 %>
|
||||
<a> 匿评中.. </a>
|
||||
<% when 2 %>
|
||||
<a> 匿评结束 </a>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</span>
|
||||
<% if cur_user_homework && cur_user_homework.empty? %>
|
||||
<span class="span_wping">
|
||||
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="span_wping">
|
||||
<a>已 提 交</a>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%>
|
||||
<span id="<%=bid.id %>_anonymous_comment" class="span_wping">
|
||||
<% case bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
|
||||
<% when 1 %>
|
||||
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
|
||||
<% when 2 %>
|
||||
<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>
|
||||
<% end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<span class="span_wping">
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
|
||||
) %>
|
||||
</span>
|
||||
<%#= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'icon icon-del'
|
||||
) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="font_lighter">
|
||||
<% bidding_project = bid.biding_projects.all
|
||||
temp = []
|
||||
bidding_project.each do |pro|
|
||||
if pro.project && pro.project.project_status
|
||||
temp << pro
|
||||
end
|
||||
temp
|
||||
end
|
||||
%>
|
||||
<% if bid.homework_type == 1%>
|
||||
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>
|
||||
(
|
||||
<strong>
|
||||
<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>
|
||||
</strong>)
|
||||
<% else %>
|
||||
<%= l(:label_x_homework_project, :count => temp.count) %>
|
||||
(
|
||||
<strong>
|
||||
<%= link_to temp.count, course_for_bid_path(bid.id) %>
|
||||
</strong>)
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<% if bid.reward_type.nil? or bid.reward_type == 1 %>
|
||||
<strong>
|
||||
<%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'">
|
||||
<%= l(:label_call_bonus) %>
|
||||
|
||||
<%= l(:label_RMB_sign) %>
|
||||
<%= bid.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
<% elsif bid.reward_type == 2 %>
|
||||
<strong>
|
||||
<%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'">
|
||||
<%= bid.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<span class="font_description">
|
||||
<%=h sanitize(bid.description.html_safe) %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left" colspan="2">
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_end_time) %>
|
||||
:
|
||||
<%= bid.deadline %>
|
||||
</span>
|
||||
<span style="float: right">
|
||||
<% if betweentime(bid.deadline) < 0 %>
|
||||
<span style="color: red; float: right">
|
||||
<%= l(:label_commit_limit)%>
|
||||
</span>
|
||||
<% else %>
|
||||
<script type="text/javascript">
|
||||
window.setInterval(function(){ShowCountDown(<%= bid.deadline.year%>,<%= bid.deadline.month%>,<%= bid.deadline.day + 1%>,"show_deadtime_span_<%= bid.id%>");},1000)
|
||||
</script>
|
||||
<span id="show_deadtime_span_<%= bid.id%>" style="float: right">
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full bid_pages %>
|
||||
<!--modified by huang-->
|
||||
<script type="text/javascript">
|
||||
function ShowCountDown(year,month,day,divname)
|
||||
{
|
||||
var now = new Date();
|
||||
var endDate = new Date(year, month-1, day);
|
||||
var leftTime=endDate.getTime()-now.getTime();
|
||||
var leftsecond = parseInt(leftTime/1000);
|
||||
var day1=Math.floor(leftsecond/(60*60*24));
|
||||
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
|
||||
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
|
||||
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
|
||||
$("#"+divname).html("<span style='color: #acaeb1;'>作品提交还剩 :</span> <span style='color: red;'>"
|
||||
+day1+" </span><span style='color: #acaeb1;'>天</span><span style='color: red;'> "
|
||||
+hour+" </span><span style='color: #acaeb1;'>时</span><span style='color: red;'> "
|
||||
+minute+" </span><span style='color: #acaeb1;'>分</span><span style='color: red;'> "
|
||||
+second+" </span><span style='color: #acaeb1;'>秒</span>");
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.span_wping{}
|
||||
.span_wping a{
|
||||
margin-top: 18px;
|
||||
margin-bottom: 3px;
|
||||
width: 43px;
|
||||
height: 23px;
|
||||
background: #15bccf;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 5px !important;
|
||||
}
|
||||
.span_wping a:hover{ background-color:#03a1b3;}
|
||||
</style>
|
||||
|
||||
<% if bids.blank? %>
|
||||
<%#= l(:label_uncommit_homework) %>
|
||||
暂无作业!
|
||||
<% else %>
|
||||
<% bids.each do |bid|%>
|
||||
<table class="content-text-list">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" >
|
||||
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
|
||||
</td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>
|
||||
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
|
||||
</strong>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_user_create_project_homework) %>
|
||||
</span>
|
||||
<span>
|
||||
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
|
||||
</span>
|
||||
</td>
|
||||
<td style="width: 150px;">
|
||||
<span style="float: right">
|
||||
<% if User.current.logged? && is_cur_course_student(@course) %>
|
||||
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||
<span class="span_wping">
|
||||
<% if bid.open_anonymous_evaluation == 1 %>
|
||||
<% case bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<a>未开启匿评</a>
|
||||
<% when 1 %>
|
||||
<a> 匿评中.. </a>
|
||||
<% when 2 %>
|
||||
<a> 匿评结束 </a>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</span>
|
||||
<% if cur_user_homework && cur_user_homework.empty? %>
|
||||
<span class="span_wping">
|
||||
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="span_wping">
|
||||
<a>已 提 交</a>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%>
|
||||
<span id="<%=bid.id %>_anonymous_comment" class="span_wping">
|
||||
<% case bid.comment_status %>
|
||||
<% when 0 %>
|
||||
<%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
|
||||
<% when 1 %>
|
||||
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
|
||||
<% when 2 %>
|
||||
<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>
|
||||
<% end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<span class="span_wping">
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}
|
||||
) %>
|
||||
</span>
|
||||
<%#= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'icon icon-del'
|
||||
) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="font_lighter">
|
||||
<% bidding_project = bid.biding_projects.all
|
||||
temp = []
|
||||
bidding_project.each do |pro|
|
||||
if pro.project && pro.project.project_status
|
||||
temp << pro
|
||||
end
|
||||
temp
|
||||
end
|
||||
%>
|
||||
<% if bid.homework_type == 1%>
|
||||
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>
|
||||
(
|
||||
<strong>
|
||||
<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>
|
||||
</strong>)
|
||||
<% else %>
|
||||
<%= l(:label_x_homework_project, :count => temp.count) %>
|
||||
(
|
||||
<strong>
|
||||
<%= link_to temp.count, course_for_bid_path(bid.id) %>
|
||||
</strong>)
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<% if bid.reward_type.nil? or bid.reward_type == 1 %>
|
||||
<strong>
|
||||
<%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'">
|
||||
<%= l(:label_call_bonus) %>
|
||||
|
||||
<%= l(:label_RMB_sign) %>
|
||||
<%= bid.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
<% elsif bid.reward_type == 2 %>
|
||||
<strong>
|
||||
<%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'">
|
||||
<%= bid.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<span class="font_description">
|
||||
<%=h sanitize(bid.description.html_safe) %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left" colspan="2">
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_end_time) %>
|
||||
:
|
||||
<%= bid.deadline %>
|
||||
</span>
|
||||
<span style="float: right">
|
||||
<% if betweentime(bid.deadline) < 0 %>
|
||||
<span style="color: red; float: right">
|
||||
<%= l(:label_commit_limit)%>
|
||||
</span>
|
||||
<% else %>
|
||||
<script type="text/javascript">
|
||||
window.setInterval(function(){ShowCountDown(<%= bid.deadline.year%>,<%= bid.deadline.month%>,<%= bid.deadline.day + 1%>,"show_deadtime_span_<%= bid.id%>");},1000)
|
||||
</script>
|
||||
<span id="show_deadtime_span_<%= bid.id%>" style="float: right">
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full bid_pages %>
|
||||
</div>
|
|
@ -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>
|
||||
</div>
|
||||
<div id='bidding_project_list'>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</li>
|
||||
<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>
|
||||
<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>
|
||||
<p id="bid_evaluation_num_span" class="c_red" style="padding-left: 90px;"></p>
|
||||
</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| %>
|
||||
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
||||
<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' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
@ -42,14 +42,14 @@
|
|||
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if @topics.any? %>
|
||||
<% @topics.each do |topic| %>
|
||||
<% 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.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? %>
|
||||
<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 %>
|
||||
<br/>
|
||||
<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><!--讨论主类容 end-->
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<%# 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 %>
|
||||
|
||||
<% 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-->
|
||||
<% if !User.current.logged? %>
|
||||
<div class="c_grey f14">
|
||||
<%= l(:label_user_login_project_board) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
||||
<%= l(:label_user_login_project_board) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- 内容显示部分 -->
|
||||
<div class="talk_top">
|
||||
<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) %>
|
||||
<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) %>
|
||||
<span><%= link_to l(:project_module_boards_post), new_board_message_path(@board),
|
||||
:class => 'problem_new_btn fl c_dorange',
|
||||
: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>
|
||||
:class => 'problem_new_btn fl c_dorange',
|
||||
: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 %>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
<!--讨论主类容 end-->
|
||||
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
<!--讨论主类容 end-->
|
||||
|
||||
<%# 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 %>
|
||||
|
||||
<% 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 %>
|
||||
<%= render :partial => 'project_show', locals: {project: @project} %>
|
||||
<% elsif @course %>
|
||||
|
|
|
@ -58,14 +58,14 @@
|
|||
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
|
||||
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
|
||||
</p>
|
||||
|
||||
|
||||
<!--gcm-->
|
||||
<p class="stats">
|
||||
<%= content_tag('span', link_to("#{@course_activity_count[@course.id]}", course_path(@course)), :class => "info") %>
|
||||
<%= content_tag('span', l(:label_x_activity, :count => @course_activity_count[@course.id])) %>
|
||||
</p>
|
||||
<!--gcm-->
|
||||
|
||||
|
||||
<div class="buttons_for_course" style="margin-top:30px;margin-left:144px">
|
||||
<span class="info"></span>
|
||||
<% if(course_endTime_timeout? @course) %>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) do |f| %>
|
||||
<div class="member_search">
|
||||
<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) }')" %>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
|||
<% @roles.each do |role| %>
|
||||
<li>
|
||||
<%= 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>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="st_list">
|
||||
<div class="st_box">
|
||||
<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-->
|
||||
|
||||
<% members.each do |member| %>
|
||||
|
@ -9,8 +10,9 @@
|
|||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||
</a>
|
||||
<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 mr30 w45"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<%= 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;",
|
||||
: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">
|
||||
<%= l(:button_leave_meassge)%>
|
||||
</a>
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
<li >
|
||||
<%= link_to_user_header member.principal,true,:class => "w150 c_orange 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),
|
||||
:method => :put,
|
||||
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
||||
) do |f| %>
|
||||
<% @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),
|
||||
: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>
|
||||
<!--<br/>-->
|
||||
<% end %>
|
||||
<%= 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;">
|
||||
<%= l(:button_change)%>
|
||||
</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) %>
|
||||
|
||||
<% if manage_allowed && file.container_id == project.id && file.container_type == "Project" %>
|
||||
<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 %>
|
||||
</span>
|
||||
<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 %>
|
||||
</span>
|
||||
<% else %>
|
||||
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
||||
<% end %>
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
|
||||
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;}
|
||||
$('#new_form_user_message').parent().submit();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<% unless is_student_batch_homework %>
|
||||
<%= l(:label_teacher_score)%>:
|
||||
<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>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="to_top" id="goTopBtn" style="display: none;">
|
||||
返<br/>回<br/>顶<br/>部
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% unless homeworks.nil? %>
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
</span>
|
||||
<% end %>
|
||||
</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) %>
|
||||
</span>
|
||||
<span style="font-weight:bold; color:#a6a6a6; float: right;">
|
||||
<% if review.stars && review.stars.to_i > 0%>
|
||||
<% if review.stars%>
|
||||
<span style="float:left">
|
||||
<%= l(:label_work_rating) %>:
|
||||
</span>
|
||||
|
|
|
@ -11,6 +11,14 @@
|
|||
for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");}
|
||||
$("#stars_value").val(num);
|
||||
}
|
||||
|
||||
function ChoseZero()
|
||||
{
|
||||
if(confirm('是否确定评分为0分?'))
|
||||
{
|
||||
ChoseStars(0);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="popbox">
|
||||
<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="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>
|
||||
|
|
|
@ -3,7 +3,7 @@ showModal('ajax-modal', '513px');
|
|||
$('#ajax-modal').css('height','569px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#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().css("top","").css("left","");
|
||||
$('#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" %>
|
||||
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):</span>
|
||||
<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 class="cl"></div>
|
||||
<p>
|
||||
|
|
|
@ -1,151 +1,151 @@
|
|||
<script>
|
||||
function remote_function() {
|
||||
$.ajax({
|
||||
url:'<%= project_issues_path(@project)%>',
|
||||
data:{
|
||||
subject:$("#v_subject").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
status_id: $("#status_id").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
assigned_to_id: $("#assigned_to_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
priority_id: $("#priority_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
author_id: $("#author_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, "")
|
||||
},
|
||||
success: function(data){
|
||||
},
|
||||
error: function(data){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function EnterPress(e){
|
||||
var e = e || window.event;
|
||||
if(e.keyCode == 13){
|
||||
remote_function();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_issue_tracking) %></h2>
|
||||
</div>
|
||||
<div class="problem_top">
|
||||
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||
<%#= 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' %>
|
||||
<div class="problem_search" >
|
||||
<input class="problem_search_input fl" id="v_subject" type="text" name="v[subject]" value="" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
||||
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
||||
</div><!--problem_search end-->
|
||||
|
||||
<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]),
|
||||
{ :include_blank => false,:selected=>0
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"}
|
||||
)
|
||||
%>
|
||||
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
|
||||
{ :include_blank => false,:selected=>0
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"v[priority_id]",:class=>"w90"}
|
||||
)
|
||||
%>
|
||||
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
|
||||
{ :include_blank => false,:selected=>0
|
||||
},
|
||||
{: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]),
|
||||
{ :include_blank => false,:selected=>0
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"author_id",:name=>"v[author_id]",:class=>"w90"}
|
||||
)
|
||||
%>
|
||||
</div><!--filter_form end-->
|
||||
<div class="cl"></div>
|
||||
<%# end %>
|
||||
<p class="problem_p fl" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.count %></a>
|
||||
<%= l(:lable_issues_undo) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').count %> </a>
|
||||
</p>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||
<%= delete_link query_path(@query) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
||||
<div style="clear:right; ">
|
||||
</div>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
|
||||
<% if @query.valid? %>
|
||||
<% if @issues.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<div id="issue_list">
|
||||
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %>
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<div style="float: left; padding-top: 30px">
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
||||
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
|
||||
<%= f.link_to 'PDF', :url => params %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="csv-export-options" style="display:none;">
|
||||
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
|
||||
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'columns', 'all' %>
|
||||
<%= l(:description_all_columns) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
|
||||
<%= l(:field_description) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_issue_plural)) %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:controller => 'journals', :action => 'index',
|
||||
:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_changes_details)) %>
|
||||
<% end %>
|
||||
|
||||
<%= context_menu issues_context_menu_path %>
|
||||
<script>
|
||||
function remote_function() {
|
||||
$.ajax({
|
||||
url:'<%= project_issues_path(@project)%>',
|
||||
data:{
|
||||
subject:$("#v_subject").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
status_id: $("#status_id").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
assigned_to_id: $("#assigned_to_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
priority_id: $("#priority_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, ""),
|
||||
author_id: $("#author_id option:selected").attr("value").replace(/(^\s*)|(\s*$)/g, "")
|
||||
},
|
||||
success: function(data){
|
||||
},
|
||||
error: function(data){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function EnterPress(e){
|
||||
var e = e || window.event;
|
||||
if(e.keyCode == 13){
|
||||
remote_function();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_issue_tracking) %></h2>
|
||||
</div>
|
||||
<div class="problem_top">
|
||||
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||
<%#= 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' %>
|
||||
<div class="problem_search" >
|
||||
<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>
|
||||
</div><!--problem_search end-->
|
||||
|
||||
<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]),
|
||||
{ :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"}
|
||||
)
|
||||
%>
|
||||
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
|
||||
{ :include_blank => false,:selected=>@priority_id ? @priority_id : 0
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"v[priority_id]",:class=>"w90"}
|
||||
)
|
||||
%>
|
||||
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
|
||||
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
|
||||
},
|
||||
{: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]),
|
||||
{ :include_blank => false,:selected=>@author_id ? @author_id : 0
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"author_id",:name=>"v[author_id]",:class=>"w90"}
|
||||
)
|
||||
%>
|
||||
</div><!--filter_form end-->
|
||||
<div class="cl"></div>
|
||||
<%# end %>
|
||||
<p class="problem_p fl" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.count %></a>
|
||||
<%= l(:lable_issues_undo) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').count %> </a>
|
||||
</p>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||
<%= delete_link query_path(@query) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
||||
<div style="clear:right; ">
|
||||
</div>
|
||||
|
||||
<%= error_messages_for 'query' %>
|
||||
|
||||
<% if @query.valid? %>
|
||||
<% if @issues.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<div id="issue_list">
|
||||
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %>
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<div style="float: left; padding-top: 30px">
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
||||
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
|
||||
<%= f.link_to 'PDF', :url => params %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="csv-export-options" style="display:none;">
|
||||
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
|
||||
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'columns', 'all' %>
|
||||
<%= l(:description_all_columns) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
|
||||
<%= l(:field_description) %>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_issue_plural)) %>
|
||||
<%= auto_discovery_link_tag(:atom,
|
||||
{:controller => 'journals', :action => 'index',
|
||||
:query_id => @query, :format => 'atom',
|
||||
:page => nil, :key => User.current.rss_key},
|
||||
:title => l(:label_changes_details)) %>
|
||||
<% end %>
|
||||
|
||||
<%= context_menu issues_context_menu_path %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
|
||||
<div class="pro_page_box">
|
||||
<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>
|
||||
</div>
|
||||
<div class="problem_main">
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
||||
<% end %>
|
||||
<% 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 %>
|
||||
</div>
|
||||
<% end%>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<% end %><!--meny end -->
|
||||
|
||||
<!-- more -->
|
||||
<div class="subNav subNav_jiantou" onclick="expand_tools_expand();" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent">
|
||||
<div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent" id="navContent">
|
||||
<%= render 'projects/tools_expand' %>
|
||||
</ul>
|
|
@ -1,189 +1,189 @@
|
|||
<style type="text/css">
|
||||
html{ overflow-x:hidden;}
|
||||
.scrollsidebar{ position:fixed;bottom:1px; right:1px; background:none; }
|
||||
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
|
||||
.side_content .side_list {width:154px;overflow:hidden;}
|
||||
.show_btn{ width:0; height:112px; overflow:hidden; float:left;margin-top: 200px; cursor:pointer;}
|
||||
.show_btn span { display:none;}
|
||||
.close_btn{width:24px;height:24px;cursor:pointer;}
|
||||
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; }
|
||||
.side_title {height:35px;}
|
||||
.side_bottom { height:8px;}
|
||||
.side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;}
|
||||
.close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;}
|
||||
.close_btn span { display:none;}
|
||||
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
|
||||
.msgserver { margin:2px 0px 0px 4px; padding-top: 0px}
|
||||
.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;}
|
||||
.opnionText{ width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;}
|
||||
.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;}
|
||||
.opnionButton:hover{background: #0fa9bb; }
|
||||
|
||||
/* blue skin as the default skin */
|
||||
.side_title {background-position:-195px 0;}
|
||||
.side_center {background:url(/images/blue_line.png) repeat-y center;}
|
||||
.side_bottom {background-position:-195px -50px;}
|
||||
.close_btn {background-position:-44px 0;}
|
||||
.close_btn:hover {background-position:-66px 0;}
|
||||
.show_btn {background-position:-119px 0;}
|
||||
.msgserver a {color:#15bccf; }
|
||||
.msgserver a:hover { text-decoration:underline; }
|
||||
</style>
|
||||
|
||||
<head>
|
||||
<script>
|
||||
(function($){
|
||||
$.fn.fix = function(options){
|
||||
var defaults = {
|
||||
float : 'right',
|
||||
minStatue : true,
|
||||
skin : 'blue',
|
||||
durationTime : 1000
|
||||
}
|
||||
var options = $.extend(defaults, options);
|
||||
|
||||
this.each(function(){
|
||||
//???????
|
||||
var thisBox = $(this),
|
||||
closeBtn = thisBox.find('.close_btn' ),
|
||||
show_btn = thisBox.find('.show_btn' ),
|
||||
sideContent = thisBox.find('.side_content'),
|
||||
sideList = thisBox.find('.side_list')
|
||||
;
|
||||
var defaultTop = thisBox.offset().top; //????????top
|
||||
|
||||
thisBox.css(options.float, 0);
|
||||
if(options.minStatue == "true"){
|
||||
$(".show_btn").css("float", options.float);
|
||||
sideContent.css('width', 0);
|
||||
show_btn.css('width', 25);
|
||||
|
||||
}
|
||||
//close
|
||||
closeBtn.bind("click",function(){
|
||||
sideContent.animate({width: '0px'},"fast");
|
||||
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
|
||||
cookiesave('minStatue','true','','','');
|
||||
});
|
||||
//show
|
||||
show_btn.bind("click",function() {
|
||||
$(this).animate({width: '0px'},"fast");
|
||||
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
|
||||
cookiesave('minStatue','false','','','');
|
||||
});
|
||||
|
||||
|
||||
|
||||
}); //end this.each
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
|
||||
$(function(){
|
||||
$("#button1").click(function(){
|
||||
myTips("<%= l(:label_feedback_success) %>","success");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function f_submit()
|
||||
{
|
||||
// var subject = $("#memo_subject").val();
|
||||
// var content = $("#memo_content_1").val();
|
||||
// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"...");
|
||||
$("#new_memo").submit();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#scrollsidebar").fix({
|
||||
float : 'right', //default.left or right
|
||||
minStatue : cookieget('minStatue'),
|
||||
skin : 'green', //default.gray or blue
|
||||
durationTime : 600
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#subject").keydown(function(){
|
||||
var curLength=$("#subject").val().length;
|
||||
if(curLength>50){
|
||||
var num=$("#subject").val().substr(0,50);
|
||||
$("#subject").val(num);
|
||||
}
|
||||
else{
|
||||
$("#textCount").text(50-$("#subject").val().length)
|
||||
}
|
||||
})
|
||||
$("#subject").keyup(function(){
|
||||
var curLength=$("#subject").val().length;
|
||||
if(curLength>50){
|
||||
var num=$("#subject").val().substr(0,50);
|
||||
$("#subject").val(num);
|
||||
}
|
||||
else{
|
||||
$("#textCount").text(50-$("#subject").val().length)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="scrollsidebar" id="scrollsidebar" style="float: right">
|
||||
<div class="side_content">
|
||||
<div class="side_list">
|
||||
<div class="side_title"><a title="<%= l(:label_feedback) %>" class="close_btn"><span><%= l(:label_feedback) %></span></a></div>
|
||||
<div class="side_center">
|
||||
<div class="custom_service">
|
||||
<% get_memo %>
|
||||
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
|
||||
<%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
||||
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
||||
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
|
||||
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
|
||||
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="msgserver">
|
||||
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白 羽</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side_bottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show_btn"><span><%= l(:label_submit)%></span></div>
|
||||
</div>
|
||||
</body>
|
||||
<style type="text/css">
|
||||
html{ overflow-x:hidden;}
|
||||
.scrollsidebar{ position:fixed;bottom:1px; right:1px; background:none; }
|
||||
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
|
||||
.side_content .side_list {width:154px;overflow:hidden;}
|
||||
.show_btn{ width:0; height:112px; overflow:hidden; float:left;margin-top: 200px; cursor:pointer;}
|
||||
.show_btn span { display:none;}
|
||||
.close_btn{width:24px;height:24px;cursor:pointer;}
|
||||
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; }
|
||||
.side_title {height:35px;}
|
||||
.side_bottom { height:8px;}
|
||||
.side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;}
|
||||
.close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;}
|
||||
.close_btn span { display:none;}
|
||||
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
|
||||
.msgserver { margin:2px 0px 0px 4px; padding-top: 0px}
|
||||
.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;}
|
||||
.opnionText{ width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;}
|
||||
.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;}
|
||||
.opnionButton:hover{background: #0fa9bb; }
|
||||
|
||||
/* blue skin as the default skin */
|
||||
.side_title {background-position:-195px 0;}
|
||||
.side_center {background:url(/images/blue_line.png) repeat-y center;}
|
||||
.side_bottom {background-position:-195px -50px;}
|
||||
.close_btn {background-position:-44px 0;}
|
||||
.close_btn:hover {background-position:-66px 0;}
|
||||
.show_btn {background-position:-119px 0;}
|
||||
.msgserver a {color:#15bccf; }
|
||||
.msgserver a:hover { text-decoration:underline; }
|
||||
</style>
|
||||
|
||||
<head>
|
||||
<script>
|
||||
(function($){
|
||||
$.fn.fix = function(options){
|
||||
var defaults = {
|
||||
float : 'right',
|
||||
minStatue : true,
|
||||
skin : 'blue',
|
||||
durationTime : 1000
|
||||
}
|
||||
var options = $.extend(defaults, options);
|
||||
|
||||
this.each(function(){
|
||||
//???????
|
||||
var thisBox = $(this),
|
||||
closeBtn = thisBox.find('.close_btn' ),
|
||||
show_btn = thisBox.find('.show_btn' ),
|
||||
sideContent = thisBox.find('.side_content'),
|
||||
sideList = thisBox.find('.side_list')
|
||||
;
|
||||
var defaultTop = thisBox.offset().top; //????????top
|
||||
|
||||
thisBox.css(options.float, 0);
|
||||
if(options.minStatue == "true"){
|
||||
$(".show_btn").css("float", options.float);
|
||||
sideContent.css('width', 0);
|
||||
show_btn.css('width', 25);
|
||||
|
||||
}
|
||||
//close
|
||||
closeBtn.bind("click",function(){
|
||||
sideContent.animate({width: '0px'},"fast");
|
||||
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
|
||||
cookiesave('minStatue','true','','','');
|
||||
});
|
||||
//show
|
||||
show_btn.bind("click",function() {
|
||||
$(this).animate({width: '0px'},"fast");
|
||||
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
|
||||
cookiesave('minStatue','false','','','');
|
||||
});
|
||||
|
||||
|
||||
|
||||
}); //end this.each
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
|
||||
$(function(){
|
||||
$("#button1").click(function(){
|
||||
myTips("<%= l(:label_feedback_success) %>","success");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function f_submit()
|
||||
{
|
||||
// var subject = $("#memo_subject").val();
|
||||
// var content = $("#memo_content_1").val();
|
||||
// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"...");
|
||||
$("#new_memo").submit();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#scrollsidebar").fix({
|
||||
float : 'right', //default.left or right
|
||||
minStatue : cookieget('minStatue'),
|
||||
skin : 'green', //default.gray or blue
|
||||
durationTime : 600
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#subject").keydown(function(){
|
||||
var curLength=$("#subject").val().length;
|
||||
if(curLength>50){
|
||||
var num=$("#subject").val().substr(0,50);
|
||||
$("#subject").val(num);
|
||||
}
|
||||
else{
|
||||
$("#textCount").text(50-$("#subject").val().length)
|
||||
}
|
||||
})
|
||||
$("#subject").keyup(function(){
|
||||
var curLength=$("#subject").val().length;
|
||||
if(curLength>50){
|
||||
var num=$("#subject").val().substr(0,50);
|
||||
$("#subject").val(num);
|
||||
}
|
||||
else{
|
||||
$("#textCount").text(50-$("#subject").val().length)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="scrollsidebar" id="scrollsidebar" style="float: right">
|
||||
<div class="side_content">
|
||||
<div class="side_list">
|
||||
<div class="side_title"><a title="<%= l(:label_feedback) %>" class="close_btn"><span><%= l(:label_feedback) %></span></a></div>
|
||||
<div class="side_center">
|
||||
<div class="custom_service">
|
||||
<% get_memo %>
|
||||
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
|
||||
<%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
||||
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
||||
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
|
||||
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
|
||||
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="msgserver">
|
||||
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白 羽</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side_bottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show_btn"><span><%= l(:label_submit)%></span></div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
|
||||
<% end %>
|
||||
<% 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 %>
|
||||
</div>
|
||||
<% end%>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= 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 %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<%=l(:label_project_hosting_platform) %>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @project.name, nil %>
|
||||
<%= link_to @project.name, project_path(@project.id) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="search fl">
|
||||
|
@ -122,13 +122,12 @@
|
|||
<!-- 项目得分 -->
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<a class="pr_info_name fl c_dark fb break_word" href="javascript:void(0)" target="_blank" >
|
||||
<%= l(:label_project_name) %><%= @project.name %>
|
||||
<%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<% if @project.is_public? %>
|
||||
<span class="img_private"><%= l(:label_public)%></span>
|
||||
<% else %>
|
||||
<span class="img_private"><%= l(:label_private)%></span>
|
||||
<% end %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
|
@ -158,8 +157,8 @@
|
|||
<!--邀请加入-->
|
||||
<div class="subNavBox">
|
||||
<% 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>
|
||||
<ul class="navContent " style="display:block">
|
||||
<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" id="navContent_invit">
|
||||
<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) %>
|
||||
<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) %>
|
||||
</p>
|
||||
</div>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @topic},
|
||||
:class => 'talk_edit fr'
|
||||
) if @message.course_editable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => @topic},
|
||||
|
@ -40,6 +35,11 @@
|
|||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'talk_edit fr'
|
||||
) 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="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>
|
||||
|
@ -105,6 +105,7 @@
|
|||
<%= 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} %>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= error_messages_for 'message' %>
|
||||
<% replying ||= false %>
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>
|
||||
|
||||
<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 %>
|
||||
<%= 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 %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p id="subject_span" class="ml55"></p>
|
||||
</li>
|
||||
<li class="ml60 mb5">
|
||||
|
@ -26,7 +27,7 @@
|
|||
<div class="cl"></div>
|
||||
</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" >
|
||||
<span class="c_red">*</span>
|
||||
<%= l(:field_description) %> :
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<% end %>
|
||||
<p id="subject_span" class="ml55"></p>
|
||||
</li>
|
||||
<li class="ml60 mb5">
|
||||
<li class="ml55 mb5">
|
||||
<% unless replying %>
|
||||
<% if @message.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<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' %>
|
||||
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<% if @message.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">
|
||||
<div class="ml15">
|
||||
<ul>
|
||||
<%= form_for @message, { :as => :message,
|
||||
:url => {:action => 'edit'},
|
||||
|
|
|
@ -5,3 +5,4 @@ $('#quote_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
|||
|
||||
showAndScrollTo("reply", "message_content");
|
||||
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
||||
$("img").removeAttr("align");
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
|
||||
<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;'%>
|
||||
<span class='font_lighter'><%= l(:label_max_number) %></span>
|
||||
<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" %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
||||
|
@ -39,7 +33,7 @@
|
|||
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
||||
</div>
|
||||
<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) %>
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','111px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','111px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -1,10 +1,10 @@
|
|||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','80px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','80px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -20,7 +20,7 @@
|
|||
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||
<div class="member_search">
|
||||
<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) }')" %>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -33,8 +33,18 @@
|
|||
</li>
|
||||
<% roles.each do |role| %>
|
||||
<li class="fl mr5">
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||
<%= h role %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||
<% 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>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
<%
|
||||
roles = Role.givable.all
|
||||
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
|
||||
roles = roles[0..2]
|
||||
end
|
||||
|
@ -18,7 +23,23 @@
|
|||
<li >
|
||||
<%= link_to_user_header member.principal,false,:class => "w140_h c_setting_blue 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),
|
||||
:method => :put,
|
||||
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
||||
|
@ -27,7 +48,18 @@
|
|||
<ul style="text-align: left;" >
|
||||
<%= 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? } %>
|
||||
<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>
|
||||
<!--<br/>-->
|
||||
<% end %>
|
||||
|
@ -91,7 +123,7 @@
|
|||
<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| %>
|
||||
<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') }')" %>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -107,7 +139,17 @@
|
|||
<% roles.each do |role| %>
|
||||
<li>
|
||||
<%= 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>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<!-- new repository ,new by xianbo-->
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_repository_new_repos) %></h2>
|
||||
</div>
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form'} do |f| %>
|
||||
<%= render :partial => 'form_create', :locals => {:f => f} %>
|
||||
|
||||
<!-- new repository ,new by xianbo-->
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_repository_new_repos) %></h2>
|
||||
</div>
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form'} do |f| %>
|
||||
<%= render :partial => 'form_create', :locals => {:f => f} %>
|
||||
|
||||
<% end %>
|
|
@ -30,13 +30,13 @@
|
|||
</p>
|
||||
</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">
|
||||
<br>
|
||||
<div class=" c_dark f14">
|
||||
<p>项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码</p>
|
||||
|
||||
<p>建立版本库文件夹,打开命令行执行如下:</p>
|
||||
<p>项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码。</p>
|
||||
<p>通过cmd命令提示符进入代码对应文件夹的根目录,假设当前用户的登录名为user,版本库名称为demo,需要操作的版本库分支为branch。
|
||||
如果是首次提交代码,执行如下命令:</p>
|
||||
</div>
|
||||
<div class="repos_explain">
|
||||
<p>git init</p>
|
||||
|
@ -46,19 +46,19 @@
|
|||
<p>git commit -m "first commit"</p>
|
||||
|
||||
<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>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>
|
||||
<!--repos_explain end-->
|
||||
<div class="c_dark f14">
|
||||
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
@ -66,14 +66,14 @@
|
|||
|
||||
<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>
|
||||
<!--repos_explain end-->
|
||||
<div class="c_dark f14">
|
||||
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
|||
</div>
|
||||
<div class="repos_explain">
|
||||
<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>git add .</p>
|
||||
|
@ -96,7 +96,7 @@
|
|||
|
||||
<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>
|
||||
</div>
|
||||
|
|
|
@ -1,110 +1,110 @@
|
|||
<script type="text/javascript">
|
||||
// $(this).ready(function(){
|
||||
// $('.tag_show').hover(function() {
|
||||
// $(this).children("span").show();
|
||||
// }, function() {
|
||||
// $(this).children("span").hide();
|
||||
// });
|
||||
// })
|
||||
</script>
|
||||
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 7代表竞赛 9代表课程-->
|
||||
<% @tags = obj.reload.tag_list %>
|
||||
<% if non_list_all and (@tags.size > 0) %>
|
||||
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
|
||||
<% if @tags.size > Setting.show_tags_length.to_i then %>
|
||||
<% i = 0 %>
|
||||
<% until i>Setting.show_tags_length.to_i do %>
|
||||
<div id="tag">
|
||||
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
|
||||
</div>
|
||||
<% i += 1 %>
|
||||
<% end %>
|
||||
<%= more_tags(obj.id,object_flag)%>
|
||||
<% else %>
|
||||
<% @tags.each do |tag| %>
|
||||
<div id="tag">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<!--object_flag == '2'为项目 项目暂时单独出来,后面其它几个选项也需样式重构-->
|
||||
<% if object_flag == '2' %>
|
||||
<span class="re_tag f_l">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
|
||||
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% else %>
|
||||
<div id="tag">
|
||||
<span class="tag_show">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
|
||||
<% case object_flag %>
|
||||
<% when '1' %>
|
||||
<% if User.current.eql?(obj) %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '3' %>
|
||||
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '4' %>
|
||||
<% if obj.author_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '5' %>
|
||||
<% test = Forum.find(obj.id) %>
|
||||
<% if test && test.creator_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '6' %>
|
||||
<%# if (User.current.logged? &&
|
||||
User.current.admin?
|
||||
# && (@project && User.current.member_of?(@project))
|
||||
)
|
||||
%>
|
||||
<% if obj.author_id == User.current.id || User.current.admin?%>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '7' %>
|
||||
<% if obj.author_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '9' %>
|
||||
<% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
// $(this).ready(function(){
|
||||
// $('.tag_show').hover(function() {
|
||||
// $(this).children("span").show();
|
||||
// }, function() {
|
||||
// $(this).children("span").hide();
|
||||
// });
|
||||
// })
|
||||
</script>
|
||||
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 7代表竞赛 9代表课程-->
|
||||
<% @tags = obj.reload.tag_list %>
|
||||
<% if non_list_all and (@tags.size > 0) %>
|
||||
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
|
||||
<% if @tags.size > Setting.show_tags_length.to_i then %>
|
||||
<% i = 0 %>
|
||||
<% until i>Setting.show_tags_length.to_i do %>
|
||||
<div id="tag">
|
||||
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
|
||||
</div>
|
||||
<% i += 1 %>
|
||||
<% end %>
|
||||
<%= more_tags(obj.id,object_flag)%>
|
||||
<% else %>
|
||||
<% @tags.each do |tag| %>
|
||||
<div id="tag">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<!--object_flag == '2'为项目 项目暂时单独出来,后面其它几个选项也需样式重构-->
|
||||
<% if object_flag == '2' %>
|
||||
<span class="re_tag f_l">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
|
||||
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% else %>
|
||||
<div id="tag">
|
||||
<span class="tag_show">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
|
||||
<% case object_flag %>
|
||||
<% when '1' %>
|
||||
<% if User.current.eql?(obj) %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '3' %>
|
||||
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '4' %>
|
||||
<% if obj.author_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '5' %>
|
||||
<% test = Forum.find(obj.id) %>
|
||||
<% if test && test.creator_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '6' %>
|
||||
<%# if (User.current.logged? &&
|
||||
User.current.admin?
|
||||
# && (@project && User.current.member_of?(@project))
|
||||
)
|
||||
%>
|
||||
<% if obj.author_id == User.current.id || User.current.admin?%>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '7' %>
|
||||
<% if obj.author_id == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% when '9' %>
|
||||
<% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %>
|
||||
<span class='del'>
|
||||
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||
:taggable_id => obj.id, :taggable_type => object_flag %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -39,9 +39,9 @@
|
|||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% selector = ".#{watcher_css(watched)}" %>
|
||||
<% id_selector = "#{watcher_css(watched)}" %>
|
||||
if($("<%= selector %>").get(0) == undefined)
|
||||
{
|
||||
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||||
}
|
||||
|
||||
<% selector = ".#{watcher_css(watched)}" %>
|
||||
<% id_selector = "#{watcher_css(watched)}" %>
|
||||
if($("<%= selector %>").get(0) == undefined)
|
||||
{
|
||||
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
(<%= course.members.count %>人)
|
||||
<% files_count = course.attachments.count %>
|
||||
<% 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 %>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<li style="overflow:hidden;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
|
||||
<div style="float: left;">
|
||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div style="float: left; margin-left: 10px; width: 380px;">
|
||||
<% unless project.is_public %>
|
||||
<span class="private_project">
|
||||
<%= l(:label_private) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to l(:label_project_member_amount, :count => projectCount(project)), project_member_path(project) ,:course =>'0' %>)
|
||||
</div>
|
||||
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
|
||||
<span class='font_lighter' title ='<%= project.short_description%>'> <%=project.description.truncate(90, omission: '...')%> </span>
|
||||
</div>
|
||||
<div >
|
||||
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||
:title => l(:label_project_score_tips),
|
||||
:class => "tooltip",
|
||||
:id => "tooltip-#{project.id}" %>
|
||||
</div>
|
||||
<li style="overflow:hidden;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
|
||||
<div style="float: left;">
|
||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div style="float: left; margin-left: 10px; width: 380px;">
|
||||
<% unless project.is_public %>
|
||||
<span class="private_project">
|
||||
<%= l(:label_private) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to l(:label_project_member_amount, :count => projectCount(project)), project_member_path(project) ,:course =>'0' %>)
|
||||
</div>
|
||||
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
|
||||
<span class='font_lighter' title ='<%= project.short_description%>'> <%=project.description.truncate(90, omission: '...')%> </span>
|
||||
</div>
|
||||
<div >
|
||||
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||
:title => l(:label_project_score_tips),
|
||||
:class => "tooltip",
|
||||
:id => "tooltip-#{project.id}" %>
|
||||
</div>
|
||||
</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_password: 密码
|
||||
|
|
|
@ -351,7 +351,7 @@ zh:
|
|||
# 意见反馈
|
||||
#
|
||||
label_feedback: 意见反馈
|
||||
label_feedback_tips: "有什么想说的,尽管来咆哮吧~~"
|
||||
label_feedback_tips: "欢迎反馈网站问题,课程中遇到的问题请反馈给相关老师!"
|
||||
label_technical_support: "技术支持:"
|
||||
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
|
||||
label_feedback_value: "该帖来自用户反馈:)"
|
||||
|
|
|
@ -15,8 +15,8 @@ zh:
|
|||
label_forum_all: 公共贴吧
|
||||
label_school_all: 中国高校
|
||||
label_contest_innovate: 创新竞赛
|
||||
#label_software_user: 软件创客
|
||||
#label_requirement_enterprise: 软件众包
|
||||
label_software_user: 软件创客
|
||||
label_requirement_enterprise: 软件众包
|
||||
label_stores_index: 资源搜索
|
||||
label_login: 登录
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ zh:
|
|||
label_input_email: 请输入邮箱地址
|
||||
|
||||
label_invite_trustie_user: "邀请Trustie注册用户"
|
||||
label_invite_trustie_user_tips: "请输入用户名称来搜索好友"
|
||||
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
|
||||
label_user_role_null: 用户和角色不能留空!
|
||||
label_invite_project: 邀请您加入项目
|
||||
label_invite_success: 邀请成功
|
||||
|
@ -415,3 +415,4 @@ zh:
|
|||
#
|
||||
field_sharing: 共享
|
||||
label_title_code_review: 代码评审
|
||||
label_home_non_project: 您还没有创建项目,您可以查看系统的其它项目!
|
|
@ -227,6 +227,8 @@ RedmineApp::Application.routes.draw do
|
|||
match '/projects/search', :via => [:get, :post]
|
||||
match '/users/search', :via => [:get, :post]
|
||||
#end
|
||||
|
||||
match 'account/heartbeat', to: 'account#heartbeat', :via => :get
|
||||
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||
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
|
2947
db/schema.rb
2947
db/schema.rb
File diff suppressed because it is too large
Load Diff
|
@ -1,30 +1,30 @@
|
|||
#coding=utf-8
|
||||
#!/usr/bin/env python
|
||||
|
||||
# 脚本用于刷新版本库,由git hooks里进行调用,传入参数为git仓库路径
|
||||
# 需要配置rails项目地址
|
||||
# 必须装此文件放在git的存放目录,现在是 /home/pdl/redmine-2.3.2-0/apache2/htdocs
|
||||
|
||||
import sys
|
||||
import os
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
RAILS_URL = 'http://192.168.128.128:3000/'
|
||||
|
||||
def get_git_path():
|
||||
return sys.argv[1]
|
||||
path=os.path.realpath(sys.argv[0])
|
||||
if os.path.isfile(path):
|
||||
path=os.path.dirname(os.path.dirname(path))
|
||||
return os.path.abspath(path)
|
||||
|
||||
def post_http_data(url, data):
|
||||
data_urlencode = urllib.urlencode(data)
|
||||
req = urllib2.Request(url = url,data =data_urlencode)
|
||||
res_data = urllib2.urlopen(req)
|
||||
#res = res_data.read()
|
||||
#return res
|
||||
|
||||
path = get_git_path()
|
||||
post_http_data(RAILS_URL + 'git_callback/post_update', {'root_url': path})
|
||||
#coding=utf-8
|
||||
#!/usr/bin/env python
|
||||
|
||||
# 脚本用于刷新版本库,由git hooks里进行调用,传入参数为git仓库路径
|
||||
# 需要配置rails项目地址
|
||||
# 必须装此文件放在git的存放目录,现在是 /home/pdl/redmine-2.3.2-0/apache2/htdocs
|
||||
|
||||
import sys
|
||||
import os
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
RAILS_URL = 'http://192.168.128.128:3000/'
|
||||
|
||||
def get_git_path():
|
||||
return sys.argv[1]
|
||||
path=os.path.realpath(sys.argv[0])
|
||||
if os.path.isfile(path):
|
||||
path=os.path.dirname(os.path.dirname(path))
|
||||
return os.path.abspath(path)
|
||||
|
||||
def post_http_data(url, data):
|
||||
data_urlencode = urllib.urlencode(data)
|
||||
req = urllib2.Request(url = url,data =data_urlencode)
|
||||
res_data = urllib2.urlopen(req)
|
||||
#res = res_data.read()
|
||||
#return res
|
||||
|
||||
path = get_git_path()
|
||||
post_http_data(RAILS_URL + 'git_callback/post_update', {'root_url': path})
|
||||
|
|
|
@ -55,7 +55,7 @@ module RailsKindeditor
|
|||
}"
|
||||
else
|
||||
"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
|
||||
|
@ -101,4 +101,4 @@ module RailsKindeditor
|
|||
@template.send("kindeditor", @object_name, method, objectify_options(options))
|
||||
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'
|
||||
|
|
|
@ -17,4 +17,4 @@ end
|
|||
|
||||
if __FILE__ == $0
|
||||
puts Trustie::Utils.digest('/Users/guange/Downloads/QQ_V4.0.2.dmg')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
source 'http://ruby.taobao.org'
|
||||
|
||||
gem 'rich', '1.4.6'
|
||||
gem 'kaminari'
|
||||
gem 'htmlentities'
|
||||
gem 'paperclip', '~> 3.5.4'
|
||||
source 'http://ruby.taobao.org'
|
||||
|
||||
gem 'rich', '1.4.6'
|
||||
gem 'kaminari'
|
||||
gem 'htmlentities'
|
||||
gem 'paperclip', '~> 3.5.4'
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue