Merge branch 'szzh' into sw_new_course

This commit is contained in:
sw 2015-05-19 08:44:20 +08:00
commit ee5efab7b8
276 changed files with 10741 additions and 6300 deletions

60
.gitignore vendored
View File

@ -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

2
.rspec
View File

@ -1,2 +1,2 @@
--format documentation
--color
--require spec_helper

37
Gemfile
View File

@ -24,38 +24,25 @@ 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'
gem 'puma' if RbConfig::CONFIG['host_os'] =~ /linux/
gem 'pry-rails'
if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug'
else
# gem 'pry-debugger'
end
gem 'pry-stack_explorer'
gem 'better_errors', '~> 1.1.0'
gem 'rack-mini-profiler', '~> 0.9.3'
end
group :test do
gem "shoulda", "~> 3.5.0"
gem "mocha", "~> 1.1.0"
gem 'capybara', '~> 2.4.1'
gem 'nokogiri', '~> 1.6.3'
gem 'factory_girl', '~> 4.4.0'
gem 'selenium-webdriver', '~> 2.42.0'
group :development, :test do
unless RUBY_PLATFORM =~ /w32/
gem 'pry-rails'
if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug'
end
gem 'pry-stack_explorer'
end
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
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required

View File

@ -168,6 +168,30 @@ module Mobile
present :status, 0
end
desc "设置教辅"
params do
requires :token,type:String
requires :user_id,type:Integer,desc: '用户id'
requires :course_id,type:Integer,desc:'课程id'
end
get 'set_user_as_assitant' do
cs = CoursesService.new
cs.set_as_assitant_teacher params
present :status, 0
end
desc "删除教辅"
params do
requires :token,type:String
requires :user_id,type:Integer,desc: '用户id'
requires :course_id,type:Integer,desc:'课程id'
end
get 'del_user_as_assitant' do
cs = CoursesService.new
cs.del_assitant_teacher params
present :status, 0
end
desc "返回单个课程"
params do
requires :id, type: Integer
@ -179,7 +203,7 @@ module Mobile
course = cs.show_course(params,(current_user.nil? ? User.find(2):current_user))
#course = Course.find(params[:id])
present :data, course, with: Mobile::Entities::Course
present :status, 0
{ status: 0}
end
end
@ -250,10 +274,43 @@ module Mobile
get ":course_id/members" do
cs = CoursesService.new
count = cs.course_members params
# 我如果在学生当中,那么我将放在第一位
count.each do |m|
if m.user.id == current_user.id
count.delete m
count.unshift m
end
end
present :data, count, with: Mobile::Entities::Member
present :status, 0
end
desc '查看用户历次作业成绩'
params do
requires :token,type:String
requires :member_id,type:Integer,desc:'课程member_id'
optional :homeworkName,type:String,desc:'作业名称以及作业名称可能包含的字符'
end
get '/show_member_score/:member_id' do
cs = CoursesService.new
homeworkscore = cs.show_member_score params
present :data,homeworkscore,with: Mobile::Entities::Homeworkscore
present :status,0
end
desc '发布课程通知'
params do
requires :token,type:String
requires :course_id,type:Integer,desc:'课程id'
requires :title,type:String,desc:'通知标题'
requires :desc,type:String,desc:'通知描述'
end
post ':course_id/create_course_notice' do
cs = CoursesService.new
news = cs.create_course_notice params,current_user
present :data,news,with:Mobile::Entities::News
present :status,0
end
end
end
end

View File

@ -96,6 +96,21 @@ module Mobile
present :status, 0
end
desc '创建作业'
params do
requires :token,type:String
requires :work_name,type:String,desc:'作业名称'
requires :work_desc,type:String,desc:'作业描述'
requires :work_deadline,type:String,desc:'截止日期'
requires :is_blind_appr,type:Integer,desc:'是否匿评'
requires :blind_appr_num,type:Integer,desc:'匿评分配数'
requires :course_id,type:Integer,desc: '课程id'
end
post 'create_home_work' do
Homeworks.get_service.create_home_work params,current_user
present :status, 0
end
end
end

View File

@ -83,6 +83,9 @@ module Mobile
params do
requires :name, type: String, desc: '用户名关键字'
requires :search_by, type: String,desc: '搜索依据0 昵称1 用户名2 邮箱,3 昵称和姓名'
optional :is_search_assitant,type:Integer,desc:'是否搜索注册用户来作为助教'
optional :course_id,type:Integer,desc: '课程id搜索注册用户不为该课程教师的其他用户'
optional :user_id,type:Integer,desc:'用户id'
end
get 'search/search_user' do
us = UsersService.new

View File

@ -37,7 +37,6 @@ module Mobile
f.send(:attachments)
end
end
#homework_attach_expose :user
end
end
end

View File

@ -0,0 +1,18 @@
module Mobile
module Entities
class Homeworkscore < Grape::Entity
include Redmine::I18n
include ApplicationHelper
def self.homeworkscore_expose(field)
expose field do |f,opt|
if f.is_a?(Hash) && f.key?(field)
f[field]
end
end
end
homeworkscore_expose :name
homeworkscore_expose :score
end
end
end

View File

@ -28,6 +28,7 @@ module Mobile
end
member_expose :student_id
member_expose :score
member_expose :id
end
end
end

View File

@ -9,7 +9,7 @@ module Mobile
u[f]
elsif u.is_a?(::User)
if u.respond_to?(f)
u.send(f)
u.send(f) unless u.user_extensions.nil?
else
case f
when :img_url
@ -17,9 +17,9 @@ module Mobile
when :gender
u.nil? || u.user_extensions.nil? || u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
when :work_unit
get_user_work_unit u
get_user_work_unit u unless u.user_extensions.nil?
when :location
get_user_location u
get_user_location u unless u.user_extensions.nil?
when :brief_introduction
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
end

View File

@ -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.host_user)
else
if last_login_on == ''
redirect_to my_account_url
@ -329,10 +330,10 @@ 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,
:expires => 1.month.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:httponly => true

View File

@ -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

View File

@ -8,23 +8,26 @@ class AvatarController < ApplicationController
# Make sure that API users get used to set this content type
# as it won't trigger Rails' automatic parsing of the request body for parameters
unless request.content_type == 'application/octet-stream'
render :nothing => true, :status => 406
return
end
unless request.raw_post.nil?
@source_type = params[:source_type]
@source_type = params[:source_type]
@source_id = params[:source_id]
@temp_file = request.raw_post
if @temp_file.size > 0
if @temp_file.respond_to?(:original_filename)
@image_file = @temp_file.original_filename
#image_file.force_encoding("UTF-8") if filename.respond_to?(:force_encoding)
else
@image_file=params[:filename]
end
@temp_file = params[:avatar][:image]
@image_file = @temp_file.original_filename
else
unless request.raw_post.nil?
@source_type = params[:source_type]
@source_id = params[:source_id]
@temp_file = request.raw_post
if @temp_file.size > 0
if @temp_file.respond_to?(:original_filename)
@image_file = @temp_file.original_filename
#image_file.force_encoding("UTF-8") if filename.respond_to?(:force_encoding)
else
@image_file=params[:filename]
end
end
end
end
if @temp_file && (@temp_file.size > 0)
diskfile=disk_filename(@source_type,@source_id)
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
@ -56,27 +59,15 @@ 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.json{
render :inline => "#{@urlfile.to_s}?#{Time.now.to_i}",:content_type => 'text/html'
return
}
format.js
format.api {
if saved

View File

@ -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

View File

@ -27,7 +27,7 @@ class BoardsController < ApplicationController
include SortHelper
helper :watchers
helper :project_score
helper :attachments
def index
#modify by nwb
@flag = params[:flag] || false
@ -80,7 +80,7 @@ class BoardsController < ApplicationController
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}).
all
elsif @course
@ -88,7 +88,7 @@ class BoardsController < ApplicationController
includes(:last_reply).
# limit(@topic_pages.per_page).
# offset(@topic_pages.offset).
order(sort_clause).
order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}).
all : []
@topics = paginateHelper board_topics,10

View File

@ -5,6 +5,7 @@ class CoursesController < ApplicationController
helper :activities
helper :members
helper :words
helper :attachments
before_filter :auth_login1, :only => [:show, :feedback]
menu_item :overview
@ -851,7 +852,7 @@ class CoursesController < ApplicationController
#验证是否显示课程
def can_show_course
@first_page = FirstPage.find_by_page_type('project')
if @first_page.show_course == 2
if @first_page.try(:show_course) == 2
render_404
end
end

View File

@ -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

View File

@ -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

View File

@ -58,7 +58,7 @@ class IssuesController < ApplicationController
def index
retrieve_query
sort_init(@query.sort_criteria.empty? ? [['updated_on', 'desc']] : @query.sort_criteria)
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a
@ -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
@ -383,7 +387,7 @@ class IssuesController < ApplicationController
def retrieve_previous_and_next_issue_ids
retrieve_query_from_session
if @query
sort_init(@query.sort_criteria.empty? ? [['updated_on', 'desc']] : @query.sort_criteria)
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns, 'issues_index_sort')
limit = 500
issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version])

View File

@ -93,10 +93,27 @@ class MessagesController < ApplicationController
end
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
render_attachment_warning_if_needed(@message)
redirect_to board_message_url(@board, @message)
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
end
else
redirect_to board_message_url(@board, @message)
end
else
layout_file = @project ? 'base_projects' : 'base_courses'
render :action => 'new', :layout => layout_file
if params[:is_board]
if @project
redirect_to project_boards_path(@project, :flag => true)
elsif @course
redirect_to course_boards_path(@course, :flag => true)
end
else
layout_file = @project ? 'base_projects' : 'base_courses'
render :action => 'new', :layout => layout_file
end
end
else
respond_to do |format|
@ -111,7 +128,15 @@ class MessagesController < ApplicationController
# Reply to a topic
def reply
if params[:reply][:content] == ""
(redirect_to board_message_url(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
if params[:is_board]
if @project
(redirect_to project_boards_path(@project), :notice => l(:label_reply_empty);return)
elsif @course
(redirect_to course_boards_path(@course), :notice => l(:label_reply_empty);return)
end
else
(redirect_to board_message_url(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
end
end
@quote = params[:quote][:quote]
@reply = Message.new
@ -123,16 +148,24 @@ 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)
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
end
else
redirect_to board_message_url(@board, @topic, :r => @reply)
end
end
@ -144,19 +177,36 @@ class MessagesController < ApplicationController
else
(render_403; return false) unless @message.course_editable_by?(User.current)
end
@message.safe_attributes = params[:message]
if request.post? && @message.save
attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message)
flash[:notice] = l(:notice_successful_update)
@message.reload
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
end
else
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end
elsif request.get?
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : 'base_courses'
render :layout => layout_file
}
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
end
else
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : 'base_courses'
render :layout => layout_file
}
end
end
end
end
@ -172,16 +222,20 @@ class MessagesController < ApplicationController
@message.destroy
# modify by nwb
if @project
if @message.parent
redirect_to board_message_url(@board, @message.parent, :r => r)
else
if params[:is_board]
redirect_to project_boards_url(@project)
else
redirect_to board_message_url(@board, @topic, :r => @reply)
end
elsif @course
if @message.parent
redirect_to board_message_url(@board, @message.parent, :r => r)
if params[:is_board]
redirect_to course_boards_url(@course)
else
redirect_to course_board_url(@course, @board)
if @message.parent
redirect_to board_message_url(@board, @message.parent, :r => r)
else
redirect_to course_board_url(@course, @board)
end
end
end
end
@ -202,7 +256,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)

View File

@ -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 if File.exist? diskfile1
@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

View File

@ -244,12 +244,12 @@ update
def show
## TODO: the below will move to filter, done.
# if !User.current.member_of?(@project)
# if @project.hidden_repo
# render_403
# return -1
# end
# end
if !User.current.member_of?(@project)
if @project.hidden_repo
render_403
return -1
end
end
#if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?

View File

@ -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

View File

@ -383,6 +383,8 @@ class UsersController < ApplicationController
# scope = User.logged.status(@status)
# @search_by = params[:search_by] ? params[:search_by][:id] : 0
# scope = scope.like(params[:name],@search_by) if params[:name].present?
@search_by = params[:search_by] ? params[:search_by] : 0
us = UsersService.new
scope = us.search_user params
@user_count = scope.count

View File

@ -118,11 +118,11 @@ module ApplicationHelper
end
#if user.active? || (User.current.admin? && user.logged?)
# link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
# link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => user.css_classes
#else
# name
#end
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => user.css_classes
else
h(user.to_s)
end
@ -131,7 +131,7 @@ module ApplicationHelper
def link_to_isuue_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "pro_info_p"
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "pro_info_p"
else
h(user.to_s)
end
@ -140,7 +140,7 @@ module ApplicationHelper
def link_to_settings_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "w90 c_orange fl"
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "w90 c_orange fl"
else
h(user.to_s)
end
@ -155,7 +155,7 @@ module ApplicationHelper
else
name = user.login
end
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class]
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => options[:class]
else
h(user.to_s)
end
@ -593,6 +593,42 @@ module ApplicationHelper
Project.project_tree(projects, &block)
end
# 项目版本库可见权限判断
# 条件1、modules中设置不可见或项目没有版本库2、如果项目是私有或者项目版本库隐藏则必须是项目成员才可见
def visible_repository?(project)
@result = false
unless project.enabled_modules.where("name = 'repository'").empty? || project.repositories.count == 0
if (project.hidden_repo || !project.is_public?)
if User.current.member_of?(project)
@result = true
end
else
@result = true
end
end
return @result
end
# 判断当前用户是否为项目管理员
def is_project_manager?(user_id, project_id)
@result = false
mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
unless mem.blank?
@result = mem.first.roles.to_s.include?("Manager") ? true : false
end
return @result
end
# 公开项目资源可以引用admin和管理员和资源上传者拥有设置公开私有权限
def authority_pubilic_for_files(project, file)
@result = false
if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id || User.current.admin) &&
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
@result = true
end
return @result
end
def principals_check_box_tags(name, principals)
s = ''
principals.each do |principal|
@ -1770,8 +1806,7 @@ module ApplicationHelper
def get_memo
@new_memo = Memo.new
#@new_memo.subject = "有什么想说的,尽管来咆哮吧~~"
@public_forum = Forum.find(1)
@public_forum = Forum.find(1) rescue ActiveRecord::RecordNotFound
end
#获取用户未过期的课程
@ -2066,21 +2101,21 @@ module ApplicationHelper
hidden_non_project = Setting.find_by_name("hidden_non_project")
visiable = !(hidden_non_project && hidden_non_project.value == "0")
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain}
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.host_course}
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.host_name}
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.host_contest}
# course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.host_course}
# courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.host_user}
# contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
project_new_link = link_to l(:label_project_new), {:controller => 'projects', :action => 'new', :host => Setting.project_domain}
# project_mine_link = link_to l(:label_my_project), {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
project_new_link = link_to l(:label_project_new), {:controller => 'projects', :action => 'new', :host => Setting.host_name}
# project_mine_link = link_to l(:label_my_project), {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
#@nav_dispaly_project_label
nav_list = Array.new

View File

@ -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

View File

@ -11,7 +11,7 @@ module GitlabHelper
PROJECT_PATH_CUT = 40
# gitlab版本库所在服务器
# 注意REPO_IP_ADDRESS必须以http://开头暂时只支持HTTP协议未支持SSH
#REPO_IP_ADDRESS = "http://" + Setting.repository_domain
#REPO_IP_ADDRESS = "http://" + Setting.host_repository
REPO_IP_ADDRESS = "http://192.168.137.100"
GITLAB_API = "/api/v3"

View File

@ -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

View File

@ -24,7 +24,7 @@ module RepositoriesHelper
ROOT_PATH="/home/pdl/redmine-2.3.2-0/apache2/"
end
PROJECT_PATH_CUT = 40
REPO_IP_ADDRESS = Setting.repository_domain
REPO_IP_ADDRESS = Setting.host_repository
def format_revision(revision)
if revision.respond_to? :format_identifier
@ -232,6 +232,18 @@ module RepositoriesHelper
:label => l(:label_git_report_last_commit)
))
end
# 判断项目是否有主版本库
def judge_main_repository(pro)
if pro.repositories.blank?
return false
else
pro.repositories.sort.each do |rep|
rep.is_default?
return true
end
end
end
# def cvs_field_tags(form, repository)
# content_tag('p', form.text_field(
# :root_url,

View File

@ -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,16 @@ 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')
else
token.update_attribute(:created_on, Time.now)
end
token
end
def self.get_token_from_user(user, action)
token = Token.where(:action => action, :user_id => user).first
unless token
@ -42,7 +53,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 +91,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)

View File

@ -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

View File

@ -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
@ -458,6 +458,62 @@ class CoursesService
@all_members = searchmember_by_name(student_homework_score(0,params[:course_id], 10,"desc"),params[:name])
end
def show_member_score params
@member_score = Member.find(params[:member_id]) if params[:member_id]
atta = @member_score.student_homework_score[0]
result = []
atta.each do |t|
if !params[:homeworkName].nil? && params[:homeworkName] != ""
result << {:name=>t[:name],:score=>t[:score]} if t[:name].include?(params[:homeworkName])
else
result << {:name=>t[:name],:score=>t[:score]}
end
end
result
end
# 设置人员为课程教辅
def set_as_assitant_teacher params
members = []
#找到课程
course = Course.find(params[:course_id])
#新建课程人员
member = Member.new(:role_ids =>[7], :user_id => params[:user_id],:course_id=>params[:course_id])
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id)
joined.each do |join|
join.delete
end
member.course_group_id = 0
members << member
course.members << members
#将课程人员设置为教辅
end
def del_assitant_teacher params
member = Member.where("user_id = ? and course_id = ?",params[:user_id],params[:course_id])
member.each do |m|
m.destroy
end
user_admin = CourseInfos.where("user_id = ? and course_id = ?",params[:user_id], params[:course_id])
if user_admin.size > 0
user_admin.each do |user|
user.destroy
end
end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:course_id])
joined.each do |join|
join.delete
end
end
def create_course_notice params ,current_user
n = News.new(:course_id =>params[:course_id], :author_id => current_user.id,:title =>params[:title],:description=> params[:desc])
n.save
{:id => n.id,:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count}
end
private
def searchmember_by_name members, name
#searchPeopleByRoles(project, StudentRoles)
@ -559,4 +615,8 @@ class CoursesService
end
end

View File

@ -231,6 +231,29 @@ class HomeworkService
anonymous_repy(jour)
end
end
# 发布作业
def create_home_work params,current_user
@bid = Bid.new
@bid.name = params[:work_name]
@bid.description = params[:work_desc]
# @bid.is_evaluation = params[:is_blind_appr]
@bid.evaluation_num = params[:blind_appr_num]
@bid.open_anonymous_evaluation = params[:is_blind_appr]
@bid.reward_type = 3
@bid.deadline = params[:work_deadline]
@bid.budget = 0
@bid.author_id = current_user.id
@bid.commit = 0
@bid.homework_type = 1
# @bid.
if @bid.save
HomeworkForCourse.create(:course_id => params[:course_id], :bid_id => @bid.id)
unless @bid.watched_by?(current_user)
@bid.add_watcher(current_user)
end
end
end
# 学生匿评列表
def student_jour_list params

View File

@ -205,10 +205,23 @@ class UsersService
"show_changesets" => true
}
scope = User.logged.status(status)
watcher = User.watched_by(params[:user_id])
watcher.push(params[:user_id])
search_by = params[:search_by] ? params[:search_by] : "0"
scope = scope.where("id not in (?)",watcher).like(params[:name],search_by) if params[:name].present?
if params[:is_search_assitant].nil?
#modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件(bug:#2270) start
#say by yutao: params[:user_id]这个是指谁发起的搜索么? 如果是 这个值貌似应该从session获取 怪怪的赶脚-_-!
search_by = params[:search_by] ? params[:search_by] : "0"
if params[:name].present?
if !params[:user_id].nil?
watcher = User.watched_by(params[:user_id])
watcher.push(params[:user_id])
scope = scope.where("id not in (?)",watcher)
end
scope = scope.like(params[:name],search_by)
end
#modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件 end
else
teachers = searchTeacherAndAssistant(Course.find(params[:course_id]))
scope = scope.where("id not in (?)",teachers.map{|t| t.user_id}).like(params[:name],search_by) if params[:name].present?
end
scope
end

View File

@ -17,6 +17,7 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
<% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
@ -34,10 +35,12 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
<% end %>
<% end %>
</span>
<% project = project %>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->

View File

@ -1,27 +1,31 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<span id="attachments_fields<%= container.id %>" class="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<span id="attachments_p<%= i %>" class="sub_btn">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
@ -38,12 +42,12 @@
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"file#{container.id}.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:id => "file#{container.id}",
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:onchange => "addInputFiles_board(this, '#{container.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
@ -56,7 +60,9 @@
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
<% if container.nil? %>
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
<% end %>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>

View File

@ -1,4 +1,73 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) %>
<span id="attachments_fields<%= container.id %>" class="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="sub_btn">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), 'data-containerid'=>"#{container.id}",:method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
<% end %>
</span>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment" data-containerid="<%= container.id %>">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file#{container.id}.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{container.id}",
:class => 'file_selector',
:multiple => true,
:onchange => "addInputFiles_board(this, '#{container.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all),
:containerid => "#{container.id}"
} %>
<span id="upload_file_count<%=container.id %>" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% else %>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
@ -27,39 +96,42 @@
<% end %>
<% end %>
</span>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment">
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<% if defined?(container) %>
<span id="upload_file_count" class="c_grey"><%= l(:label_no_file_uploaded)%></span>
<% end %>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

View File

@ -13,6 +13,6 @@
:target => "_blank"%>
</div>
<% end %>
<br>
<div class="cl"></div>
<% end %>
</div>

View File

@ -1,8 +1,26 @@
$('#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>"+"个文件");
}
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
if(containerid==undefined){
$('#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>"+"个文件"+"已上传");
}
}else{
$('#attachments_<%= j params[:attachment_id] %>').remove();
var count=$('#attachments_fields'+containerid+'>span').length;
if(count<=0){
$('#upload_file_count'+containerid).text('<%= l(:label_no_file_uploaded)%>');
var remove_all_html_obj = $(".remove_all").filter(function(index){
return $(this).data('containerid')==containerid;
});
remove_all_html_obj.remove();
}else{
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
}
}
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end

View File

@ -3,14 +3,15 @@ var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
fileSpan.hide();
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
<% else %>
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
fileSpan.find('a.remove-upload')
.attr({
"data-remote": true,
"data-method": 'delete',
"href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
})
.off('click');
.attr({
"data-remote": true,
"data-method": 'delete',
"href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
})
.off('click');
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
//var divattach = fileSpan.find('div.div_attachments');
//divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>');
<% end %>

View File

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

View File

@ -7,11 +7,10 @@
:id => nil,
:class => 'upload_file',
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:multiple => true,
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_file_size => Setting.upload_avatar_max_size,
:max_file_size_message => l(:error_upload_avatar_to_large, :max_size => number_to_human_size(Setting.upload_avatar_max_size.to_i)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
@ -22,6 +21,6 @@
} %>
<!--</span>-->
<% content_for :header_tags do %>
<%= javascript_include_tag 'avatars' %>
<%= javascript_include_tag 'jq-upload/jquery.ui.widget', 'jq-upload/jquery.iframe-transport', 'jq-upload/jquery.fileupload', 'jq-upload/upload' %>
<% end %>
<div class="cl"></div>
<div class="cl"></div>

View File

@ -1,4 +1,4 @@
var imgSpan = $('#avatar_image');
var imgSpan = jQuery('#avatar_image');
imgSpan.attr({"src":'<%= @urlfile.to_s << "?" << Time.now.to_s%>'});
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});

View File

@ -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;'>作品提交还剩&nbsp;:</span>&nbsp;<span style='color: red;'>"
+day1+"&nbsp;</span><span style='color: #acaeb1;'>天</span><span style='color: red;'>&nbsp;"
+hour+"&nbsp;</span><span style='color: #acaeb1;'>时</span><span style='color: red;'>&nbsp;"
+minute+"&nbsp;</span><span style='color: #acaeb1;'>分</span><span style='color: red;'>&nbsp;"
+second+"&nbsp;</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>&nbsp;&nbsp;匿评中..&nbsp;&nbsp;</a>
<% when 2 %>
<a>&nbsp;&nbsp;匿评结束&nbsp;&nbsp;</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>已&nbsp;提&nbsp;交</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) %>
&nbsp;
<%= 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) %>
:&nbsp;
<%= 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;'>作品提交还剩&nbsp;:</span>&nbsp;<span style='color: red;'>"
+day1+"&nbsp;</span><span style='color: #acaeb1;'>天</span><span style='color: red;'>&nbsp;"
+hour+"&nbsp;</span><span style='color: #acaeb1;'>时</span><span style='color: red;'>&nbsp;"
+minute+"&nbsp;</span><span style='color: #acaeb1;'>分</span><span style='color: red;'>&nbsp;"
+second+"&nbsp;</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>&nbsp;&nbsp;匿评中..&nbsp;&nbsp;</a>
<% when 2 %>
<a>&nbsp;&nbsp;匿评结束&nbsp;&nbsp;</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>已&nbsp;提&nbsp;交</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) %>
&nbsp;
<%= 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) %>
:&nbsp;
<%= 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>

View File

@ -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'>

View File

@ -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>&nbsp;<%= l(:field_evaluation_num)%>&nbsp;&nbsp;</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>

View File

@ -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, :topic => @message} %>
<li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div>
</li>
<% end %>

View File

@ -1,28 +1,26 @@
<div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %>
<h3>
<%= link_to h(@board.name), course_board_path(@course, @board) %>
<%= l(:label_message_new) %>
</h3>
<div class="add_frame_header" >
<%= l(:label_message_new) %>
</div>
<%= 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>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
</p>
<% end %>
<div id="preview" class="wiki"></div>
<% end %>
</div>
<!--display the board-->
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_board_plural) %></h2>
</div>
<h2 class="project_h2 fl">
<% if User.current.language == "zh"%>
<%= h @board.name %>
<% else %>
<%= l(:project_module_boards) %>
<% end %>
</h2>
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
<div class="cl"></div>
</div>
<!-- 发布新帖部分 -->
<div class="cl"></div>
<div class=" talklist_box" >
<div class="talk_new ml15 mb10" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;" >
<ul>
<%= render :partial => 'course_new' %>
</ul>
</div><!--talknew end-->
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
@ -31,38 +29,160 @@
<hr/>
</div>
<% end %>
<div class="talk_top ml15">
<p class="fl">
<%= l(:label_totle) %>
<span><%= @topic_count %></span>
<%= l(:label_course_momes_count) %>
</p>
<%= link_to l(:label_message_new),
new_board_message_path(@board),
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
<div class="cl"></div>
</div>
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% 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" %>
<% if topic.sticky? %>
<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>
</div>
<%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %>
<%= link_to(
l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'talk_edit fr',
:style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div>
<script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}});
</script>
<div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content.html_safe %>
</div>
</div>
<p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</p>
<%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<ul>
<%= render :partial => 'edit',locals: {:topic => topic} %>
</ul>
</div>
<div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
<ul>
<% replies_all.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<%if replies_all.first %>
<div class="talkWrapMsg"><a class=" ml258" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div>
<% end %>
<% end %>
</div>
<% end %>
<% else %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<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%>

View File

@ -0,0 +1,43 @@
<% 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?, :topic => topic} %>
<a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');" class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></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?, :topic => topic} %>
<a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<% end %>
</ul>
</div>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -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>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span<%= topic.id%>" class="ml55"></p>
</li>
<% else %>
<li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" 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>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %>
<%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %>
<div class="cl"></div>
<p id="message_content_span<%= f.object.id%>" 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 => topic,:isReply => @isReply} %>
</div>
<% end %>
</li>
<li >
<div class="cl"></div>
</li>

View File

@ -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>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li>
<% else %>
<li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" 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>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %>
<%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %>
<div class="cl"></div>
<p id="message_content_span<%= f.object.id%>" 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 => topic,:isReply => @isReply} %>
</div>
<% end %>
</li>
<li >
<div class="cl"></div>
</li>

View File

@ -0,0 +1,10 @@
<%= 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, :topic => @message} %>
<li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div>
</li>
<% end %>

View File

@ -1,11 +1,14 @@
<div class="project_r_h">
<h2 class="project_h2">
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2 fl">
<% if User.current.language == "zh"%>
<%= h @board.name %>
<% else %>
<%= l(:project_module_boards) %>
<% end %>
</h2>
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
<div class="cl"></div>
</div>
<!--display the board-->
@ -16,34 +19,172 @@
</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) %>
<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>
<!-- 发布新帖部分 -->
<div class="cl"></div>
<div class=" talklist_box" >
<div class="talk_new ml15 mb10" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;">
<ul>
<%= render :partial => 'project_new_topic' %>
</ul>
</div><!--talknew end-->
<!-- 帖子内容显示 -->
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% 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" %>
&nbsp;<%= l(:label_post_by_time)%><%= format_time topic.created_on %>
<div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %>
<%= link_to(
l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'talk_edit fr',
:style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div>
<script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}});
</script>
<div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content %>
</div>
</div>
<p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</p>
<%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= 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" %>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<% end %>
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<ul>
<%= render :partial => 'edit',locals: {:topic => topic} %>
</ul>
</div>
<div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
<ul>
<% replies_all.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<%if replies_all.first %>
<div class="talkWrapMsg"><a class=" c_blue ml258" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div>
<% end %>
<% end %>
</div>
<% end %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
@ -61,3 +202,18 @@
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
<% end %>
</div>
<script type="text/javascript">
// var flag = false;
// jQuery(document).ready(function($) {
// transpotUrl('#content');
// });
function submit_message_replay()
{
if(flag)
{
$("#message_form").submit();
}
}
</script>

View File

@ -1,4 +1,66 @@
<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">//侧导航
window.onload = function () {
var topic_id = getParam('topic_id');
document.getElementById(topic_id).focus();
}
var getParam = function(name){
var search = document.location.search;
var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if(null != matcher){
try{
items = decodeURIComponent(decodeURIComponent(matcher[1]));
}catch(e){
try{
items = decodeURIComponent(matcher[1]);
}catch(e){
items = matcher[1];
}
}
}
return items;
};
function show_newtalk()
{
$("#about_newtalk").toggle();
}
function show_newtalk1(id)
{
$(id).toggle();
}
</script>
<% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %>
<% elsif @course %>

View File

@ -33,20 +33,21 @@
%>
</p>
<p style="margin-left:-10px;padding-right: 20px;">
<p>
<%= f.text_area :description,
:rows => 5,
:class => 'wiki-edit',
:style => "font-size:small;width:490px;margin-left:10px;",
:size => 60,
:rows => 4,
:style => "width:490px;",
:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT,
:placeholder => "#{l(:label_contest_description)}"
%>
</p>
<p style="margin-left:-10px;">
<p>
<%= f.text_field :password,
:size => 60,
:style => "width:488px;margin-left: 10px;"
:rows => 4,
:style => "width:490px;"
%>
</p>

View File

@ -187,7 +187,7 @@
<!-- modified by longjun -->
<%= link_to l(:label_create_new_projects),
new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain),
new_project_path(:course => 0, :project_type => 0, :host => Setting.host_name),
:target => '_blank'
%>
<!-- end longjun -->

View File

@ -56,16 +56,16 @@
</p>
<p class="stats">
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
<%= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
</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) %>

View File

@ -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>

View File

@ -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%>

View File

@ -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">取&nbsp;&nbsp;消</a>
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" onclick="KindEditor.instances[0].html('');">取&nbsp;&nbsp;消</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>

View File

@ -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>

View File

@ -23,6 +23,7 @@
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();" value="<%= @course.name%>">
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
<input type="password" style="top: -100000px;position: fixed;">
</li>
<div class="cl"></div>
<li class="ml45">

View File

@ -15,12 +15,13 @@
<span class="fl"> &nbsp;</span>
<span class="fl"> <%= l(:label_new_activity) %></span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) :
(e.event_type.eql?("bid") ? homework_course_path(@course) : e.event_url),:class => "problem_tit c_dblue fl fb"%>
(e.event_type.eql?("bid") ? homework_course_path(@course) : (e.event_type.eql?("message") || e.event_type.eql?("reply") ? course_boards_path(@course,:topic_id => e.id) : e.event_url)),:class => "problem_tit c_dblue fl fb"%>
<br />
<p class="mt5 break_word"><%= e.event_description.html_safe %>
<br />
<%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %>
</p>
<%= link_to_attachments_course(e) if e.is_a?(News) %>
</div>
<div class="cl"></div>
</div><!--课程动态 end-->
@ -49,4 +50,4 @@
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
<div class="cl"></div>

View File

@ -20,20 +20,12 @@
<div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %>
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% if manage_allowed && file.container_id == project.id && file.container_type == "Project" %>
<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" %> -->
<% if authority_pubilic_for_files(project, file) %>
<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>
<% end %>
<% else %>
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% end %>
<% else %>
<% end %>
</div>
<div class="cl"></div>

View File

@ -48,8 +48,8 @@
</table>
</div>
</div>
<% end %>
<div class="pagination">
<% end %>
<div class="pagination" style="margin-top: 10px;">
<%= pagination_links_full @forums_pages, @forums_count %>
</div>
<% else %>

View File

@ -1,5 +1,4 @@
<!-- added by fq -->
<!--display the board-->
<script>$(function(){$("img").removeAttr("alt");});</script>
<div class="borad-topic-count">共有 <%=link_to @forum.memos.count %> 个贴子</div>
<div style="padding-top: 10px">
<% if memos.any? %>

View File

@ -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();
}
@ -57,7 +59,7 @@
<strong style="float: left;">
文件:
</strong>
<div id="homework_attach_jour_attachment">
<div id="homework_attach_jour_attachment" style="padding-left: 40px;">
<%= render :partial => 'attachments/form' %>
</div>
<div class="cl"></div>

View File

@ -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>
&nbsp;&nbsp;
<% end %>

View File

@ -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? %>

View File

@ -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>

View File

@ -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">

View File

@ -1,3 +1,4 @@
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseStars(0);">零分</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>

View File

@ -42,7 +42,7 @@
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onclick="switchTab(1);this.blur();return false;" style="width: auto; padding:5px 10px 0;">
修改作
修改作
</li>
<li id="tb_2" class="normaltab" onclick="switchTab(2);this.blur();return false;">
成员
@ -75,16 +75,32 @@
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p>
<p>
<label style="float: left;">
<!--<div class="cl"></div>-->
<!--<p>-->
<!--<label style="float: left;">-->
<!--&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--</label>-->
<!--<div style="float: left;padding-bottom: 15px;">-->
<!--<%#= render :partial => 'attachments/form', :locals => {:container => @homework}%>-->
<!--</div>-->
<!--</p>-->
<!--<div class="cl"></div>-->
<div class="cl"></div>
<label style="float: left;padding-left: 15px;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<div style="float: left;padding-bottom: 15px;">
<%= render :partial => 'attachments/form', :locals => {:container => @homework}%>
<!--<div style="float: left;margin-left: 5px;">-->
<!--<%#= render :partial => 'attachments/form',locals: {:container => @homework}%>-->
<!--</div>-->
<div style="float: left;">
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</div>
</p>
<div class="cl"></div>
<p>
<p style="padding-top: 10px;">
<label>&nbsp;&nbsp;&nbsp;开发项目
<img src="/images/bid/pic_question.png" width="16" height="16"
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
@ -101,7 +117,7 @@
<span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<a href="javascript:" class="tijiao" onclick="submit_homework_form();">
<a href="javascript:void(0)" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %>
</a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a>

View File

@ -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");

View File

@ -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>
@ -31,5 +31,5 @@
</div>
<% end -%>
<ul class="wlist">
<%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => false, :flag => true %>
<%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %>
</ul>

View File

@ -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 %>

View File

@ -46,59 +46,52 @@
<!--属性-->
<div class="pro_info_box mb10">
<%= issue_fields_rows do |rows| %>
<ul class="fl">
<li><p class="label"><span class="c_red f12">*</span>&nbsp;状态&nbsp;&nbsp;:&nbsp;</p>
<p class="pro_info_p"><%= @issue.status.name %></p>
</li>
<div class="cl"></div>
<li><p class="label"><span class="c_red f12">*</span>&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.priority.name %></span>
</li>
<div class="cl"></div>
<ul class="fl" >
<li><p class="label03" >&nbsp;状态&nbsp;&nbsp;:&nbsp;</p><p class="pro_info_p"><%= @issue.status.name %></p>
</li>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
<li><p class="label">&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "-" %></span>
</li>
<li><p class="label03" >&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label">&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "-") %></span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl ml90">
<% unless @issue.disabled_core_fields.include?('start_date') %>
<li><p class="label02">&nbsp;开始日期&nbsp;&nbsp;:&nbsp;</p>
<p class="pro_info_p"><%= format_date(@issue.start_date) %></p></li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('due_date') %>
<li><p class="label02">&nbsp;计划完成日期&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= format_date(@issue.due_date) %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
<li><p class="label02">&nbsp;预期时间&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
</li>
<% end %>
<div class="cl"></div>
<div class="cl"></div>
</ul>
<ul class="fl" >
<li><p class="label03" >&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:50px;"><%= @issue.priority.name %></span>
</li>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
<li><p class="label02">&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p"><%= @issue.done_ratio %>%</span>
</li>
<li><p class="label03" >&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:50px;"><%= @issue.done_ratio %>%</span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl " >
<% unless @issue.disabled_core_fields.include?('start_date') %>
<li><p class="label03" style="width:50px;" >&nbsp;开始&nbsp;&nbsp;:&nbsp;</p><p class="pro_info_p"><%= format_date(@issue.start_date) %></p>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
<li><p class="label03" style="width:50px;">&nbsp;周期&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl " >
<% unless @issue.disabled_core_fields.include?('due_date') %>
<li><p class="label03" >&nbsp;计划完成&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %></span>
</li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label03" >&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
</li>
<% end %>
<div class="cl"></div>
</ul>
<% end %><!--pro_info_box end-->
<%#= render_custom_fields_rows(@issue) %>
<%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
</div>

View File

@ -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), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
@ -34,19 +34,19 @@
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div>
<% end %><!--meny end -->
<% 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" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContent" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>

View File

@ -1,189 +1,191 @@
<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) %>白&nbsp;&nbsp;&nbsp;羽</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 %>
<% if @public_forum %>
<%= 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 %>
<% end %>
</div>
<div class="msgserver">
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn"><span><%= l(:label_submit)%></span></div>
</div>
</body>

View File

@ -12,7 +12,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), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
@ -23,7 +23,7 @@
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>

View File

@ -27,13 +27,13 @@
<% end %>
<%= render :partial => 'layouts/user_project_list', :locals => {:hasCourse => hasCourse} %>
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
</ul>
</li>
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')',
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain },
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user },
{:class => 'my-message'} if User.current.logged?%>
</li>
</ul>

View File

@ -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), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
@ -34,7 +34,7 @@
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>

View File

@ -67,17 +67,17 @@ end
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user }, {:class => 'my-message'} if User.current.logged? -%>
</li>
<li>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.host_course} %>
</li>
<li>
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
</li>
<li class="divider"></li>
<li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
</ul>
</li>

View File

@ -18,15 +18,15 @@
<% if User.current.logged? -%>
<li id="current_user_li">
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.user_domain}, :class => "uses_name"%>
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, :class => "uses_name"%>
<ul id="user_sub_menu" style="right: 0px;display: none;">
<% unless User.current.projects.empty? %>
<li id="my_projects_li">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain}, :class => "parent" %>
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name}, :class => "parent" %>
<ul id="my_projects_ul">
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %>
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
</li>
<% end %>
</ul>
@ -49,7 +49,7 @@
<% end %>
<% end %>
<li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
</ul>
</li>

View File

@ -3,7 +3,6 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>升级浏览器</title>
<script src="jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<style type="text/css">
body{ font-size:12px; font-family:"微软雅黑","宋体"; background: #F2F2F2; font-style:normal;}
.update{ border-bottom:1px solid #d7d7d7; color:#fea254; text-align:center; width:100%; font-size:10px; height:30px; background:#fdffd9; padding:2px 0;z-index:1000;}

View File

@ -1,10 +1,10 @@
<% if User.current.projects.count>0 %>
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
<ul class="project_sub_menu" style="top:<%= hasCourse ? 35 : 0 %>px;">
<% User.current.projects.each do |project| %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %>
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
</li>
<% end %>
</ul>

View File

@ -52,7 +52,7 @@
<a href="javascript:void(0)" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
<%= l(:label_search)%>
</a>
<br />
<div class="cl"></div>
<span id="project_name_span" style="float: left"></span>
<% end %>
</div>
@ -133,7 +133,7 @@
<div class="subNav">
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.boards.first ? @course.boards.first.topics.count : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
<%= link_to( "+#{l(:label_message_new)}", new_board_message_path(@course.boards.first), :class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) && @course.boards.first %>
<%= link_to( "+#{l(:label_message_new)}",course_boards_path(@course, :flag => true),:class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) && @course.boards.first %>
</div>
<div class="subNav">
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>

View File

@ -157,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" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit"><%= 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>

View File

@ -68,7 +68,7 @@
</tr>
<tr>
<td>
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:field_homepage), home_path %> >
<span>
<%=link_to @user.name, user_path %>
</span>
@ -122,7 +122,7 @@
<strong class="font_small_watch">
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%>
</strong> &nbsp;
<strong class="font_small_watch">
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %>
</strong>&nbsp;&nbsp;
@ -190,16 +190,16 @@
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
<tr>
<% unless @user.user_extensions.school.nil? %>
<td style=" float: right" width="70px">
<span style="float: right"><%= l(:field_occupation) %></span>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<% unless @user.user_extensions.school.nil? %>
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
<% end %>
</td>
<% end %>
</tr>
<% elsif @user.user_extensions.identity == 3 %>
<% elsif @user.user_extensions.identity == 3 && @user.user_extensions.occupation.empty? %>
<tr>
<td style=" float: right" width="70px">
<span style="float: right"> <%= l(:field_occupation) %></span>

View File

@ -2,15 +2,15 @@
<div class="actions" style="max-width:680px;">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
<p><%= f.text_field :subject, :required => true, :size => 95, :style => 'width:98%' %></p>
<p style="max-width:680px"><%= f.kindeditor :content,:width=>'99%', :required => true %></p>
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
<br/>
<div class="cl"></div>
<p style="margin-right: 10px;" class="fl">
<%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<label class="fl" style="margin-left: -80px;margin-top: 10px;"><%= l(:label_attachment_plural) %></label>
<div style="margin-left: 110px;margin-top: 10px;margin-bottom: 10px;" class="fl">
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</div>
<%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %>
</div>
<% end %>

View File

@ -5,22 +5,22 @@
<% @nav_dispaly_forum_label = 1%>
<!-- <h1>New memo</h1> -->
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td>
</tr>
</table>
</div>
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td>
</tr>
</table>
</div>
<h3><%=l(:label_memo_new)%></h3>
<div class="box tabular">
<div style="width:780px">

View File

@ -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 %>

View File

@ -1,16 +1,17 @@
<%= 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>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<div style="display:<%= replying ? 'none' : 'block'%>;" class="fl"><label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</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) %>
<p id="subject_span" class="ml55"></p>
<% end %>
<p id="subject_span" class="ml55"></p>
<div class="cl"></div>
</li>
<li class="ml60 mb5">
<% unless replying %>
@ -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>&nbsp;
<%= l(:field_description) %>&nbsp;&nbsp;

View File

@ -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 %>

View File

@ -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'},
@ -23,7 +23,7 @@
<% elsif @message.course %>
<%#= course_board_breadcrumb(@message) %>
<div class="talk_new ml15">
<ul>
<ul>0
<%= form_for @message, {
:as => :message,
:url => {:action => 'edit'},

View File

@ -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");

View File

@ -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/>

View File

@ -25,11 +25,11 @@
</li>
<li class="ml40" >
<% if is_new %>
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %>
<%= link_to l(:button_save), "#", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %>
<div class="cl"></div>
</li>

View File

@ -44,6 +44,7 @@
<span class="g-arr-down"></span>
</div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
</div>
<div class="cl"></div>
</div><!--problem_main end-->

View File

@ -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();">

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