Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-10-29 10:58:12 +08:00
commit 27ad952c50
76 changed files with 3039 additions and 2431 deletions

View File

@ -8,6 +8,7 @@ class CoursesController < ApplicationController
menu_item :overview menu_item :overview
menu_item :feedback, :only => :feedback menu_item :feedback, :only => :feedback
menu_item :homework, :only => :homework menu_item :homework, :only => :homework
menu_item :new_homework
menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_time), :only => :index
menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_active), :only => :index

View File

@ -44,7 +44,7 @@ class DocumentsController < ApplicationController
@grouped = documents.group_by {|d| d.title.first.upcase} @grouped = documents.group_by {|d| d.title.first.upcase}
when 'author' when 'author'
# @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author} # @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author}
@grouped = documents.group_by {|d| d.user.name } @grouped = documents.group_by(&:user)
else else
@grouped = documents.group_by(&:category) @grouped = documents.group_by(&:category)
end end

View File

@ -16,7 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class FilesController < ApplicationController class FilesController < ApplicationController
layout 'base_projects'#by young if @project
layout 'base_projects' #by young
else
layout 'base_courses'
end
menu_item :files menu_item :files
before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :find_project_by_project_id#, :except => [:getattachtype]
@ -122,6 +126,7 @@ class FilesController < ApplicationController
end end
end end
end end
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
show_attachments @containers show_attachments @containers
@ -261,20 +266,63 @@ class FilesController < ApplicationController
'filename' => "#{Attachment.table_name}.filename", 'filename' => "#{Attachment.table_name}.filename",
'size' => "#{Attachment.table_name}.filesize", 'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads" 'downloads' => "#{Attachment.table_name}.downloads"
sort=''
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")
case order_by[0]
when "filename"
attribute = "filename"
when "size"
attribute = "filesize"
when "attach_type"
attribute = "attachtype"
when "content_type"
attribute = "created_on"
when "field_file_dense"
attribute = "is_public"
when "downloads"
attribute = "downloads"
when "created_on"
attribute = "created_on"
end
if order_by.count == 1
sort += "#{Attachment.table_name}.#{attribute} asc "
elsif order_by.count == 2
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
end
if sort_type != params[:sort].split(",").last
sort += ","
end
end
end
if @project if @project
@isproject = true
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort @containers += @project.versions.includes(:attachments).reorder(sort).all
elsif @course
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
end
show_attachments @containers
#render :layout => 'base_projects'
elsif @course
@isproject = false
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
# show_attachments @containers
# @attachtype = params[:type].to_i
# @contenttype = params[:contentType].to_s
end
show_attachments @containers
@attachtype = params[:type].to_i @attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s @contenttype = params[:contentType].to_s
respond_to do |format| respond_to do |format|
format.js format.js
format.html
end end
end end
end end

View File

@ -1,282 +1,282 @@
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
#+ #+
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MyController < ApplicationController class MyController < ApplicationController
layout "users_base" layout "users_base"
before_filter :require_login before_filter :require_login
helper :issues helper :issues
helper :users helper :users
helper :custom_fields helper :custom_fields
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues, BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
'issuesreportedbyme' => :label_reported_issues, 'issuesreportedbyme' => :label_reported_issues,
'issueswatched' => :label_watched_issues, 'issueswatched' => :label_watched_issues,
'news' => :label_news_latest, 'news' => :label_news_latest,
'calendar' => :label_calendar, 'calendar' => :label_calendar,
'documents' => :label_document_plural, 'documents' => :label_document_plural,
'timelog' => :label_spent_time 'timelog' => :label_spent_time
}.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze
DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'], DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'],
'right' => ['issuesreportedbyme'] 'right' => ['issuesreportedbyme']
}.freeze }.freeze
def index def index
page page
render :action => 'page' render :action => 'page'
end end
# Show user's page # Show user's page
def page def page
@user = User.current @user = User.current
@Issues= Issue.visible.open. @Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@limit = 10 @limit = 10
@feedback_count = @Issues.count @feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset @offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit] @curse_attachments = @Issues[@offset, @limit]
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
end end
def page2 def page2
@limit = 10 @limit = 10
@user = User.current @user = User.current
@Issues= Issue.visible.open. @Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@feedback_count = @Issues.count @feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset @offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit] @curse_attachments = @Issues[@offset, @limit]
@state = false @state = false
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
respond_to do |format| respond_to do |format|
format.js format.js
end end
end end
# Edit user's account # Edit user's account
def account def account
@user = User.current @user = User.current
lg=@user.login lg=@user.login
@pref = @user.pref @pref = @user.pref
diskfile = disk_filename('User', @user.id) diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp' diskfile1 = diskfile + 'temp'
if request.post? if request.post?
@user.safe_attributes = params[:user] @user.safe_attributes = params[:user]
@user.pref.attributes = params[:pref] @user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1') @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
@user.login = params[:login] @user.login = params[:login]
unless @user.user_extensions.nil? unless @user.user_extensions.nil?
if @user.user_extensions.identity == 2 if @user.user_extensions.identity == 2
@user.firstname = params[:enterprise_name] @user.firstname = params[:enterprise_name]
end end
end end
@se = @user.extensions @se = @user.extensions
@se.school_id = params[:occupation] if params[:occupation] @se.school_id = params[:occupation] if params[:occupation]
@se.gender = params[:gender] @se.gender = params[:gender]
@se.location = params[:province] if params[:province] @se.location = params[:province] if params[:province]
@se.location_city = params[:city] if params[:city] @se.location_city = params[:city] if params[:city]
@se.identity = params[:identity].to_i if params[:identity] @se.identity = params[:identity].to_i if params[:identity]
@se.technical_title = params[:technical_title] if params[:technical_title] @se.technical_title = params[:technical_title] if params[:technical_title]
@se.student_id = params[:no] if params[:no] @se.student_id = params[:no] if params[:no]
if @user.save && @se.save if @user.save && @se.save
# 头像保存 # 头像保存
if File.exist?(diskfile1) if File.exist?(diskfile1)
if File.exist?(diskfile) if File.exist?(diskfile)
File.delete(diskfile) File.delete(diskfile)
end end
File.open(diskfile1, "rb") do |f| File.open(diskfile1, "rb") do |f|
buffer = f.read(10) buffer = f.read(10)
if buffer != "DELETE" if buffer != "DELETE"
File.open(diskfile1, "rb") do |f1| File.open(diskfile1, "rb") do |f1|
File.open(diskfile, "wb") do |f| File.open(diskfile, "wb") do |f|
buffer = "" buffer = ""
while (buffer = f1.read(8192)) while (buffer = f1.read(8192))
f.write(buffer) f.write(buffer)
end end
end end
end end
# File.rename(diskfile + 'temp',diskfile); # File.rename(diskfile + 'temp',diskfile);
end end
end end
end end
# 确保文件被删除 # 确保文件被删除
if File.exist?(diskfile1) if File.exist?(diskfile1)
File.delete(diskfile1) File.delete(diskfile1)
end end
@user.pref.save @user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language set_language_if_valid @user.language
flash[:notice] = l(:notice_account_updated) flash[:notice] = l(:notice_account_updated)
redirect_to user_url(@user) redirect_to user_url(@user)
return return
else else
# 确保文件被删除 # 确保文件被删除
if File.exist?(diskfile1) if File.exist?(diskfile1)
File.delete(diskfile1) File.delete(diskfile1)
end end
@user.login = lg @user.login = lg
end end
else else
# 确保文件被删除 # 确保文件被删除
if File.exist?(diskfile1) if File.exist?(diskfile1)
File.delete(diskfile1) File.delete(diskfile1)
end end
end end
end end
# Destroys user's account # Destroys user's account
def destroy def destroy
@user = User.current @user = User.current
unless @user.own_account_deletable? unless @user.own_account_deletable?
redirect_to my_account_url redirect_to my_account_url
return return
end end
if request.post? && params[:confirm] if request.post? && params[:confirm]
@user.destroy @user.destroy
if @user.destroyed? if @user.destroyed?
logout_user logout_user
flash.now[:notice] = l(:notice_account_deleted) flash.now[:notice] = l(:notice_account_deleted)
end end
redirect_to home_url redirect_to home_url
end end
end end
# Manage user's password # Manage user's password
def password def password
@user = User.current @user = User.current
unless @user.change_password_allowed? unless @user.change_password_allowed?
flash.now[:error] = l(:notice_can_t_change_password) flash.now[:error] = l(:notice_can_t_change_password)
redirect_to my_account_url redirect_to my_account_url
return return
end end
if request.post? if request.post?
if @user.check_password?(params[:password]) if @user.check_password?(params[:password])
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if @user.save if @user.save
flash.now[:notice] = l(:notice_account_password_updated) flash.now[:notice] = l(:notice_account_password_updated)
redirect_to my_account_url redirect_to my_account_url
end end
else else
flash.now[:error] = l(:notice_account_wrong_password) flash.now[:error] = l(:notice_account_wrong_password)
end end
end end
end end
# Create a new feeds key # Create a new feeds key
def reset_rss_key def reset_rss_key
if request.post? if request.post?
if User.current.rss_token if User.current.rss_token
User.current.rss_token.destroy User.current.rss_token.destroy
User.current.reload User.current.reload
end end
User.current.rss_key User.current.rss_key
flash[:notice] = l(:notice_feeds_access_key_reseted) flash[:notice] = l(:notice_feeds_access_key_reseted)
end end
redirect_to my_account_url redirect_to my_account_url
end end
# Create a new API key # Create a new API key
def reset_api_key def reset_api_key
if request.post? if request.post?
if User.current.api_token if User.current.api_token
User.current.api_token.destroy User.current.api_token.destroy
User.current.reload User.current.reload
end end
User.current.api_key User.current.api_key
flash[:notice] = l(:notice_api_access_key_reseted) flash[:notice] = l(:notice_api_access_key_reseted)
end end
redirect_to my_account_url redirect_to my_account_url
end end
# User's page layout configuration # User's page layout configuration
def page_layout def page_layout
@user = User.current @user = User.current
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT.dup @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT.dup
@block_options = [] @block_options = []
BLOCKS.each do |k, v| BLOCKS.each do |k, v|
unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)} unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)}
@block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize] @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]
end end
end end
end end
# Add a block to user's page # Add a block to user's page
# The block is added on top of the page # The block is added on top of the page
# params[:block] : id of the block to add # params[:block] : id of the block to add
def add_block def add_block
block = params[:block].to_s.underscore block = params[:block].to_s.underscore
if block.present? && BLOCKS.key?(block) if block.present? && BLOCKS.key?(block)
@user = User.current @user = User.current
layout = @user.pref[:my_page_layout] || {} layout = @user.pref[:my_page_layout] || {}
# remove if already present in a group # remove if already present in a group
%w(top left right).each {|f| (layout[f] ||= []).delete block } %w(top left right).each {|f| (layout[f] ||= []).delete block }
# add it on top # add it on top
layout['top'].unshift block layout['top'].unshift block
@user.pref[:my_page_layout] = layout @user.pref[:my_page_layout] = layout
@user.pref.save @user.pref.save
end end
redirect_to my_page_layout_url redirect_to my_page_layout_url
end end
# Remove a block to user's page # Remove a block to user's page
# params[:block] : id of the block to remove # params[:block] : id of the block to remove
def remove_block def remove_block
block = params[:block].to_s.underscore block = params[:block].to_s.underscore
@user = User.current @user = User.current
# remove block in all groups # remove block in all groups
layout = @user.pref[:my_page_layout] || {} layout = @user.pref[:my_page_layout] || {}
%w(top left right).each {|f| (layout[f] ||= []).delete block } %w(top left right).each {|f| (layout[f] ||= []).delete block }
@user.pref[:my_page_layout] = layout @user.pref[:my_page_layout] = layout
@user.pref.save @user.pref.save
redirect_to my_page_layout_url redirect_to my_page_layout_url
end end
# Change blocks order on user's page # Change blocks order on user's page
# params[:group] : group to order (top, left or right) # params[:group] : group to order (top, left or right)
# params[:list-(top|left|right)] : array of block ids of the group # params[:list-(top|left|right)] : array of block ids of the group
def order_blocks def order_blocks
group = params[:group] group = params[:group]
@user = User.current @user = User.current
if group.is_a?(String) if group.is_a?(String)
group_items = (params["blocks"] || []).collect(&:underscore) group_items = (params["blocks"] || []).collect(&:underscore)
group_items.each {|s| s.sub!(/^block_/, '')} group_items.each {|s| s.sub!(/^block_/, '')}
if group_items and group_items.is_a? Array if group_items and group_items.is_a? Array
layout = @user.pref[:my_page_layout] || {} layout = @user.pref[:my_page_layout] || {}
# remove group blocks if they are presents in other groups # remove group blocks if they are presents in other groups
%w(top left right).each {|f| %w(top left right).each {|f|
layout[f] = (layout[f] || []) - group_items layout[f] = (layout[f] || []) - group_items
} }
layout[group] = group_items layout[group] = group_items
@user.pref[:my_page_layout] = layout @user.pref[:my_page_layout] = layout
@user.pref.save @user.pref.save
end end
end end
render :nothing => true render :nothing => true
end end
end end

View File

@ -56,12 +56,12 @@ class SoftapplicationsController < ApplicationController
stars_status = stars_reates.select("stars, count(*) as scount"). stars_status = stars_reates.select("stars, count(*) as scount").
group("stars") group("stars")
@stars_status_map = Hash.new(0.0) @stars_status_map = Hash.new(0)
stars_status.each do |star_status| stars_status.each do |star_status|
percent = percent_of(star_status.scount, stars_reates_count).to_f percent = percent_of(star_status.scount, stars_reates_count).to_f
percent_m = format("%.2f", percent) people = star_status.scount.to_i
@stars_status_map["star#{star_status.stars.to_i}".to_sym] = @stars_status_map["star#{star_status.stars.to_i}".to_sym] =
percent_m.to_s + "%" people.to_s
end end
@jours = @softapplication.journals_for_messages.order('created_on DESC') @jours = @softapplication.journals_for_messages.order('created_on DESC')
@image_results = [] @image_results = []

View File

@ -38,24 +38,41 @@ class TagsController < ApplicationController
@obj_id = params[:obj_id] @obj_id = params[:obj_id]
@obj_flag = params[:object_flag] @obj_flag = params[:object_flag]
@selected_tags = Array.new @selected_tags = Array.new
@selected_tag_ids = Array.new
@selected_tag_objs = Array.new
@related_tags = nil @related_tags = nil
@related_tag_ids = Array.new
if params[:q] @related_tag_objs = Array.new
@selected_tags << params[:q] if params[:q]
@tag = ActsAsTaggableOn::Tag.find(params[:q])
@selected_tags << @tag.name
@selected_tag_ids << @tag.id.to_s
@selected_tag_objs << @tag
else else
@do_what = params[:do_what] @do_what = params[:do_what]
@tag = params[:tag] @tag = ActsAsTaggableOn::Tag.find(params[:tag])
@selected_tags = params[:current_selected_tags] #@selected_tags = params[:current_selected_tags]
@selected_tags = @selected_tags.nil? ? Array.new : @selected_tags @selected_tag_ids = params[:current_selected_tags]
@selected_tag_ids = @selected_tag_ids.nil? ? Array.new : @selected_tag_ids
@selected_tag_ids.each do |t|
ta = ActsAsTaggableOn::Tag.find(t)
@selected_tags << ta.name
@selected_tag_objs << ta
end
#@selected_tags = @selected_tags.nil? ? Array.new : @selected_tags
case @do_what case @do_what
when '0' then when '0' then
@selected_tags.delete @tag #数组中删除有多方式 可以改用shift,pop @selected_tags.delete @tag.name #数组中删除有多方式 可以改用shift,pop
@selected_tag_ids.delete @tag.id.to_s
@selected_tag_objs.delete @tag
when '1' then when '1' then
# 判断是否已存在该tag 主要用来处理分页的情况 # 判断是否已存在该tag 主要用来处理分页的情况
unless @selected_tags.include? @tag unless @selected_tags.include? @tag.name
@selected_tags << @tag @selected_tags << @tag.name
@selected_tag_ids << @tag.id.to_s
@selected_tag_objs << @tag
end end
end end
end end
@ -75,7 +92,7 @@ class TagsController < ApplicationController
@attachments_results, @attachments_results,
@contests_results, @contests_results,
@courses_results, @courses_results,
@open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags) @open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags,@selected_tag_ids)
# 这里是做tag推荐用的 用来生产推荐的tags # 这里是做tag推荐用的 用来生产推荐的tags
unless @obj.nil? unless @obj.nil?
@ -85,6 +102,13 @@ class TagsController < ApplicationController
# @tags.delete(i) # @tags.delete(i)
# end # end
@related_tags = @tags @related_tags = @tags
@tag_objs = @obj.tags
@tag_objs.each do |t|
unless @selected_tags.include?(t.name)
@related_tag_ids << t.id.to_s
@related_tag_objs << t
end
end
else else
return return
end end
@ -162,8 +186,8 @@ class TagsController < ApplicationController
if request.get? if request.get?
# 获取传过来的tag_id taggable_id 和 taggable_type,通过2者确定要删除tag的对象 # 获取传过来的tag_id taggable_id 和 taggable_type,通过2者确定要删除tag的对象
@tag_name = params[:tag_name] @tag_id = params[:tag_name]
@tag_id = (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).id @tag_name = (ActsAsTaggableOn::Tag.find(@tag_id)).name
@taggable_id = params[:taggable_id] # 当做参数传时对象会变成字符串 @taggable_id = params[:taggable_id] # 当做参数传时对象会变成字符串
@taggable_type = numbers_to_object_type(params[:taggable_type]) @taggable_type = numbers_to_object_type(params[:taggable_type])
@ -192,7 +216,7 @@ class TagsController < ApplicationController
private private
# 这里用来刷新搜索结果的区域 # 这里用来刷新搜索结果的区域
# 函数的返回值 前2字段用来处理获取其他tag和分页 另外4个返回值为过滤结果 # 函数的返回值 前2字段用来处理获取其他tag和分页 另外4个返回值为过滤结果
def refresh_results(obj_id,obj_flag,selected_tags) def refresh_results(obj_id,obj_flag,selected_tags,selected_tag_ids = nil)
@users_results = nil @users_results = nil
@projects_results = nil @projects_results = nil
@issues_results = nil @issues_results = nil
@ -210,36 +234,36 @@ class TagsController < ApplicationController
case obj_flag case obj_flag
when '1' then when '1' then
@obj = User.find_by_id(obj_id) @obj = User.find_by_id(obj_id)
@obj_pages,@users_results,@results_count = for_pagination(get_users_by_tag(selected_tags)) @obj_pages,@users_results,@results_count = for_pagination(get_users_by_tag(selected_tags,selected_tag_ids))
when '2' then when '2' then
@obj = Project.find_by_id(obj_id) @obj = Project.find_by_id(obj_id)
@obj_pages,@projects_results,@results_count = for_pagination(get_projects_by_tag(selected_tags)) @obj_pages,@projects_results,@results_count = for_pagination(get_projects_by_tag(selected_tags,selected_tag_ids))
when '3' then when '3' then
@obj = Issue.find_by_id(obj_id) @obj = Issue.find_by_id(obj_id)
@obj_pages,@issues_results,@results_count = for_pagination(get_issues_by_tag(selected_tags)) @obj_pages,@issues_results,@results_count = for_pagination(get_issues_by_tag(selected_tags,selected_tag_ids))
when '4' then when '4' then
@obj_pages,@bids_results,@results_count = for_pagination(get_bids_by_tag(selected_tags)) @obj_pages,@bids_results,@results_count = for_pagination(get_bids_by_tag(selected_tags,selected_tag_ids))
@obj = Bid.find_by_id(obj_id) @obj = Bid.find_by_id(obj_id)
when '5' when '5'
@obj = Forum.find_by_id(obj_id) @obj = Forum.find_by_id(obj_id)
@obj_pages,@forums_results,@results_count = for_pagination(get_forums_by_tag(selected_tags)) @obj_pages,@forums_results,@results_count = for_pagination(get_forums_by_tag(selected_tags,selected_tag_ids))
when '6' when '6'
@obj = Attachment.find_by_id(obj_id) @obj = Attachment.find_by_id(obj_id)
# modifed by Long Jun # modifed by Long Jun
# this is used to find the attachments that came from the same project and tagged with the same tag. # this is used to find the attachments that came from the same project and tagged with the same tag.
#@result = get_attachments_by_project_tag(selected_tags, @obj) #@result = get_attachments_by_project_tag(selected_tags, @obj)
@result = get_attachments_by_tag(selected_tags) @result = get_attachments_by_tag(selected_tags,selected_tag_ids)
@obj_pages, @attachments_results, @results_count = for_pagination(@result) @obj_pages, @attachments_results, @results_count = for_pagination(@result)
when '7' when '7'
@obj = Contest.find_by_id(obj_id) @obj = Contest.find_by_id(obj_id)
@obj_pages,@contests_results,@results_count = for_pagination(get_contests_by_tag(selected_tags)) @obj_pages,@contests_results,@results_count = for_pagination(get_contests_by_tag(selected_tags,selected_tag_ids))
when '8' when '8'
@obj = OpenSourceProject.find_by_id(obj_id) @obj = OpenSourceProject.find_by_id(obj_id)
@obj_pages, @open_source_projects_results, @results_count = for_pagination(get_open_source_projects_by_tag(selected_tags)) @obj_pages, @open_source_projects_results, @results_count = for_pagination(get_open_source_projects_by_tag(selected_tags,selected_tag_ids))
when '9' then when '9' then
@obj = Course.find_by_id(obj_id) @obj = Course.find_by_id(obj_id)
@obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags)) @obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags,selected_tag_ids))
else else
@obj = nil @obj = nil
end end

View File

@ -236,11 +236,10 @@ class WordsController < ApplicationController
#modify by nwb #modify by nwb
#添加对课程留言的支持 #添加对课程留言的支持
referer = request.headers["Referer"] referer = request.headers["Referer"]
#referer = "http://forge.trustie.net/words/create_reply"
obj_id = referer.match(%r(/([0-9]{1,})(/|\?|$)))[1] obj_id = referer.match(%r(/([0-9]{1,})(/|\?|$)))[1]
if referer.match(/project/) if referer.match(/project/)
obj = Project.find_by_id(obj_id) obj = Project.find_by_id(obj_id)
elsif referer.match(/course/)
obj = Course.find_by_id(obj_id)
elsif referer.match(/user/) elsif referer.match(/user/)
obj = User.find_by_id(obj_id) obj = User.find_by_id(obj_id)
elsif ( referer.match(/bids/) || referer.match(/calls/) ) elsif ( referer.match(/bids/) || referer.match(/calls/) )
@ -251,6 +250,8 @@ class WordsController < ApplicationController
obj = Softapplication.find_by_id(obj_id) obj = Softapplication.find_by_id(obj_id)
elsif ( referer.match(/homework_attach/) || referer.match(/homework_attach/) ) #new added elsif ( referer.match(/homework_attach/) || referer.match(/homework_attach/) ) #new added
obj = HomeworkAttach.find_by_id(obj_id) obj = HomeworkAttach.find_by_id(obj_id)
elsif referer.match(/course/)
obj = Course.find_by_id(obj_id)
else else
raise "create reply obj unknow type.#{referer}" raise "create reply obj unknow type.#{referer}"
end end

View File

@ -110,7 +110,7 @@ class ZipdownController < ApplicationController
#length = attach.storage_path.length #length = attach.storage_path.length
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end end
zipping("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) zipping("#{user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
#user_attaches_paths #user_attaches_paths
#end #end
end end

View File

@ -460,6 +460,7 @@ module ApplicationHelper
project_tree(projects) do |project, level| project_tree(projects) do |project, level|
name_prefix = (level > 0 ? '&nbsp;' * 2 * level + '&#187; ' : '').html_safe name_prefix = (level > 0 ? '&nbsp;' * 2 * level + '&#187; ' : '').html_safe
tag_options = {:value => project.id} tag_options = {:value => project.id}
tag_options[:title] = project.name
if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project)) if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project))
tag_options[:selected] = 'selected' tag_options[:selected] = 'selected'
else else

View File

@ -75,8 +75,8 @@ module AttachmentsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_attachments_by_tag(tag_name) def get_attachments_by_tag(tag_name,selected_tag_ids = nil)
Attachment.tagged_with(tag_name).order('created_on desc') Attachment.tagged_with(tag_name,{},selected_tag_ids).order('created_on desc')
end end
# this method is used to get all attachments that from one project and tagged one tag # this method is used to get all attachments that from one project and tagged one tag

View File

@ -35,8 +35,8 @@ module BidsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_bids_by_tag(tag_name) def get_bids_by_tag(tag_name,selected_tag_ids = nil)
Bid.tagged_with(tag_name).order('updated_on desc') Bid.tagged_with(tag_name,{},selected_tag_ids).order('updated_on desc')
end end
#added by huang #added by huang

View File

@ -35,8 +35,8 @@ module ContestsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_contests_by_tag(tag_name) def get_contests_by_tag(tag_name,selected_tag_ids = nil)
Contest.tagged_with(tag_name).order('updated_on desc') Contest.tagged_with(tag_name,{},selected_tag_ids).order('updated_on desc')
end end
#added by huang #added by huang

View File

@ -219,7 +219,7 @@ module CoursesHelper
def render_course_hierarchy(courses) def render_course_hierarchy(courses)
render_course_nested_lists(courses) do |course| render_course_nested_lists(courses) do |course|
s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of?(course) ? 'my-course' : nil}").html_safe s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of_course?(course) ? 'my-course' : nil}").html_safe
s s
end end
end end
@ -449,8 +449,8 @@ module CoursesHelper
return homework_users return homework_users
end end
def get_courses_by_tag(tag_name) def get_courses_by_tag(tag_name,selected_tag_ids = nil)
Course.tagged_with(tag_name).order('updated_at desc') Course.tagged_with(tag_name,{},selected_tag_ids).order('updated_at desc')
end end
#课程实践年份下拉框 #课程实践年份下拉框

View File

@ -22,7 +22,7 @@ module ForumsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_forums_by_tag(tag_name) def get_forums_by_tag(tag_name,selected_tag_ids = nil)
Forum.tagged_with(tag_name).order('updated_at desc') Forum.tagged_with(tag_name,{},selected_tag_ids).order('updated_at desc')
end end
end end

View File

@ -382,8 +382,8 @@ module IssuesHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_issues_by_tag(tag_name) def get_issues_by_tag(tag_name,selected_tag_ids = nil)
Issue.tagged_with(tag_name).order('updated_on desc') Issue.tagged_with(tag_name,{},selected_tag_ids).order('updated_on desc')
end end
end end

View File

@ -31,8 +31,8 @@ module OpenSourceProjectsHelper
s = content_tag('div', s, :class => 'user_tags') s = content_tag('div', s, :class => 'user_tags')
end end
def get_open_source_projects_by_tag(tag_name) def get_open_source_projects_by_tag(tag_name,selected_tag_ids = nil)
OpenSourceProject.tagged_with(tag_name).order('created_at desc') OpenSourceProject.tagged_with(tag_name,{},selected_tag_ids).order('created_at desc')
end end
def show_origin(url) def show_origin(url)

View File

@ -232,8 +232,8 @@ module ProjectsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_projects_by_tag(tag_name) def get_projects_by_tag(tag_name,selected_tag_ids = nil)
Project.tagged_with(tag_name).order('updated_on desc') Project.tagged_with(tag_name,{},selected_tag_ids).order('updated_on desc')
end end
# added by fq # added by fq

View File

@ -57,8 +57,8 @@ module UsersHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_users_by_tag(tag_name) def get_users_by_tag(tag_name,selected_tag_ids = nil)
User.tagged_with(tag_name).order('updated_on desc') User.tagged_with(tag_name,{},selected_tag_ids).order('updated_on desc')
end end
# added by fq # added by fq

View File

@ -137,6 +137,11 @@ class IssueQuery < Query
:type => :list_optional, :values => role_values :type => :list_optional, :values => role_values
) unless role_values.empty? ) unless role_values.empty?
#done_values = [10,20,30,40,50,60,70,80,90,100]
#add_available_filter("done_ratio_111",
# :type => :list_optional, :values => done_values
#)
if versions.any? if versions.any?
add_available_filter "fixed_version_id", add_available_filter "fixed_version_id",
:type => :list_optional, :type => :list_optional,

View File

@ -26,7 +26,11 @@
<%= back_url_hidden_field_tag %> <%= back_url_hidden_field_tag %>
<table> <table>
<tr> <tr>
<td align="right"><label for="username"><%=l(:lable_user_name)%>:</label></td> <td align="right">
<label for="username">
<%=l(:lable_user_name)%>:
</label>
</td>
<td align="left"> <td align="left">
<%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}", <%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}",
:onfocus => "clearInfo('username','#{l(:label_login_prompt)}')", :onfocus => "clearInfo('username','#{l(:label_login_prompt)}')",
@ -35,33 +39,48 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td> <td align="right">
<td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td> <label for="password">
<%=l(:field_password)%>:
</label>
</td>
<td align="left">
<%= password_field_tag 'password', nil, :tabindex => '2' %>
</td>
</tr> </tr>
<% if Setting.openid? %> <% if Setting.openid? %>
<tr> <tr>
<td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td> <td align="right">
<td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td> <label for="openid_url">
<%=l(:field_identity_url)%>
</label>
</td>
<td align="left">
<%= text_field_tag "openid_url", nil, :tabindex => '3' %>
</td>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<td></td> <td></td>
<td align="left"> <td align="left">
<% if Setting.autologin? %> <% if Setting.autologin? %>
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label> <label for="autologin">
<%= check_box_tag 'autologin', 1, false, :tabindex => 4 %>
<%= l(:label_stay_logged_in) %>
</label>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" > <td colspan="2" >
<span style="float: left"><% if Setting.lost_password? %> <span style="float: left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %> <%= link_to l(:label_password_lost), lost_password_path %>
<% end %></span> <% end %></span>
<span style="float: right"> <span style="float: right">
<input type="submit" class="small" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/></span> <input type="submit" class="small" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/></span>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -1,101 +1,101 @@
<h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3>
<p class="subtitle"> <p class="subtitle">
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
</p> </p>
<div id="activity"> <div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %> <% @events_by_day.keys.sort.reverse.each do |day| %>
<h3></h3> <h3></h3>
<div> <div>
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%> <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
<div class="issue-note"> <div class="issue-note">
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>
<td colspan="2" valign="top" width="50" > <td colspan="2" valign="top" width="50" >
<!--img src="/images/new/user.jpg" width="40" height="40"/--> <!--img src="/images/new/user.jpg" width="40" height="40"/-->
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
</td> </td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong> <strong>
<%= h(e.project) if @project.nil? || @project != e.project %> <%= h(e.project) if @project.nil? || @project != e.project %>
</strong> </strong>
<span class="font_lighter"> <span class="font_lighter">
<%= l(:label_new_activity) %> <%= l(:label_new_activity) %>
</span> </span>
<%= link_to format_activity_title(e.event_title), e.event_url %> <%= link_to format_activity_title(e.event_title), e.event_url %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<p class="font_description"> <p class="font_description">
<%= format_activity_description(e.event_description) %> <%= format_activity_description(e.event_description) %>
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="left"> <td align="left">
<a class="font_lighter"> <a class="font_lighter">
<%= format_activity_day(day) %> <%= format_activity_day(day) %>
<%= format_time(e.event_datetime, false) %> <%= format_time(e.event_datetime, false) %>
</a> </a>
</td> </td>
<td width="200" align="center" class="a"> <td width="200" align="center" class="a">
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<% end -%> <% end -%>
</div> </div>
<% end -%> <% end -%>
</div> </div>
<!--end--> <!--end-->
<div class="pagination"> <div class="pagination">
<ul> <ul>
<%= pagination_links_full @activity_pages%> <%= pagination_links_full @activity_pages%>
</ul> </ul>
</div> </div>
<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %> <%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %> <%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %> <%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %>
<% end %> <% end %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
<%= form_tag({}, :method => :get) do %> <%= form_tag({}, :method => :get) do %>
<h3><%= l(:label_activity) %></h3> <h3><%= l(:label_activity) %></h3>
<p> <p>
<% @activity.event_types.each do |t| %> <% @activity.event_types.each do |t| %>
<%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %> <%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>
<label for="show_<%= t%>"> <label for="show_<%= t%>">
<%= link_to(l("label_#{t.singularize}_plural"), {"show_#{t}" => 1, :user_id => params[:user_id], :from => params[:from]})%> <%= link_to(l("label_#{t.singularize}_plural"), {"show_#{t}" => 1, :user_id => params[:user_id], :from => params[:from]})%>
</label> </label>
<br /> <br />
<% end %> <% end %>
</p> </p>
<% if @project && @project.descendants.active.any? %> <% if @project && @project.descendants.active.any? %>
<%= hidden_field_tag 'with_subprojects', 0 %> <%= hidden_field_tag 'with_subprojects', 0 %>
<p> <p>
<label> <label>
<%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%= check_box_tag 'with_subprojects', 1, @with_subprojects %>
<%= l(:label_subproject_plural)%> <%= l(:label_subproject_plural)%>
</label> </label>
</p> </p>
<% end %> <% end %>
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %> <%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
<p> <p>
<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
<% html_title(l(:label_activity), @author) -%> <% html_title(l(:label_activity), @author) -%>

View File

@ -33,7 +33,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% if options[:author] %> <% if options[:author] %>
<span class="author" title="attachment.author"> <span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>, <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %> <%= format_time(attachment.created_on) %>
</span> </span>

View File

@ -1,6 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %> <% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
<p class="font_lighter" style="font-size: 15px; padding-left: 12px; "><%=tip1%></p> <p class="font_lighter" style="font-size: 15px; padding-left: 12px; ">
<%=tip1%>
</p>
<div id='leave-message'> <div id='leave-message'>
<%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %> <%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %>
@ -22,24 +24,31 @@
<ul class="message-for-user"> <ul class="message-for-user">
<% for journal in journals%> <% for journal in journals%>
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user"> <li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span> <span class="portrait">
<span class="body"> <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span> </span>
<span class="font_lighter"><%= label %></span> <span class="body">
<div> <%= textilizable journal.notes%> </div> <span class="user">
<span class="font_lighter"> <%= link_to journal.user, user_path(journal.user)%>
<%= l(:label_bids_published) %>&nbsp; </span>
<%= time_tag(journal.created_on).html_safe %>&nbsp; <span class="font_lighter">
<%= l(:label_bids_published_ago) %> <%= label %>
</span> </span>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <div>
<span> <%= textilizable journal.notes%>
</div>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %> <% if reply_allow %>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal},
:remote => true,:method => 'post', :title => l(:button_quote))%> :remote => true,:method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_quote),'', <%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %>
%>
<% end %> <% end %>
<% if @user==User.current|| User.current.admin? %> <% if @user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete),
@ -47,14 +56,14 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
</span>
</span> </span>
<div style="clear: both;"></div> </span>
<div style="clear: both;"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %> <% if reply_allow %>
<div id='<%= ids %>' class="respond-form"> <div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div> </div>
<% end %> <% end %>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div> <div>

View File

@ -1,16 +1,34 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span> <span class="portrait">
<%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%>
</span>
<span class="body" style="word-break: break-all;word-wrap: break-word;"> <span class="body" style="word-break: break-all;word-wrap: break-word;">
<h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= link_to(@bid.name,respond_path(@bid)) %></h3> <h3>
<%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>
<%= link_to(@bid.name,respond_path(@bid)) %>
</h3>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%> <% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<p> <p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= l(:label_call_bonus) %>&nbsp; <%= l(:label_RMB_sign) %><%= @bid.budget %></span></strong> <strong>
<%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= l(:label_call_bonus) %>
&nbsp;
<%= l(:label_RMB_sign) %>
<%= @bid.budget %>
</span>
</strong>
</p> </p>
<% elsif @bid.reward_type == 2%> <% elsif @bid.reward_type == 2%>
<p> <p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @bid.budget%></span></strong> <strong>
</p> <%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= @bid.budget%>
</span>
</strong>
</p>
<% else %> <% else %>
<% end %> <% end %>
<div class="bid_description"> <div class="bid_description">

View File

@ -1,31 +1,36 @@
<!-- <%#= course_board_breadcrumb(@board) %> --> <script type="text/javascript">
function submitCoursesBoard()
<!--new and follow--> {
<!-- <div class="content-title-top"> if(regexSubject()&&regexContent())
<%#= link_to l(:label_message_new), {
new_board_message_path(@board), $("#message-form").submit();
:class => 'icon icon-add', }
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> --> }
<!-- <%#= watcher_link(@board, User.current) %> --> </script>
<!-- </div> -->
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %> <% if User.current.logged? %>
<h3><%= link_to h(@board.name), course_board_path(@course, @board) %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), course_board_path(@course, @board) %> &#187;
<%= l(:label_message_new) %>
</h3>
<div class="add_frame_header" > <div class="add_frame_header" >
<%= l(:label_message_new) %> <%= l(:label_message_new) %>
</div> </div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <p>
<%#= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%> <input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %></p> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
</p>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
<% end %> <% end %>
</div> </div>
<!--display the board--> <!--display the board-->
<div class="borad-title"><%=h @board.name %></div> <div class="borad-title">
<%=h @board.name %>
</div>
<% if !User.current.logged?%> <% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
@ -35,9 +40,12 @@
</div> </div>
<% end %> <% end %>
<!-- <div class="borad-description"><%=h @board.description %></div> -->
<div class="borad-setitle"> <div class="borad-setitle">
<span class="borad-topic-count">共有 <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span> <span class="borad-topic-count">
共有
<%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子
</span>
<span> <span>
<%= link_to l(:label_message_new), <%= link_to l(:label_message_new),
new_board_message_path(@board), new_board_message_path(@board),
@ -47,15 +55,6 @@
</div> </div>
<div style="padding-top: 10px"> <div style="padding-top: 10px">
<% if @topics.any? %> <% if @topics.any? %>
<!-- <table class="list messages">
<thead><tr>
<th><%= l(:field_subject) %></th>
<th><%= l(:field_author) %></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
</tr></thead>
<tbody> -->
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
@ -64,36 +63,44 @@
<table width="640px" border="0"> <table width="640px" border="0">
<tr> <tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %> <%= topic.locked? ? 'locked' : '' %>">
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
</td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>
<td align="center" class="borad-count-digit">
<%=link_to (topic.replies_count), board_message_path(@board, topic) %>
</td>
</tr>
<tr>
<td align="center">
回答
</td>
</tr>
</table>
</td> </td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr>
<tr><td align="center">回答</td></tr>
</table></td>
</tr> </tr>
<!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> --> <tr>
<tr><td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_on, topic.author %><br /></span></td></tr> <td align="left" colspan="2" >
</table></td> <span class="font_lighter">
<%= authoring topic.created_on, topic.author %>
<br />
</span>
</td>
</tr>
</table>
</td>
</tr> </tr>
</table> </table>
<!-- <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
<td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
<td class="last_message">
<% if topic.last_reply %>
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
<%= link_to_message topic.last_reply %>
<% end %>
</td>
</tr> -->
<% end %> <% end %>
<!-- </tbody> <div class="pagination">
</table> --> <%= pagination_links_full @topic_pages, @topic_count %>
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div> </div>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %> <% end %>
</div> </div>

View File

@ -1,9 +1,15 @@
<%= error_messages_for @board %> <%= error_messages_for @board %>
<div class="box tabular"> <div class="box tabular">
<p style="width:666;"><%= f.text_field :name, :required => true %></p><!--by young--> <p style="width:666;">
<p><%= f.text_field :description, :required => true, :size => 30 %></p><!--by young--> <%= f.text_field :name, :required => true %>
</p><!--by young-->
<p>
<%= f.text_field :description, :required => true, :size => 30 %>
</p><!--by young-->
<% if @board.valid_parents.any? %> <% if @board.valid_parents.any? %>
<p><%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %></p> <p>
<%= f.select :parent_id, boards_options_for_select(@board.valid_parents), :include_blank => true, :label => :field_board_parent %>
</p>
<% end %> <% end %>
</div> </div>

View File

@ -1,25 +1,24 @@
<!-- <%#= board_breadcrumb(@board) %> --> <script type="text/javascript">
function submitProjectBoard()
<!--new and follow--> {
<!-- <div class="content-title-top"> if(regexSubject()&&regexContent())
<%#= link_to l(:label_message_new), {
new_board_message_path(@board), $("#message-form").submit();
:class => 'icon icon-add', }
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> --> }
<!-- <%#= watcher_link(@board, User.current) %> --> </script>
<!-- </div> -->
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %> <% if User.current.logged? %>
<h3><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %>
</h3>
<div class="add_frame_header"> <div class="add_frame_header">
<%= l(:label_message_new) %> <%= l(:label_message_new) %>
</div> </div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <p>
<%#= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %> <input type="button" onclick="submitProjectBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
@ -27,7 +26,9 @@
</div> </div>
<!--display the board--> <!--display the board-->
<div class="borad-title"><%= h @board.name %></div> <div class="borad-title">
<%= h @board.name %>
</div>
<% if !User.current.logged? %> <% if !User.current.logged? %>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
@ -40,10 +41,12 @@
<hr/> <hr/>
</div> </div>
<% end %> <% end %>
<!-- <div class="borad-description"><%= h @board.description %></div> -->
<div class="borad-setitle"> <div class="borad-setitle">
<span class="borad-topic-count">共有 <%= link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子</span> <span class="borad-topic-count">
共有
<%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子
</span>
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %> <% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
<span> <span>
<%= link_to l(:label_message_new), <%= link_to l(:label_message_new),
@ -55,15 +58,6 @@
</div> </div>
<div style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div style="width: 100%;word-break: break-all;word-wrap: break-word;">
<% if @topics.any? %> <% if @topics.any? %>
<!-- <table class="list messages">
<thead><tr>
<th><%= l(:field_subject) %></th>
<th><%= l(:field_author) %></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
</tr></thead>
<tbody> -->
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
@ -88,7 +82,6 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- <tr><td colspan="2" ><span class="font_description">标签</span></td></tr> -->
<tr> <tr>
<td align="left" colspan="2"> <td align="left" colspan="2">
<span class="font_lighter"><%= authoring topic.created_on, topic.author %><br/></span></td> <span class="font_lighter"><%= authoring topic.created_on, topic.author %><br/></span></td>
@ -97,23 +90,10 @@
</td> </td>
</tr> </tr>
</table> </table>
<!-- <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
<td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
<td class="last_message">
<% if topic.last_reply %>
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
<%= link_to_message topic.last_reply %>
<% end %>
</td>
</tr> -->
<% end %> <% end %>
<!-- </tbody> <div class="pagination">
</table> --> <%= pagination_links_full @topic_pages, @topic_count %>
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div> </div>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% end %> <% end %>

View File

@ -3,14 +3,26 @@
<%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %> <%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>
<% end %> <% end %>
</div> </div>
<h3 style="padding-top:0px;"><%= l(:label_board_plural) %></h3> <h3 style="padding-top:0px;">
<%= l(:label_board_plural) %>
</h3>
<table class="list boards"> <table class="list boards">
<thead><tr> <thead>
<th><%= l(:label_board) %></th> <tr>
<th><%= l(:label_topic_plural) %></th> <th>
<th><%= l(:label_message_plural) %></th> <%= l(:label_board) %>
<th><%= l(:label_message_last) %></th> </th>
</tr></thead> <th>
<%= l(:label_topic_plural) %>
</th>
<th>
<%= l(:label_message_plural) %>
</th>
<th>
<%= l(:label_message_last) %>
</th>
</tr>
</thead>
<tbody> <tbody>
<% Board.board_tree(@boards) do |board, level| %> <% Board.board_tree(@boards) do |board, level| %>
<tr class="<%= cycle 'odd', 'even' %>"> <tr class="<%= cycle 'odd', 'even' %>">
@ -18,12 +30,16 @@
<%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %><br /> <%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %><br />
<%=h board.description %> <%=h board.description %>
</td> </td>
<td class="topic-count"><%= board.topics_count %></td> <td class="topic-count">
<td class="message-count"><%= board.messages_count %></td> <%= board.topics_count %>
</td>
<td class="message-count">
<%= board.messages_count %>
</td>
<td class="last-message"> <td class="last-message">
<% if board.last_message %> <% if board.last_message %>
<%= authoring board.last_message.created_on, board.last_message.author %><br /> <%= authoring board.last_message.created_on, board.last_message.author %><br />
<%= link_to_message board.last_message %> <%= link_to_message board.last_message %>
<% end %> <% end %>
</td> </td>
</tr> </tr>

View File

@ -1,151 +1,151 @@
<script type="text/javascript"> <script type="text/javascript">
function submitContestNews() function submitContestNews()
{ {
if(regexTitle() && regexDescription()) if(regexTitle() && regexDescription())
{ {
$("#contestnotifications-form").submit(); $("#contestnotifications-form").submit();
} }
} }
</script> </script>
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;"> <span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= l(:label_notification) %> <%= l(:label_notification) %>
</span> </span>
<% if User.current.logged? && (User.current.admin? ||User.current == @contest.author) %> <% if User.current.logged? && (User.current.admin? ||User.current == @contest.author) %>
<%= link_to(l(:bale_news_notice), <%= link_to(l(:bale_news_notice),
new_contest_contestnotification_path(@contest), new_contest_contestnotification_path(@contest),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %> :onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %>
<% end %> <% end %>
<% if @contest %> <% if @contest %>
<div id="add-contestnotifications" class="add_frame" style="display:none;"> <div id="add-contestnotifications" class="add_frame" style="display:none;">
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), <%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest),
:html => {:id => 'contestnotifications-form', :multipart => true} do |f| %> :html => {:id => 'contestnotifications-form', :multipart => true} do |f| %>
<%= render :partial => 'contestnotifications/form', :locals => {:f => f} %> <%= render :partial => 'contestnotifications/form', :locals => {:f => f} %>
<input type="button" onclick="submitContestNews();" class="enterprise" value="<%= l(:button_create)%>"/> <input type="button" onclick="submitContestNews();" class="enterprise" value="<%= l(:button_create)%>"/>
| |
<input type="button" onclick="$('#add-contestnotifications').hide(); return false;" class="enterprise" value="<%= l(:button_cancel)%>"/> <input type="button" onclick="$('#add-contestnotifications').hide(); return false;" class="enterprise" value="<%= l(:button_cancel)%>"/>
<% end if @contest %> <% end if @contest %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>
<br/> <br/>
<% end %> <% end %>
<div> <div>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span class="portrait"> <span class="portrait">
<%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%> <%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%>
</span> </span>
<span class="body"> <span class="body">
<span id="praise_tread" style="float: right"> <span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread", <%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => @contest, :locals => {:obj => @contest,
:show_flag => true, :show_flag => true,
:user_id =>User.current.id, :user_id =>User.current.id,
:horizontal => false} :horizontal => false}
%> %>
</span> </span>
<h3> <h3>
<%= link_to(@contest.author.lastname+@contest.author.firstname, <%= link_to(@contest.author.lastname+@contest.author.firstname,
user_path(@contest.author))%> user_path(@contest.author))%>
<%= @contest.name %> <%= @contest.name %>
</h3> </h3>
<p> <p>
<strong> <strong>
<%= l(:label_bids_reward_method) %> <%= l(:label_bids_reward_method) %>
<span class="bonus"> <span class="bonus">
<%= @contest.budget%> <%= @contest.budget%>
</span> </span>
</strong> </strong>
</p> </p>
<div class="bid_description" style="width: 100%;word-break:break-all;word-wrap: break-word;"> <div class="bid_description" style="width: 100%;word-break:break-all;word-wrap: break-word;">
<%= @contest.description %> <%= @contest.description %>
</div> </div>
</span> </span>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<br><br> <br><br>
<% @contestnotificationss.each do |contestnotifications| %> <% @contestnotificationss.each do |contestnotifications| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50"> <td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(contestnotifications.author), :class => "avatar"), user_path(contestnotifications.author) %> <%= link_to image_tag(url_to_avatar(contestnotifications.author), :class => "avatar"), user_path(contestnotifications.author) %>
</td> </td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong> <strong>
<%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %> <%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %>
</strong> </strong>
<span style="margin-left: 4px;" class="font_lighter"> <span style="margin-left: 4px;" class="font_lighter">
<%= l(:label_project_notice) %> <%= l(:label_project_notice) %>
</span> </span>
<span> <span>
<%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %> <%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %>
</span> </span>
<span style="float: right"> <span style="float: right">
<%= link_to l(:button_edit), edit_contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %> <%= link_to l(:button_edit), edit_contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
<%= delete_link contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %> <%= delete_link contest_contestnotification_path(@contest, contestnotifications) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
</span> </span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px"> <td colspan="2" width="580px">
<span class="font_description"> <span class="font_description">
<%= textilizable(contestnotifications, :description) %> <%= textilizable(contestnotifications, :description) %>
</span> </span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <td align="left"><span class="font_lighter">
<%= l :label_update_time %> <%= l :label_update_time %>
&nbsp; &nbsp;
<%= format_time(contestnotifications.created_at) %> <%= format_time(contestnotifications.created_at) %>
</span> </span>
</td> </td>
<td width="350" align="right" class="a"> <td width="350" align="right" class="a">
<%= link_to l(:label_check_comment), contest_contestnotification_path(@contest, contestnotifications) %> <%= link_to l(:label_check_comment), contest_contestnotification_path(@contest, contestnotifications) %>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
</div> </div>
<!--end--> <!--end-->
<div style="padding-right: 10px"> <div style="padding-right: 10px">
<div class="pagination"> <div class="pagination">
<ul> <ul>
<%= pagination_links_full @contestnotifications_pages %> <%= pagination_links_full @contestnotifications_pages %>
</ul> </ul>
</div> </div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %> <%= stylesheet_link_tag 'scm' %>
<% end %> <% end %>
<% html_title(l(:label_contest_notification)) -%> <% html_title(l(:label_contest_notification)) -%>
</div> </div>
<script type='text/javascript'> <script type='text/javascript'>
$(document).ready(function ($) { $(document).ready(function ($) {
$('.content-text-list').each(function () { $('.content-text-list').each(function () {
$(this).find('.delete_icon').hide(); $(this).find('.delete_icon').hide();
$(this).mouseenter(function (event) { $(this).mouseenter(function (event) {
$(this).find('.delete_icon').show(); $(this).find('.delete_icon').show();
}); });
$(this).mouseleave(function (event) { $(this).mouseleave(function (event) {
$(this).find('.delete_icon').hide(); $(this).find('.delete_icon').hide();
}); });
}); });
}); });
</script> </script>
<!--end--> <!--end-->

View File

@ -1,53 +1,53 @@
<div class="top-content"> <div class="top-content">
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %>
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_contest_innovate) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_contest_innovate) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>
<!-- end longjun --> <!-- end longjun -->
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
<td rowspan="2" > <td rowspan="2" >
<div class="project-search" style="float: right"> <div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %> <%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %> <%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"> <td style="padding-left: 8px">
<a> <a>
<%= link_to request.host()+"/contests", contests_path %> <%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun --> <!-- end longjun -->
</a> </a>
</td> </td>
<td > <td >
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
<!-- end longjun --> <!-- end longjun -->
</td> </td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
</div> </div>
<% if @contests.size > 0%> <% if @contests.size > 0%>
<%= sort_contest(@s_state)%> <%= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>
<% elsif @is_search%> <% elsif @is_search%>
<%= render :partial => "layouts/no_content"%> <%= render :partial => "layouts/no_content"%>
<% else %> <% else %>
<%= sort_contest(@s_state)%> <%= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>
<% end %> <% end %>
<% html_title l(:label_contest_list)%> <% html_title l(:label_contest_list)%>

View File

@ -15,7 +15,7 @@
<%= l(:label_private) %> <%= l(:label_private) %>
</span> </span>
<% end %> <% end %>
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%> <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info #{User.current.member_of_course?(@course) ? 'my-project' : nil}"))%>
</p> </p>
<p > <p >
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> <%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>

View File

@ -1,75 +1,75 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>快速进入课程通道</title> <title>快速进入课程通道</title>
<style> <style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;} div,img,tr,td{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none} ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; } a{ text-decoration:none; }
a:hover{ } a:hover{ }
#popbox{width:488px;height:308px;} #popbox{width:488px;height:308px;}
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; } .alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
.C_top{ margin-top:20px; width:368px; height:100px; background:#e9e9e9; padding:0px 60px; } .C_top{ margin-top:20px; width:368px; height:100px; background:#e9e9e9; padding:0px 60px; }
.C_top h2{ color:#1c1d1d; font-size:24px; font-style:normal; font-weight:normal;} .C_top h2{ color:#1c1d1d; font-size:24px; font-style:normal; font-weight:normal;}
.C_top p{ color:#a9aaaa; line-height:22px;} .C_top p{ color:#a9aaaa; line-height:22px;}
.C_form{ margin:20px 0 0 60px;} .C_form{ margin:20px 0 0 60px;}
.C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; } .C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; }
.C_form ul li input{ margin-left:30px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; } .C_form ul li input{ margin-left:30px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
.C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:90px;} .C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:90px;}
.width190{ width:190px; height:26px; border-color:#e1e1e1;} .width190{ width:190px; height:26px; border-color:#e1e1e1;}
.C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;} .C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;}
.C_form a:hover{ text-decoration:underline;} .C_form a:hover{ text-decoration:underline;}
.C_form a.btn{ display:block; width:100px; height:36px; padding-top:4px; text-align: center; background:#15bccf; color:#fff; font-size:14px; margin:20px 20px 0 95px;} .C_form a.btn{ display:block; width:100px; height:36px; padding-top:4px; text-align: center; background:#15bccf; color:#fff; font-size:14px; margin:20px 20px 0 95px;}
.C_form a.btn:hover{ background:#ff821d;} .C_form a.btn:hover{ background:#ff821d;}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
function submit_form(obj) function submit_form(obj)
{ {
hideModal(obj); hideModal(obj);
$("#new-watcher-form").submit(); $("#new-watcher-form").submit();
} }
</script> </script>
</head> </head>
<body> <body>
<div id="popbox"> <div id="popbox">
<div class="C" > <div class="C" >
<div class="C_top"> <div class="C_top">
<h2>快速进入课程通道</h2> <h2>快速进入课程通道</h2>
<p>只要持有课程ID和密码就可快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦</p> <p>只要持有课程ID和密码就可快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦</p>
</div> </div>
<div class="C_form"> <div class="C_form">
<%= form_tag({:controller => 'courses', <%= form_tag({:controller => 'courses',
:action => 'join'}, :action => 'join'},
:remote => true, :remote => true,
:method => :post, :method => :post,
:id => 'new-watcher-form') do %> :id => 'new-watcher-form') do %>
<ul> <ul>
<li> <li>
<span class="tips">课&nbsp;程&nbsp;ID</span> <span class="tips">课&nbsp;程&nbsp;ID</span>
<input class=" width190" name="object_id" id="object_id" type="text" value="" > <input class=" width190" name="object_id" id="object_id" type="text" value="" >
</li> </li>
<li class="mB5">课程ID是所在课程网址中显示的序号</li> <li class="mB5">课程ID是所在课程网址中显示的序号</li>
<li> <li>
<span class="tips">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</span> <span class="tips">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</span>
<input class=" width190" type="password" name="course_password" id="course_password" value="" > <input class=" width190" type="password" name="course_password" id="course_password" value="" >
</li> </li>
<li> <li>
<a href="#" class="btn" onclick="submit_form(this);"><%= l(:label_new_join) %></a> <a href="#" class="btn" onclick="submit_form(this);"><%= l(:label_new_join) %></a>
<a href="#" onclick="hideModal(this);"><%= l(:button_cancel)%></a> <a href="#" onclick="hideModal(this);"><%= l(:button_cancel)%></a>
</li> </li>
</ul> </ul>
<% end%> <% end%>
</div> </div>
</div><!---- C end----> </div><!---- C end---->
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,18 +1,25 @@
<!-- <h4><%= link_to h(document.title), document_path(document) %></h4>
<p><em><%= format_time(document.updated_on) %></em></p>
<div class="wiki">
<%= textilizable(truncate_lines(document.description), :object => document) %>
</div> -->
<!--add by huang--> <!--add by huang-->
<table width="660px" align="center"> <table width="660px" align="center">
<tr><td class="font_title_document"><%= link_to h(document.title), document_path(document) %></td></tr> <tr>
<tr><td colspan="2"> <td class="font_title_document">
<%= link_to h(document.title), document_path(document) %>
</td>
</tr>
<tr>
<td colspan="2">
<div class="font_description"> <div class="font_description">
<%= textilizable(truncate_lines(document.description), :object => document) %> <%= textilizable(truncate_lines(document.description), :object => document) %>
</div> </div>
</td></tr> </td>
<tr><td align="right"><p class="font_lighter"><%= format_time(document.updated_on) %></p></td></tr> </tr>
<tr><td class="line_under"></td></tr> <tr>
<td align="right">
<p class="font_lighter">
<%= format_time(document.updated_on) %>
</p>
</td>
</tr>
<tr>
<td class="line_under"></td>
</tr>
</table> </table>

View File

@ -12,23 +12,34 @@
</div> </div>
<div id="add-document" style="display:none;"> <div id="add-document" style="display:none;">
<h3><%=l(:label_document_new)%></h3> <h3>
<%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %> <%=l(:label_document_new)%>
<%= render :partial => 'form', :locals => {:f => f} %> </h3>
<p> <%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
<%= submit_tag l(:button_create) %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %> <p>
</p> <%= submit_tag l(:button_create) %>
<% end %> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-document").hide(); return false;' %>
</p>
<% end %>
</div> </div>
<h3><%=l(:label_document_plural)%></h3> <h3><%=l(:label_document_plural)%></h3>
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %> <% if @grouped.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
<% @grouped.keys.sort.each do |group| %> <% if @grouped.has_key? nil %>
<!-- <h3><%= group %></h3> --> <% @grouped.keys.each do |group| %>
<%= render :partial => 'documents/document', :collection => @grouped[group] %> <%= render :partial => 'documents/document', :collection => @grouped[group] %>
<% end %>
<% else %>
<% @grouped.keys.sort.each do |group| %>
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
<% end %>
<% end %> <% end %>
<% html_title(l(:label_document_plural)) -%> <% html_title(l(:label_document_plural)) -%>

View File

@ -2,11 +2,11 @@
<% attachmenttypes = @course.attachmenttypes %> <% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %> <% sufixtypes = @course.contenttypes %>
<span class="borad-title"> <span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<%= l(:label_coursefile_sharingarea) %>
</span>
<div class="content-title-top"> <div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
<div class="clearfix"></div> <div class="clearfix"></div>
<div id="file_buttons" class="nhidden"> <div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %> <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
@ -55,7 +55,7 @@
<% if sufixtypes.any? %> <% if sufixtypes.any? %>
&nbsp; &nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label> <label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') + options_for_select(sufixtypes), <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "course_attachment_contenttypes_searchex(this.value)" %> :onchange => "course_attachment_contenttypes_searchex(this.value)" %>
<% end %> <% end %>
</div> </div>
@ -67,6 +67,16 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<div id="all_browse_div" class="all_browse_div"> <div id="all_browse_div" class="all_browse_div">
<%= render :partial => 'course_show_all_attachment' %> <%#= render :partial => 'course_show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "course_show_all_attachment"%>
<%else%>
<%= render partial: "course_sort_by_attachtypel"%>
<%end%>
</div> </div>
<% html_title(l(:label_course_file)) -%>
<% html_title(l(:label_attachment_plural)) -%>

View File

@ -69,7 +69,17 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<div id="all_browse_div" class="all_browse_div"> <div id="all_browse_div" class="all_browse_div">
<%= render :partial => 'show_all_attachment' %> <%#= render :partial => 'show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "show_all_attachment"%>
<%else%>
<%= render partial: "sort_by_attachtypel"%>
<%end%>
</div> </div>
<% html_title(l(:project_module_files)) -%> <% html_title(l(:label_attachment_plural)) -%>

View File

@ -0,0 +1,249 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<% if @isproject %>
<%= render :partial => 'project_file', locals: {project: @project} %>
<% else %>
<%= render :partial => 'course_file', locals: {course: @course} %>
<% end %>
<script type='text/javascript'>
var slideHeight = 29;
function readmore(aNode) {
// console.log(aNode)
// var $td_tags_area = $(aNode).parent().parent();
var $td_tags_area = $(aNode).parent().parent().parent().parent();
var $tags_area = $td_tags_area.find('.tags_area')
var $tags_gradint = $td_tags_area.find('.tags_gradint')
var $read_more = $td_tags_area.find('.read-more')
var $read_more_a = $td_tags_area.find('.read-more a')
var $tags = $td_tags_area.find('#tags')
var $icona = $td_tags_area.find('.tags_icona')
var slideHeight = 13; //px
var defHeight = $tags.height();
var curHeight = $tags_area.height();
if (curHeight == slideHeight) {
$tags_area.animate({
height: defHeight
}, 'normal');
$read_more_a.html('隐藏');
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
$tags_gradint.fadeOut();
} else {
$tags_area.animate({
height: slideHeight
}, 'normal');
$read_more_a.html('更多');
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
$tags_gradint.fadeIn();
}
;
}
$(function () {
var slideHeight = 20; //px
var defHeight = $('.tags_area').height();
if (defHeight >= slideHeight) {
$('.tags_area').css('height', slideHeight + 'px');
}
;
});
function eval_ajax(xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
alert('error');
}
}
function attachment_contenttypes_searchex(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachtype_edit(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachmenttypes_searchex(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: encodeURIComponent(value),
contentType: $('#attach_sufix_browse').val()
}
}).complete(eval_ajax);
<%end%>
}
function course_attachmenttypes_searchex(value) {
<% if @course%>
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: encodeURIComponent(value),
contentType: $('#attach_sufix_browse').val()
}
}).complete(eval_ajax);
<%end%>
}
function course_attachment_contenttypes_searchex(value) {
<% if @course%>
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function course_attachtype_edit(value) {
<% if @course%>
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachmenttypes_change(id, type) {
<% if @project%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
// 编辑文件密级
function file_dense_edit(id, type) {
$.ajax({
url: '<%=updateFileDense_attachments_path%>',
type: "POST",
remote:"true",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
});
}
</script>
<script type='text/javascript'>
function tagAddClick(divid, objId, objTag) {
alert("OK");
$.ajax({
type: "POST",
url: '/users/tag_saveEx',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag: encodeURIComponent(objTag)
},
success: function (data, textStatus) {
alert("OK");
$(divid).empty();
$(divid).html('123');
$("#" + divid + " #name").val("");
}
})
}
</script>

View File

@ -1,13 +1,13 @@
<% if @attachtype==0 && @contenttype=='0' %> <% if @attachtype==0 && @contenttype=='0' %>
<% if @project%> <% if @project%>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<% elsif @course%> <% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); $("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
<%end%> <%end%>
<%else%> <%else%>
<% if @project%> <% if @project%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>') $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
<% elsif @course%> <% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>') $("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
<%end%>; <%end%>;
<%end%> <%end%>

View File

@ -1,248 +1,249 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 --> <!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<% if @isproject %> <% if @isproject %>
<%= render :partial => 'project_file', locals: {project: @project} %> <%= render :partial => 'project_file', locals: {project: @project} %>
<% else %> <% else %>
<%= render :partial => 'course_file', locals: {course: @course} %> <%= render :partial => 'course_file', locals: {course: @course} %>
<% end %> <% end %>
<script type='text/javascript'> <script type='text/javascript'>
var slideHeight = 29; var slideHeight = 29;
function readmore(aNode) { function readmore(aNode) {
// console.log(aNode) // console.log(aNode)
// var $td_tags_area = $(aNode).parent().parent(); // var $td_tags_area = $(aNode).parent().parent();
var $td_tags_area = $(aNode).parent().parent().parent().parent(); var $td_tags_area = $(aNode).parent().parent().parent().parent();
var $tags_area = $td_tags_area.find('.tags_area') var $tags_area = $td_tags_area.find('.tags_area')
var $tags_gradint = $td_tags_area.find('.tags_gradint') var $tags_gradint = $td_tags_area.find('.tags_gradint')
var $read_more = $td_tags_area.find('.read-more') var $read_more = $td_tags_area.find('.read-more')
var $read_more_a = $td_tags_area.find('.read-more a') var $read_more_a = $td_tags_area.find('.read-more a')
var $tags = $td_tags_area.find('#tags') var $tags = $td_tags_area.find('#tags')
var $icona = $td_tags_area.find('.tags_icona') var $icona = $td_tags_area.find('.tags_icona')
var slideHeight = 13; //px var slideHeight = 13; //px
var defHeight = $tags.height(); var defHeight = $tags.height();
var curHeight = $tags_area.height(); var curHeight = $tags_area.height();
if (curHeight == slideHeight) { if (curHeight == slideHeight) {
$tags_area.animate({ $tags_area.animate({
height: defHeight height: defHeight
}, 'normal'); }, 'normal');
$read_more_a.html('隐藏'); $read_more_a.html('隐藏');
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>') $icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
$tags_gradint.fadeOut(); $tags_gradint.fadeOut();
} else { } else {
$tags_area.animate({ $tags_area.animate({
height: slideHeight height: slideHeight
}, 'normal'); }, 'normal');
$read_more_a.html('更多'); $read_more_a.html('更多');
$icona.html('<%=image_tag "/images/sidebar/add.png"%>') $icona.html('<%=image_tag "/images/sidebar/add.png"%>')
$tags_gradint.fadeIn(); $tags_gradint.fadeIn();
} }
; ;
} }
$(function () { $(function () {
var slideHeight = 20; //px var slideHeight = 20; //px
var defHeight = $('.tags_area').height(); var defHeight = $('.tags_area').height();
if (defHeight >= slideHeight) { if (defHeight >= slideHeight) {
$('.tags_area').css('height', slideHeight + 'px'); $('.tags_area').css('height', slideHeight + 'px');
} }
; ;
}); });
function eval_ajax(xhr, textStatus) { function eval_ajax(xhr, textStatus) {
if (textStatus == 'success') { if (textStatus == 'success') {
eval(xhr.responseText); eval(xhr.responseText);
} else if (textStatus == 'error') { } else if (textStatus == 'error') {
// alert('error'); alert('error');
} }
} }
function attachment_contenttypes_searchex(value) { function attachment_contenttypes_searchex(value) {
<% if @project%> <% if @project%>
$.ajax({ $.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>', url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST", type: "POST",
data: { data: {
type: $('#attachment_browse').val(), type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value) contentType: encodeURIComponent(value)
} }
}).complete(eval_ajax); }).complete(eval_ajax);
<%end%> <%end%>
} }
function attachtype_edit(value) { function attachtype_edit(value) {
<% if @project%> <% if @project%>
$.ajax({ $.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>', url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST", type: "POST",
data: { data: {
type: $('#attachment_browse').val(), type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value) contentType: encodeURIComponent(value)
} }
}).complete(eval_ajax); }).complete(eval_ajax);
<%end%> <%end%>
} }
function attachmenttypes_searchex(value) { function attachmenttypes_searchex(value) {
<% if @project%> <% if @project%>
$.ajax({ $.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>', url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST", type: "POST",
data: { data: {
type: encodeURIComponent(value), type: encodeURIComponent(value),
contentType: $('#attach_sufix_browse').val() contentType: $('#attach_sufix_browse').val()
} }
}).complete(eval_ajax); }).complete(eval_ajax);
<%end%> <%end%>
} }
function course_attachmenttypes_searchex(value) { function course_attachmenttypes_searchex(value) {
<% if @course%> <% if @course%>
$.ajax({ $.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>', url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST", type: "POST",
data: { data: {
type: encodeURIComponent(value), type: encodeURIComponent(value),
contentType: $('#attach_sufix_browse').val() contentType: $('#attach_sufix_browse').val()
} }
}).complete(eval_ajax); }).complete(eval_ajax);
<%end%> <%end%>
} }
function course_attachment_contenttypes_searchex(value) { function course_attachment_contenttypes_searchex(value) {
<% if @course%> <% if @course%>
$.ajax({ $.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST", url: '<%=getattachtype_course_files_path(course_id: @course)%>',
data: { type: "POST",
type: $('#attachment_browse').val(), data: {
contentType: encodeURIComponent(value) type: $('#attachment_browse').val(),
} contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%> }).complete(eval_ajax);
} <%end%>
function course_attachtype_edit(value) { }
<% if @course%> function course_attachtype_edit(value) {
$.ajax({ <% if @course%>
url: '<%=getattachtype_course_files_path(course_id: @course)%>', $.ajax({
type: "POST", url: '<%=getattachtype_course_files_path(course_id: @course)%>',
data: { type: "POST",
type: $('#attachment_browse').val(), data: {
contentType: encodeURIComponent(value) type: $('#attachment_browse').val(),
} contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%> }).complete(eval_ajax);
} <%end%>
}
function attachmenttypes_change(id, type) {
<% if @project%> function attachmenttypes_change(id, type) {
$.ajax({ <% if @project%>
url: '<%=updateType_attachments_path%>', $.ajax({
type: "POST", url: '<%=updateType_attachments_path%>',
data: { type: "POST",
attachmentid: encodeURIComponent(id), data: {
newtype: encodeURIComponent(type) attachmentid: encodeURIComponent(id),
} newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({ if (textStatus == 'success') {
url: '<%=getattachtype_project_files_path(project_id: @project)%>', $.ajax({
type: "POST", url: '<%=getattachtype_project_files_path(project_id: @project)%>',
data: { type: "POST",
type: $('#attachment_browse').val(), data: {
contentType: $('#attach_sufix_browse').val() type: $('#attachment_browse').val(),
} contentType: $('#attach_sufix_browse').val()
}).error(function () { }
alert('error'); }).error(function () {
}); alert('error');
} else if (textStatus == 'error') { });
alert('An error has occurred'); } else if (textStatus == 'error') {
} alert('An error has occurred');
}); }
<%end%> });
<%end%>
}
}
function course_attachmenttypes_change(id, type) {
<% if @course%> function course_attachmenttypes_change(id, type) {
$.ajax({ <% if @course%>
url: '<%=updateType_attachments_path%>', $.ajax({
type: "POST", url: '<%=updateType_attachments_path%>',
data: { type: "POST",
attachmentid: encodeURIComponent(id), data: {
newtype: encodeURIComponent(type) attachmentid: encodeURIComponent(id),
} newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({ if (textStatus == 'success') {
url: '<%=getattachtype_course_files_path(course_id: @course)%>', $.ajax({
type: "POST", url: '<%=getattachtype_course_files_path(course_id: @course)%>',
data: { type: "POST",
type: $('#attachment_browse').val(), data: {
contentType: $('#attach_sufix_browse').val() type: $('#attachment_browse').val(),
} contentType: $('#attach_sufix_browse').val()
}).error(function () { }
alert('error'); }).error(function () {
}); alert('error');
} else if (textStatus == 'error') { });
alert('An error has occurred'); } else if (textStatus == 'error') {
} alert('An error has occurred');
}); }
<%end%> });
<%end%>
}
}
// 编辑文件密级
function file_dense_edit(id, type) { // 编辑文件密级
$.ajax({ function file_dense_edit(id, type) {
url: '<%=updateFileDense_attachments_path%>', $.ajax({
type: "POST", url: '<%=updateFileDense_attachments_path%>',
remote:"true", type: "POST",
data: { remote:"true",
attachmentid: encodeURIComponent(id), data: {
newtype: encodeURIComponent(type) attachmentid: encodeURIComponent(id),
} newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
}); }).complete(function (xhr, textStatus) {
});
}
}
</script>
</script>
<script type='text/javascript'>
function tagAddClick(divid, objId, objTag) { <script type='text/javascript'>
alert("OK"); function tagAddClick(divid, objId, objTag) {
$.ajax({ alert("OK");
type: "POST", $.ajax({
url: '/users/tag_saveEx', type: "POST",
data: { url: '/users/tag_saveEx',
tagname: $('tag_name').value, data: {
obj_id: encodeURIComponent(objId), tagname: $('tag_name').value,
obj_flag: encodeURIComponent(objTag) obj_id: encodeURIComponent(objId),
}, obj_flag: encodeURIComponent(objTag)
success: function (data, textStatus) { },
alert("OK"); success: function (data, textStatus) {
$(divid).empty(); alert("OK");
$(divid).html('123'); $(divid).empty();
$("#" + divid + " #name").val(""); $(divid).html('123');
} $("#" + divid + " #name").val("");
}) }
} })
</script> }
</script>

View File

@ -153,7 +153,7 @@
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 --> <!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr> <tr>
<td valign="top" style="padding-left: 8px; width:60px"> <td valign="top" style="padding-left: 8px; width:62px">
<%= l(:label_main_teacher) %> : <%= l(:label_main_teacher) %> :
</td> </td>
<td class="font_lighter_sidebar"> <td class="font_lighter_sidebar">
@ -202,18 +202,18 @@
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %> <% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"> <td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> : <%= l(:label_course_organizers) %> :
</td> </td>
<td class="font_lighter_sidebar"> <td class="font_lighter_sidebar">
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.teacher.user_extensions.school.id%>"> <a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>">
<%= @course.teacher.user_extensions.school %> <%= @course.school %>
</a> </a>
</td> </td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"> <td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> : <%= l(:label_course_organizers) %> :
</td> </td>
<td class="font_lighter_sidebar"> <td class="font_lighter_sidebar">
<%= l(:field_course_un) %> <%= l(:field_course_un) %>

View File

@ -126,7 +126,7 @@
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px; width:60px"> <td valign="top" style="padding-left: 8px; width:62px;">
<%= l(:lable_course_teacher) %> : <%= l(:lable_course_teacher) %> :
</td> </td>
<td class="font_lighter_sidebar"> <td class="font_lighter_sidebar">

View File

@ -1,9 +1,4 @@
<style type="text/css"> <style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.lz { .lz {
position: relative; position: relative;
min-height: 200px; min-height: 200px;
@ -60,7 +55,9 @@
</style> </style>
<div class="lz"> <div class="lz">
<!-- 在这里添加赞和踩--> <!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span> <span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="contextual"> <div class="contextual">
<%= watcher_link(@topic, User.current) %> <%= watcher_link(@topic, User.current) %>
<%= link_to( <%= link_to(
@ -103,12 +100,14 @@
<div class="memo-content"> <div class="memo-content">
<%= textilizable(@topic, :content) %> <%= textilizable(@topic, :content) %>
<%= link_to_attachments @topic, :author => false %> <%= link_to_attachments @topic, :author => false %>
<%# options = {:author => true, :deletable => @topic.author.eql?(User.current)} %>
<%#= render :partial => 'attachments/app_link', :locals => {:attachments => @topi.attachments, :options => options} %>
</div> </div>
<div class="memo-timestamp"> <div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div> <div style="float: left">
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div> <%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
</div>
</div> </div>
</div> </div>
<br /> <br />
@ -119,15 +118,19 @@
<br /> <br />
<br /> <br />
<br /> <br />
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3> <h3 class="comments">
<%= l(:label_reply_plural) %>
(<%= @reply_count %>)
</h3>
<% reply_count = 0 %> <% reply_count = 0 %>
<% @replies.each do |message| %> <% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>"> <div class="message reply" id="<%= "message-#{message.id}" %>">
<table class="borad-text-list"> <table class="borad-text-list">
<tr> <tr>
<!--<td class="font_lighter"> </td> --> <td rowspan="3" valign="top" width="60px">
<td rowspan="3" valign="top" width="60px"><%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %></td> <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
</td>
<td> <td>
<div class="contextual-borad"> <div class="contextual-borad">
<%= link_to( <%= link_to(
@ -157,12 +160,14 @@
<td class="comments"> <td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable message,:content,:attachments => message.attachments %> <%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div> </div>
<%= link_to_attachments message, :author => false %> </td> <%= link_to_attachments message, :author => false %>
</td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float: left"><%= authoring message.created_on, message.author %></td> <td class="font_lighter" style="float: left">
<%= authoring message.created_on, message.author %>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -174,12 +179,9 @@
<% end %> <% end %>
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %> <% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
<div id="reply" style="display:none;"> <div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%#= submit_tag l(:button_submit) %> <input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onmousemove="regexContent()" onclick="submit_message_replay();" >
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>
@ -188,7 +190,7 @@
<% html_title @topic.subject %> <% html_title @topic.subject %>
<script type="text/javascript"> <script type="text/javascript">
var flag = false var flag = false;
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
transpotUrl('#content'); transpotUrl('#content');
}); });

View File

@ -1,48 +1,86 @@
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script type="text/javascript">
function regexSubject()
{
var content = $.trim($("#message_subject").val());
if(content.length ==0)
{
$("#subject_span").text("<%= l(:label_subject_empty) %>");
$("#subject_span").css('color','#ff0000');
return false;
}
else
{
$("#subject_span").text("<%= l(:label_field_correct) %>");
$("#subject_span").css('color','#008000');
return true;
}
return false;
}
function regexContent()
{
var content = $.trim($("#message_content").val());
if(content.length ==0)
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
return false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
return true;
}
return false;
}
</script>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<% replying ||= false %> <% replying ||= false %>
<div class="box ph10_5"> <div class="box ph10_5">
<!--[form:message]--> <!--[form:message]-->
<% extra_option = replying ? { readonly: true} : { maxlength: 254 } %> <% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<p> <p>
<label for="message_subject"> <label for="message_subject">
<%= l(:field_subject) %> <%= l(:field_subject) %>
<span class="required"> *&nbsp;&nbsp;</span> <span class="required"> *&nbsp;&nbsp;</span>
</label> </label>
<br/> <br/>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %> <% if replying %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
<% else %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onblur: "regexSubject();" }.merge(extra_option) %>
<% end %>
<span id="subject_span"></span>
</p> </p>
<p> <p>
<% unless replying %> <% unless replying %>
<% if @message.safe_attribute? 'sticky' %> <% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %> <%= f.check_box :sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %> <% end %>
<% if @message.safe_attribute? 'locked' %> <% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %> <%= f.check_box :locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %> <% end %>
<% end %> <% end %>
</p> </p>
<p> <p>
<label for="message_subject"><%= l(:field_description) %> <label for="message_subject">
<span class="required"> *&nbsp;&nbsp;</span></label> <%= l(:field_description) %>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <span class="required"> *&nbsp;&nbsp;</span>
<%= text_area :quote,:quote,:style => 'display:none' %> </label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %>
</p> </p>
<p> <p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();" %> <%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();", :maxlength => 5000 %>
<span id="message_content_span"></span> <span id="message_content_span"></span>
</p> </p>
<!--[eoform:message]-->
<p> <p>
<%= l(:label_attachment_plural) %> <%= l(:label_attachment_plural) %>
<br /> <br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %> <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</p> </p>
</div> </div>
<%#= wikitoolbar_for 'message_content' %>

View File

@ -1,9 +1,4 @@
<style type="text/css"> <style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.lz { .lz {
position: relative; position: relative;
min-height: 200px; min-height: 200px;
@ -63,7 +58,9 @@
<div class="lz"> <div class="lz">
<!-- 在这里添加赞和踩--> <!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span> <span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="contextual"> <div class="contextual">
<%= watcher_link(@topic, User.current) %> <%= watcher_link(@topic, User.current) %>
<%= link_to( <%= link_to(
@ -98,9 +95,11 @@
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 53%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"> <div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 53%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<% if @project %> <% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %> <%= label_tag l(:field_subject) %>:
<%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %> <% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %> <%= label_tag l(:field_subject) %>:
<%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %> <% end %>
</div> </div>
<div class="memo-content"> <div class="memo-content">
@ -108,15 +107,13 @@
<%= link_to_attachments @topic, :author => false %> <%= link_to_attachments @topic, :author => false %>
</div> </div>
<div class="memo-timestamp"> <div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div> <div style="float: left">
<%= authoring @topic.created_on, @topic.author %>
</div>
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div> <div style="float: right">
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
</div>
</div> </div>
</div> </div>
<br /> <br />
</div> </div>
@ -130,11 +127,11 @@
<% reply_count = 0 %> <% reply_count = 0 %>
<% @replies.each do |message| %> <% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>"> <div class="message reply" id="<%= "message-#{message.id}" %>">
<table class="borad-text-list"> <table class="borad-text-list">
<tr> <tr>
<!--<td class="font_lighter"> </td> --> <td rowspan="3" valign="top" width="60px">
<td rowspan="3" valign="top" width="60px"><%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %></td> <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
</td>
<td> <td>
<div class="contextual-borad"> <div class="contextual-borad">
<%= link_to( <%= link_to(
@ -164,37 +161,58 @@
<td class="comments"> <td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable message,:content,:attachments => message.attachments %> <%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div> </div>
<%= link_to_attachments message, :author => false %> </td> <%= link_to_attachments message, :author => false %>
</td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float: left"><%= authoring message.created_on, message.author %></td> <td class="font_lighter" style="float: left">
<%= authoring message.created_on, message.author %>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<% end %> <% end %>
<div class="pagination"> <div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %> <%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div> </div>
<% end %> <% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %> <% if !@topic.locked? && authorize_for('messages', 'reply') %>
<div id="reply" style="display:none;"> <div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%= submit_tag l(:button_submit) %> <input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>
<% end %> <% end %>
<% html_title @topic.subject %> <% html_title @topic.subject %>
<script type="text/javascript"> <script type="text/javascript">
var flag = false;
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
transpotUrl('#content'); transpotUrl('#content');
}); });
function submit_message_replay()
{
if(flag)
{
$("#message-form").submit();
}
}
function regexContent()
{
var content = $.trim($("#message_content").val());
if(content.length ==0)
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
flag = true;
}
}
</script> </script>

View File

@ -35,7 +35,9 @@
<%= call_hook(:view_my_account_contextual, :user => @user) %> <%= call_hook(:view_my_account_contextual, :user => @user) %>
</div> </div>
<h3 style="padding-left: 10px;"><%= l(:label_my_account) %></h3> <h3 style="padding-left: 10px;">
<%= l(:label_my_account) %>
</h3>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<fieldset class="box" style="margin:10px;"> <fieldset class="box" style="margin:10px;">
<%= labelled_form_for :user, @user, <%= labelled_form_for :user, @user,
@ -68,17 +70,22 @@
<span id='name' style='display:none'> <span id='name' style='display:none'>
<p style="width:530px;padding-left: 26px;"> <p style="width:530px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %> <%= f.text_field :lastname, :required => true %>
<span class='font_lighter'><%= l(:field_lastname_eg) %></span> <span class='font_lighter'>
<%= l(:field_lastname_eg) %>
</span>
</p> </p>
<p style="width:530px;padding-left: 26px;"> <p style="width:530px;padding-left: 26px;">
<%= f.text_field :firstname, :required => true %> <%= f.text_field :firstname, :required => true %>
<span class='font_lighter'><%= l(:field_firstname_eg) %></span> <span class='font_lighter'>
<%= l(:field_firstname_eg) %>
</span>
</p> </p>
</span> </span>
<span id='enterprise' style='display:none'> <span id='enterprise' style='display:none'>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 26px;">
<%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %> <%= l(:label_company_name)%>
<%= text_field_tag :enterprise_name, @user.firstname %>
</p> </p>
</span> </span>
@ -171,6 +178,7 @@
<% city = User.current.user_extensions.location_city %> <% city = User.current.user_extensions.location_city %>
<% identity = User.current.user_extensions.identity %> <% identity = User.current.user_extensions.identity %>
<% title = User.current.user_extensions.technical_title %> <% title = User.current.user_extensions.technical_title %>
<% language = User.current.language %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$().ready(function () { $().ready(function () {
var province = "<%= "#{province}" %>" var province = "<%= "#{province}" %>"
@ -178,7 +186,8 @@
init_province_and_city(document.getElementById('userProvince'), province, document.getElementById('userCity'), city); init_province_and_city(document.getElementById('userProvince'), province, document.getElementById('userCity'), city);
var identity = "<%= "#{identity}" %>" var identity = "<%= "#{identity}" %>"
var title = "<%= "#{title}" %>" var title = "<%= "#{title}" %>"
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title); var language = "<%= "#{language}" %>"
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
}); });
</script> </script>
@ -230,11 +239,19 @@
<% unless @user.user_extensions.identity == 2 %> <% unless @user.user_extensions.identity == 2 %>
<p style="width:400px;padding-left: 26px;"> <p style="width:400px;padding-left: 26px;">
<%= l(:label_identity) %> <%= l(:label_identity) %>
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location"> <select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value=""><%= l(:label_account_identity_choose) %></option> <option value="">
<option value="0"><%= l(:label_account_identity_teacher) %></option> <%= l(:label_account_identity_choose) %>
<option value="1"><%= l(:label_account_identity_student) %></option> </option>
<option value="3"><%= l(:label_account_identity_developer) %></option> <option value="0">
<%= l(:label_account_identity_teacher) %>
</option>
<option value="1">
<%= l(:label_account_identity_student) %>
</option>
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select> </select>
<span id='technical_title' style='display:none'> <span id='technical_title' style='display:none'>
@ -243,9 +260,9 @@
<span id='no' style='display:none'> <span id='no' style='display:none'>
<!-- modified by fq --> <!-- modified by fq -->
<% unless User.current.user_extensions.student_id.nil? %> <% unless User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %> <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
<% else %> <% else %>
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span> <%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
<% end %> <% end %>
<!-- end --> <!-- end -->
</span> </span>
@ -254,11 +271,21 @@
<p> <p>
<span style="display:none"> <span style="display:none">
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location"> <select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
<option value=""><%= l(:label_account_identity_choose) %></option> <option value="">
<option value="0"><%= l(:label_account_identity_teacher) %></option> <%= l(:label_account_identity_choose) %>
<option value="1"><%= l(:label_account_identity_student) %></option> </option>
<option value="2"><%= l(:label_account_identity_enterprise) %></option> <option value="0">
<option value="3"><%= l(:label_account_identity_developer) %></option> <%= l(:label_account_identity_teacher) %>
</option>
<option value="1">
<%= l(:label_account_identity_student) %>
</option>
<option value="2">
<%= l(:label_account_identity_enterprise) %>
</option>
<option value="3">
<%= l(:label_account_identity_developer) %>
</option>
</select> </select>
</span> </span>
</p> </p>
@ -267,7 +294,9 @@
<% if Setting.openid? %> <% if Setting.openid? %>
<p> <%= f.text_field :identity_url %> </p> <p>
<%= f.text_field :identity_url %>
</p>
<% end %> <% end %>
<% @user.custom_field_values.select(&:editable?).each do |value| %> <% @user.custom_field_values.select(&:editable?).each do |value| %>
@ -499,15 +528,55 @@
} }
} }
} }
function init_identity_and_title(pField, identity, cField, title) { function init_identity_and_title(pField, identity, cField, title, language) {
for (var i = 0; i < pField.options.length; i++) { for (var i = 0; i < pField.options.length; i++) {
if (pField.options[i].value == identity) { if (pField.options[i].value == identity) {
pField.selectedIndex = i; pField.selectedIndex = i;
} }
} }
showtechnical_title(identity, cField); showtechnical_title(identity, cField);
if(language == 'zh') {
switch (title) {
case 'Professor' :
title1 = '教授';
break;
case 'Associate professor' :
title1 = '副教授';
break;
case 'Lecturer' :
title1 = '讲师';
break;
case 'Teaching assistant' :
title1 = '助教';
break;
default :
title1 = title;
break;
}
}
else {
switch (title) {
case '教授' :
title1 = 'Professor';
break;
case '副教授' :
title1 = 'Associate professor';
break;
case '讲师' :
title1 = 'Lecturer';
break;
case '助教' :
title1 = 'Teaching assistant';
break;
default :
title1 = title;
break;
}
}
for (var i = 0; i < cField.options.length; i++) { for (var i = 0; i < cField.options.length; i++) {
if (cField.options[i].value == title) { if (cField.options[i].value == title1) {
cField.selectedIndex = i; cField.selectedIndex = i;
} }
} }

View File

@ -8,7 +8,7 @@
<% if params[:project_type] == "1" %> <% if params[:project_type] == "1" %>
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf""><%= l(:label_course_practice) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2">
<% if User.current.logged?%> <% if User.current.logged?%>
@ -33,7 +33,7 @@
<% else %> <% else %>
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf""><%= l(:label_project_deposit) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2">
<% if User.current.logged? %> <% if User.current.logged? %>

View File

@ -25,7 +25,7 @@
<tbody> <tbody>
<% for version in @project.shared_versions.sort %> <% for version in @project.shared_versions.sort %>
<tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>"> <tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>">
<td class="name"> <td class="name" title="<%= link_to_version version %>">
<%= link_to_version version %> <%= link_to_version version %>
</td> </td>
<td class="date"> <td class="date">

View File

@ -1,28 +1,28 @@
<%= javascript_tag do %> <%= javascript_tag do %>
var operatorLabels = <%= raw_json Query.operators_labels %>; var operatorLabels = <%= raw_json Query.operators_labels %>;
var operatorByType = <%= raw_json Query.operators_by_filter_type %>; var operatorByType = <%= raw_json Query.operators_by_filter_type %>;
var availableFilters = <%= raw_json query.available_filters_as_json %>; var availableFilters = <%= raw_json query.available_filters_as_json %>;
var labelDayPlural = <%= raw_json l(:label_day_plural) %>; var labelDayPlural = <%= raw_json l(:label_day_plural) %>;
var allProjects = <%= raw query.all_projects_values.to_json %>; var allProjects = <%= raw query.all_projects_values.to_json %>;
$(document).ready(function(){ $(document).ready(function(){
initFilters(); initFilters();
<% query.filters.each do |field, options| %> <% query.filters.each do |field, options| %>
addFilter("<%= field %>", <%= raw_json query.operator_for(field) %>, <%= raw_json query.values_for(field) %>); addFilter("<%= field %>", <%= raw_json query.operator_for(field) %>, <%= raw_json query.values_for(field) %>);
<% end %> <% end %>
}); });
<% end %> <% end %>
<table style="width:100%"> <table style="width:100%">
<tr> <tr>
<td> <td>
<table id="filters-table"> <table id="filters-table">
</table> </table>
</td> </td>
<td class="add-filter"> <td class="add-filter">
<%= label_tag('add_filter_select', l(:label_filter_add)) %> <%= label_tag('add_filter_select', l(:label_filter_add)) %>
<%= select_tag 'add_filter_select', filters_options_for_select(query), :name => nil %> <%= select_tag 'add_filter_select', filters_options_for_select(query), :name => nil %>
</td> </td>
</tr> </tr>
</table> </table>
<%= hidden_field_tag 'f[]', '' %> <%= hidden_field_tag 'f[]', '' %>
<% include_calendar_headers_tags %> <% include_calendar_headers_tags %>

View File

@ -17,15 +17,17 @@
:revisions => @changesets, :revisions => @changesets,
:entry => nil } %> :entry => nil } %>
<div class="pagination"><%= pagination_links_full @changeset_pages,@changeset_count %></div> <div class="pagination">
<%= pagination_links_full @changeset_pages,@changeset_count %>
</div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>
<%= auto_discovery_link_tag( <%= auto_discovery_link_tag(
:atom, :atom,
params.merge( params.merge(
{:format => 'atom', :page => nil, :key => User.current.rss_key})) %> {:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<% end %> <% end %>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>

View File

@ -7,79 +7,93 @@
<%= render :partial => 'breadcrumbs', <%= render :partial => 'breadcrumbs',
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %> :locals => { :path => @path, :kind => 'dir', :revision => @rev } %>
<div style="font-size:15px;"> <div style="font-size:15px;">
<%if @repository.type.to_s=="Repository::Git"%> <%if @repository.type.to_s=="Repository::Git"%>
<%= @repos_url%> <%= @repos_url%>
<%else %> <%else %>
<td><%=h @repository.url %></td> <td>
<% end %> <%=h @repository.url %>
</td>
<% end %>
</div> </div>
<p style=" word-wrap: break-word; word-break: break-all"> <p style=" word-wrap: break-word; word-break: break-all">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo| (<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
link_to h(repo.name), link_to h(repo.name),
{:controller => 'repositories', :action => 'show', {:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : '') :class => 'repository' + (repo == @repository ? ' selected' : '')
}.join('&nbsp|&nbsp').html_safe %>)</p> }.join('&nbsp|&nbsp').html_safe %>)
<h3>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</h3> </p>
<h3>建立版本库文件夹,打开命令行执行如下:</h3> <h3>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</h3>
<div class="repos_explain"> <h3>建立版本库文件夹,打开命令行执行如下:</h3>
<p>git init</p> <div class="repos_explain">
<p>git add *</p> <p>git init</p>
<p>git commit -m "first commit"</p> <p>git add *</p>
<p>git remote add origin <%= @repos_url%></p> <p>git commit -m "first commit"</p>
<p>git remote add origin
<%= @repos_url%>
</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p> <p>git push -u origin master:master</p>
</div> </div>
<h3>已经有本地库,还没有配置远程地址,打开命令行执行如下:</h3> <h3>已经有本地库,还没有配置远程地址,打开命令行执行如下:</h3>
<div class="repos_explain"> <div class="repos_explain">
<p>git remote add origin <%= @repos_url%></p> <p>git remote add origin <%= @repos_url%></p>
<p>git add .</p> <p>git add .</p>
<p>git commit -m "first commit"</p> <p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p> <p>git push -u origin master:master</p>
</div> </div>
<h3>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git clone <%= @repos_url%></p>
<p>git push</p>
<p>git checkout -b branch_name</p>
<p>git push origin branch_name</p>
</div>
</h3> </h3>
<h3>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</h3> <h3>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</h3>
<div class="repos_explain"> <div class="repos_explain">
<p>git remote add trustie <%= @repos_url%></p> <p>git remote add trustie
<p>git add .</p> <%= @repos_url%>
<p>git commit -m "first commit"</p> </p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git add .</p>
<p>git push -u trustie master:master</p> <p>git commit -m "first commit"</p>
<p><%= link_to "李海提供", user_path(646)%></p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
</div> <p>git push -u trustie master:master</p>
</h3> <p><%= link_to "李海", user_path(646)%>提供</p>
</div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %> <%= render :partial => 'dir_list' %>
<% end %> <% end %>
<%= render_properties(@properties) %> <%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %> <% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %> <% if @changesets && !@changesets.empty? %>
<h3><%= l(:label_latest_revision_plural) %></h3> <h3>
<%= l(:label_latest_revision_plural) %>
</h3>
<%= render :partial => 'revisions', <%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path, :locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil }%> :revisions => @changesets, :entry => nil }%>
<% end %> <% end %>
<p> <p>
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = '' %> sep = '' %>
<% if @repository.supports_all_revisions? && @path.blank? %> <% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project, <%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project,
:repository_id => @repository.identifier_param %> :repository_id => @repository.identifier_param %>
<% sep = '|' %> <% sep = '|' %>
<% end %> <% end %>
<% if @repository.supports_directory_revisions? && <% if @repository.supports_directory_revisions? && ( has_branches || !@path.blank? || !@rev.blank? ) %>
( has_branches || !@path.blank? || !@rev.blank? ) %> <%= sep %>
<%= sep %> <%= link_to l(:label_view_revisions),
<%= link_to l(:label_view_revisions), :action => 'changes',
:action => 'changes', :path => to_path_param(@path),
:path => to_path_param(@path), :id => @project,
:id => @project, :repository_id => @repository.identifier_param,
:repository_id => @repository.identifier_param, :rev => @rev %>
:rev => @rev %> <% end %>
<% end %>
</p> </p>
<% if @repository.supports_all_revisions? %> <% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
@ -99,7 +113,15 @@
<% end %> <% end %>
<!-- added by bai --> <!-- added by bai -->
<strong><span style="color: #099;"><%= l(:label_how_commit_code) %></span></strong>&nbsp;<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "usage")%>&nbsp;|&nbsp;<%= link_to('English', en_usage_path, :class => "usage")%> <strong>
<span style="color: #099;">
<%= l(:label_how_commit_code) %>
</span>
</strong>
&nbsp;
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "usage")%>
&nbsp;|&nbsp;
<%= link_to('English', en_usage_path, :class => "usage")%>
<!-- end --> <!-- end -->

View File

@ -1,26 +1,26 @@
<%= form_tag({:action => 'edit', :tab => 'projects'}) do %> <%= form_tag({:action => 'edit', :tab => 'projects'}) do %>
<div class="box tabular settings"> <div class="box tabular settings">
<p> <p>
<%= setting_check_box :default_projects_public %> <%= setting_check_box :default_projects_public %>
</p> </p>
<p> <p>
<%= setting_multiselect(:default_projects_modules, <%= setting_multiselect(:default_projects_modules,
Redmine::AccessControl.available_project_modules.collect {|m| [l_or_humanize(m, :prefix => "project_module_"), m.to_s]}) %> Redmine::AccessControl.available_project_modules.collect {|m| [l_or_humanize(m, :prefix => "project_module_"), m.to_s]}) %>
</p> </p>
<p> <p>
<%= setting_multiselect(:default_projects_tracker_ids, Tracker.sorted.all.collect {|t| [t.name, t.id.to_s]}) %> <%= setting_multiselect(:default_projects_tracker_ids, Tracker.sorted.all.collect {|t| [t.name, t.id.to_s]}) %>
</p> </p>
<p> <p>
<%= setting_check_box :sequential_project_identifiers %> <%= setting_check_box :sequential_project_identifiers %>
</p> </p>
<p style="display: none;"><%= setting_select :new_project_user_role_id, Role.find_all_givable.collect {|r| [r.name, r.id.to_s]}, <p style="display: none;"><%= setting_select :new_project_user_role_id, Role.find_all_givable.collect {|r| [r.name, r.id.to_s]},
:blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %> :blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %>
</p> </p>
</div> </div>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -71,7 +71,7 @@
<!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> --> <!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> -->
<div style="overflow: hidden"> <div style="overflow: hidden">
<div style="margin-left: 15%; float: left"> <div style="margin-left: 15%; float: left">
<div style="padding-left: 45px; padding-bottom: 5px"><%=l(:label_work_scores_proportion)%></div> <div style="padding-left: 45px; padding-bottom: 5px"><%=l(:label_work_scores_people)%></div>
<div> <div>
<% 100.step(20, -20) do |star| %> <% 100.step(20, -20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;"> <div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">

View File

@ -5,14 +5,14 @@
<% i += 1 %> <% i += 1 %>
<li> <li>
<%= link_to image_tag("/images/sidebar/add.png"),:action => "index", <%= link_to image_tag("/images/sidebar/add.png"),:action => "index",
:current_selected_tags => selected_tags,:tag => rt,:do_what => "1", :current_selected_tags => selected_tags,:tag => rt.id,:do_what => "1",
:obj_id => obj_id,:object_flag => obj_flag %> :obj_id => obj_id,:object_flag => obj_flag %>
<span id="tag"> <span id="tag">
<%= rt %> <%= rt.name %>
</span> </span>
<% break if i >= 10 %> <% break if i >= 10 %>
<!-- 这里用例计数某类对象的所有该tag总数 --> <!-- 这里用例计数某类对象的所有该tag总数 -->
<%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => rt }%> <%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => rt,:selected_tag_ids => related_tag_ids }%>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@ -3,10 +3,10 @@
<% for sg in selected_tags %> <% for sg in selected_tags %>
<li> <li>
<%= link_to image_tag("/images/sidebar/minus.png"),:action => "index", <%= link_to image_tag("/images/sidebar/minus.png"),:action => "index",
:current_selected_tags => selected_tags ,:tag => sg,:do_what => "0", :current_selected_tags => selected_tags ,:tag => sg.id,:do_what => "0",
:obj_id => obj_id,:object_flag => obj_flag %> :obj_id => obj_id,:object_flag => obj_flag %>
<span id="tag"><%= sg %> </span> <span id="tag"><%= sg.name %> </span>
<%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => sg }%> <%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => sg ,:selected_tag_ids => @selected_tag_ids}%>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@ -1,14 +1,14 @@
<% case show_flag%> <% case show_flag%>
<% when '1' then %> <% when '1' then %>
(<%= User.tagged_with("#{sg}").size %>) (<%= User.tagged_with("#{sg.name}",{},selected_tag_ids).size %>)
<%when '2' then %> <%when '2' then %>
(<%= Project.tagged_with(sg).size %>) (<%= Project.tagged_with(sg.name,{},selected_tag_ids).size %>)
<% when '3' then %> <% when '3' then %>
(<%= Issue.tagged_with("#{sg}").size %>) (<%= Issue.tagged_with("#{sg.name}",{},selected_tag_ids).size %>)
<% when '4' then %> <% when '4' then %>
(<%= Bid.tagged_with("#{sg}").size %>) (<%= Bid.tagged_with("#{sg.name}",{},selected_tag_ids).size %>)
<% when '5' then %> <% when '5' then %>
(<%= Forum.tagged_with("#{sg}").size %>) (<%= Forum.tagged_with("#{sg.name}",{},selected_tag_ids).size %>)
<% when '6' then %> <% when '6' then %>
(<%= Attachment.tagged_with("#{sg}").size %>) (<%= Attachment.tagged_with("#{sg.name}",{},selected_tag_ids).size %>)
<% end %> <% end %>

View File

@ -8,7 +8,7 @@
// }) // })
</script> </script>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 9代表课程--> <!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 9代表课程-->
<% @tags = obj.reload.tag_list %> <% @tags = obj.reload.tags %>
<% if non_list_all and (@tags.size > 0) %> <% if non_list_all and (@tags.size > 0) %>
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 --> <!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->

View File

@ -3,13 +3,13 @@
<h3><strong><%= l(:label_tags_selected) %></strong></h3> <h3><strong><%= l(:label_tags_selected) %></strong></h3>
<div id="selected_tags"> <div id="selected_tags">
<%= render :partial => "selected_tags",:locals => { <%= render :partial => "selected_tags",:locals => {
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%> :selected_tags => @selected_tag_objs,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div> </div>
<h3><strong><%= l(:label_tags_related) %></strong></h3> <h3><strong><%= l(:label_tags_related) %></strong></h3>
<div id="related_tags"> <div id="related_tags">
<%= render :partial => "related_tags",:locals => {:related_tags => @related_tags, <%= render :partial => "related_tags",:locals => {:related_tags => @related_tag_objs,
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%> :selected_tags => @selected_tag_ids,:related_tag_ids => @related_tag_ids,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div> </div>
</div> </div>
<% end %> <% end %>

View File

@ -15,11 +15,12 @@
<% if User.current == @user %> <% if User.current == @user %>
<% (membership.roles).each do |role| %> <% (membership.roles).each do |role| %>
<% unless (role == Role.find(9) || role == Role.find(3)) %> <% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.course, User.current) %>&nbsp;&nbsp;&nbsp;&nbsp; <%= join_in_course(membership.course, User.current) %>
<% end %> <% end %>
<% end %> <% end %>
<% else %> <% else %>
<% end %> <% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %> <%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
(<%= "#{membership.course.members.count}" %>)&nbsp;&nbsp; (<%= "#{membership.course.members.count}" %>)&nbsp;&nbsp;
<%= l(:label_homework) %> <%= l(:label_homework) %>

View File

@ -3,10 +3,10 @@
<div class="box tabular"> <div class="box tabular">
<p style="margin-left:-10px;"> <p style="margin-left:-10px;">
<%= f.text_field :name, :size => 60, :required => true %> <%= f.text_field :name, :maxlength => 60, :required => true %>
</p> </p>
<p style="margin-left:-20px;"> <p style="margin-left:-20px;">
<%= f.text_field :description, :size => 60, :style => "margin-left:10px;" %> <%= f.text_field :description, :maxlength => 100, :style => "margin-left:10px;" %>
</p> </p>
<p style="margin-left:-20px;"> <p style="margin-left:-20px;">
<span style="margin-left:10px;"> <span style="margin-left:10px;">
@ -15,7 +15,7 @@
</p> </p>
<p style="margin-left:-20px;"> <p style="margin-left:-20px;">
<span style="margin-left:10px;"> <span style="margin-left:10px;">
<%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %> <%= f.text_field :wiki_page_title, :label => :label_wiki_page, :disabled => @project.wiki.nil? %>
</span> </span>
</p> </p>
<p style="margin-left:-20px;"> <p style="margin-left:-20px;">

View File

@ -1,6 +1,8 @@
<h3><%=l(:label_version_new)%></h3> <h3>
<%=l(:label_version_new)%>
</h3>
<%= labelled_form_for @version, :url => project_versions_path(@project) do |f| %> <%= labelled_form_for @version, :url => project_versions_path(@project) do |f| %>
<%= render :partial => 'versions/form', :locals => { :f => f } %> <%= render :partial => 'versions/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<% end %> <% end %>

View File

@ -1,301 +1,301 @@
<% <%
@nav_dispaly_contest_label = 1 @nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1 @nav_dispaly_store_all_label = 1
%> %>
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<style type="text/css"> <style type="text/css">
#up_zzjs{height:100px;overflow:hidden;} #up_zzjs{height:100px;overflow:hidden;}
</style> </style>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function clearInfo(id, content) { function clearInfo(id, content) {
var text = $('#' + id); var text = $('#' + id);
if (text.val() == content) { if (text.val() == content) {
$('#' + id).val(''); $('#' + id).val('');
} }
} }
$(function(){ $(function(){
$("#main").find("a").attr("target", "_blank"); $("#main").find("a").attr("target", "_blank");
setCss(); setCss();
}); });
//设置div居中 //设置div居中
function setCss() function setCss()
{ {
var mainBar = $('#main-content-bar')[0]; var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight; var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0]; var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight; var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#J_Slide')[0]; var searchbar = $('#J_Slide')[0];
var searchHeight = searchbar.offsetHeight; var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px"; welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px"; searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 ); //alert((topHeight - leftHeight)/2 );
} }
function showInfo(id, content) { function showInfo(id, content) {
var text = $('#' + id); var text = $('#' + id);
if (text.val() == '') { if (text.val() == '') {
$('#' + id).val(content); $('#' + id).val(content);
} }
} }
// 给主页用户弹新页面 // 给主页用户弹新页面
$(document).ready(function($) { $(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank"); $("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target"); //$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
}); });
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
(function (){ (function (){
window.onload = function(){ window.onload = function(){
function fixedBar(id, options){ function fixedBar(id, options){
var ele = document.getElementById(id); var ele = document.getElementById(id);
if(!ele) return; if(!ele) return;
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){ if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
var pageHeight=window.innerHeight; var pageHeight=window.innerHeight;
var d=document; var d=document;
if(typeof pageHeight!="number"){ if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){ if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight; pageHeight=document.documentElement.clientHeight;
}else{ }else{
pageHeight=document.body.clientHeight; pageHeight=document.body.clientHeight;
} }
} }
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop; var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
if(options.addclass) ele.className = options.addclass; if(options.addclass) ele.className = options.addclass;
ele.style.position= 'absolute'; ele.style.position= 'absolute';
if(options.show){ if(options.show){
ele.style.top = 0 + "px"; ele.style.top = 0 + "px";
ele.style.display= 'block'; ele.style.display= 'block';
} }
window.attachEvent('onscroll' , function (){ window.attachEvent('onscroll' , function (){
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop; var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
ele.style.top = 0 + "px"; ele.style.top = 0 + "px";
if(options.autoHidden){ if(options.autoHidden){
if(ieScrollTop==0){ if(ieScrollTop==0){
ele.style.display="none"; ele.style.display="none";
}else{ }else{
ele.style.display="block"; ele.style.display="block";
} }
} }
}); });
}else{ }else{
var ele = document.getElementById(id); var ele = document.getElementById(id);
if(typeof pageHeight!="number"){ if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){ if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight; pageHeight=document.documentElement.clientHeight;
}else{ }else{
pageHeight=document.body.clientHeight; pageHeight=document.body.clientHeight;
} }
} }
if(options.show) ele.style.display= 'block'; if(options.show) ele.style.display= 'block';
ele.style.top = 0 +'px'; ele.style.top = 0 +'px';
window.addEventListener('scroll',function (){ window.addEventListener('scroll',function (){
if(options.autoHidden){ if(options.autoHidden){
if(baidu.page.getScrollTop()==0){ if(baidu.page.getScrollTop()==0){
ele.style.display="none"; ele.style.display="none";
}else{ }else{
ele.style.display="block"; ele.style.display="block";
} }
} }
},false); },false);
} }
} }
fixedBar('backTopBtn' , {autoHidden: true, top : 186}); fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true}); fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
//修改微信扫码样式布局后添加微信扫码跟随滚动处理 //修改微信扫码样式布局后添加微信扫码跟随滚动处理
$(window).scroll(function(){ $(window).scroll(function(){
var vtop=$(document).scrollTop(); var vtop=$(document).scrollTop();
$("#identifier-pannel").css('top',vtop+"px"); $("#identifier-pannel").css('top',vtop+"px");
}) })
} }
})(); })();
</script> </script>
<div class='top_bar'> <div class='top_bar'>
<%#= render partial: 'wei_xin' %> <%#= render partial: 'wei_xin' %>
<div class="main-content-bar" id="main-content-bar"> <div class="main-content-bar" id="main-content-bar">
<!--文字--> <!--文字-->
<div style="float: left;padding-left:15px;"> <div style="float: left;padding-left:15px;">
<% if get_avatar?(@contest_page) %> <% if get_avatar?(@contest_page) %>
<%= image_tag(url_to_avatar(@contest_page), width:@contest_page.image_width,height: @contest_page.image_height) %> <%= image_tag(url_to_avatar(@contest_page), width:@contest_page.image_width,height: @contest_page.image_height) %>
<% else %> <% else %>
<%= image_tag '/images/transparent.png', width:@contest_page.image_width,height: @contest_page.image_height %> <%= image_tag '/images/transparent.png', width:@contest_page.image_width,height: @contest_page.image_height %>
<% end %> <% end %>
</div> </div>
<div class="welcome_left" id="welcome_left"> <div class="welcome_left" id="welcome_left">
<% unless @contest_page.nil? %> <% unless @contest_page.nil? %>
<span class="font_welcome_trustie"><%= @contest_page.title %></span> <span class="font_welcome_tdescription">, <%= @contest_page.description %></span> <span class="font_welcome_trustie"><%= @contest_page.title %></span> <span class="font_welcome_tdescription">, <%= @contest_page.description %></span>
<% end %> <% end %>
</div> </div>
<!--搜索框--> <!--搜索框-->
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %> <%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<%= text_field_tag 'name', params[:name], :placeholder => l(:label_search_intimation), name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%> <%= text_field_tag 'name', params[:name], :placeholder => l(:label_search_intimation), name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%>
&nbsp; &nbsp;
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %> <%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<% end %> <% end %>
<!-- <div class='font_lighter' style="display: inline-block; margin-top:3px;">竞赛相关内容搜索,如竞赛题目,参赛题目,参赛人名等。</div> --> <!-- <div class='font_lighter' style="display: inline-block; margin-top:3px;">竞赛相关内容搜索,如竞赛题目,参赛题目,参赛人名等。</div> -->
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-left" > <div id="J_Slide" class="d-p-index-box d-p-index-left" >
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_hot_contest)%></strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_hot_contest)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"> <span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %>
<% end %> <% end %>
<% end %> <% end %>
&nbsp;&nbsp; &nbsp;&nbsp;
<%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %> <%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %>
</span> </span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<div class="d-p-projectlist"> <div class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %> <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'> <li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4" style="float: left; margin-top: 7px"> <div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/contest1.png')%> <%= image_tag('/images/contest1.png')%>
</div> </div>
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;"> <div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span> <span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% else %> <% else %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span> <span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% end %> <% end %>
</div> </div>
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;" class="text_nowrap"> <div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;" class="text_nowrap">
<span class='font_lighter' title ='<%=contest.description%>'><%=contest.description.truncate(100, omission: '...')%></span> <span class='font_lighter' title ='<%=contest.description%>'><%=contest.description.truncate(100, omission: '...')%></span>
</div><br /> </div><br />
<div style="padding-left: 57px; clear: left;"> <div style="padding-left: 57px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time contest.created_on %></span> <span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time contest.created_on %></span>
</div> </div>
</li> </li>
<% end; reset_cycle %> <% end; reset_cycle %>
</div> </div>
</div> </div>
</div> </div>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic"> <div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;"> <h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_notification)%></strong> <strong><%=l(:label_notification)%></strong>
</h3> </h3>
<ul class="contest-notification-list"> <ul class="contest-notification-list">
<% @contest_notifications.each do |notification| %> <% @contest_notifications.each do |notification| %>
<li> <li>
<div class="inner-right" style="float: left; margin-top: 7px "> <div class="inner-right" style="float: left; margin-top: 7px ">
<%= link_to image_tag(url_to_avatar(notification.author), :class => "avatar"), user_path(notification.author) %> <%= link_to image_tag(url_to_avatar(notification.author), :class => "avatar"), user_path(notification.author) %>
</div> </div>
<div class="font_lighter" style="padding-top: 7px;padding-left: 55px;" title="<%= notification.title%>"> <div class="font_lighter" style="padding-top: 7px;padding-left: 55px;" title="<%= notification.title%>">
<span> <span>
<strong><%= link_to_user(notification.author) %></strong> <strong><%= link_to_user(notification.author) %></strong>
<%= l(:label_project_notice) %> <%= l(:label_project_notice) %>
<%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %> <%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
</span> </span>
</div> </div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>"><%= notification.description.truncate(30, omission: '...') %></div> <div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>"><%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></div> <div class="font_lighter" style="padding-left: 55px;"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic"> <div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;"> <h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_issue_feedback_activities)%></strong> <strong><%=l(:label_issue_feedback_activities)%></strong>
<%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> <%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> <%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3> </h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), forums_path %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), forums_path %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%> <% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px "> <li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
<div style="display: inline-block; width: 100%;"> <div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %> <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
</span> </span>
<div class='memo_activity memo_attr'> <div class='memo_activity memo_attr'>
<span class='memo_timestamp'> <span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span> </span>
<span class="memo_author"> <span class="memo_author">
<%=l(:label_question_sponsor)%>:&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> <%=l(:label_question_sponsor)%>:&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span> </span>
<span class="memo_last_person"> <span class="memo_last_person">
<%=l(:label_final_reply)%>:&nbsp;<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> <%=l(:label_final_reply)%>:&nbsp;<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
</span> </span>
<span class="memo_reply"> <span class="memo_reply">
<%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>) <%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span> </span>
</div> </div>
</div> </div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
</div> </div>
<div id="J_Slide" class="d-p-index-box d-p-index-left"> <div id="J_Slide" class="d-p-index-box d-p-index-left">
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), {:controller => 'softapplications', :action => 'index'}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), {:controller => 'softapplications', :action => 'index'}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<% if Softapplication.count > 0%> <% if Softapplication.count > 0%>
<div class="d-p-projectlist"> <div class="d-p-projectlist">
<% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %> <% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'> <li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4" style="float: left; margin-top: 7px"> <div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/app1.png')%> <%= image_tag('/images/app1.png')%>
</div> </div>
<div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;"> <div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %> <%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</div> </div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;"> <div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.to_s.truncate(50, omission: '...')%></span> <span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.to_s.truncate(50, omission: '...')%></span>
</div><br /> </div><br />
<div style="padding-left: 55px; clear: left;"> <div style="padding-left: 55px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time softapplication.created_at %></span> <span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time softapplication.created_at %></span>
</div> </div>
</li> </li>
<% end; reset_cycle %> <% end; reset_cycle %>
</div> </div>
<% else %> <% else %>
<p class="font_lighter"><%= l(:label_no_ftapplication) %></p> <p class="font_lighter"><%= l(:label_no_ftapplication) %></p>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<%= render partial: 'link_to_another' %> <%= render partial: 'link_to_another' %>

View File

@ -1,193 +1,205 @@
<% @nav_dispaly_project_label = 1 <% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %> @nav_dispaly_forum_label = 1 %>
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %> <%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(function(){ $(function(){
$("#main").find("a").attr("target", "_blank"); $("#main").find("a").attr("target", "_blank");
setCss(); setCss();
}); });
//设置div居中 //设置div居中
function setCss() function setCss()
{ {
var mainBar = $('#main-content-bar')[0]; var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight; var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0]; var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight; var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#search-bar')[0]; var searchbar = $('#search-bar')[0];
var searchHeight = searchbar.offsetHeight; var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px"; welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px"; searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 ); //alert((topHeight - leftHeight)/2 );
} }
// 给主页用户弹新页面 // 给主页用户弹新页面
$(document).ready(function($) { $(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank"); $("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target"); //$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
}); });
</script> </script>
<div class='top_bar'> <div class='top_bar'>
<%#= render partial: 'wei_xin' %> <%#= render partial: 'wei_xin' %>
<div class="main-content-bar" id="main-content-bar"> <div class="main-content-bar" id="main-content-bar">
<div style="float: left;padding-left:15px "> <div style="float: left;padding-left:15px ">
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> --> <!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
<% if get_avatar?(@first_page) %> <% if get_avatar?(@first_page) %>
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %> <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
<% else %> <% else %>
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %> <%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
<% end %> <% end %>
</div> </div>
<div class="welcome_left" id="welcome_left"> <div class="welcome_left" id="welcome_left">
<% unless @first_page.nil? %> <% unless @first_page.nil? %>
<%= @first_page.description.html_safe %> <%= @first_page.description.html_safe %>
<% end %> <% end %>
</div> </div>
<div class="search-bar" id="search-bar"> <div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%> <%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hot"> <div id="J_Slide" class="d-p-index-box d-p-index-hot">
<h3 style="margin-left: 5px; color: #e8770d;"> <h3 style="margin-left: 5px; color: #e8770d;">
<strong><%= l(:lable_hot_projects)%></strong> <strong>
</h3> <%= l(:lable_hot_projects)%>
<span style="margin-top: -20px;float: right; display: block;"> </strong>
<% if User.current.logged? %> </h3>
<%= link_to(l(:label_project_new), {:controller => 'projects', <span style="margin-top: -20px;float: right; display: block;">
:action => 'new', <% if User.current.logged? %>
:course => 0, <%= link_to(l(:label_project_new), {:controller => 'projects',
:project_type =>( @project_type||=0)}, :action => 'new',
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> :course => 0,
<% end %> :project_type =>( @project_type||=0)},
&nbsp;&nbsp; :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<%= link_to l(:label_more), { :controller => 'projects', <% end %>
:action => 'index', &nbsp;&nbsp;
:project_type => 0, <%= link_to l(:label_more), { :controller => 'projects',
:host => Setting.project_domain}, :action => 'index',
:target => "_blank" %> :project_type => 0,
</span> :host => Setting.project_domain},
<div class="d-p-projectlist-box"> :target => "_blank" %>
<ul class="d-p-projectlist"> </span>
<% @projects.map do |project| %> <div class="d-p-projectlist-box">
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'> <ul class="d-p-projectlist">
<div style="float: left;"> <% @projects.map do |project| %>
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %> <li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
</div> <div style="float: left;">
<!-- 上左下右 --> <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
<div style="float: left; margin-left: 10px; width: 380px;"> </div>
<% unless project.is_public %> <!-- 上左下右 -->
<span class="private_project"><%= l(:label_private) %></span> <div style="float: left; margin-left: 10px; width: 380px;">
<% end %> <% unless project.is_public %>
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <span class="private_project">
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>) <%= l(:label_private) %>
</div> </span>
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;"> <% end %>
<span class='font_lighter' title ='<%=project.short_description%>'> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
<%=project.description.truncate(100, omission: '...')%> (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
</span> </div>
</div> <div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
<div > <span class='font_lighter' title ='<%=project.short_description%>'>
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s, <%=project.description.truncate(90, omission: '...')%>
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", </span>
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", </div>
:class => "tooltip", <div >
:id => "tooltip-#{project.id}" %> <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
</div> :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
</li> :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
<!--<%#end %> --> :class => "tooltip",
<% end; reset_cycle %> :id => "tooltip-#{project.id}" %>
</ul> </div>
</div> </li>
</div> <!--<%#end %> -->
<% end; reset_cycle %>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic"> </ul>
<ul class="user-welcome-message-list"> </div>
<h3 style="color: rgb(21, 188, 207)"><strong><%= l(:lable_user_active)%></strong></h3> </div>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;"> <div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<%activities = find_all_activities%> <ul class="user-welcome-message-list">
<% activities.each do |event| %> <h3 style="color: rgb(21, 188, 207)">
<!--<%# cache cache_key_for_event(event) do %> --> <strong>
<li style="display: block;height:60px; padding-bottom: 4px;"> <%= l(:lable_user_active)%>
<div class="inner-right" style="float: left; height: 100%; "> </strong>
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> </h3>
</div> <span style="margin-top: -20px;float: right; display: block;">
<%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %>
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" > </span>
<span style="color: green;"> <div class="user-message-box-list" style="margin-top: 10px;">
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author), <%activities = find_all_activities%>
:style => "color:green;", :target => "_blank" %> <% activities.each do |event| %>
</span> <li style="display: block;height:60px; padding-bottom: 4px;">
<%= show_user_content event %> <div class="inner-right" style="float: left; height: 100%; ">
<p style="margin-top: 4px;"> <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
<span style="color: rgb(172, 174, 177)"> </div>
<%= l(:field_updated_on) %> <div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
<%= time_tag_welcome event.event_datetime %>前 <span style="color: green;">
</span> <%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :style => "color:green;", :target => "_blank" %>
<span style="float: right; color: rgb(172, 174, 177);"> </span>
<%= show_event_reply event %> <%= show_user_content event %>
</span> <p style="margin-top: 4px;">
</p> <span style="color: rgb(172, 174, 177)">
</div> <%= l(:field_updated_on) %>
</li> <%= time_tag_welcome event.event_datetime %>前
<% end %> </span>
</div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</ul> <span style="float: right; color: rgb(172, 174, 177);">
</div> <%= show_event_reply event %>
</span>
<div class="right" style="float: right; width: 48%; "> </p>
<ul class="welcome-message-list"> </div>
<!--<%# cache 'forum_links' do %> --> </li>
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;"> <% end %>
<h3 style="color: rgb(21, 188, 207);"> </div>
<strong><%= l(:lable_bar_active)%></strong> </ul>
<%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> </div>
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3> <div class="right" style="float: right; width: 48%; ">
<span style="margin-top: -30px;float: right; display: block;"><%= link_to l(:label_more), forums_path %></span> <ul class="welcome-message-list">
</div> <!--<%# cache 'forum_links' do %> -->
<div class="welcome-box-list-new memo_activity"> <div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<% topics = find_new_forum_topics(7) %> <h3 style="color: rgb(21, 188, 207);">
<% topics.includes(:forum, :last_reply, :author).each do |topic|%> <strong>
<!--<%# cache cache_key_for_topic(topic) do %> --> <%= l(:lable_bar_active)%>
<li class="message-brief-intro"> </strong>
<div class='memo_title text_nowrap'> <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %> <%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %> </h3>
</div> <span style="margin-top: -30px;float: right; display: block;">
<div class='memo_attr'> <%= link_to l(:label_more), forums_path %>
<span class='memo_timestamp'> </span>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> </div>
</span> <div class="welcome-box-list-new memo_activity">
<span class="memo_author"> <% topics = find_new_forum_topics(6) %>
<%= l(:label_question_sponsor)%> <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> <!--<%# cache cache_key_for_topic(topic) do %> -->
</span> <li class="message-brief-intro">
<span class="memo_last_person"> <div class='memo_title text_nowrap'>
<%= l(:label_final_reply)%> <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %> <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%> </div>
<% end %> <div class='memo_attr'>
</span> <span class='memo_timestamp'>
<span class="memo_reply"> <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
<%= l(:label_reply)%> </span>
(<%= link_to topic.try(:replies_count), topic.event_url %>) <span class="memo_author">
</span> <%= l(:label_question_sponsor)%>
</div> <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</li> </span>
<!--<%#end %> --> <!-- cache --> <span class="memo_last_person">
<% end %> <%= l(:label_final_reply)%>
</div> <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
</ul> <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
</div> <% end %>
</span>
<div class="clearfix"></div> <span class="memo_reply">
<%= l(:label_reply)%>
(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</li>
<!--<%#end %> --> <!-- cache -->
<% end %>
</div>
</ul>
</div>
<div class="clearfix"></div>
<%= render partial: 'link_to_another' %> <%= render partial: 'link_to_another' %>

View File

@ -1,33 +1,33 @@
<div class="contextual"> <div class="contextual">
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
</div> </div>
<%= wiki_page_breadcrumb(@page) %> <%= wiki_page_breadcrumb(@page) %>
<h3> <h3>
<%= h(@page.pretty_title) %> <%= h(@page.pretty_title) %>
</h3> </h3>
<p> <p>
<%= l(:label_version) %> <%= l(:label_version) %>
<%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
<em> <em>
(<%= @diff.content_from.author ? @diff.content_from.author.name : l(:label_user_anonymous)%>, (<%= @diff.content_from.author ? @diff.content_from.author.name : l(:label_user_anonymous)%>,
<%= format_time(@diff.content_from.updated_on) %>) <%= format_time(@diff.content_from.updated_on) %>)
</em> </em>
&#8594; &#8594;
<%= l(:label_version) %> <%= l(:label_version) %>
<%= link_to @diff.content_to.version, :action => 'show', <%= link_to @diff.content_to.version, :action => 'show',
:id => @page.title, :project_id => @page.project, :id => @page.title, :project_id => @page.project,
:version => @diff.content_to.version %> :version => @diff.content_to.version %>
/ /
<%= @page.content.version %> <%= @page.content.version %>
<em> <em>
(<%= @diff.content_to.author ? link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)%>, (<%= @diff.content_to.author ? link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)%>,
<%= format_time(@diff.content_to.updated_on) %>) <%= format_time(@diff.content_to.updated_on) %>)
</em> </em>
</p> </p>
<div class="text-diff" style=" width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="text-diff" style="word-break: break-all;word-wrap: break-word;">
<%= simple_format_without_paragraph @diff.to_html %> <%= simple_format_without_paragraph @diff.to_html %>
</div> </div>

View File

@ -1,62 +1,62 @@
<%= wiki_page_breadcrumb(@page) %> <%= wiki_page_breadcrumb(@page) %>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<h3 style="word-break: break-all;word-wrap: break-word;"> <h3 style="word-break: break-all;word-wrap: break-word;">
<%= h @page.pretty_title %> <%= h @page.pretty_title %>
</h3> </h3>
<%= form_for @content, :as => :content, <%= form_for @content, :as => :content,
:url => {:action => 'update', :id => @page.title}, :url => {:action => 'update', :id => @page.title},
:html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %> :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %>
<%= f.hidden_field :version %> <%= f.hidden_field :version %>
<% if @section %> <% if @section %>
<%= hidden_field_tag 'section', @section %> <%= hidden_field_tag 'section', @section %>
<%= hidden_field_tag 'section_hash', @section_hash %> <%= hidden_field_tag 'section_hash', @section_hash %>
<% end %> <% end %>
<%= error_messages_for 'content' %> <%= error_messages_for 'content' %>
<div class="actions" style="max-width:680px"> <div class="actions" style="max-width:680px">
<p style="max-width:680px;"> <p style="max-width:680px;">
<%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %> <%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %>
</p> </p>
<script type="text/javascript"> <script type="text/javascript">
var ckeditor=CKEDITOR.replace('editor02',{height: '300'}); var ckeditor=CKEDITOR.replace('editor02',{height: '300'});
</script> </script>
</div> </div>
<div class="box tabular"> <div class="box tabular">
<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
<%= fields_for @page do |fp| %> <%= fields_for @page do |fp| %>
<p> <p>
<label> <label>
<%= l(:field_parent_title) %> <%= l(:field_parent_title) %>
</label> </label>
<%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %> <%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
<p style="width: 100%;"> <p style="width: 100%;">
<label> <label>
<%= l(:field_comments) %> <%= l(:field_comments) %>
</label> </label>
<%= f.text_field :comments, :style => "width:75%;" %> <%= f.text_field :comments, :style => "width:75%;" %>
</p> </p>
<p> <p>
<label> <label>
<%=l(:label_attachment_plural)%> <%=l(:label_attachment_plural)%>
</label> </label>
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form',:locals => {:container => @page} %>
</p> </p>
</div> </div>
<p> <p>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
</p> </p>
<%= wikitoolbar_for 'content_text' %> <%= wikitoolbar_for 'content_text' %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= robot_exclusion_tag %> <%= robot_exclusion_tag %>
<% end %> <% end %>
<% html_title @page.pretty_title %> <% html_title @page.pretty_title %>

View File

@ -1,7 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%> <% id = "journal_reply_ul_" + journal.id.to_s%>
<ul class="messages-for-user-reply" id = '<%= id %>' > <ul class="messages-for-user-reply" id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%> <% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %> <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<% end %> <% end %>
</ul> </ul>

View File

@ -2,33 +2,39 @@
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()"> <li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<span class="portrait"> <span class="portrait">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %> <%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</span> </span>
<div class="message-body"> <div class="message-body">
<% id = 'project_respond_form_'+ reply.id.to_s %> <% id = 'project_respond_form_'+ reply.id.to_s %>
<p> <p>
<span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span> <span>
<span class="message-notes"> <%= reply.notes %></span> <%= link_to reply.user.name, user_path(reply.user) %>
:&nbsp;
</span>
<span class="message-notes">
<%= reply.notes %>
</span>
</p> </p>
<p> <p>
<span class="time"><%= format_time reply.created_on %></span> <span class="time">
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' > <%= format_time reply.created_on %>
<% if reply_allow %> </span>
<%= link_to l(:label_projects_feedback_respond),'', <span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} <% if reply_allow %>
%> <%= link_to l(:label_projects_feedback_respond),'',
<% end %> {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %> <% end %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, <% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
<% end %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
</span> <% end %>
</span>
</p> </p>
</div> </div>
<div id='<%=id%>' class="respond-form"> <div id='<%=id%>' class="respond-form">
<% if reply_allow %> <% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %> <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
<% end %> <% end %>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</li> </li>

View File

@ -1,5 +1,5 @@
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %> <%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline', <%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4, :style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content), :placeholder => l(:label_projects_feedback_respond_content),

View File

@ -5,15 +5,12 @@
) %>').hide(); ) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600); pre_append.fadeIn(600);
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea'); textarea.val('');
textarea.val(''); $('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide(); var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea'); $('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]); setMaxLengthItem(pre_append.find('textarea')[0]);
<% else %> <% else %>
alert("<%= l(:label_feedback_fail) %>"); alert("<%= l(:label_feedback_fail) %>");

View File

@ -204,6 +204,8 @@ default:
# specific configuration options for production environment # specific configuration options for production environment
# that overrides the default ones # that overrides the default ones
production: production:
# CJK support
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
# specific configuration options for development environment # specific configuration options for development environment
# that overrides the default ones # that overrides the default ones

View File

@ -1840,4 +1840,6 @@ en:
label_my_school: My school label_my_school: My school
label_all_schol: All school label_all_schol: All school
label_select_province: Please select the provinces label_select_province: Please select the provinces
label_search_conditions_not_null: The search conditions can not be empty label_search_conditions_not_null: The search conditions can not be empty
lable_school_list: List of schools
button_delete_file: delete

View File

@ -2006,7 +2006,7 @@ zh:
label_work_scores: 作品得分 label_work_scores: 作品得分
label_work_rating: 评分 label_work_rating: 评分
label_work_tishi: 您可以重新打分,打分结果以最后一次打分为主! label_work_tishi: 您可以重新打分,打分结果以最后一次打分为主!
label_work_scores_proportion: 得分比例 label_work_scores_people: 得分人数
label_softapplication_type: 应用分类 label_softapplication_type: 应用分类
label_work_type: 作品分类 label_work_type: 作品分类
label_work_photo: 作品截图 label_work_photo: 作品截图
@ -2168,3 +2168,5 @@ zh:
label_contest_news_condition: 竞赛描述超过5000个汉字 label_contest_news_condition: 竞赛描述超过5000个汉字
label_no_contest_news_title: 竞赛标题不能为空 label_no_contest_news_title: 竞赛标题不能为空
label_contest_news_title_condition: 竞赛标题超过255个汉字 label_contest_news_title_condition: 竞赛标题超过255个汉字
label_subject_empty: 主题不能为空
label_course_organizers: 开设单位

View File

@ -1,170 +1,170 @@
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module Redmine module Redmine
module Acts module Acts
module Attachable module Attachable
def self.included(base) def self.included(base)
base.extend ClassMethods base.extend ClassMethods
end end
module ClassMethods module ClassMethods
def acts_as_attachable(options = {}) def acts_as_attachable(options = {})
cattr_accessor :attachable_options cattr_accessor :attachable_options
self.attachable_options = {} self.attachable_options = {}
attachable_options[:view_permission] = options.delete(:view_permission) || "view_#{self.name.pluralize.underscore}".to_sym attachable_options[:view_permission] = options.delete(:view_permission) || "view_#{self.name.pluralize.underscore}".to_sym
attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym
has_many :attachments, options.merge(:as => :container, has_many :attachments, options.merge(:as => :container,
:order => "#{Attachment.table_name}.created_on ASC, #{Attachment.table_name}.id ASC", :order => "#{Attachment.table_name}.created_on ASC, #{Attachment.table_name}.id ASC",
:dependent => :destroy) :dependent => :destroy)
send :include, Redmine::Acts::Attachable::InstanceMethods send :include, Redmine::Acts::Attachable::InstanceMethods
before_save :attach_saved_attachments before_save :attach_saved_attachments
end end
end end
module InstanceMethods module InstanceMethods
def self.included(base) def self.included(base)
base.extend ClassMethods base.extend ClassMethods
end end
def attachments_visible?(user=User.current) def attachments_visible?(user=User.current)
if self.respond_to?(:project) if self.respond_to?(:project)
(respond_to?(:visible?) ? visible?(user) : true) && (respond_to?(:visible?) ? visible?(user) : true) &&
user.allowed_to?(self.class.attachable_options[:view_permission], self.project) user.allowed_to?(self.class.attachable_options[:view_permission], self.project)
else else
return true return true
end end
end end
def attachments_deletable?(user=User.current) def attachments_deletable?(user=User.current)
if (self.has_attribute?(:course) ||self.has_attribute?(:course_id)) && self.course if (self.has_attribute?(:course) ||self.has_attribute?(:course_id)) && self.course
#默认给予删除自己上传的附件的权限 #默认给予删除自己上传的附件的权限
(respond_to?(:visible?) ? visible?(user) : true) && (respond_to?(:visible?) ? visible?(user) : true) &&
(user.allowed_to?(self.class.attachable_options[:delete_permission], self.course) || (self.has_attribute?(:author_id) && self.author == user)) (user.allowed_to?(self.class.attachable_options[:delete_permission], self.course) || (self.has_attribute?(:author_id) && self.author == user))
else else
#默认给予删除自己上传的附件的权限 #默认给予删除自己上传的附件的权限
(respond_to?(:visible?) ? visible?(user) : true) && (respond_to?(:visible?) ? visible?(user) : true) &&
(user.allowed_to?(self.class.attachable_options[:delete_permission], self.project) || (self.has_attribute?(:author_id) && self.author == user)) (user.allowed_to?(self.class.attachable_options[:delete_permission], self.project) || (self.has_attribute?(:author_id) && self.author == user))
end end
end end
def saved_attachments def saved_attachments
@saved_attachments ||= [] @saved_attachments ||= []
end end
def unsaved_attachments def unsaved_attachments
@unsaved_attachments ||= [] @unsaved_attachments ||= []
end end
# 设置资源文件的公开属性 # 设置资源文件的公开属性
# add by nwb # add by nwb
def set_attachment_public(res) def set_attachment_public(res)
# 公开的资源判断他的父级的公开属性 # 公开的资源判断他的父级的公开属性
if res.is_public if res.is_public
if( (self.class.to_s=="Project" && self.is_public == false) || if( (self.class.to_s=="Project" && self.is_public == false) ||
(self.has_attribute?(:project) && self.project && self.project.is_public == false) || (self.has_attribute?(:project) && self.project && self.project.is_public == false) ||
(self.has_attribute?(:board) && self.board.project && self.board.project.is_public == false) || (self.has_attribute?(:board) && self.board.project && self.board.project.is_public == false) ||
(self.class.to_s=="HomeworkAttach" && self.bid.reward_type == 3) || (self.class.to_s=="HomeworkAttach" && self.bid.reward_type == 3) ||
(self.class.to_s=="Course" && self.is_public == false) || (self.class.to_s=="Course" && self.is_public == false) ||
(self.has_attribute?(:course) && self.course && self.course.is_public == false) || (self.has_attribute?(:course) && self.course && self.course.is_public == false) ||
(self.has_attribute?(:board) && self.board.course && self.board.course.is_public == false) (self.has_attribute?(:board) && self.board.course && self.board.course.is_public == false)
) )
res.is_public = false res.is_public = false
end end
end end
end end
def save_attachmentsex(attachments, author=User.current,attachment_type) def save_attachmentsex(attachments, author=User.current,attachment_type)
@curattachment_type = attachment_type @curattachment_type = attachment_type
result = save_attachments(attachments,author) result = save_attachments(attachments,author)
result result
end end
def save_attachments(attachments, author=User.current) def save_attachments(attachments, author=User.current)
# 清除临时文件 # 清除临时文件
if attachments if attachments
tempAttach = attachments[:dummy] tempAttach = attachments[:dummy]
if tempAttach && tempAttach[:file] if tempAttach && tempAttach[:file]
attachments.delete(:dummy) attachments.delete(:dummy)
end end
end end
if attachments.is_a?(Hash) if attachments.is_a?(Hash)
attachments = attachments.stringify_keys attachments = attachments.stringify_keys
attachments = attachments.to_a.sort {|a, b| attachments = attachments.to_a.sort {|a, b|
if a.first.to_i > 0 && b.first.to_i > 0 if a.first.to_i > 0 && b.first.to_i > 0
a.first.to_i <=> b.first.to_i a.first.to_i <=> b.first.to_i
elsif a.first.to_i > 0 elsif a.first.to_i > 0
1 1
elsif b.first.to_i > 0 elsif b.first.to_i > 0
-1 -1
else else
a.first <=> b.first a.first <=> b.first
end end
} }
attachments = attachments.map(&:last) attachments = attachments.map(&:last)
end end
if attachments.is_a?(Array) if attachments.is_a?(Array)
attachments.each do |attachment| attachments.each do |attachment|
if attachment.is_a?(Hash) if attachment.is_a?(Hash)
a = nil a = nil
file = attachment['file'] file = attachment['file']
token = attachment['token'] token = attachment['token']
t = file && file.size > 0 t = file && file.size > 0
if file && file.size > 0 if file && file.size > 0
a = Attachment.create(:file => file, :author => author) a = Attachment.create(:file => file, :author => author)
elsif token elsif token
a = Attachment.find_by_token_only(token) a = Attachment.find_by_token_only(token)
if a if a
a.filename = attachment['filename'] unless attachment['filename'].blank? a.filename = attachment['filename'] unless attachment['filename'].blank?
a.content_type = attachment['content_type'] a.content_type = attachment['content_type']
end end
end end
end end
if a && !attachment['is_public_checkbox'] if a && !attachment['is_public_checkbox']
a.is_public = false a.is_public = false
elsif a && attachment['is_public_checkbox'] elsif a && attachment['is_public_checkbox']
a.is_public = true a.is_public = true
end end
set_attachment_public(a) if a set_attachment_public(a) if a
next unless a next unless a
a.description = attachment['description'].to_s.strip a.description = attachment['description'].to_s.strip
a.attachtype = @curattachment_type a.attachtype = @curattachment_type
if a.new_record? if a.new_record?
unsaved_attachments << a unsaved_attachments << a
else else
saved_attachments << a saved_attachments << a
end end
end end
end end
{:files => saved_attachments, :unsaved => unsaved_attachments} {:files => saved_attachments, :unsaved => unsaved_attachments}
end end
def attach_saved_attachments def attach_saved_attachments
saved_attachments.each do |attachment| saved_attachments.each do |attachment|
self.attachments << attachment self.attachments << attachment
end end
end end
module ClassMethods module ClassMethods
end end
end end
end end
end end
end end

View File

@ -24,10 +24,14 @@
<%= error_messages_for 'review' -%> <%= error_messages_for 'review' -%>
<%= error_messages_for 'reply' -%> <%= error_messages_for 'reply' -%>
<% if @notice -%> <% if @notice -%>
<div class="flash notice"><%= @notice -%></div> <div class="flash notice">
<%= @notice -%>
</div>
<% end -%> <% end -%>
<% if @error -%> <% if @error -%>
<div class="flash error"><%= @error -%></div> <div class="flash error">
<%= @error -%>
</div>
<% end -%> <% end -%>
<!-- code review view --> <!-- code review view -->
@ -77,9 +81,7 @@
<!-- review comment edit form --> <!-- review comment edit form -->
<div class="box" id="update-form-<%= @review.id %>" style="display:none;"> <div class="box" id="update-form-<%= @review.id %>" style="display:none;">
<% <% review_form_id = "review_form_#{@review.id}" -%>
review_form_id = "review_form_#{@review.id}"
-%>
<%= form_for :review, <%= form_for :review,
:url => {:controller => 'code_review', :url => {:controller => 'code_review',
:action => 'update', :action => 'update',
@ -90,12 +92,20 @@
<%= hidden_field :issue, :lock_version%> <%= hidden_field :issue, :lock_version%>
<%= hidden_field_tag :review_id, @review.id %> <%= hidden_field_tag :review_id, @review.id %>
<p> <p>
<label><b><%=h l(:field_subject)%>:</b></label> <label>
<b>
<%=h l(:field_subject)%>:
</b>
</label>
<%= f.text_field :subject, :size => 70, :value => @review.subject%> <%= f.text_field :subject, :size => 70, :value => @review.subject%>
</p> </p>
<% if @allowed_statuses and @allowed_statuses.any? %> <% if @allowed_statuses and @allowed_statuses.any? %>
<p> <p>
<label><b><%=h l(:field_status)%>:</b></label> <label>
<b>
<%=h l(:field_status)%>:
</b>
</label>
<%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %> <%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %>
</p> </p>
<% end %> <% end %>
@ -108,10 +118,8 @@
:id => 'review_comment_' + @review.id.to_s %> :id => 'review_comment_' + @review.id.to_s %>
</p> </p>
<p> <p>
<% <% submit_url = url_for(:controller => 'code_review', :action => 'update', :id => @project) -%>
submit_url = url_for(:controller => 'code_review', :action => 'update', :id => @project) <%= button_to_function l(:button_submit), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{review_form_id}').serialize())" %>
-%>
<%= button_to_function l(:button_apply), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{review_form_id}').serialize())" %>
<input type="button" value="<%=h l(:button_cancel) %>" onclick='$("#review_form_<%= @review.id %>").hide();' /> <input type="button" value="<%=h l(:button_cancel) %>" onclick='$("#review_form_<%= @review.id %>").hide();' />
<%= link_to_function l(:label_preview), "$('#preview_#{@review.id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{review_form_id}').serialize())" %> <%= link_to_function l(:label_preview), "$('#preview_#{@review.id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{review_form_id}').serialize())" %>
</p> </p>
@ -127,14 +135,18 @@
<% # ChiliProject -%> <% # ChiliProject -%>
<% if journals.length > 0 %> <% if journals.length > 0 %>
<div id="history"> <div id="history">
<h3 class="rounded-background"><%= l(:label_history) %></h3> <h3 class="rounded-background">
<%= l(:label_history) %>
</h3>
<%= render :partial => 'history', :locals => { :issue => @review.issue, :journals => journals } %> <%= render :partial => 'history', :locals => { :issue => @review.issue, :journals => journals } %>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<% # Redmine -%> <% # Redmine -%>
<% if journals.length > 0 %> <% if journals.length > 0 %>
<h3><%= l(:label_history) %></h3> <h3>
<%= l(:label_history) %>
</h3>
<% end %> <% end %>
<%= render :partial => 'reply', :collection => journals %> <%= render :partial => 'reply', :collection => journals %>
<% end %> <% end %>
@ -144,9 +156,7 @@
<p> <p>
<%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %> <%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %>
</p> </p>
<% <% message_form_id = "message-form-#{@review.id}" -%>
message_form_id = "message-form-#{@review.id}"
-%>
<div id="reply_<%= @review.id %>" style="display:none;" class="box"> <div id="reply_<%= @review.id %>" style="display:none;" class="box">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @project, :review_id => @review.id}, :html => {:id => message_form_id} do |f| %> <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @project, :review_id => @review.id}, :html => {:id => message_form_id} do |f| %>
<%= hidden_field_tag :review_id, @review.id %> <%= hidden_field_tag :review_id, @review.id %>
@ -154,8 +164,9 @@
<%= hidden_field :issue, :lock_version%> <%= hidden_field :issue, :lock_version%>
<% if @allowed_statuses and @allowed_statuses.any? %> <% if @allowed_statuses and @allowed_statuses.any? %>
<p> <p>
<label><%=h l(:field_status) %>:</label> <label>
<% # select :review, :status, {l(:label_review_closed) => CodeReview::STATUS_CLOSED, l(:label_review_open) => CodeReview::STATUS_OPEN} %> <%=h l(:field_status) %>:
</label>
<%= select :review, :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %> <%= select :review, :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %>
</p> </p>
<% end %> <% end %>
@ -168,13 +179,9 @@
:id => 'reply_comment_' + @review.id.to_s %> :id => 'reply_comment_' + @review.id.to_s %>
</p> </p>
<p> <p>
<% <% submit_url = url_for(:controller => 'code_review', :action => 'reply', :id => @project)-%>
submit_url = url_for(:controller => 'code_review', :action => 'reply', :id => @project)
-%>
<%= button_to_function l(:button_apply), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{message_form_id}').serialize())" %> <%= button_to_function l(:button_apply), "$('#show_review_#{@review.id}').load('#{submit_url}', $('##{message_form_id}').serialize())" %>
<% <% reply_preview_id = "reply_preview_#{@review.id}" -%>
reply_preview_id = "reply_preview_#{@review.id}"
-%>
<%= link_to_function l(:label_preview), "$('##{reply_preview_id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{message_form_id}').serialize())" %> <%= link_to_function l(:label_preview), "$('##{reply_preview_id}').load('#{url_for(:controller => 'code_review', :action => 'preview', :id => @project)}', $('##{message_form_id}').serialize())" %>
</p> </p>
<div id="<%= reply_preview_id %>" class="wiki"></div> <div id="<%= reply_preview_id %>" class="wiki"></div>
@ -182,7 +189,5 @@
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>

View File

@ -1,233 +1,233 @@
/* Redmine - project management software /* Redmine - project management software
Copyright (C) 2006-2013 Jean-Philippe Lang */ Copyright (C) 2006-2013 Jean-Philippe Lang */
function postUpMsg(attachmentId) function postUpMsg(attachmentId)
{ {
$.ajax({ $.ajax({
url: '/attachments/renderTag', url: '/attachments/renderTag',
type: "GET", type: "GET",
data: { data: {
attachmentId: attachmentId attachmentId: attachmentId
} }
}) })
} }
function addFile(inputEl, file, eagerUpload) { function addFile(inputEl, file, eagerUpload) {
if ($('#attachments_fields').children().length < 10) { if ($('#attachments_fields').children().length < 10) {
var attachmentId = addFile.nextAttachmentId++; var attachmentId = addFile.nextAttachmentId++;
var fileSpan = $('<span>', { 'id': 'attachments_' + attachmentId, 'class':'attachment' }); var fileSpan = $('<span>', { 'id': 'attachments_' + attachmentId, 'class':'attachment' });
fileSpan.append( fileSpan.append(
$('<input>', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('<input>', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
$('<input>', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), $('<input>', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
$('<span >公开:</span>').attr({ 'class': 'ispublic-label' }) , $('<span >公开:</span>').attr({ 'class': 'ispublic-label' }) ,
$('<input>', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), $('<input>', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload),
$('<a>&nbsp</a>').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload), $('<a>&nbsp</a>').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload),
$('<div>', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} ) $('<div>', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} )
).appendTo('#attachments_fields'); ).appendTo('#attachments_fields');
if(eagerUpload) { if(eagerUpload) {
ajaxUpload(file, attachmentId, fileSpan, inputEl); ajaxUpload(file, attachmentId, fileSpan, inputEl);
} }
return attachmentId; return attachmentId;
} }
return null; return null;
} }
addFile.nextAttachmentId = 1; addFile.nextAttachmentId = 1;
function ajaxUpload(file, attachmentId, fileSpan, inputEl) { function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
function onLoadstart(e) { function onLoadstart(e) {
fileSpan.removeClass('ajax-waiting'); fileSpan.removeClass('ajax-waiting');
fileSpan.addClass('ajax-loading'); fileSpan.addClass('ajax-loading');
$('input:submit', $(this).parents('form')).attr('disabled', 'disabled'); $('input:submit', $(this).parents('form')).attr('disabled', 'disabled');
} }
function onProgress(e) { function onProgress(e) {
if(e.lengthComputable) { if(e.lengthComputable) {
this.progressbar( 'value', e.loaded * 100 / e.total ); this.progressbar( 'value', e.loaded * 100 / e.total );
} }
} }
function actualUpload(file, attachmentId, fileSpan, inputEl) { function actualUpload(file, attachmentId, fileSpan, inputEl) {
ajaxUpload.uploading++; ajaxUpload.uploading++;
uploadBlob(file, $(inputEl).data('upload-path'), attachmentId, { uploadBlob(file, $(inputEl).data('upload-path'), attachmentId, {
loadstartEventHandler: onLoadstart.bind(progressSpan), loadstartEventHandler: onLoadstart.bind(progressSpan),
progressEventHandler: onProgress.bind(progressSpan) progressEventHandler: onProgress.bind(progressSpan)
}) })
.done(function(result) { .done(function(result) {
progressSpan.progressbar( 'value', 100 ).remove(); progressSpan.progressbar( 'value', 100 ).remove();
fileSpan.find('input.description, a').css('display', 'inline-block'); fileSpan.find('input.description, a').css('display', 'inline-block');
fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block'); fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block');
}) })
.fail(function(result) { .fail(function(result) {
progressSpan.text(result.statusText); progressSpan.text(result.statusText);
if($("#network_issue")) if($("#network_issue"))
{ {
$("#network_issue").show(); $("#network_issue").show();
} }
}).always(function() { }).always(function() {
ajaxUpload.uploading--; ajaxUpload.uploading--;
fileSpan.removeClass('ajax-loading'); fileSpan.removeClass('ajax-loading');
var form = fileSpan.parents('form'); var form = fileSpan.parents('form');
if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) {
$('input:submit', form).removeAttr('disabled'); $('input:submit', form).removeAttr('disabled');
} }
form.dequeue('upload'); form.dequeue('upload');
}); });
//gcm files count and add delete_all link //gcm files count and add delete_all link
var count=$('#attachments_fields>span').length; var count=$('#attachments_fields>span').length;
$('#upload_file_count').html("已上传"+"<span id=\"count\">"+count+"</span>"+"个文件"); $('#upload_file_count').html("已上传"+"<span id=\"count\">"+count+"</span>"+"个文件");
if(count>=1){ if(count>=1){
var add_attachs=$('.add_attachment'); var add_attachs=$('.add_attachment');
var delete_all=$('.remove_all'); var delete_all=$('.remove_all');
if(delete_all.length<1){ if(delete_all.length<1){
add_attachs.append($("<a>&nbsp</a>").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"})); add_attachs.append($("<a>&nbsp</a>").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"}));
} }
} }
//gcm //gcm
} }
var progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename')); var progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename'));
progressSpan.progressbar(); progressSpan.progressbar();
fileSpan.addClass('ajax-waiting'); fileSpan.addClass('ajax-waiting');
var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); var maxSyncUpload = $(inputEl).data('max-concurrent-uploads');
if(maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload) if(maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload)
actualUpload(file, attachmentId, fileSpan, inputEl); actualUpload(file, attachmentId, fileSpan, inputEl);
else else
$(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl)); $(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl));
} }
ajaxUpload.uploading = 0; ajaxUpload.uploading = 0;
function removeFile() { function removeFile() {
$(this).parent('span').remove(); $(this).parent('span').remove();
return false; return false;
} }
//gcm delete all file //gcm delete all file
function removeAll(){ function removeAll(){
if(confirm("您确定要删除所有文件吗?")){ if(confirm("您确定要删除所有文件吗?")){
$(".remove-upload").removeAttr("data-confirm"); $(".remove-upload").removeAttr("data-confirm");
$(".remove-upload").click(); $(".remove-upload").click();
} }
// return false; // return false;
} }
//gcm //gcm
function uploadBlob(blob, uploadUrl, attachmentId, options) { function uploadBlob(blob, uploadUrl, attachmentId, options) {
var actualOptions = $.extend({ var actualOptions = $.extend({
loadstartEventHandler: $.noop, loadstartEventHandler: $.noop,
progressEventHandler: $.noop progressEventHandler: $.noop
}, options); }, options);
uploadUrl = uploadUrl + '?attachment_id=' + attachmentId; uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
if (blob instanceof window.File) { if (blob instanceof window.File) {
uploadUrl += '&filename=' + encodeURIComponent(blob.name); uploadUrl += '&filename=' + encodeURIComponent(blob.name);
} }
return $.ajax(uploadUrl, { return $.ajax(uploadUrl, {
type: 'POST', type: 'POST',
contentType: 'application/octet-stream', contentType: 'application/octet-stream',
beforeSend: function(jqXhr) { beforeSend: function(jqXhr) {
jqXhr.setRequestHeader('Accept', 'application/js'); jqXhr.setRequestHeader('Accept', 'application/js');
}, },
xhr: function() { xhr: function() {
var xhr = $.ajaxSettings.xhr(); var xhr = $.ajaxSettings.xhr();
xhr.upload.onloadstart = actualOptions.loadstartEventHandler; xhr.upload.onloadstart = actualOptions.loadstartEventHandler;
xhr.upload.onprogress = actualOptions.progressEventHandler; xhr.upload.onprogress = actualOptions.progressEventHandler;
return xhr; return xhr;
}, },
data: blob, data: blob,
cache: false, cache: false,
processData: false processData: false
}); });
} }
function addInputFiles(inputEl) { function addInputFiles(inputEl) {
// var clearedFileInput = $(inputEl).clone().val(''); // var clearedFileInput = $(inputEl).clone().val('');
if (inputEl.files) { if (inputEl.files) {
// upload files using ajax // upload files using ajax
uploadAndAttachFiles(inputEl.files, inputEl); uploadAndAttachFiles(inputEl.files, inputEl);
// $(inputEl).remove(); // $(inputEl).remove();
} else { } else {
// browser not supporting the file API, upload on form submission // browser not supporting the file API, upload on form submission
var attachmentId; var attachmentId;
var aFilename = inputEl.value.split(/\/|\\/); var aFilename = inputEl.value.split(/\/|\\/);
attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false);
if (attachmentId) { if (attachmentId) {
$(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]', style: 'display:none;' }).appendTo('#attachments_' + attachmentId); $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]', style: 'display:none;' }).appendTo('#attachments_' + attachmentId);
} }
} }
//clearedFileInput.insertAfter('#attachments_fields'); //clearedFileInput.insertAfter('#attachments_fields');
} }
function uploadAndAttachFiles(files, inputEl) { function uploadAndAttachFiles(files, inputEl) {
var maxFileSize = $(inputEl).data('max-file-size'); var maxFileSize = $(inputEl).data('max-file-size');
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
var sizeExceeded = false; var sizeExceeded = false;
$.each(files, function() { $.each(files, function() {
if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;} if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
}); });
if (sizeExceeded) { if (sizeExceeded) {
window.alert(maxFileSizeExceeded); window.alert(maxFileSizeExceeded);
} else { } else {
$.each(files, function() {addFile(inputEl, this, true);}); $.each(files, function() {addFile(inputEl, this, true);});
} }
} }
function handleFileDropEvent(e) { function handleFileDropEvent(e) {
$(this).removeClass('fileover'); $(this).removeClass('fileover');
blockEventPropagation(e); blockEventPropagation(e);
if ($.inArray('Files', e.dataTransfer.types) > -1) { if ($.inArray('Files', e.dataTransfer.types) > -1) {
uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector')); uploadAndAttachFiles(e.dataTransfer.files, $('input:file.file_selector'));
} }
} }
function dragOverHandler(e) { function dragOverHandler(e) {
$(this).addClass('fileover'); $(this).addClass('fileover');
blockEventPropagation(e); blockEventPropagation(e);
} }
function dragOutHandler(e) { function dragOutHandler(e) {
$(this).removeClass('fileover'); $(this).removeClass('fileover');
blockEventPropagation(e); blockEventPropagation(e);
} }
function setupFileDrop() { function setupFileDrop() {
if (window.File && window.FileList && window.ProgressEvent && window.FormData) { if (window.File && window.FileList && window.ProgressEvent && window.FormData) {
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] }; $.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
$('form div.box').has('input:file').each(function() { $('form div.box').has('input:file').each(function() {
$(this).on({ $(this).on({
dragover: dragOverHandler, dragover: dragOverHandler,
dragleave: dragOutHandler, dragleave: dragOutHandler,
drop: handleFileDropEvent drop: handleFileDropEvent
}); });
}); });
} }
} }
$(document).ready(setupFileDrop); $(document).ready(setupFileDrop);

View File

@ -22,6 +22,7 @@ body
{ {
font-size: 13px; font-size: 13px;
line-height: 1.6em; line-height: 1.6em;
word-wrap: break-word;
} }
blockquote blockquote

View File

@ -1356,7 +1356,7 @@ tr.message.locked td.subject { background: url(../images/locked.png) no-repeat 0
tr.message.sticky td.subject { background: url(../images/bullet_go.png) no-repeat 0 1px; font-weight: bold; } tr.message.sticky td.subject { background: url(../images/bullet_go.png) no-repeat 0 1px; font-weight: bold; }
tr.version.closed, tr.version.closed a { color: #999; } tr.version.closed, tr.version.closed a { color: #999; }
tr.version td.name { padding-left: 20px;word-break: break-all; } tr.version td.name { padding-left: 20px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; }
tr.version td.description{word-break: break-all} tr.version td.description{word-break: break-all}
tr.version.shared td.name { background: url(../images/link.png) no-repeat 0% 70%; } tr.version.shared td.name { background: url(../images/link.png) no-repeat 0% 70%; }
tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; } tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; }
@ -2834,4 +2834,8 @@ div.repos_explain{
.list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;} .list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;}
.projects-index{min-height: 350px} .projects-index{min-height: 350px}
.school-index{min-height: 400px} .school-index{min-height: 400px}
#membership_project_id option
{
width: 190px;
}