Conflicts:
	app/helpers/projects_helper.rb
	app/views/contest_notification/show.html.erb

Signed-off-by: alan <547533434@qq.com>
course_group
alan 11 years ago
commit 8c19ec8aa0

@ -1,372 +1,373 @@
# 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 AttachmentsController < ApplicationController class AttachmentsController < ApplicationController
layout "users_base" layout "users_base"
before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete]
before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young
before_filter :delete_authorize, :only => :destroy before_filter :delete_authorize, :only => :destroy
before_filter :authorize_global, :only => :upload before_filter :authorize_global, :only => :upload
before_filter :login_without_softapplication, only: [:download] before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload accept_api_auth :show, :download, :upload
require 'iconv' require 'iconv'
def show def show
respond_to do |format| respond_to do |format|
format.html { format.html {
if @attachment.is_diff? if @attachment.is_diff?
@diff = File.new(@attachment.diskfile, "rb").read @diff = File.new(@attachment.diskfile, "rb").read
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline' @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type) @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
# Save diff type as user preference # Save diff type as user preference
if User.current.logged? && @diff_type != User.current.pref[:diff_type] if User.current.logged? && @diff_type != User.current.pref[:diff_type]
User.current.pref[:diff_type] = @diff_type User.current.pref[:diff_type] = @diff_type
User.current.preference.save User.current.preference.save
end end
render :action => 'diff' render :action => 'diff'
elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte
@content = File.new(@attachment.diskfile, "rb").read @content = File.new(@attachment.diskfile, "rb").read
# 编码为非 UTF-8先进行间接转码 # 编码为非 UTF-8先进行间接转码
# 部分unicode编码不直接支持转为 UTF-8 # 部分unicode编码不直接支持转为 UTF-8
# modify by nwb # modify by nwb
if @content.encoding.name != 'UTF-8' if @content.encoding.name != 'UTF-8'
@content = @content.force_encoding('GBK') @content = @content.force_encoding('GBK')
@content = @content.encode('UTF-8') @content = @content.encode('UTF-8')
end end
render :action => 'file' render :action => 'file'
else else
download download
end end
} }
format.api format.api
end end
end end
def download def download
# modify by nwb # modify by nwb
# 下载添加权限设置 # 下载添加权限设置
candown = false candown = false
if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project
project = @attachment.container.project project = @attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
elsif @attachment.container.is_a?(Project) elsif @attachment.container.is_a?(Project)
project = @attachment.container project = @attachment.container
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course
course = @attachment.container.course course = @attachment.container.course
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif @attachment.container.is_a?(Course) elsif @attachment.container.is_a?(Course)
course = @attachment.container course = @attachment.container
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3 elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3
candown = true candown = true
else else
candown = @attachment.is_public == 1 candown = @attachment.is_public == 1
end end
if candown || User.current.admin? || User.current.id == @attachment.author_id if candown || User.current.admin? || User.current.id == @attachment.author_id
@attachment.increment_download @attachment.increment_download
if stale?(:etag => @attachment.digest) if stale?(:etag => @attachment.digest)
# images are sent inline # images are sent inline
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename), send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
:type => detect_content_type(@attachment), :type => detect_content_type(@attachment),
:disposition => (@attachment.image? ? 'inline' : 'attachment') :disposition => (@attachment.image? ? 'inline' : 'attachment')
end end
else else
render_403 :message => :notice_not_authorized render_403 :message => :notice_not_authorized
end end
rescue => e rescue => e
redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html" redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
end end
#更新资源文件类型 #更新资源文件类型
def updateType def updateType
@attachment = Attachment.find(params[:attachmentid]) @attachment = Attachment.find(params[:attachmentid])
if @attachment != nil if @attachment != nil
@attachment.attachtype = params[:newtype] @attachment.attachtype = params[:newtype]
@attachment.save @attachment.save
render :text =>'success' render :text =>'success'
else else
render :text=>'error' render :text=>'error'
end end
end end
# 更新文件密级 # 更新文件密级
def updateFileDense def updateFileDense
@attachment = Attachment.find(params[:attachmentid]) @attachment = Attachment.find(params[:attachmentid])
if @attachment != nil if @attachment != nil
filedense = params[:newtype].to_s filedense = params[:newtype].to_s
# d = Iconv.conv("unicodebig","utf-8",filedense) # d = Iconv.conv("unicodebig","utf-8",filedense)
if filedense == "%E5%85%AC%E5%BC%80" #l(:field_is_public) if filedense == "%E5%85%AC%E5%BC%80" #l(:field_is_public)
@attachment.is_public = 1 @attachment.is_public = 1
else else
@attachment.is_public = 0 @attachment.is_public = 0
end end
@attachment.save @attachment.save
@newfiledense = filedense @newfiledense = filedense
end end
respond_to do |format| respond_to do |format|
format.js format.js
end end
end end
def thumbnail def thumbnail
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size]) if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
if stale?(:etag => thumbnail) if stale?(:etag => thumbnail)
send_file thumbnail, send_file thumbnail,
:filename => filename_for_content_disposition(@attachment.filename), :filename => filename_for_content_disposition(@attachment.filename),
:type => detect_content_type(@attachment), :type => detect_content_type(@attachment),
:disposition => 'inline' :disposition => 'inline'
end end
else else
# No thumbnail for the attachment or thumbnail could not be created # No thumbnail for the attachment or thumbnail could not be created
render :nothing => true, :status => 404 render :nothing => true, :status => 404
end end
end end
def upload def upload
# Make sure that API users get used to set this content type # Make sure that API users get used to set this content type
# as it won't trigger Rails' automatic parsing of the request body for parameters # as it won't trigger Rails' automatic parsing of the request body for parameters
unless request.content_type == 'application/octet-stream' unless request.content_type == 'application/octet-stream'
render :nothing => true, :status => 406 render :nothing => true, :status => 406
return return
end end
@attachment = Attachment.new(:file => request.raw_post) @attachment = Attachment.new(:file => request.raw_post)
@attachment.author = User.current @attachment.author = User.current
@attachment.filename = params[:filename].presence || Redmine::Utils.random_hex(16) @attachment.filename = params[:filename].presence || Redmine::Utils.random_hex(16)
saved = @attachment.save saved = @attachment.save
respond_to do |format| respond_to do |format|
format.js format.js
format.api { format.api {
if saved if saved
render :action => 'upload', :status => :created render :action => 'upload', :status => :created
else else
render_validation_errors(@attachment) render_validation_errors(@attachment)
end end
} }
end end
end end
def destroy def destroy
if @attachment.container.respond_to?(:init_journal) if @attachment.container.respond_to?(:init_journal)
@attachment.container.init_journal(User.current) @attachment.container.init_journal(User.current)
end end
if @attachment.container if @attachment.container
# Make sure association callbacks are called # Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment) @attachment.container.attachments.delete(@attachment)
else else
@attachment.destroy @attachment.destroy
end end
respond_to do |format| respond_to do |format|
# modify by nwb if !@attachment.container.nil? &&
if !@attachment.container.nil? && (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id) ) &&
(@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && @attachment.container.board.course ) ) @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) &&
if @attachment.container.is_a?(News) @attachment.container.board && @attachment.container.board.course ) )
format.html { redirect_to_referer_or news_path(@attachment.container) } if @attachment.container.is_a?(News)
elsif @attachment.container.is_a?(Message) format.html { redirect_to_referer_or news_path(@attachment.container) }
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) } elsif @attachment.container.is_a?(Message)
elsif @course.nil? format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } elsif @course.nil?
else format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
format.html { redirect_to_referer_or course_path(@course) } else
end format.html { redirect_to_referer_or course_path(@course) }
else end
if @project.nil? else
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } if @project.nil?
else format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
format.html { redirect_to_referer_or project_path(@project) } else
end format.html { redirect_to_referer_or project_path(@project) }
end end
end
format.js
end format.js
end end
end
def delete_homework
@bid = @attachment.container.bid def delete_homework
# Make sure association callbacks are called @bid = @attachment.container.bid
container = @attachment.container # Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment) container = @attachment.container
#if container.attachments.empty? @attachment.container.attachments.delete(@attachment)
#container.delete #if container.attachments.empty?
#end #container.delete
#end
respond_to do |format|
format.html { redirect_to_referer_or respond_path(@bid) } respond_to do |format|
format.js format.html { redirect_to_referer_or respond_path(@bid) }
end format.js
end end
end
#删除竞赛作品的附件
def delete_softapplications #删除竞赛作品的附件
@attachment = Attachment.find params[:id] def delete_softapplications
@softapplication = @attachment.container if @attachment!=nil @attachment = Attachment.find params[:id]
@attachment.container.attachments.delete(@attachment) if @attachment!=nil @softapplication = @attachment.container if @attachment!=nil
respond_to do |format| @attachment.container.attachments.delete(@attachment) if @attachment!=nil
format.html { redirect_to_referer_or edit_softapplication_path(@softapplication) } respond_to do |format|
#format.js format.html { redirect_to_referer_or edit_softapplication_path(@softapplication) }
end #format.js
end end
end
def autocomplete
# modify by nwb def autocomplete
if params[:project_id] # modify by nwb
@project = Project.find_by_id(params[:project_id]) if params[:project_id]
elsif params[:course_id] @project = Project.find_by_id(params[:project_id])
@course = Course.find_by_id(params[:course_id]) elsif params[:course_id]
end @course = Course.find_by_id(params[:course_id])
end
respond_to do |format|
format.js respond_to do |format|
end format.js
end end
end
def add_exist_file_to_project
classname = params[:class_name] def add_exist_file_to_project
class_id = params[:class_id] classname = params[:class_name]
attachments = params[:attachment][:attach] class_id = params[:class_id]
attachments = params[:attachment][:attach]
obj = Object.const_get(classname).find_by_id(class_id)
attachments.collect do |attach_id| obj = Object.const_get(classname).find_by_id(class_id)
ori = Attachment.find_by_id(attach_id) attachments.collect do |attach_id|
next if ori.blank? ori = Attachment.find_by_id(attach_id)
attach_copied_obj = ori.copy next if ori.blank?
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联 attach_copied_obj = ori.copy
attach_copied_obj.container = obj attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.created_on = Time.now attach_copied_obj.container = obj
attach_copied_obj.author_id = User.current.id attach_copied_obj.created_on = Time.now
if attach_copied_obj.attachtype == nil attach_copied_obj.author_id = User.current.id
attach_copied_obj.attachtype = 1 if attach_copied_obj.attachtype == nil
end attach_copied_obj.attachtype = 1
@obj = obj end
@save_flag = attach_copied_obj.save @obj = obj
@save_message = attach_copied_obj.errors.full_messages @save_flag = attach_copied_obj.save
end @save_message = attach_copied_obj.errors.full_messages
end
respond_to do |format|
format.js respond_to do |format|
end format.js
rescue NoMethodError end
@save_flag = false rescue NoMethodError
@save_message = [] << l(:error_attachment_empty) @save_flag = false
respond_to do |format| @save_message = [] << l(:error_attachment_empty)
format.js respond_to do |format|
end format.js
end end
end
def add_exist_file_to_course
class_id = params[:class_id] def add_exist_file_to_course
attachments = params[:attachment][:attach] class_id = params[:class_id]
attachments = params[:attachment][:attach]
obj = Course.find_by_id(class_id)
attachments.collect do |attach_id| obj = Course.find_by_id(class_id)
ori = Attachment.find_by_id(attach_id) attachments.collect do |attach_id|
next if ori.blank? ori = Attachment.find_by_id(attach_id)
attach_copied_obj = ori.copy next if ori.blank?
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联 attach_copied_obj = ori.copy
attach_copied_obj.container = obj attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.created_on = Time.now attach_copied_obj.container = obj
attach_copied_obj.author_id = User.current.id attach_copied_obj.created_on = Time.now
if attach_copied_obj.attachtype == nil attach_copied_obj.author_id = User.current.id
attach_copied_obj.attachtype = 4 if attach_copied_obj.attachtype == nil
end attach_copied_obj.attachtype = 4
@obj = obj end
@save_flag = attach_copied_obj.save @obj = obj
@save_message = attach_copied_obj.errors.full_messages @save_flag = attach_copied_obj.save
end @save_message = attach_copied_obj.errors.full_messages
end
respond_to do |format|
format.js respond_to do |format|
end format.js
rescue NoMethodError end
@save_flag = false rescue NoMethodError
@save_message = [] << l(:error_attachment_empty) @save_flag = false
respond_to do |format| @save_message = [] << l(:error_attachment_empty)
format.js respond_to do |format|
end format.js
end end
end
private
def find_project private
@attachment = Attachment.find(params[:id]) def find_project
# Show 404 if the filename in the url is wrong @attachment = Attachment.find(params[:id])
# modify by nwb # Show 404 if the filename in the url is wrong
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename # modify by nwb
if @attachment.container_type == 'Course' raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
@course = @attachment.course if @attachment.container_type == 'Course'
elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course @course = @attachment.course
@course = @attachment.container.course elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course
else @course = @attachment.container.course
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' else
@project = @attachment.project unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication'
end @project = @attachment.project
end end
rescue ActiveRecord::RecordNotFound end
render_404 rescue ActiveRecord::RecordNotFound
end render_404
end
# Checks that the file exists and is readable
def file_readable # Checks that the file exists and is readable
if @attachment.readable? def file_readable
true if @attachment.readable?
else true
logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable." else
render_404 logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable."
end render_404
end end
end
def read_authorize
if @attachment.container_type == "HomeworkAttach" || @attachment.container_type == 'Bid' def read_authorize
true if @attachment.container_type == "HomeworkAttach" || @attachment.container_type == 'Bid'
#User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access true
else #User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access
@attachment.visible? ? true : deny_access else
end @attachment.visible? ? true : deny_access
end end
end
def delete_authorize
@attachment.deletable? ? true : deny_access def delete_authorize
end @attachment.deletable? ? true : deny_access
end
def detect_content_type(attachment)
content_type = attachment.content_type def detect_content_type(attachment)
if content_type.blank? content_type = attachment.content_type
content_type = Redmine::MimeType.of(attachment.filename) if content_type.blank?
end content_type = Redmine::MimeType.of(attachment.filename)
content_type.to_s end
end content_type.to_s
end
def login_without_softapplication
referer = request.headers['Referer'] def login_without_softapplication
require_login unless referer =~ /softapplication/ referer = request.headers['Referer']
end require_login unless referer =~ /softapplication/
end
def renderTag
@attachmentNew = Attachment.find(params[:attchmentId]) def renderTag
respond_to do |format| @attachmentNew = Attachment.find(params[:attchmentId])
format.js respond_to do |format|
end format.js
end end
end end
end

@ -1,202 +1,202 @@
# 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 MessagesController < ApplicationController class MessagesController < ApplicationController
include ApplicationHelper include ApplicationHelper
menu_item :boards menu_item :boards
default_search_scope :messages default_search_scope :messages
before_filter :find_board, :only => [:new, :preview,:edit] before_filter :find_board, :only => [:new, :preview,:edit]
before_filter :find_attachments, :only => [:preview] before_filter :find_attachments, :only => [:preview]
before_filter :find_message, :except => [:new, :preview] before_filter :find_message, :except => [:new, :preview]
before_filter :authorize, :except => [:preview, :edit, :destroy, :new] before_filter :authorize, :except => [:preview, :edit, :destroy, :new]
helper :boards helper :boards
helper :watchers helper :watchers
helper :attachments helper :attachments
include AttachmentsHelper include AttachmentsHelper
helper :project_score helper :project_score
REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE) REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
# Show a topic and its replies # Show a topic and its replies
def show def show
@isReply = true @isReply = true
page = params[:page] page = params[:page]
# Find the page of the requested reply # Find the page of the requested reply
if params[:r] && page.nil? if params[:r] && page.nil?
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i]) offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
page = 1 + offset / REPLIES_PER_PAGE page = 1 + offset / REPLIES_PER_PAGE
end end
@reply_count = @topic.children.count @reply_count = @topic.children.count
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children. @replies = @topic.children.
includes(:author, :attachments, {:board => :project}). includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC"). reorder("#{Message.table_name}.created_on DESC").
limit(@reply_pages.per_page). limit(@reply_pages.per_page).
offset(@reply_pages.offset). offset(@reply_pages.offset).
all all
@reply = Message.new(:subject => "RE: #{@message.subject}") @reply = Message.new(:subject => "RE: #{@message.subject}")
if @course if @course
render :action => "show", :layout => "base_courses"#by young render :action => "show", :layout => "base_courses"#by young
else else
render :action => "show", :layout => "base_projects"#by young render :action => "show", :layout => "base_projects"#by young
end end
end end
# Create a new topic # Create a new topic
def new def new
@message = Message.new @message = Message.new
@message.author = User.current @message.author = User.current
@message.board = @board @message.board = @board
@message.safe_attributes = params[:message] @message.safe_attributes = params[:message]
if request.post? if request.post?
@message.save_attachments(params[:attachments]) @message.save_attachments(params[:attachments])
if @message.save if @message.save
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message}) call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
render_attachment_warning_if_needed(@message) render_attachment_warning_if_needed(@message)
redirect_to board_message_path(@board, @message) redirect_to board_message_path(@board, @message)
else else
layout_file = @project ? 'base_projects' : 'base_courses' layout_file = @project ? 'base_projects' : 'base_courses'
render :action => 'new', :layout => layout_file render :action => 'new', :layout => layout_file
end end
end end
end end
# Reply to a topic # Reply to a topic
def reply def reply
if params[:reply][:content] == "" if params[:reply][:content] == ""
(redirect_to board_message_path(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return) (redirect_to board_message_path(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
end end
@quote = params[:quote][:quote] @quote = params[:quote][:quote]
@reply = Message.new @reply = Message.new
@reply.author = User.current @reply.author = User.current
@reply.board = @board @reply.board = @board
@reply.safe_attributes = params[:reply] @reply.safe_attributes = params[:reply]
@reply.content = @quote + @reply.content @reply.content = @quote + @reply.content
@topic.children << @reply @topic.children << @reply
#@topic.update_attribute(:updated_on, Time.now) #@topic.update_attribute(:updated_on, Time.now)
if !@reply.new_record? if !@reply.new_record?
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply}) call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attachments = Attachment.attach_files(@reply, params[:attachments]) attachments = Attachment.attach_files(@reply, params[:attachments])
render_attachment_warning_if_needed(@reply) render_attachment_warning_if_needed(@reply)
else else
#render file: 'messages#show', layout: 'base_courses' #render file: 'messages#show', layout: 'base_courses'
end end
redirect_to board_message_path(@board, @topic, :r => @reply) redirect_to board_message_path(@board, @topic, :r => @reply)
end end
# Edit a message # Edit a message
def edit def edit
@isReply = false @isReply = false
if @project if @project
(render_403; return false) unless @message.editable_by?(User.current) (render_403; return false) unless @message.editable_by?(User.current)
else else
(render_403; return false) unless @message.course_editable_by?(User.current) (render_403; return false) unless @message.course_editable_by?(User.current)
end end
@message.safe_attributes = params[:message] @message.safe_attributes = params[:message]
if request.post? && @message.save if request.post? && @message.save
attachments = Attachment.attach_files(@message, params[:attachments]) attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message) render_attachment_warning_if_needed(@message)
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
@message.reload @message.reload
redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id)) redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id))
elsif request.get? elsif request.get?
respond_to do |format| respond_to do |format|
format.html { format.html {
layout_file = @project ? 'base_projects' : 'base_courses' layout_file = @project ? 'base_projects' : 'base_courses'
render :layout => layout_file render :layout => layout_file
} }
end end
end end
end end
# Delete a messages # Delete a messages
def destroy def destroy
if @project if @project
(render_403; return false) unless @message.destroyable_by?(User.current) (render_403; return false) unless @message.destroyable_by?(User.current)
else else
(render_403; return false) unless @message.course_destroyable_by?(User.current) (render_403; return false) unless @message.course_destroyable_by?(User.current)
end end
r = @message.to_param r = @message.to_param
@message.destroy @message.destroy
# modify by nwb # modify by nwb
if @project if @project
if @message.parent if @message.parent
redirect_to board_message_path(@board, @message.parent, :r => r) redirect_to board_message_path(@board, @message.parent, :r => r)
else else
redirect_to project_board_path(@project, @board) redirect_to project_board_path(@project, @board)
end end
elsif @course elsif @course
if @message.parent if @message.parent
redirect_to board_message_path(@board, @message.parent, :r => r) redirect_to board_message_path(@board, @message.parent, :r => r)
else else
redirect_to course_board_path(@course, @board) redirect_to course_board_path(@course, @board)
end end
end end
end end
def quote def quote
@subject = @message.subject @subject = @message.subject
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
#@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
#@temp = Message.new @temp = Message.new
##@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> " #@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> "
#@content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" @content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
#@content_html = textilizable(@content) @content_html = textilizable(@content)
#@temp.content = @content_html @temp.content = @content_html
@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/> &nbsp; " #@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/> &nbsp; "
@content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>" #@content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
@content = "<blockquote>" << @content #@content = "<blockquote>" << @content
@temp = Message.new #@temp = Message.new
@temp.content = @content #@temp.content = @content
end end
def preview def preview
message = @board.messages.find_by_id(params[:id]) message = @board.messages.find_by_id(params[:id])
@text = (params[:message] || params[:reply])[:content] @text = (params[:message] || params[:reply])[:content]
@previewed = message @previewed = message
render :partial => 'common/preview' render :partial => 'common/preview'
end end
private private
def find_message def find_message
return unless find_board return unless find_board
@message = @board.messages.find(params[:id], :include => :parent) @message = @board.messages.find(params[:id], :include => :parent)
@topic = @message.root @topic = @message.root
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
end end
def find_board def find_board
#modify by nwb #modify by nwb
@board = Board.find(params[:board_id]) @board = Board.find(params[:board_id])
if @board.project_id != -1 && @board.project_id != nil if @board.project_id != -1 && @board.project_id != nil
@project = @board.project @project = @board.project
elsif @board.course_id elsif @board.course_id
@course = @board.course @course = @board.course
end end
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
nil nil
end end
end end

@ -468,8 +468,8 @@ class ProjectsController < ApplicationController
def new def new
@issue_custom_fields = IssueCustomField.sorted.all @issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all @trackers = Tracker.sorted.all
@project = Project.new @project = Project.new
@project.safe_attributes = params[:project] @project.safe_attributes = params[:project]
render :layout => 'base' render :layout => 'base'
end end
@ -836,7 +836,7 @@ class ProjectsController < ApplicationController
format.api { render_api_ok } format.api { render_api_ok }
end end
else else
render :layout => "base" render :layout => "project_base"
end end
# hide project in layout # hide project in layout
@project = nil @project = nil

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,200 +1,200 @@
# 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 VersionsController < ApplicationController class VersionsController < ApplicationController
layout "base_projects" layout "base_projects"
menu_item :roadmap menu_item :roadmap
model_object Version model_object Version
before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] before_filter :find_model_object, :except => [:index, :new, :create, :close_completed]
#before_filter :find_model_object_contest, :except => [:index, :new, :create] #before_filter :find_model_object_contest, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed] before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed]
before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed] before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed]
before_filter :authorize before_filter :authorize
accept_api_auth :index, :show, :create, :update, :destroy accept_api_auth :index, :show, :create, :update, :destroy
helper :custom_fields helper :custom_fields
helper :projects helper :projects
helper :project_score helper :project_score
def index def index
respond_to do |format| respond_to do |format|
format.html { format.html {
@trackers = @project.trackers.sorted.all @trackers = @project.trackers.sorted.all
retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?}) retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?})
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id] project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id]
@versions = @project.shared_versions || [] @versions = @project.shared_versions || []
@versions += @project.rolled_up_versions.visible if @with_subprojects @versions += @project.rolled_up_versions.visible if @with_subprojects
#added by young #added by young
@versions = @versions.uniq.reverse#Modified by young @versions = @versions.uniq.reverse#Modified by young
unless params[:completed] unless params[:completed]
@completed_versions = @versions.select {|version| version.closed? || version.completed? } @completed_versions = @versions.select {|version| version.closed? || version.completed? }
@versions -= @completed_versions @versions -= @completed_versions
end end
@offset, @limit = api_offset_and_limit({:limit => 4}) @offset, @limit = api_offset_and_limit({:limit => 4})
@versions_count = @versions.count @versions_count = @versions.count
@versions_pages = Paginator.new @versions_count, @limit, params['page'] @versions_pages = Paginator.new @versions_count, @limit, params['page']
@offset ||= @versions_pages.offset @offset ||= @versions_pages.offset
@versions = @versions.slice(@offset, @limit) @versions = @versions.slice(@offset, @limit)
#end by young #end by young
@issues_by_version = {} @issues_by_version = {}
if @selected_tracker_ids.any? && @versions.any? if @selected_tracker_ids.any? && @versions.any?
issues = Issue.visible.all( issues = Issue.visible.all(
:include => [:project, :status, :tracker, :priority, :fixed_version], :include => [:project, :status, :tracker, :priority, :fixed_version],
:conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)}, :conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)},
:order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id" :order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id"
) )
@issues_by_version = issues.group_by(&:fixed_version) @issues_by_version = issues.group_by(&:fixed_version)
end end
@versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?} @versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?}
} }
format.api { format.api {
@versions = @project.shared_versions.all @versions = @project.shared_versions.all
} }
end end
end end
def show def show
respond_to do |format| respond_to do |format|
format.html { format.html {
@issues = @version.fixed_issues.visible. @issues = @version.fixed_issues.visible.
includes(:status, :tracker, :priority). includes(:status, :tracker, :priority).
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id"). reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
all all
} }
format.api format.api
end end
end end
def new def new
@version = @project.versions.build @version = @project.versions.build
@version.safe_attributes = params[:version] @version.safe_attributes = params[:version]
respond_to do |format| respond_to do |format|
format.html format.html
format.js format.js
end end
end end
def create def create
@version = @project.versions.build @version = @project.versions.build
if params[:version] if params[:version]
attributes = params[:version].dup attributes = params[:version].dup
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing']) attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
@version.safe_attributes = attributes @version.safe_attributes = attributes
end end
if request.post? if request.post?
if @version.save if @version.save
respond_to do |format| respond_to do |format|
format.html do format.html do
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
redirect_back_or_default settings_project_path(@project, :tab => 'versions') redirect_to settings_project_path(@project, :tab => 'versions')
end end
format.js format.js
format.api do format.api do
render :action => 'show', :status => :created, :location => version_url(@version) render :action => 'show', :status => :created, :location => version_url(@version)
end end
end end
else else
respond_to do |format| respond_to do |format|
format.html { render :action => 'new' } format.html { render :action => 'new' }
format.js { render :action => 'new' } format.js { render :action => 'new' }
format.api { render_validation_errors(@version) } format.api { render_validation_errors(@version) }
end end
end end
end end
end end
def edit def edit
end end
def update def update
if request.put? && params[:version] if request.put? && params[:version]
attributes = params[:version].dup attributes = params[:version].dup
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
@version.safe_attributes = attributes @version.safe_attributes = attributes
if @version.save if @version.save
respond_to do |format| respond_to do |format|
format.html { format.html {
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_back_or_default settings_project_path(@project, :tab => 'versions') redirect_back_or_default settings_project_path(@project, :tab => 'versions')
} }
format.api { render_api_ok } format.api { render_api_ok }
end end
else else
respond_to do |format| respond_to do |format|
format.html { render :action => 'edit' } format.html { render :action => 'edit' }
format.api { render_validation_errors(@version) } format.api { render_validation_errors(@version) }
end end
end end
end end
end end
def close_completed def close_completed
if request.put? if request.put?
@project.close_completed_versions @project.close_completed_versions
end end
redirect_to settings_project_path(@project, :tab => 'versions') redirect_to settings_project_path(@project, :tab => 'versions')
end end
def close_completed_contest def close_completed_contest
if request.put? if request.put?
@contest.close_completed_versions @contest.close_completed_versions
end end
redirect_to settings_contest_path(@contest, :tab => 'versions') redirect_to settings_contest_path(@contest, :tab => 'versions')
end end
def destroy def destroy
if @version.fixed_issues.empty? if @version.fixed_issues.empty?
@version.destroy @version.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_back_or_default settings_project_path(@project, :tab => 'versions') } format.html { redirect_back_or_default settings_project_path(@project, :tab => 'versions') }
format.api { render_api_ok } format.api { render_api_ok }
end end
else else
respond_to do |format| respond_to do |format|
format.html { format.html {
flash[:error] = l(:notice_unable_delete_version) flash[:error] = l(:notice_unable_delete_version)
redirect_to settings_project_path(@project, :tab => 'versions') redirect_to settings_project_path(@project, :tab => 'versions')
} }
format.api { head :unprocessable_entity } format.api { head :unprocessable_entity }
end end
end end
end end
def status_by def status_by
respond_to do |format| respond_to do |format|
format.html { render :action => 'show' } format.html { render :action => 'show' }
format.js format.js
end end
end end
private private
def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil) def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil)
if ids = params[:tracker_ids] if ids = params[:tracker_ids]
@selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s } @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
else else
@selected_tracker_ids = (selectable_trackers).collect {|t| t.id.to_s } @selected_tracker_ids = (selectable_trackers).collect {|t| t.id.to_s }
end end
end end
end end

@ -1,200 +1,200 @@
# 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 WelcomeController < ApplicationController class WelcomeController < ApplicationController
include ApplicationHelper include ApplicationHelper
include WelcomeHelper include WelcomeHelper
helper :project_score helper :project_score
caches_action :robots caches_action :robots
before_filter :find_first_page, :only => [:index] before_filter :find_first_page, :only => [:index]
# before_filter :fake, :only => [:index, :course] # before_filter :fake, :only => [:index, :course]
before_filter :entry_select, :only => [:index] before_filter :entry_select, :only => [:index]
def index def index
#@first_page = FirstPage.where("page_type = 'project'").first #@first_page = FirstPage.where("page_type = 'project'").first
#@show_course = @first_page.show_course #@show_course = @first_page.show_course
if @first_page.nil? || @first_page.sort_type.nil? if @first_page.nil? || @first_page.sort_type.nil?
@projects = find_miracle_project(10, 3,"score desc") @projects = find_miracle_project(10, 3,"score desc")
else else
case @first_page.sort_type case @first_page.sort_type
when 0 when 0
@projects = find_miracle_project(10, 3,"created_on desc") @projects = find_miracle_project(10, 3,"created_on desc")
#@projects = @projects_all.order("created_on desc") #@projects = @projects_all.order("created_on desc")
when 1 when 1
@projects = find_miracle_project(10, 3,"score desc") @projects = find_miracle_project(10, 3,"score desc")
#@projects = @projects_all.order("grade desc") #@projects = @projects_all.order("grade desc")
when 2 when 2
@projects = find_miracle_project(10, 3,"watchers_count desc") @projects = find_miracle_project(10, 3,"watchers_count desc")
#@projects = @projects_all.order("watchers_count desc") #@projects = @projects_all.order("watchers_count desc")
#gcm #gcm
#when '3' #when '3'
#@projects=desc_sort_course_by_avtivity(@project_activity_count_array,@project_all_array) #@projects=desc_sort_course_by_avtivity(@project_activity_count_array,@project_all_array)
# @projects=handle_project @projects_all,@project_activity_count # @projects=handle_project @projects_all,@project_activity_count
# @s_type = 3 # @s_type = 3
# @projects = @projects[@project_pages.offset, @project_pages.per_page] # @projects = @projects[@project_pages.offset, @project_pages.per_page]
else else
@projects = @projects_all.order("score desc") @projects = @projects_all.order("score desc")
end end
end end
end end
def robots def robots
@projects = Project.all_public.active @projects = Project.all_public.active
render :layout => false, :content_type => 'text/plain' render :layout => false, :content_type => 'text/plain'
end end
def course def course
@course_page = FirstPage.where("page_type = 'course'").first @course_page = FirstPage.where("page_type = 'course'").first
if params[:school_id] if params[:school_id]
@school_id = params[:school_id] @school_id = params[:school_id]
elsif User.current.logged? && User.current.user_extensions.school elsif User.current.logged? && User.current.user_extensions.try(:school)
@school_id = User.current.user_extensions.school.try(:id) @school_id = User.current.user_extensions.school.try(:id)
end end
@logoLink ||= logolink() @logoLink ||= logolink()
end end
def logolink() def logolink()
@course_page = FirstPage.where("page_type = 'course'").first @course_page = FirstPage.where("page_type = 'course'").first
logo = get_avatar?(@course_page) logo = get_avatar?(@course_page)
id = params[:school_id] id = params[:school_id]
logo_link = "" logo_link = ""
if id.nil? && (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) if id.nil? && (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?)
if logo if logo
logo_link = url_to_avatar(@course_page) logo_link = url_to_avatar(@course_page)
else else
logo_link = '/images/transparent.png' logo_link = '/images/transparent.png'
end end
else else
if id == "0" if id == "0"
if logo if logo
logo_link = url_to_avatar(@course_page) logo_link = url_to_avatar(@course_page)
else else
logo_link = '/images/transparent.png' logo_link = '/images/transparent.png'
end end
else else
if id.nil? if id.nil?
if School.find(User.current.user_extensions.school.id).logo_link.nil? if School.find(User.current.user_extensions.school.id).logo_link.nil?
logo_link = '/images/transparent.png' logo_link = '/images/transparent.png'
else else
logo_link = School.find(User.current.user_extensions.school.id).logo_link logo_link = School.find(User.current.user_extensions.school.id).logo_link
end end
else else
logo_link = School.find(id).logo_link logo_link = School.find(id).logo_link
end end
end end
end end
return logo_link return logo_link
end end
def contest def contest
@contest_page = FirstPage.where("page_type = 'contest'").first @contest_page = FirstPage.where("page_type = 'contest'").first
@contest_notifications = ContestNotification.order("id desc") @contest_notifications = ContestNotification.order("id desc")
end end
def search def search
search_condition = params[:q] search_condition = params[:q]
search_type = params[:search_type].to_sym unless search_condition.blank? search_type = params[:search_type].to_sym unless search_condition.blank?
if search_type.nil? && params[:contests_search] && params[:name] != "" if search_type.nil? && params[:contests_search] && params[:name] != ""
search_type = :contests search_type = :contests
search_condition = params[:name] search_condition = params[:name]
end end
respond_to do |format| respond_to do |format|
format.html{ format.html{
case search_type case search_type
when :projects when :projects
redirect_to projects_search_path(:name => search_condition, redirect_to projects_search_path(:name => search_condition,
:project_type => Project::ProjectType_project) :project_type => Project::ProjectType_project)
when :courses when :courses
redirect_to courses_search_path(:name => search_condition) redirect_to courses_search_path(:name => search_condition)
when :contests when :contests
redirect_to contests_path(:name => search_condition) redirect_to contests_path(:name => search_condition)
when :users when :users
redirect_to users_search_path(:name => search_condition) redirect_to users_search_path(:name => search_condition)
when :users_teacher when :users_teacher
redirect_to users_search_path(:name => search_condition, :role => :teacher) redirect_to users_search_path(:name => search_condition, :role => :teacher)
when :users_student when :users_student
redirect_to users_search_path(:name => search_condition, :role => :student) redirect_to users_search_path(:name => search_condition, :role => :student)
else else
#redirect_to home_path, :alert => l(:label_sumbit_empty) #redirect_to home_path, :alert => l(:label_sumbit_empty)
(redirect_to home_path, :notice => l(:label_sumbit_empty);return) #if params[:name].blank? (redirect_to home_path, :notice => l(:label_sumbit_empty);return) #if params[:name].blank?
end end
} }
end end
end end
private private
# 判断网站的入口,是课程 course 则跳过index去渲染 course 方法 # 判断网站的入口,是课程 course 则跳过index去渲染 course 方法
def entry_select def entry_select
#@first_page = FirstPage.where("page_type = 'project'").first #@first_page = FirstPage.where("page_type = 'project'").first
url = request.original_url.gsub('/','') url = request.original_url.gsub('/','')
if url.include?(Setting.host_course.gsub('/','')) if url.include?(Setting.host_course.gsub('/',''))
if @first_page.show_course == 1 if @first_page.show_course == 1
course course
render :course render :course
else else
render_404 render_404
end end
return 0 return 0
elsif url.include?(Setting.host_contest.gsub('/','')) elsif url.include?(Setting.host_contest.gsub('/',''))
if @first_page.show_contest == 1 if @first_page.show_contest == 1
contest contest
render :contest render :contest
else else
render_404 render_404
end end
return 0 return 0
elsif url.include?(Setting.host_user.gsub('/','')) elsif url.include?(Setting.host_user.gsub('/',''))
redirect_to(:controller => "users", :action => "index") redirect_to(:controller => "users", :action => "index")
end end
end end
# def render(*args) # def render(*args)
# _fake if @fake_filter # _fake if @fake_filter
# super # super
# end # end
# private # private
# def fake # def fake
# @fake_filter = true # @fake_filter = true
# end # end
# # 骗子方法 # # 骗子方法
# def _fake # def _fake
# instance_variables.map { |variable| # instance_variables.map { |variable|
# if variable.to_s =~ /Count$/ # if variable.to_s =~ /Count$/
# self.instance_variable_set(variable.to_sym, # self.instance_variable_set(variable.to_sym,
# ("1" + (self.instance_variable_get(variable.to_sym).to_s)).to_i) # ("1" + (self.instance_variable_get(variable.to_sym).to_s)).to_i)
# end # end
# } # }
# end # end
end end

@ -1,170 +1,175 @@
class ZipdownController < ApplicationController require 'zip'
class ZipdownController < ApplicationController
#查找项目(课程) #查找项目(课程)
before_filter :find_project_by_bid_id, :only => [:assort] before_filter :find_project_by_bid_id, :only => [:assort]
#检查权限 #检查权限
#勿删 before_filter :authorize, :only => [:assort,:download_user_homework] #勿删 before_filter :authorize, :only => [:assort,:download_user_homework]
SAVE_FOLDER = "#{Rails.root}/files" SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip" OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip"
#通过作业Id找到项目课程 #通过作业Id找到项目课程
def find_project_by_bid_id def find_project_by_bid_id
obj_class = params[:obj_class] obj_class = params[:obj_class]
obj_id = params[:obj_id] obj_id = params[:obj_id]
obj = obj_class.constantize.find(obj_id) obj = obj_class.constantize.find(obj_id)
case obj.class.to_s.to_sym case obj.class.to_s.to_sym
when :Bid when :Bid
@project = obj.courses[0] @project = obj.courses[0]
end end
end end
def assort def assort
obj_class = params[:obj_class] obj_class = params[:obj_class]
obj_id = params[:obj_id] obj_id = params[:obj_id]
obj = obj_class.constantize.find(obj_id) obj = obj_class.constantize.find(obj_id)
zipfile = nil zipfile = nil
case obj.class.to_s.to_sym case obj.class.to_s.to_sym
when :Bid when :Bid
zipfile = zip_bid obj zipfile = zip_bid obj
else else
logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!" logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!"
end end
send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile
#rescue NameError, ActiveRecord::RecordNotFound => e #rescue NameError, ActiveRecord::RecordNotFound => e
#logger.error "[ZipDown] ===> #{e}" #logger.error "[ZipDown] ===> #{e}"
#@error = e #@error = e
end end
#下载某一学生的作业的所有文件 #下载某一学生的作业的所有文件
def download_user_homework def download_user_homework
homework = HomeworkAttach.find params[:homework] homework = HomeworkAttach.find params[:homework]
if User.current.admin? || User.current.member_of_course?(homework.bid.courses.first) if User.current.admin? || User.current.member_of_course?(homework.bid.courses.first)
if homework != nil if homework != nil
if homework.attachments.count > 0 if homework.attachments.count > 0
zipfile = zip_homework_by_user homework zipfile = zip_homework_by_user homework
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
else else
render_403 :message => :no_file_dowmload ,:layout => "course_base" render file: 'public/no_file_found.html' , :layout => 'course_base'
end end
else else
render_403 :message =>:notice_file_not_found ,:layout => "course_base" render file: 'public/file_not_found.html' , :layout => 'course_base'
end end
else else
render_403 :message => :notice_not_authorized ,:layout => "course_base" render_403 :message => :notice_not_authorized ,:layout => "course_base"
end end
rescue => e
rescue => e render file: 'public/file_not_found.html' , :layout => 'course_base'
render file: 'public/file_not_found.html' , :layout => 'course_base' end
end
private
private
def zip_user_bid(bid,user_id)
def zip_user_bid(bid,user_id) # Todo: User Access Controll
# Todo: User Access Controll
homeattaches = bid.homeworks.where("user_id = ?",user_id)
homeattaches = bid.homeworks.where("user_id = ?",user_id) # 得到每一个人所有文件打包的zip文件
# 得到每一个人所有文件打包的zip文件 # 并将每一个人的zip打包为一个并返回路径
# 并将每一个人的zip打包为一个并返回路径 user_zip_paths = homeattaches.map do |homeattach|
user_zip_paths = homeattaches.map do |homeattach| zip_homework_by_user homeattach
zip_homework_by_user homeattach end
end #zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
#zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER user_zip_paths
user_zip_paths end
end
def zip_bid(bid)
def zip_bid(bid) # Todo: User Access Controll
# Todo: User Access Controll
homeattaches = bid.homeworks
homeattaches = bid.homeworks #记录所有作业是不是有附件有一个附件就改为true
# 得到每一个人所有文件打包的zip文件 has_file = false
# 并将每一个人的zip打包为一个并返回路径 # 得到每一个人所有文件打包的zip文件
user_zip_paths = homeattaches.map do |homeattach| # 并将每一个人的zip打包为一个并返回路径
if homeattach.attachments.count > 0 user_zip_paths = homeattaches.map do |homeattach|
zip_homework_by_user homeattach if homeattach.attachments.count > 0
end zip_homework_by_user homeattach
end has_file = true unless has_file
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER end
end
#@paths = homeworks_attach_path unless has_file
#zipfile = ziping homeworks_attach_path render file: 'public/no_file_fond.html' , :layout => 'course_base'
#send_file zipfile, :filename => bid.name, end
# :type => detect_content_type(zipfile) zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
#rescue Errno::ENOENT => e
# logger.error "[Errno::ENOENT] ===> #{e}" #@paths = homeworks_attach_path
# @error = e #zipfile = ziping homeworks_attach_path
end #send_file zipfile, :filename => bid.name,
# :type => detect_content_type(zipfile)
def zip_homework_by_user(homeattach) #rescue Errno::ENOENT => e
#if homeattach.attachments.count > 0 # logger.error "[Errno::ENOENT] ===> #{e}"
homeworks_attach_path = [] # @error = e
# 需要将所有homework.attachments遍历加入zip end
# 并且返回zip路径
user_attaches_paths = homeattach.attachments.each do |attach| def zip_homework_by_user(homeattach)
#length = attach.storage_path.length #if homeattach.attachments.count > 0
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) homeworks_attach_path = []
end # 需要将所有homework.attachments遍历加入zip
zipping("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) # 并且返回zip路径
#user_attaches_paths user_attaches_paths = homeattach.attachments.each do |attach|
#end #length = attach.storage_path.length
end homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end
zipping("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false) #user_attaches_paths
# 输入待打包的文件列表已经打包文件定位到ouput_path #end
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE') end
input_filename = files_paths
rename_zipfile = zip_name_refer ||= "archive_#{Time.now.to_i}.zip" def zipping(zip_name_refer, files_paths, output_path, is_attachment=false)
zipfile_name = "#{output_path}/#{rename_zipfile}" # 输入待打包的文件列表已经打包文件定位到ouput_path
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) input_filename = files_paths
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile| rename_zipfile = zip_name_refer ||= "archive_#{Time.now.to_i}.zip"
input_filename.each do |filename| zipfile_name = "#{output_path}/#{rename_zipfile}"
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
zipfile.add(rename_file, filename) Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
end input_filename.each do |filename|
zipfile.get_output_stream('ReadMe') do |os| rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
os.write 'Homeworks' rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
end
end zipfile.add(rename_file, filename)
zipfile_name end
rescue Errno => e zipfile.get_output_stream('ReadMe') do |os|
logger.error "[zipdown#zipping] ===> #{e}" os.write 'Homeworks'
@error = e end
end end
zipfile_name
#def ziping files_path rescue Errno => e
# ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE') logger.error "[zipdown#zipping] ===> #{e}"
# folder = SaveFolder @error = e
# input_filename = files_path end
# zipfile_name = "#{OutputFolder}/archive_#{Time.now.to_i}.zip"
# #def ziping files_path
# Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) # ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
# Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile| # folder = SaveFolder
# input_filename.each do |filename| # input_filename = files_path
# zipfile.add(ic.iconv(filename_to_real(File.basename(filename))), folder + '/' + filename) # zipfile_name = "#{OutputFolder}/archive_#{Time.now.to_i}.zip"
# end #
# zipfile.get_output_stream("ReadMe") { |os| # Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
# os.write "Homeworks" # Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
# } # input_filename.each do |filename|
# end # zipfile.add(ic.iconv(filename_to_real(File.basename(filename))), folder + '/' + filename)
# zipfile_name # end
#rescue Errno => e # zipfile.get_output_stream("ReadMe") { |os|
# logger.error "[zipdown#zipping] ===> #{e}" # os.write "Homeworks"
# @error = e # }
#end # end
# zipfile_name
def detect_content_type(name) #rescue Errno => e
content_type = Redmine::MimeType.of(name) # logger.error "[zipdown#zipping] ===> #{e}"
content_type.to_s # @error = e
end #end
def filename_to_real(name) def detect_content_type(name)
attach = Attachment.find_by_disk_filename(name) content_type = Redmine::MimeType.of(name)
attach.filename content_type.to_s
end end
end def filename_to_real(name)
attach = Attachment.find_by_disk_filename(name)
attach.filename
end
end

File diff suppressed because it is too large Load Diff

@ -1,21 +1,21 @@
class ProjectStatus < ActiveRecord::Base class ProjectStatus < ActiveRecord::Base
attr_accessible :changesets_count, :watchers_count, :project_id, :project_type,:grade attr_accessible :changesets_count, :watchers_count, :project_id, :project_type,:grade
belongs_to :project belongs_to :project
belongs_to :watchers belongs_to :watchers
belongs_to :changesets belongs_to :changesets
validates_presence_of :project_id validates_presence_of :project_id
validates_uniqueness_of :project_id validates_uniqueness_of :project_id
scope :visible, lambda {|*args| nil } scope :visible, lambda {|*args| nil }
# 更新字段 watchers_count 加1 这里没有做用户是否存在的匹配 # 更新字段 watchers_count 加1 这里没有做用户是否存在的匹配
# 负责这个表的聂同学 是在新建用户时就新建了该表的记录 # 负责这个表的聂同学 是在新建用户时就新建了该表的记录
# 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点 # 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点
# 删除用户时 此表创建人员未作相应删除动作 # 删除用户时 此表创建人员未作相应删除动作
def update_watchers_count(num) def update_watchers_count(num)
if self.watchers_count >= 0 if self.watchers_count||0 >= 0
self.update_attribute(:watchers_count, self.watchers_count.to_i + num) self.update_attribute(:watchers_count, self.watchers_count.to_i + num)
end end
end end
end end

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

@ -1,26 +1,26 @@
<h3><%=h @attachment.filename %></h3> <h3><%=h @attachment.filename %></h3>
<div class="attachments"> <div class="attachments">
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %> <p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p> <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%> <p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp <span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size"> <span class="size">
<!-- --> <% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') &&
<% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage')&&User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %> User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review', <%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment', :action => 'assign', :action_type => 'attachment',
:id=>@attachment.project, :id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id, :change_id => '', :attachment_id => @attachment.id,
}, :class => 'icon icon-add') %> }, :class => 'icon icon-add') %>
<% end %> <% end %>
</span></p> </span></p>
</div> </div>
&nbsp; &nbsp;
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %> <%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
<% html_title @attachment.filename %> <% html_title @attachment.filename %>
<% content_for :header_tags do -%> <% content_for :header_tags do -%>
<%= stylesheet_link_tag "scm" -%> <%= stylesheet_link_tag "scm" -%>
<% end -%> <% end -%>

@ -1,232 +1,232 @@
<%#= error_messages_for 'softapplication' %> <%#= error_messages_for 'softapplication' %>
<script type="text/javascript"> <script type="text/javascript">
//验证作品名称 //验证作品名称
function regexName() function regexName()
{ {
var name = $("#softapplication_name").val(); var name = $("#softapplication_name").val();
if(name.length ==0) if(name.length ==0)
{ {
$("#spane_name_notice").text("作品名称不能为空"); $("#spane_name_notice").text("作品名称不能为空");
$("#spane_name_notice").css('color','#ff0000'); $("#spane_name_notice").css('color','#ff0000');
$("#spane_name_notice").focus(); $("#spane_name_notice").focus();
return false; return false;
} }
else if(name.length <= 25) else if(name.length <= 25)
{ {
$("#spane_name_notice").text("填写正确"); $("#spane_name_notice").text("填写正确");
$("#spane_name_notice").css('color','#008000'); $("#spane_name_notice").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#spane_name_notice").text("作品名称超过25个汉字"); $("#spane_name_notice").text("作品名称超过25个汉字");
$("#spane_name_notice").css('color','#ff0000'); $("#spane_name_notice").css('color','#ff0000');
$("#spane_name_notice").focus(); $("#spane_name_notice").focus();
return false; return false;
} }
} }
//验证运行平台 //验证运行平台
function regexWorkdescription() function regexWorkdescription()
{ {
var workDescription = $("#softapplication_android_min_version_available").val(); var workDescription = $("#softapplication_android_min_version_available").val();
if(workDescription.length ==0) if(workDescription.length ==0)
{ {
$("#spane_workdescription_notice").text("运行平台不能为空"); $("#spane_workdescription_notice").text("运行平台不能为空");
$("#spane_workdescription_notice").css('color','#ff0000'); $("#spane_workdescription_notice").css('color','#ff0000');
return false; return false;
} }
if(workDescription.length <= 125) if(workDescription.length <= 125)
{ {
$("#spane_workdescription_notice").text("填写正确"); $("#spane_workdescription_notice").text("填写正确");
$("#spane_workdescription_notice").css('color','#008000'); $("#spane_workdescription_notice").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#spane_workdescription_notice").text("运行平台超过125个汉字"); $("#spane_workdescription_notice").text("运行平台超过125个汉字");
$("#spane_workdescription_notice").css('color','#ff0000'); $("#spane_workdescription_notice").css('color','#ff0000');
return false; return false;
} }
} }
//验证开发人员 //验证开发人员
function regexDevelopers() function regexDevelopers()
{ {
var workDescription = $("#softapplication_application_developers").val(); var workDescription = $("#softapplication_application_developers").val();
if(workDescription.length ==0) if(workDescription.length ==0)
{ {
$("#span_softapplication_application_developers").text("开发人员不能为空"); $("#span_softapplication_application_developers").text("开发人员不能为空");
$("#span_softapplication_application_developers").css('color','#ff0000'); $("#span_softapplication_application_developers").css('color','#ff0000');
return false; return false;
} }
if(workDescription.length <= 125) if(workDescription.length <= 125)
{ {
$("#span_softapplication_application_developers").text("填写正确"); $("#span_softapplication_application_developers").text("填写正确");
$("#span_softapplication_application_developers").css('color','#008000'); $("#span_softapplication_application_developers").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#span_softapplication_application_developers").text("开发人员超过125个汉字"); $("#span_softapplication_application_developers").text("开发人员超过125个汉字");
$("#span_softapplication_application_developers").css('color','#ff0000'); $("#span_softapplication_application_developers").css('color','#ff0000');
return false; return false;
} }
} }
//提交验证 //提交验证
function submit_new_softapplication() function submit_new_softapplication()
{ {
if(regexName() && regexWorkdescription() && regexDevelopers()) if(regexName() && regexWorkdescription() && regexDevelopers())
{ {
$("#new_softapplication").submit(); $("#new_softapplication").submit();
} }
} }
</script> </script>
<%= form_for Softapplication.new, :url => softapplications_path do |f| %> <%= form_for Softapplication.new, :url => softapplications_path do |f| %>
<fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" > <fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" >
<%= hidden_field_tag 'contest_id', @contest.id %> <%= hidden_field_tag 'contest_id', @contest.id %>
<tr style="width:700px; margin-left: -10px;"> <tr style="width:700px; margin-left: -10px;">
<span><%= l(:label_work_name) %></span> <span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td> <td>
<%= f.text_field :name, <%= f.text_field :name,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => "regexName();" :onblur => "regexName();"
%> %>
</td> </td>
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span> <span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_running_platform) %></span> <span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"> <td style="width: 100px">
<%= f.text_field :android_min_version_available, <%= f.text_field :android_min_version_available,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur=>"regexWorkdescription();" :onblur=>"regexWorkdescription();"
%> %>
</td> </td>
<span style="font-size: 10px" id="spane_workdescription_notice">(<%= l(:label_workdescription_lengthlimit) %>)</span> <span style="font-size: 10px" id="spane_workdescription_notice">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_type) %></span> <span><%= l(:label_work_type) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"> <td style="width: 100px">
<span> <span>
<%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %> <%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %>
</span> </span>
<%= f.select :app_type_name,work_type_opttion, <%= f.select :app_type_name,work_type_opttion,
{}, {},
{:style => "width:328px;",:onchange => "selectChange(this)"} %> {:style => "width:328px;",:onchange => "selectChange(this)"} %>
<%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
</td> </td>
<span style="font-size: 10px;display: none" id="other_span"> <span style="font-size: 10px;display: none" id="other_span">
<%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %> <%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
<input type="text" style="width: 120px;" id="other_input" name = "other_input"/> <input type="text" style="width: 120px;" id="other_input" name = "other_input"/>
</span> </span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_description) %></span> <span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"> <td style="width: 100px">
<%= f.text_field :description, <%= f.text_field :description,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;" :style => "width:320px;"
%> %>
</td> </td>
<!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span--> <!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span-->
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span> <span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"> <td style="width: 100px">
<%= f.text_field :application_developers, <%= f.text_field :application_developers,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => 'regexDevelopers();' :onblur => 'regexDevelopers();'
%> %>
</td> </td>
<span style="font-size: 10px" id="span_softapplication_application_developers"> <span style="font-size: 10px" id="span_softapplication_application_developers">
(<%= l(:label_workdescription_lengthlimit) %>) (<%= l(:label_workdescription_lengthlimit) %>)
</span> </span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_deposit_project) %></span> <span><%= l(:label_work_deposit_project) %></span>
<span style="padding-left: 4px"> <span style="padding-left: 4px">
<%= select_tag 'project', <%= select_tag 'project',
options_for_select(select_option_helper(@option)), options_for_select(select_option_helper(@option)),
:name => 'project', :name => 'project',
:class => 'grayline2', :class => 'grayline2',
:style => "width:328px;" :style => "width:328px;"
%> %>
</span> </span>
<span> <span>
<!-- modified by longjun --> <!-- modified by longjun -->
<%= link_to l(:label_create_new_projects), <%= link_to l(:label_create_new_projects),
new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain), new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain),
:target => '_blank' :target => '_blank'
%> %>
<!-- end longjun --> <!-- end longjun -->
</span><!-- new_project_path(course: 0, project_type: 0) --> </span><!-- new_project_path(course: 0, project_type: 0) -->
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<fieldset style="width: 500px; padding-top: 10px"> <fieldset style="width: 500px; padding-top: 10px">
<legend> <legend>
<%= l(:label_upload_softworkpacket_photo) %> <%= l(:label_upload_softworkpacket_photo) %>
</legend> </legend>
<%#= render_flash_messages %> <%#= render_flash_messages %>
<p id="put-bid-form-partial"> <p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form' %>
</p> </p>
<p style="font-size: 11px"> <p style="font-size: 11px;line-height:normal;">
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/> 1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
<br> <br>
2、<%= l(:label_upload_softapplication_photo_condition) %> 2、<%= l(:label_upload_softapplication_photo_condition) %>
</p> </p>
</fieldset> </fieldset>
</fieldset></br> </fieldset></br>
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px"> <div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
<input type="button" class="enterprise" value="<%=l(:button_create) %>" onclick="submit_new_softapplication();" > <input type="button" class="enterprise" value="<%=l(:button_create) %>" onclick="submit_new_softapplication();" >
<%#= submit_tag l(:button_create) %> <%#= submit_tag l(:button_create) %>
<%= submit_tag l(:button_cancel), <%= submit_tag l(:button_cancel),
:name => nil, :name => nil,
:onclick => "cancel();", :onclick => "cancel();",
:type => 'button', :type => 'button',
:class => "enterprise", :class => "enterprise",
:onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %> :onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
</div> </div>
<% end %> <% end %>

@ -11,7 +11,7 @@
<p > <p >
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%> <%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%>
<% unless @course.is_public == 1 %> <% unless @course.is_public == 1 %>
<span class='private_project'><%= l(:lable_private) %></span> <span class='private_project'><%= l(:label_private) %></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"))%>
</p> </p>

@ -37,7 +37,7 @@
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> --> <!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td> <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type"> <td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %></span> <span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
&nbsp; &nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;"> <span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,

@ -37,7 +37,7 @@
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> --> <!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td> <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type"> <td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %></span> <span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
&nbsp; &nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;"> <span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,

@ -1,32 +1,32 @@
<!-- added by fq --> <!-- added by fq -->
<!-- %= form_for(@forum) do |f| % --> <!-- %= form_for(@forum) do |f| % -->
<div id="share_new" style = "width: 500px; margin:0 auto; " > <div id="share_new" style = "width: 500px; margin:0 auto; " >
<%= labelled_form_for(@forum) do |f| %> <%= labelled_form_for(@forum) do |f| %>
<% if @forum.errors.any? %> <% if @forum.errors.any? %>
<!--<div id="error_explanation"> <!--<div id="error_explanation">
<h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2> <h2><#%= pluralize(@forum.errors.count, "error") %> prohibited this forum from being saved:</h2>
<ul> <ul>
<#% @forum.errors.full_messages.each do |msg| %> <#% @forum.errors.full_messages.each do |msg| %>
<li><#%= msg %></li> <li><#%= msg %></li>
<#% end %> <#% end %>
</ul> </ul>
</div> --> </div> -->
<% end %> <% end %>
<div style="width: 120%;"> <div style="width: 120%;">
<div class="field"> <div class="field">
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %> <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
</div> </div>
<div> <div>
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script> <script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<%= f.text_area :description, :required => true, :id => 'editor01' %> <%= f.text_area :description, :required => true, :id => 'editor01' %>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01',{height:300});</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01',{height:300});</script>
<p style="color: #ff0000">(<%= l(:lable_forums_max_length) %>)</p> <p style="color: #ff0000">(<%= l(:label_forums_max_length) %>)</p>
</div> </div>
<div class="actions" style=" padding-top: 10px; float:right"> <div class="actions" style=" padding-top: 10px; float:right">
<%= submit_tag l(:button_submit) %> <%= submit_tag l(:button_submit) %>
<%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %> <%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %>
</div> </div>
</div> </div>
<% end %> <% end %>
</div> </div>

@ -10,7 +10,7 @@
</div> </div>
<div class="forums-index-content"> <div class="forums-index-content">
<p ><%= link_to h(forum.name), forum_path(forum) %></p> <p ><%= link_to h(forum.name), forum_path(forum) %></p>
<p ><%= forum.description%></p> <p ><%= textAreailizable forum.description%></p>
<p ><%= authoring forum.created_at, forum.creator %></p></div> <p ><%= authoring forum.created_at, forum.creator %></p></div>
<div class="forums-index-count"> <div class="forums-index-count">
<table class="forums-count-color"><tr class="forums-count-color" align="center"><td><%= link_to (forum.memo_count), forum_path(forum) %></td><td><%= link_to (forum.topic_count), forum_path(forum) %></td></tr> <table class="forums-count-color"><tr class="forums-count-color" align="center"><td><%= link_to (forum.memo_count), forum_path(forum) %></td><td><%= link_to (forum.topic_count), forum_path(forum) %></td></tr>

@ -1,56 +1,44 @@
<!-- added by fq --> <!-- added by fq -->
<div id="add-memo" class='lz' style="display: none; padding: 20px;"> <div id="add-memo" class='lz' style="display: none; padding: 20px;">
<h3><%=l(:label_memo_new)%></h3> <h3><%=l(:label_memo_new)%></h3>
<% if User.current.logged? %> <% if User.current.logged? %>
<%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %> <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
<!--<#% if @memo.errors.any? %> <div class="actions" style="max-width:680px">
<div id="error_explanation"> <p><%= f.text_field :subject, :required => true%></p>
<h2><#%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2> <p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
<ul> <p style="color: #ff0000">(<%= l(:label_memos_max_length) %>)</p>
<#% @memo.errors.full_messages.each do |msg| %> <p>
<li><#%= msg %></li> <%= l(:label_attachment_plural) %><br />
<#% end %> <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</ul> </p>
</div> <%= f.submit :value => l(:label_memo_create) %>
<#% end %> --> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
<div class="actions" style="max-width:680px"> </div>
<p><%= f.text_field :subject, :required => true%></p> <% end %>
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p> <% end %>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script> </div>
<p style="color: #ff0000">(<%= l(:lable_memos_max_length) %>)</p> <!--modified by huang-->
<p> <% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
<span class="contextual-borad">
<%= l(:label_attachment_plural) %><br /> <%= link_to(
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %> image_tag('edit.png')+l(:label_forum_edit),
</p> {:action => 'edit', :id => @forum},
<%= f.submit :value => l(:label_memo_create) %> :method => 'get',
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %> :title => l(:button_edit)
</div> ) if @forum.editable_by?(User.current) %>
<% end %> <%= link_to(
<% end %> image_tag('delete.png')+'删除讨论区',
</div> {:action => 'destroy', :id => @forum},
<!--modified by huang--> :method => :delete,
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %> :data => {:confirm => l(:text_are_you_sure)},
<span class="contextual-borad"> :title => l(:button_delete)
<%= link_to( ) if @forum.destroyable_by?(User.current) %>
image_tag('edit.png')+l(:label_forum_edit), </span>
{:action => 'edit', :id => @forum}, <span>
:method => 'get', <%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
:title => l(:button_edit) :onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
) if @forum.editable_by?(User.current) %> </span>
<%= link_to(
image_tag('delete.png')+'删除讨论区',
{:action => 'destroy', :id => @forum}, <%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @forum.destroyable_by?(User.current) %>
</span>
<span>
<%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
</span>
<%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>

@ -1,235 +1,235 @@
<% <%
@nav_dispaly_contest_label = 1 @nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1 @nav_dispaly_store_all_label = 1
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main" class=""> <div id="main" class="">
<!-- added by bai --> <!-- added by bai -->
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td> <td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', @bid.reward_type %> <%= hidden_field_tag 'reward_type', @bid.reward_type %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %></td> <td style="padding-left: 8px"><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > <td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
<span><%= link_to @bid.name, bid_path %></span></td> <span><%= link_to @bid.name, bid_path %></span></td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- end --> <!-- end -->
<div id="sidebar"> <div id="sidebar">
<div class="main_context"> <div class="main_context">
<div class="spaceleft"> <div class="spaceleft">
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr>
<td align="left" width="100px"> <td align="left" width="100px">
<%= image_tag(url_to_avatar(@user), :class => "avatar2") %> <%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
</td> </td>
<td> <td>
<table> <table>
<tr> <tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= h @bid.name %></td> <td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= h @bid.name %></td>
</tr> </tr>
<% if User.current.login? %> <!--added by linchun--> <% if User.current.login? %> <!--added by linchun-->
<tr colspan='3'> <tr colspan='3'>
<td valign="middle"> <td valign="middle">
<span style="display:block; margin-left:20px;"><%= join_in_contest(@bid, User.current)%></span> <span style="display:block; margin-left:20px;"><%= join_in_contest(@bid, User.current)%></span>
<span style="display:block; margin-left:20px;"><span class="icon-fav icon"></span><%= watcher_link(@bid, User.current) %></span> <span style="display:block; margin-left:20px;"><span class="icon-fav icon"></span><%= watcher_link(@bid, User.current) %></span>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
<!-- added by bai 增加了竞赛的配置 --> <!-- added by bai 增加了竞赛的配置 -->
<% if User.current.logged? %> <% if User.current.logged? %>
<% if @bid.author.id == User.current.id %> <% if @bid.author.id == User.current.id %>
<%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %>
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
</table> </table>
</div> </div>
<!-- added by bai 增加参与人和参与项目的数量显示 --> <!-- added by bai 增加参与人和参与项目的数量显示 -->
<div class="user_fans"> <div class="user_fans">
<table width="240" border="0"> <table width="240" border="0">
<tr align="center" width="80px"> <tr align="center" width="80px">
<td class="font_index"><%=link_to "#{@bid.join_in_contests.count}",:controller => "bids", <td class="font_index"><%=link_to "#{@bid.join_in_contests.count}",:controller => "bids",
:action => "show_participator" %></td> :action => "show_participator" %></td>
<td class="font_index"><%=link_to "#{@bid.projects.where('is_public=1').count}", :controller => 'bids', <td class="font_index"><%=link_to "#{@bid.projects.where('is_public=1').count}", :controller => 'bids',
:action => 'show_project' %></td> :action => 'show_project' %></td>
<tr class="font_aram"> <tr class="font_aram">
<td align="center" width="70px"> <%= l(:label_participator) %></td> <td align="center" width="70px"> <%= l(:label_participator) %></td>
<td align="center" width="70px"> <%= l(:label_bidding_project) %></td> <td align="center" width="70px"> <%= l(:label_bidding_project) %></td>
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<!-- end --> <!-- end -->
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr>
<td><%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%></td> <td><%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%></td>
</tr> </tr>
<!-- end --> <!-- end -->
<tr> <tr>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td> <td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
</tr> </tr>
<tr> <tr>
<td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td> <td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
<!--description--> <!--description-->
<div class="inf_user_context"> <div class="inf_user_context">
<div class="font_title_left"> <div class="font_title_left">
<%= l(:label_project_overview) %> <%= l(:label_project_overview) %>
</div> </div>
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<% if @bid.description.size>0 %> <% if @bid.description.size>0 %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
<%= textilizable @bid.description %> <%= textilizable @bid.description %>
</div> </div>
<% else %> <% else %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
<%= l(:label_course_description_no) %> <%= l(:label_course_description_no) %>
</div> </div>
<% end %> <% end %>
<div class="created_on_project"> <div class="created_on_project">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@bid.created_on) %> <strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@bid.created_on) %>
</div> </div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<!--tags--> <!--tags-->
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
<table style="font-family:微软雅黑"> <table style="font-family:'微软雅黑'">
<tr> <tr>
<td><!-- added by william -for tag --> <td><!-- added by william -for tag -->
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong> <strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong>
<% if show_more_fans?(@bid) %> <% if show_more_fans?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%></span> <span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%></span>
<% end %> <% end %>
</div> </div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <td style="padding-top: 5px">
<%= show_bid_fans_picture(@bid)%> <%= show_bid_fans_picture(@bid)%>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<!-- participate --> <!-- participate -->
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_bidding_project) %></strong> <strong><%= l(:label_bidding_project) %></strong>
<% if show_more_bid_project?(@bid) %> <% if show_more_bid_project?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%></span> <span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%></span>
<% end %> <% end %>
</div> </div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <td style="padding-top: 5px">
<%= show_bid_project(@bid) %> <%= show_bid_project(@bid) %>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- end --> <!-- end -->
<div class="user_underline"></div> <div class="user_underline"></div>
<!--fans fq--> <!--fans fq-->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong> <strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong>
<% if show_more_participate?(@bid) %> <% if show_more_participate?(@bid) %>
<span style="font-size: 12px; display: inline; float: right;" > <span style="font-size: 12px; display: inline; float: right;" >
<%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%> <%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%>
</span> </span>
<% end %> <% end %>
</div> </div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <%= show_participate_picture(@bid) %> </td> <td style="padding-top: 5px"> <%= show_participate_picture(@bid) %> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div id="content"> <div id="content">
<% if display_main_menu?(@bid) %> <% if display_main_menu?(@bid) %>
<div class="tabs_new"> <div class="tabs_new">
<%= render_menu :bid_menu %> <%= render_menu :bid_menu %>
</div> </div>
<% end %> <% end %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<%=render :partial => 'layouts/base_footer'%> <%=render :partial => 'layouts/base_footer'%>
</div> </div>
</div> </div>
</div> </div>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</div> </div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>

@ -1,97 +1,99 @@
<% @nav_dispaly_home_path_label = 1 <% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1 @nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1 @nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= javascript_include_tag "ckeditor/ckeditor.js" %> <%= javascript_include_tag "ckeditor/ckeditor.js" %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main"> <div id="main">
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td> <td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(:controller => 'forums', :action => "search_memo", :id => params[:id], :method => :get) do %> <%= form_tag(:controller => 'forums', :action => "search_memo", :id => params[:id], :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'forum_id', params[:id] %> <%= hidden_field_tag 'forum_id', params[:id] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td> <td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %></p></td> <td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %></p></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="sidebar"> <div id="sidebar">
<!--informations--> <!--informations-->
<div class="sidebar-forums"> <div class="sidebar-forums">
<div class="forums-line"> <div class="forums-line">
<div class="forums-title"><%= @forum.name %></div> <div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= textilizable @forum.description %></div> <div class="forums-description"><%= textAreailizable @forum.description %></div>
</div> </div>
<!--informations--> <!--informations-->
<div class="formus-first-title" >创建人信息</div> <div class="formus-first-title" >创建人信息</div>
<div class="forums-info"> <div class="forums-info">
<div style="padding-top: 20px" > <div style="padding-top: 20px" >
<span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class =>'vatar-size') %></span> <span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class =>'vatar-size') %></span>
<span class="forums-avatar-right"> <span class="forums-avatar-right">
<%=link_to @forum.creator.name, user_path(@forum.creator) %> <% unless @forum.creator.nil? %>
<div> <%=link_to @forum.creator.name, user_path(@forum.creator) %>
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %> <div>
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %> <%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %>
</div> <%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %>
</span> </div>
</div> <% end %>
</div> </span>
<!--tags--> </div>
<% if User.current.logged? || User.current.admin? %> </div>
<div class="forums-tags"><%= render :partial => 'tags/tag', :locals => {:obj => @forum,:object_flag => "5"}%></div> <!--tags-->
<% end %> <% if User.current.logged? || User.current.admin? %>
</div> <div class="forums-tags"><%= render :partial => 'tags/tag', :locals => {:obj => @forum,:object_flag => "5"}%></div>
</div> <% end %>
<div id="content"> </div>
</div>
<%= render_flash_messages %> <div id="content">
<%= yield %>
<%= call_hook :view_layouts_base_content %> <%= render_flash_messages %>
<div style="clear:both;"></div> <%= yield %>
<%= call_hook :view_layouts_base_content %>
</div> <div style="clear:both;"></div>
<%= render :partial => 'layouts/base_footer'%>
</div> </div>
<div id="ajax-indicator" style="display:none;"> <%= render :partial => 'layouts/base_footer'%>
<span><%= l(:label_loading) %></span> </div>
</div> <div id="ajax-indicator" style="display:none;">
<div id="ajax-modal" style="display:none;"></div> <span><%= l(:label_loading) %></span>
</div> </div>
</div> <div id="ajax-modal" style="display:none;"></div>
</div> </div>
<%= call_hook :view_layouts_base_body_bottom %> </div>
</body> </div>
</html> <%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

@ -63,11 +63,16 @@
<div class="forums-info"> <div class="forums-info">
<div style="padding-top: 20px" > <div style="padding-top: 20px" >
<span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %></span> <span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %></span>
<span class="forums-avatar-right"><%=link_to @forum.creator.name, user_path(@forum.creator) %> <span class="forums-avatar-right">
<div> <% unless @forum.creator.nil? %>
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %> <%=link_to @forum.creator.name, user_path(@forum.creator) %>
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %></div></span> <div>
</div> <%= link_to l(:label_user_watcher)+"("+User.watched_by(@forum.creator.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist", :id => @forum.creator.id %>
<%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@forum.creator.watcher_users(@forum.creator.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist", :id => @forum.creator.id %>
</div>
</span>
<% end %>
</div>
</div> </div>
<!--tags--> <!--tags-->
<% if User.current.logged? || User.current.admin? %> <% if User.current.logged? || User.current.admin? %>

@ -1,245 +1,240 @@
<% <%
@nav_dispaly_contest_label = 1 @nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1 @nav_dispaly_store_all_label = 1
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main" class=""> <div id="main" class="">
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td> <td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <div class="project-search">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %> <%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td> <td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td>
<td ><%=link_to l(:field_homepage), home_path %> > <td><%=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' %> >
<span><%= link_to @contest.name, show_contest_contest_path(@contest) %></span> <span title="<%= @contest.name%>"><%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %></span>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="sidebar"> <div id="sidebar">
<div class="main_context"> <div class="main_context">
<div class="spaceleft"> <div class="spaceleft">
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr>
<td align="left" width="100px"> <td align="left" width="100px">
<%= image_tag(url_to_avatar(@user), :class => "avatar2") %> <%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
</td> </td>
<td> <td>
<table> <table>
<tr> <tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= link_to @contest.name, show_contest_contest_path(@contest) %></td> <td class="info_font" title="<%= @contest.name%>"><%= link_to h(truncate(@contest.name, length: 13, omission: '...')), show_contest_contest_path(@contest) %></td>
</tr> </tr>
<% if User.current.login? %> <% if User.current.login? %>
<tr colspan='3'> <tr colspan='3'>
<td valign="middle"> <td valign="middle">
<!-- <span style="display:block; margin-left:20px; margin-bottom: 5px"><%= join_in_competition(@contest, User.current)%></span> --> <!-- <span style="display:block; margin-left:20px; margin-bottom: 5px"><%= join_in_competition(@contest, User.current)%></span> -->
<span style="display:block; margin-left:20px;"><%= new_watcher_link(@contest, User.current) %></span> <span style="display:block; margin-left:20px;"><%= new_watcher_link(@contest, User.current) %></span>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<!-- 竞赛的配置 --> <!-- 竞赛的配置 -->
<% if User.current.logged? %> <% if User.current.logged? %>
<% if (@contest.author.id == User.current.id) || User.current.admin? %> <% if (@contest.author.id == User.current.id) || User.current.admin? %>
<tr colspan='3'> <tr colspan='3'>
<td valign="middle"> <td valign="middle">
<span style="display:block; margin-left:20px;"><%= link_to l(:label_contest_modify_settings), {:controller => 'contests', :action => 'settings', :id => @contest} %></span> <span style="display:block; margin-left:20px;"><%= link_to l(:label_contest_modify_settings), {:controller => 'contests', :action => 'settings', :id => @contest} %></span>
</td> </td>
</tr> </tr>
<tr colspan='3'> <tr colspan='3'>
<td valign="middle"> <td valign="middle">
<span style="display:block; margin-left:20px;"><%= link_to l(:label_contest_delete), {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, data: { confirm: '你确定要删除该竞赛吗?' }, method: :delete %></span> <span style="display:block; margin-left:20px;"><%= link_to l(:label_contest_delete), {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, data: { confirm: '你确定要删除该竞赛吗?' }, method: :delete %></span>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% end %> <% end %>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 参与人和参与项目的数量显示 --> <!-- 参与人和参与项目的数量显示 -->
<div class="user_fans"> <div class="user_fans">
<table width="240" border="0"> <table width="240" border="0">
<tr align="center" width="80px"> <tr align="center" width="80px">
<!--关注人数--> <!--关注人数-->
<td class="font_index"> <td class="font_index">
<%=link_to "#{@contest.watcher_users.count}",show_project_contest_path(@contest) %> <span id="watcher_count_span">
</td> <%=link_to "#{@contest.watcher_users.count}",show_project_contest_path(@contest) %>
<!--参赛作品数量--> </span>
<td class="font_index"> </td>
<% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %> <!--参赛作品数量-->
<%=link_to "#{@contest.projects.where('is_public=1').count}" %> <td class="font_index">
<% else %> <% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %>
<%=link_to "#{@contest.contesting_softapplications.count}",show_attendingcontest_contest_path(@contest) %> <%=link_to "#{@contest.projects.where('is_public=1').count}" %>
<% end %> <% else %>
</td> <%=link_to "#{@contest.contesting_softapplications.count}",show_attendingcontest_contest_path(@contest) %>
<% end %>
</tr> </td>
<tr class="font_aram">
<!-- <td align="center" width="70px"> <%= l(:label_participate) %></td> --> </tr>
<td align="center" width="70px"> <%= l(:label_contest_watchers) %></td> <tr class="font_aram">
<td align="center" width="70px"> <%= l(:label_contest_work) %></td> <!-- <td align="center" width="70px"> <%= l(:label_participate) %></td> -->
<td align="center" width="70px"> <%= l(:label_contest_watchers) %></td>
</tr> <td align="center" width="70px"> <%= l(:label_contest_work) %></td>
</table>
<div class="user_underline"></div> </tr>
</div> </table>
<div class="user_underline"></div>
<div class="inf_user_image"> </div>
<table>
<tr> <div class="inf_user_image">
<td><%= l(:lable_contest_user) %>:&nbsp;<%= link_to(@user.name, user_path(@user))%></td> <table>
</tr> <tr>
<tr> <td><%= l(:lable_contest_user) %>:&nbsp;<%= link_to(@user.name, user_path(@user))%></td>
<td><%= l(:label_bids_reward_method) %><%= @contest.budget%></td> </tr>
</tr> <tr>
<tr> <td><%= l(:label_bids_reward_method) %><%= @contest.budget%></td>
<td><%= l(:label_limit_time) %> : <%= @contest.deadline%></td> </tr>
</tr> <tr>
</table> <td><%= l(:label_limit_time) %> : <%= @contest.deadline%></td>
</div> </tr>
<div class="user_underline"></div> </table>
</div>
<div class="inf_user_context"> <div class="user_underline"></div>
<div class="font_title_left">
<%= l(:label_project_overview) %> <div class="inf_user_context">
</div> <div class="font_title_left">
<div style="padding-bottom: 8px"> <%= l(:label_project_overview) %>
<% if @contest.description.size>0 %> </div>
<div class="font_lighter_sidebar"> <div style="padding-bottom: 8px">
<% if @contest.description.size>0 %>
<%= textilizable @contest.description %> <div class="font_lighter_sidebar">
</div>
<% else %> <%= textilizable @contest.description %>
<div class="font_lighter_sidebar"> </div>
<%= l(:label_contest_description_no) %> <% else %>
</div> <div class="font_lighter_sidebar">
<% end %> <%= l(:label_contest_description_no) %>
<div class="created_on_project"> </div>
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@contest.created_on) %> <% end %>
</div> <div class="created_on_project">
<!-- <% if User.current.logged? %> <strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@contest.created_on) %>
<% if @contest.author.id == User.current.id %> </div>
<div> </div>
<%= link_to '删除', {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, data: { confirm: '你确定要删除该竞赛吗?' } %> <div class="user_underline"></div>
</div> </div>
<% end %>
<% end %> --> <!--标签-->
</div> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
</div> <table style="font-family:'微软雅黑'">
<tr>
<!--标签--> <td>
<div class="user_fans"> <%= render :partial => 'tags/tag', :locals => {:obj => @contest, :object_flag => "7"}%>
<div class="user_underline"></div> </td>
<table style="font-family:微软雅黑"> </tr>
<tr> </table>
<td> </div>
<%= render :partial => 'tags/tag', :locals => {:obj => @contest, :object_flag => "7"}%>
</td> <!--关注-->
</tr> <div class="user_fans">
</table> <div class="user_underline"></div>
</div> <div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @contest.watcher_users.count) %></strong>
<!--关注--> <!-- <% if show_more_fans?(@contest) %>
<div class="user_fans"> <span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'contests', :action => 'show_contest_user'%></span>
<div class="user_underline"></div> <% end %> -->
<div class="font_title_left"> </div>
<strong><%= l(:label_x_followers, :count => @contest.watcher_users.count) %></strong> <div class="left_wf">
<!-- <% if show_more_fans?(@contest) %> <table>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'contests', :action => 'show_contest_user'%></span> <tr>
<% end %> --> <td style="padding-top: 5px">
</div> <%= show_contest_fans_picture(@contest)%>
<div class="left_wf"> </td>
<table> </tr>
<tr> </table>
<td style="padding-top: 5px"> </div>
<%= show_contest_fans_picture(@contest)%> </div>
</td>
</tr> <!-- 参赛项目 -->
</table>
</div>
</div> <!-- 参赛应用-->
<!-- 参赛项目 --> </div>
</div>
<!-- 参赛应用-->
<div class="user_underline"></div>
</div>
</div> <div class="user_underline"></div>
</div>
<div class="user_underline"></div>
<div id="content">
<div class="user_underline"></div> <% if display_main_menu?(@contest) %>
</div> <div class="tabs_new">
<ul>
<li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li>
<div id="content"> <li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li>
<% if display_main_menu?(@contest) %> <li><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li>
<div class="tabs_new"> </ul>
<ul> </div>
<li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li> <% end %>
<li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li>
<li><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li> <%= yield %>
</ul> <%= call_hook :view_layouts_base_content %>
</div> <div style="clear:both;"></div>
<% end %> </div>
<%=render :partial => 'layouts/base_footer'%>
<%= yield %> </div>
<%= call_hook :view_layouts_base_content %> </div>
<div style="clear:both;"></div> </div>
</div>
<%=render :partial => 'layouts/base_footer'%> <div id="ajax-indicator" style="display:none;">
</div> <span><%= l(:label_loading) %></span>
</div> </div>
</div> <div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;"> </div>
<span><%= l(:label_loading) %></span> <%= call_hook :view_layouts_base_body_bottom %>
</div> </body>
<div id="ajax-modal" style="display:none;"></div> </html>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

@ -1,165 +1,156 @@
<% @nav_dispaly_project_label = 1 <% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %> @nav_dispaly_forum_label = 1 %>
<% #@nav_dispaly_project_label = 1 %> <%#@nav_dispaly_project_label = 1 %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= hubspot_head %> <%= hubspot_head %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<!--add by huang--> <!--add by huang-->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main"> <div id="main">
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td> <td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(projects_search_path, :method => :get) do %> <%= form_tag(projects_search_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %></td> <td style="padding-left: 8px"><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_project_deposit),:controller => 'projects', :action => 'index', :project_type => 0 %> > <%=link_to @project, project_path(@project) %></p></td> <td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_project_deposit),:controller => 'projects', :action => 'index', :project_type => 0 %> > <%=link_to @project, project_path(@project) %></p></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="sidebar">
<div class="spaceleft">
<div class="inf_user_image">
<div id="sidebar"> <% @project = Project.find_by_id(@project.id)%>
<div class="spaceleft"> <table>
<div class="inf_user_image"> <tr>
<% @project = Project.find_by_id(@project.id)%> <td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<table> <td>
<tr> <div class="info-course">
<td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td> <%= link_to @project.name, project_path(@project)%>
<td> </div>
<div class="info-course"> <div>
<%= link_to @project.name, project_path(@project)%>
</div> <% if @project.project_type == 0 %>
<div> <%= l(:label_project_grade)%> :
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
<% if @project.project_type == 0 %> :action => 'show_projects_score',
<%= l(:label_project_grade)%> : :remote => true,
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', :id => @project.id
:action => 'show_projects_score', }, :style => "color: #EC6300;")%>
:remote => true, <% end %>
:id => @project.id <!-- end -->
}, :style => "color: #EC6300;")%> </div>
<% end %> <div id="join_exit_project_div">
<!-- end --> <%= render 'layouts/join_exit_project' %>
</div> </div>
<div id="join_exit_project_div"> </td>
<%= render 'layouts/join_exit_project' %> </tr>
</div> </table>
</td> </div>
</tr>
</table> <div class="user_fans">
</div> <table width="240" border="0">
<tr align="center" width="80px">
<div class="user_fans"> <% files_count = @project.attachments.count %>
<table width="240" border="0"> <% @project.versions.each do |version| %>
<tr align="center" width="80px"> <% files_count += version.attachments.count %>
<% files_count = @project.attachments.count %> <% end %>
<% @project.versions.each do |version| %> <td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
<% files_count += version.attachments.count %> <td class="font_index"><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %></td>
<% end %> <td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
<!-- <td class="font_index"><%=link_to files_count, project_files_path(@project) %></td> -->
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td> </tr>
<td class="font_index"><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %></td> <tr class="font_aram">
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td> <td align="center" width="70px"> <%= l(:label_member) %></td>
<!-- <td class="font_index"><%=link_to files_count, project_files_path(@project) %></td> --> <td align="center" width="100px"><%= l(:label_user_watchered) %></td>
</tr> <td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> -->
<tr class="font_aram"> </tr>
<td align="center" width="70px"> <%= l(:label_member) %></td> </table>
<td align="center" width="100px"><%= l(:label_user_watchered) %></td> <div class="user_underline"></div>
<td align="center" width="70px"> <%= l(:label_project_issues) %></td> </div>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> --> <div class="inf_user_context">
</tr> <div class="font_title_left">
</table> <%= l(:label_project_overview) %>
<div class="user_underline"></div> </div>
</div> <div style="padding-bottom: 8px">
<div class="font_lighter_sidebar" style="word-break:break-all;word-wrap: break-word;">
<div class="inf_user_context"> <%= textilizable @project.description %>
<div class="font_title_left"> </div>
<%= l(:label_project_overview) %> <div class="created_on_project">
</div> <strong style="color: #15bccf"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %>
</div>
<div style="padding-bottom: 8px"> </div>
<div class="font_lighter_sidebar" style="word-break:break-all;word-wrap: break-word;"> <div class="user_underline"></div>
<%= textilizable @project.description %> </div>
</div> <!--tags-->
<div class="created_on_project"> <div class="user_fans">
<strong style="color: #15bccf"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %> <!-- added by william -for tag -->
</div> <div class="user_tags">
</div> <div id="tags">
<div class="user_underline"></div> <%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div> </div>
<!--tags--> </div>
</div>
<div class="user_fans"> <!--tool-->
<!-- added by william -for tag --> <div class="user_underline"></div>
<div class="user_tags"> <div class="tool">
<div id="tags"> <%= render 'projects/tools_expand' %>
<%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%> </div>
</div> <div class="user_underline"></div>
</div> </div>
</div> </div>
<div id="content">
<!--tool--> <div class="tabs_new">
<div class="user_underline"></div> <%= render_main_menu(@project) %>
<div class="tool"> </div>
<%= render 'projects/tools_expand' %> <%= render_flash_messages %>
</div> <%= yield %>
<div class="user_underline"></div> <%= call_hook :view_layouts_base_content %>
</div> <div style="clear:both;"></div>
</div> </div>
<div id="content"> <%= render :partial => 'layouts/base_footer'%>
<div class="tabs_new"> </div>
<%= render_main_menu(@project) %>
</div> <div id="ajax-indicator" style="display:none;">
<%= render_flash_messages %> <span><%= l(:label_loading) %></span>
<%= yield %> </div>
<%= call_hook :view_layouts_base_content %> <div id="ajax-modal" style="display:none;"></div>
<div style="clear:both;"></div> </div>
</div> </div>
<%= render :partial => 'layouts/base_footer'%> <%= call_hook :view_layouts_base_body_bottom %>
</div> </div>
</body>
<div id="ajax-indicator" style="display:none;"> </html>
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</div>
</body>
</html>

@ -1,50 +1,50 @@
<% @nav_dispaly_home_path_label = 1 <% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1 @nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1 @nav_dispaly_main_project_label = 1
@nav_dispaly_main_contest_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%= current_language %>"> <html lang="<%= current_language %>">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%=h html_title %></title> <title><%=h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= javascript_include_tag "jquery.leanModal.min" %> <%= javascript_include_tag "jquery.leanModal.min" %>
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%> <%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body class="<%=h body_css_classes %>"> <body class="<%=h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main" class="nosidebar"> <div id="main" class="nosidebar">
<div id="content_"> <div id="content_">
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<%=render :partial => 'layouts/base_footer'%> <%=render :partial => 'layouts/base_footer'%>
</div> </div>
</div> </div>
</div> </div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</div> </div>
</div> </div>
<%= call_hook :view_layouts_base_body_bottom %> <!--<#%= call_hook :view_layouts_base_body_bottom %>-->
</body> </body>
</html> </html>

@ -157,7 +157,7 @@
<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;">
<%= textAreailizable message,:content,:attachments => message.attachments %> <%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %> <%#= message.content.html_safe %>
</div> </div>
<%= link_to_attachments message, :author => false %> </td> <%= link_to_attachments message, :author => false %> </td>

@ -1,39 +1,40 @@
<%= 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]-->
<% unless replying %> <% unless replying %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young--> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young-->
</p> </p>
<% else %> <% else %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/> <p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>
</p> </p>
<% end %> <% end %>
<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><label for="message_subject"><%= l(:field_description) %><span class="required"> *&nbsp;&nbsp;</span></label> <p><label for="message_subject"><%= l(:field_description) %><span class="required"> *&nbsp;&nbsp;</span></label>
<%= text_area :quote,:quote,:style => 'display:none' %> <div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
</p> <%= text_area :quote,:quote,:style => 'display:none' %>
<p> </p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <p>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %></p> <%= 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' %></p>
<!--[eoform:message]-->
<!--[eoform:message]-->
<p><%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p> <p><%= l(:label_attachment_plural) %><br />
</div> <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p>
</div>
<%#= wikitoolbar_for 'message_content' %> <%#= wikitoolbar_for 'message_content' %>

@ -163,7 +163,7 @@
<tr> <tr>
<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;">
<%= textAreailizable message,:content,:attachments => message.attachments %> <%= textilizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %> <%#= message.content.html_safe %>
</div> </div>
<%= link_to_attachments message, :author => false %> </td> <%= link_to_attachments message, :author => false %> </td>

@ -69,7 +69,7 @@
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %>
<%#= submit_tag l(:button_save) %> <%#= submit_tag l(:button_save) %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %> <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'whiteButton m3p10' %>
<%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %>
<% end %> <% end %>

@ -49,6 +49,12 @@
$("#news-form").submit(); $("#news-form").submit();
} }
} }
function submitFocus(obj)
{
$(obj).focus();
}
</script> </script>
<% <%
@ -76,7 +82,7 @@
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %> <%= render :partial => 'news/form', :locals => {:f => f} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> <%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :class => 'whiteButton m3p10' %> <%= link_to l(:button_create), "#", :onclick => 'submitNews();',:onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>
| |
<%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
| |

@ -49,6 +49,7 @@
$("#news-form").submit(); $("#news-form").submit();
} }
} }
</script> </script>
<div class="contextual"> <div class="contextual">
<%= watcher_link(@news, User.current) %> <%= watcher_link(@news, User.current) %>
@ -68,7 +69,7 @@
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%#= submit_tag l(:button_save) %> <%#= submit_tag l(:button_save) %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %> <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'whiteButton m3p10' %>
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %>
<% end %> <% end %>

@ -1,157 +1,156 @@
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 --> <!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
<% if User.current.logged? %> <% if User.current.logged? %>
<% if horizontal %> <% if horizontal %>
<!-- 横排 --> <!-- 横排 -->
<div id="praise_tread_<%= obj.id %>" style="float:right;"> <div id="praise_tread_<%= obj.id %>" style="float:right;">
<% @is_valuate = is_praise_or_tread(obj,user_id)%> <% @is_valuate = is_praise_or_tread(obj,user_id)%>
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 --> <% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
<% @flag = @is_valuate.first.praise_or_tread %> <% @flag = @is_valuate.first.praise_or_tread %>
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai --> <% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
<table style="line-height: 1px"> <table style="line-height: 1px">
<tr> <tr>
<td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td> <td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td> <td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td>
</tr> </tr>
</table> </table>
<% elsif @flag == 0 %> <!-- 踩过 0--> <% elsif @flag == 0 %> <!-- 踩过 0-->
<table style="line-height: 1px"> <table style="line-height: 1px">
<tr> <tr>
<td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td> <td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td> <td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
<% else %> <% else %>
<% if user_id == obj.author_id %> <% if user_id == obj.author_id %>
<table style="line-height: 1px"> <table style="line-height: 1px">
<tr> <tr>
<td ><%= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %></td> <td ><%= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td> <td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td>
</tr> </tr>
</table> </table>
<% else %> <% else %>
<!-- 积分少于2分不能踩帖 --> <!-- 积分少于2分不能踩帖 -->
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> <% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
<table style="line-height: 1px"> <table style="line-height: 1px">
<tr> <tr>
<td ><%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), <td ><%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td> :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %></td> <td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %></td>
</tr> </tr>
</table> </table>
<% else %> <% else %>
<table style="line-height: 1px"> <table style="line-height: 1px">
<tr> <tr>
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), <td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> </td> :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> </td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", <td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td> :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
<% end %> <% end %>
<!-- end --> <!-- end -->
<% end %> <% end %>
</div> </div>
<% else %> <% else %>
<!-- 竖排 --> <!-- 竖排 -->
<div id="praise_tread_<%= obj.id %>" style="float:right;"> <div id="praise_tread_<%= obj.id %>" style="float:right;">
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
<% @is_valuate = is_praise_or_tread(obj,user_id)%> <% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 --> <% @flag = @is_valuate.first.praise_or_tread %>
<% @flag = @is_valuate.first.praise_or_tread %> <% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai --> <table style="line-height: 1px">
<table style="line-height: 1px"> <tr>
<tr> <td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td>
<td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td> </tr>
</tr> <tr>
<tr> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> </tr>
</tr>
<tr>
<tr> <td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td> </tr>
</tr> </table>
</table>
<% elsif @flag == 0 %> <!-- 踩过 0-->
<% elsif @flag == 0 %> <!-- 踩过 0-->
<table style="line-height: 1px">
<table style="line-height: 1px"> <tr>
<tr> <td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td>
<td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td> </tr>
</tr>
<tr>
<tr> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> </tr>
</tr> <tr>
<tr> <td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td> </tr>
</tr> </table>
</table> <% end %>
<% end %>
<% else %>
<% else %> <% if user_id == obj.author_id %>
<% if user_id == obj.author_id %> <table style="line-height: 1px">
<table style="line-height: 1px"> <tr>
<tr> <td > <%= image_tag "/images/praise_tread/praise_true.png",weight:"22px", height:"22px", :title => l(:label_issue_not_praise_over) %></td>
<td > <%= image_tag "/images/praise_tread/praise_true.png",weight:"22px", height:"22px", :title => l(:label_issue_not_praise_over) %></td> </tr>
</tr>
<tr>
<tr> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> </tr>
</tr> <tr>
<tr> <td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %> </td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %> </td> </tr>
</tr> </table>
</table> <% else %>
<% else %> <% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> <table style="line-height: 1px">
<table style="line-height: 1px"> <tr>
<tr> <td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td> </tr>
</tr>
<tr>
<tr> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> </tr>
</tr> <tr>
<tr> <td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %> </td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %> </td> </tr>
</tr> </table>
</table> <% else %>
<% else %> <table style="line-height: 1px">
<table style="line-height: 1px"> <tr>
<tr> <td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %> </td>
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %> </td> </tr>
</tr> <tr>
<tr> <td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td> </tr>
</tr> <tr>
<tr> <td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td> </tr>
</tr> </table>
</table> <% end %>
<% end %>
<% end %>
<% end %>
<!-- end -->
<!-- end --> <% end %>
<% end %> </div>
</div> <% end %>
<% end %> <% end %>
<% end %>

@ -1,154 +1,154 @@
<!--Added by nie--> <!--Added by nie-->
<div class="project-block"> <div class="project-block">
<div class="img-tag"> <div class="img-tag">
<% if(@project.project_type==1)%> <% if(@project.project_type==1)%>
<% if get_avatar?(project)%> <% if get_avatar?(project)%>
<%= image_tag(url_to_avatar(project), :class => "avatar2") %> <%= image_tag(url_to_avatar(project), :class => "avatar2") %>
<% else %> <% else %>
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar2") %> <%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar2") %>
<% end %> <% end %>
<% else %> <% else %>
<%= image_tag(url_to_avatar(project), :class => "avatar2") %> <%= image_tag(url_to_avatar(project), :class => "avatar2") %>
</div> </div>
<div class="wiki-description"> <div class="wiki-description">
<p> <p>
<%= textilizable(project.short_description.strip, :project => project) %> <%= textilizable(project.short_description.strip, :project => project) %>
</p> </p>
</div> </div>
<div class="information"> <div class="information">
<p class="stats"> <p class="stats">
<table style="width: 280px;"> <table style="width: 280px;">
<tr> <tr>
<td style="width: 40%;text-align: right;font-size: 17px;"> <td style="width: 40%;text-align: right;font-size: 17px;">
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong> <strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
</td> </td>
<td style="width: 60%;text-align: left"> <td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> <%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width: 40%;text-align: right;font-size: 17px;"> <td style="width: 40%;text-align: right;font-size: 17px;">
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong> <strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
</td> </td>
<td style="width: 60%;text-align: left"> <td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %> <%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)"> <td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong> <strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
</td> </td>
<td style="width: 60%;text-align: left"> <td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_since_last_commits)) %> <%= content_tag('span', l(:label_since_last_commits)) %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)"> <td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
<!-- @project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count --> <!-- @project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count -->
<strong><%= content_tag('span', "#{get_project_score(@project).nil? ? 0:get_project_score(@project).changeset_num}", :class => "info") %></strong> <strong><%= content_tag('span', "#{get_project_score(@project).nil? ? 0:get_project_score(@project).changeset_num}", :class => "info") %></strong>
</td> </td>
<td style="width: 60%;text-align: left"> <td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_commit_on)) %> <%= content_tag('span', l(:label_commit_on)) %>
</td> </td>
</tr> </tr>
</table> </table>
</p> </p>
</div> </div>
<% end %> <% end %>
<% if(@project.project_type==1)%> <% if(@project.project_type==1)%>
</div> </div>
<div class="wiki-description"> <div class="wiki-description">
<p> <p>
<%= textilizable(project.short_description, :project => project) %> <%= textilizable(project.short_description, :project => project) %>
</p> </p>
</div> </div>
<div class="information"> <div class="information">
<!-- p class="stats"> <!-- p class="stats">
<%#= content_tag('span', @project.watcher_users.count, :class => "info") %> <%#= content_tag('span', @project.watcher_users.count, :class => "info") %>
<%#= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> <%#= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</p --> </p -->
<p class="stats"> <p class="stats">
<%= content_tag('span', link_to("#{@project.homeworks.count}", homework_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %> <%= content_tag('span', link_to("#{@project.homeworks.count}", homework_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %>
</p> </p>
<p class="stats"> <p class="stats">
<%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %> <%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %>
</p> </p>
<p class="stats"> <p class="stats">
<% files_count = @project.attachments.count %> <% files_count = @project.attachments.count %>
<% @project.versions.each do |version| %> <% @project.versions.each do |version| %>
<% files_count += version.attachments.count %> <% files_count += version.attachments.count %>
<% end %> <% end %>
<%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %> <%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p> </p>
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="add-info-project"> <div class="add-info-project">
<div class="main-language"> <div class="main-language">
<!-- added by huang --> <!-- added by huang -->
<% if(@project.project_type==1)%> <% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %> <%= content_tag('span', "#{l(:field_tea_name)}: ") %>
<% else %> <% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %> <%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %> <% end %>
<% @admin = @project.project_infos%> <% @admin = @project.project_infos%>
<% if @admin.size > Setting.show_tags_length.to_i then %> <% if @admin.size > Setting.show_tags_length.to_i then %>
<% i = 0 %> <% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %> <% until i>Setting.show_tags_length.to_i do %>
<%= link_to @admin[i].user.name, user_path(@admin[i].user_id) %> <%= link_to @admin[i].user.name, user_path(@admin[i].user_id) %>
<% i += 1 %> <% i += 1 %>
<% end %> <% end %>
<%= link_to l(:label_more_tags), member_project_path(@project) %> <%= link_to l(:label_more_tags), member_project_path(@project) %>
<% else %> <% else %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %> <%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %> <% end %>
<%# if @admin.size > 0 %> <%# if @admin.size > 0 %>
<%#= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %> <%#= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
<%# end %> <%# end %>
<% if(@project.project_type==1)%> <% if(@project.project_type==1)%>
&nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %> &nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<%= @admin.first.user.user_extensions.occupation %> <%= @admin.first.user.user_extensions.occupation %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="licences"> <div class="licences">
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %> <%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
</div> </div>
<!-- added by bai --> <!-- added by bai -->
<div class="grade"> <div class="grade">
<% if @project.project_type !=1 %> <% if @project.project_type !=1 %>
<%= l(:label_project_grade)%>: <%= l(:label_project_grade)%>:
<span > <span >
<%= link_to(format("%.2f" , red_project_scores(@project) ).to_i, <%= link_to(format("%.2f" , red_project_scores(@project) ).to_i,
{:controller => 'projects', {:controller => 'projects',
:action => 'show_projects_score', :action => 'show_projects_score',
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %> :remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
</span> </span>
<% end %> <% end %>
</div> </div>
<!-- end --> <!-- end -->
<!-- added by liuping --> <!-- added by liuping -->
</span> </span>
</div> </div>
<div class="tags"> <div class="tags">
<!-- added by william -for tag --> <!-- added by william -for tag -->
<div id="tags"> <div id="tags">
<%= image_tag( "/images/sidebar/tags.png") %> <%= image_tag( "/images/sidebar/tags.png") %>
<%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%> <%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%>
</div> </div>
</div> </div>

@ -1,146 +1,147 @@
<%= error_messages_for 'member' %> <%= error_messages_for 'member' %>
<% <%
roles = Role.givable.all roles = Role.givable.all
if @project.project_type == Project::ProjectType_course if @project.project_type == Project::ProjectType_course
roles = roles[3..5] roles = roles[3..5]
else else
roles = roles[0..2] roles = roles[0..2]
end end
members = @project.member_principals.includes(:roles, :principal).all.sort members = @project.member_principals.includes(:roles, :principal).all.sort
%> %>
<div class="splitcontentleft"> <div class="splitcontentleft">
<% if members.any? %> <% if members.any? %>
<table class="list members"> <table class="list members">
<thead> <thead>
<tr> <tr>
<th><%= l(:label_user) %></th> <th><%= l(:label_user) %></th>
<th><%= l(:label_role_plural) %></th> <th><%= l(:label_role_plural) %></th>
<th style="width:15%"></th> <th style="width:15%"></th>
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %> <%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% members.each do |member| %> <% members.each do |member| %>
<% next if member.new_record? %> <% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member"> <tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> <td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles"> <td class="roles">
<span id="member-<%= member.id %>-roles"> <span id="member-<%= member.id %>-roles">
<%= h member.roles.sort.collect(&:to_s).join(', ') %> <%= h member.roles.sort.collect(&:to_s).join(', ') %>
</span> </span>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put, :method => :put,
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}} :html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %> ) do |f| %>
<p> <p>
<% roles.each do |role| %> <% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role), <label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %> <%= h role %></label><br/> :disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %> <%= h role %></label><br/>
<% end %></p> <% end %></p>
<%= hidden_field_tag 'membership[role_ids][]', '' %> <%= hidden_field_tag 'membership[role_ids][]', '' %>
<p><%= submit_tag l(:button_change), :class => "small" %> <p><%= submit_tag l(:button_change), :class => "small" %>
<%= link_to_function l(:button_cancel), <%= link_to_function l(:button_cancel),
"$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;" "$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;"
%></p> %></p>
<% end %> <% end %>
</td> </td>
<!--modified by huang for: if the user'roles is Manager that he will can't modified himself--> <!--modified by huang for: if the user'roles is Manager that he will can't modified himself-->
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<% if member.roles.first.to_s == "Manager" %> <% if member.roles.first.to_s == "Manager" %>
<td class="buttons"></td> <td class="buttons"></td>
<% else %> <% else %>
<td class="buttons"> <td class="buttons">
<%= link_to_function l(:button_edit), <%= link_to_function l(:button_edit),
"$('#member-#{member.id}-roles').hide(); $('#member-#{member.id}-roles-form').show(); return false;", "$('#member-#{member.id}-roles').hide(); $('#member-#{member.id}-roles-form').show(); return false;",
:class => 'icon icon-edit' %> :class => 'icon icon-edit' %>
<%= delete_link membership_path(member), <%= delete_link membership_path(member),
:remote => true, :remote => true,
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %> :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %>
</td> </td>
<% end %> <% end %>
<% else %> <% else %>
<td class="buttons"> <td class="buttons">
<%= link_to_function l(:button_edit), <%= link_to_function l(:button_edit),
"$('#member-#{member.id}-roles').hide(); $('#member-#{member.id}-roles-form').show(); return false;", "$('#member-#{member.id}-roles').hide(); $('#member-#{member.id}-roles-form').show(); return false;",
:class => 'icon icon-edit' %> :class => 'icon icon-edit' %>
<%= delete_link membership_path(member), <%= delete_link membership_path(member),
:remote => true, :remote => true,
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %> :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %>
</td> </td>
<% end %> <% end %>
<!--end--> <!--end-->
<%= call_hook(:view_projects_settings_members_table_row, {:project => @project, :member => member}) %> <%= call_hook(:view_projects_settings_members_table_row, {:project => @project, :member => member}) %>
</tr> </tr>
<% end; reset_cycle %> <% end; reset_cycle %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% end %> <% end %>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
<% if roles.any? %> <% if roles.any? %>
<% if @project.applied_projects.any? %> <% if @project.applied_projects.any? %>
<div id="applied_project_block"> <div id="applied_project_block">
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %> <%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<fieldset> <fieldset>
<legend><%= l(:label_apply_project) %></legend> <legend><%= l(:label_apply_project) %></legend>
<div id="principals_for_applied_member"> <div id="principals_for_applied_member">
<%= render_principals_for_applied_members(@project) %> <%= render_principals_for_applied_members(@project) %>
</div> </div>
<br/> <br/>
<!--show the roles which will select--> <!--show the roles which will select-->
<p style="padding-top: 5px"><%= l(:label_role_plural) %>: <p style="padding-top: 5px"><%= l(:label_role_plural) %>:
<% roles.each do |role| %> <% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %></label> <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %></p> <% end %></p>
<p><%= submit_tag l(:label_approve), :id => 'member-add-submit' %> <p><%= submit_tag l(:label_approve), :id => 'member-add-submit' %>
<%= submit_tag l(:label_refusal), :name => "refusal_button", :id => 'member-refusal-submit' %> <%= submit_tag l(:label_refusal), :name => "refusal_button", :id => 'member-refusal-submit' %>
</p> </p>
</fieldset> </fieldset>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %> <%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<fieldset> <fieldset>
<legend><%= l(:label_member_new) %></legend> <legend><%= l(:label_member_new) %></legend>
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p> <p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %> <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
<div id="principals_for_new_member"> <div id="principals_for_new_member">
<%= render_principals_for_new_members(@project) %> <%= render_principals_for_new_members(@project) %>
</div> </div>
<!--show the roles which will select--> <br />
<p style="padding-top: 5px"><%= l(:label_role_plural) %>: <!--show the roles which will select-->
<% roles.each do |role| %> <p style="padding-top: 5px"><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %></p> <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %></p>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
</fieldset> <p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
<% end %> </fieldset>
<% end %> <% end %>
</div> <% end %>
<script type="text/javascript"> </div>
$(document).ready(function () { <script type="text/javascript">
var collection=$("#principals_for_new_member").children("#principals").children("label"); $(document).ready(function () {
collection.css("text-overflow","ellipsis"); var collection=$("#principals_for_new_member").children("#principals").children("label");
collection.css("white-space","nowrap"); collection.css("text-overflow","ellipsis");
collection.css("width","200px"); collection.css("white-space","nowrap");
collection.css("overflow","hidden"); collection.css("width","200px");
for(i=0;i<collection.length;i++){ //增加悬浮显示 collection.css("overflow","hidden");
var label=collection[i]; for(i=0;i<collection.length;i++){ //增加悬浮显示
var text=$(label).text(); var label=collection[i];
$(label).attr("title",text); var text=$(label).text();
} $(label).attr("title",text);
}); }
});
</script> </script>

@ -1,72 +1,71 @@
<!-- added by bai -->
<head>
<head> <meta charset="utf-8" />
<meta charset="utf-8" /> <title><%= h html_title %></title>
<title><%= h html_title %></title> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="keywords" content="issue,bug,tracker" />
<meta name="keywords" content="issue,bug,tracker" /> <%= csrf_meta_tag %>
<%= csrf_meta_tag %> <%= favicon %>
<%= favicon %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %>
<%= javascript_heads %> <%= heads_for_theme %>
<%= heads_for_theme %> <%= hubspot_head %>
<%= hubspot_head %> <%= call_hook :view_layouts_base_html_head %>
<%= call_hook :view_layouts_base_html_head %> <!-- page specific tags -->
<!-- page specific tags --> <%= yield :header_tags -%>
<%= yield :header_tags -%> </head>
</head> <% if @project %>
<h3 class="title"><%= l(:label_projects_score) %></h3>
<h3 class="title"><%= l(:label_projects_score) %></h3> <div class="inf_user_image">
<div class="inf_user_image"> <table style="border-bottom: solid 1px #80a6d2;" width="100%">
<table style="border-bottom: solid 1px #80a6d2;" width="100%"> <tr>
<tr> <td align="left" valign="middle" ><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td> <td>
<td> <table>
<table> <tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= @project.name %></td>
<tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= @project.name %></td> </tr>
</tr> </table>
</table> </td>
</td> <td width="35%">
<td width="35%"> <table>
<table> <tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr> <tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr>
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr> </table>
</table> </td>
</td> </tr>
</tr> </table>
</table> </div>
</div>
<div class="tabs_new">
<div class="tabs_new"> <ul>
<ul> <li>
<li> <%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> : <%= format("%.2f" , project_scores(@project) ).to_i %>
<%= format("%.2f" , project_scores(@project) ).to_i %> </li>
</li> <li>
<li> <%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> : <%= format("%.2f" , issue_score(@project)).to_i %>
<%= format("%.2f" , issue_score(@project)).to_i %> </li>
</li> <li>
<li> <%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> : <%= format("%.2f" , news_score(@project)).to_i %>
<%= format("%.2f" , news_score(@project)).to_i %> </li>
</li> <li>
<li> <%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> : <%= format("%.2f" , documents_score(@project)).to_i %>
<%= format("%.2f" , document_score(@project)).to_i %> </li>
</li> <li>
<li> <%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> : <%= format("%.2f" , changesets_score(@project)).to_i %>
<%= format("%.2f" , changesets_score(@project)).to_i %> </li>
</li> <li>
<li> <%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> : <%= format("%.2f" , board_message_score(@project)).to_i %>
<%= format("%.2f" , board_message_score(@project)).to_i %> </li>
</li> </ul>
</ul> </div>
</div> <div id="show_score_detail">
<div id="show_score_detail"> <%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %>
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %> </div>
</div> <% end %>
<!-- end -->

@ -1,97 +1,97 @@
<div class="contextual" style="padding-right: 10px;"> <div class="contextual" style="padding-right: 10px;">
&#171; &#171;
<% unless @changeset.previous.nil? -%> <% unless @changeset.previous.nil? -%>
<%= link_to_revision(@changeset.previous, @repository, :text => l(:label_previous)) %> <%= link_to_revision(@changeset.previous, @repository, :text => l(:label_previous)) %>
<% else -%> <% else -%>
<%= l(:label_previous) %> <%= l(:label_previous) %>
<% end -%> <% end -%>
| |
<% unless @changeset.next.nil? -%> <% unless @changeset.next.nil? -%>
<%= link_to_revision(@changeset.next, @repository, :text => l(:label_next)) %> <%= link_to_revision(@changeset.next, @repository, :text => l(:label_next)) %>
<% else -%> <% else -%>
<%= l(:label_next) %> <%= l(:label_next) %>
<% end -%> <% end -%>
&#187;&nbsp; &#187;&nbsp;
<%= form_tag({:controller => 'repositories', <%= form_tag({:controller => 'repositories',
:action => 'revision', :action => 'revision',
:id => @project, :id => @project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,
:rev => nil}, :rev => nil},
:method => :get) do %> :method => :get) do %>
<%= text_field_tag 'rev', @rev, :size => 8 %> <%= text_field_tag 'rev', @rev, :size => 8 %>
<%= submit_tag 'OK', :name => nil %> <%= submit_tag l(:label_button_ok), :name => nil %>
<% end %> <% end %>
</div> </div>
<h3 style="padding-top:40px;"><%= avatar(@changeset.user, :size => "24") %><%= l(:label_revision) %> <%= format_revision(@changeset) %></h3> <h3 style="padding-top:40px;"><%= avatar(@changeset.user, :size => "24") %><%= l(:label_revision) %> <%= format_revision(@changeset) %></h3>
<% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %> <% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %>
<table class="revision-info"> <table class="revision-info">
<% if @changeset.scmid.present? %> <% if @changeset.scmid.present? %>
<tr> <tr>
<td>ID</td><td><%= h(@changeset.scmid) %></td> <td>ID</td><td><%= h(@changeset.scmid) %></td>
</tr> </tr>
<% end %> <% end %>
<% if @changeset.parents.present? %> <% if @changeset.parents.present? %>
<tr> <tr>
<td><%= l(:label_parent_revision) %></td> <td><%= l(:label_parent_revision) %></td>
<td> <td>
<%= @changeset.parents.collect{ <%= @changeset.parents.collect{
|p| link_to_revision(p, @repository, :text => format_revision(p)) |p| link_to_revision(p, @repository, :text => format_revision(p))
}.join(", ").html_safe %> }.join(", ").html_safe %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% if @changeset.children.present? %> <% if @changeset.children.present? %>
<tr> <tr>
<td><%= l(:label_child_revision) %></td> <td><%= l(:label_child_revision) %></td>
<td> <td>
<%= @changeset.children.collect{ <%= @changeset.children.collect{
|p| link_to_revision(p, @repository, :text => format_revision(p)) |p| link_to_revision(p, @repository, :text => format_revision(p))
}.join(", ").html_safe %> }.join(", ").html_safe %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
<% end %> <% end %>
<p> <p>
<span class="author"> <span class="author">
<%= authoring(@changeset.committed_on, @changeset.author) %> <%= authoring(@changeset.committed_on, @changeset.author) %>
</span> </span>
</p> </p>
<%= textilizable @changeset.comments %> <%= textilizable @changeset.comments %>
<% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %> <% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %>
<%= render :partial => 'related_issues' %> <%= render :partial => 'related_issues' %>
<% end %> <% end %>
<% if User.current.allowed_to?(:browse_repository, @project) %> <% if User.current.allowed_to?(:browse_repository, @project) %>
<h3><%= l(:label_attachment_plural) %></h3> <h3><%= l(:label_attachment_plural) %></h3>
<ul id="changes-legend"> <ul id="changes-legend">
<li class="change change-A"><%= l(:label_added) %></li> <li class="change change-A"><%= l(:label_added) %></li>
<li class="change change-M"><%= l(:label_modified) %></li> <li class="change change-M"><%= l(:label_modified) %></li>
<li class="change change-C"><%= l(:label_copied) %></li> <li class="change change-C"><%= l(:label_copied) %></li>
<li class="change change-R"><%= l(:label_renamed) %></li> <li class="change change-R"><%= l(:label_renamed) %></li>
<li class="change change-D"><%= l(:label_deleted) %></li> <li class="change change-D"><%= l(:label_deleted) %></li>
</ul> </ul>
<p><%= link_to(l(:label_view_diff), <p><%= link_to(l(:label_view_diff),
:action => 'diff', :action => 'diff',
:id => @project, :id => @project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,
:path => "", :path => "",
:rev => @changeset.identifier) if @changeset.filechanges.any? %></p> :rev => @changeset.identifier) if @changeset.filechanges.any? %></p>
<div class="changeset-changes"> <div class="changeset-changes">
<%= render_changeset_changes %> <%= render_changeset_changes %>
</div> </div>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>
<% end %> <% end %>
<% html_title("#{l(:label_revision)} #{format_revision(@changeset)}") -%> <% html_title("#{l(:label_revision)} #{format_revision(@changeset)}") -%>

@ -1,34 +1,34 @@
<div class="contextual"> <div class="contextual">
<%= form_tag( <%= form_tag(
{:controller => 'repositories', :action => 'revision', :id => @project, {:controller => 'repositories', :action => 'revision', :id => @project,
:repository_id => @repository.identifier_param}, :repository_id => @repository.identifier_param},
:method => :get :method => :get
) do %> ) do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', nil, :size => 8 %> <%= l(:label_revision) %>: <%= text_field_tag 'rev', nil, :size => 8 %>
<%= submit_tag 'OK' %> <%= submit_tag l(:label_button_ok) %>
<% end %> <% end %>
</div> </div>
<h3><%= l(:label_revision_plural) %></h3> <h3><%= l(:label_revision_plural) %></h3>
<%= render :partial => 'revisions', <%= render :partial => 'revisions',
:locals => {:project => @project, :locals => {:project => @project,
:path => '', :path => '',
: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} %>
<% end %> <% end %>
<% html_title(l(:label_revision_plural)) -%> <% html_title(l(:label_revision_plural)) -%>

@ -3,10 +3,6 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#province").html("<option value='0' selected = true style='display: none;'></option>"); $("#province").html("<option value='0' selected = true style='display: none;'></option>");
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'/school/get_province', url :'/school/get_province',
@ -43,7 +39,7 @@
<script type="text/javascript"> <script type="text/javascript">
function test(id){ function test(id){
location.href = encodeURI('http://course.trustie.net/?school_id='+id); location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
} }
</script> </script>
@ -55,7 +51,7 @@
//alert(value); //alert(value);
if(value == "") if(value == "")
{ {
alert("搜索条件不能为空"); alert("<%= l(:label_search_conditions_not_null) %>");
return; return;
} }
//alert(province); //alert(province);
@ -82,17 +78,17 @@
<div> <div>
<p> <p>
<%= link_to "全部学校",school_index_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <%= link_to l(:label_all_schol),school_index_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% if User.current.logged? %> <% if User.current.logged? %>
<a href="http://course.trustie.net">我的学校</a> <a href="http://<%= Setting.host_course %>"><%= l(:label_my_school) %></a>
<% end %> <% end %>
</p> </p>
<ul> <ul>
<li style="width: 40%; float: left">请选择省份: <li style="width: 40%; float: left"><%= l(:label_select_province) %>:
<select id="province" name="province" onchange="get_school(this.value)"></select> <select id="province" name="province" onchange="get_school(this.value)"></select>
</li> </li>
<li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" onkeydown="word_keydown(event);"/> <li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" onkeydown="word_keydown(event);"/>
<input type="button" class="enterprise" value="搜索" onclick="ssearch()"></li> <input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="ssearch()"></li>
</ul> </ul>
</div> </div>

@ -1,122 +1,122 @@
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function selectChange(obj) function selectChange(obj)
{ {
if(obj.value=="其他") if(obj.value=="其他")
{ {
//document.getElementById("a").style.display = "" //document.getElementById("a").style.display = ""
$("#other_span").show(); $("#other_span").show();
} }
else else
{ {
$("#other_span").hide(); $("#other_span").hide();
$("#other_input").val(""); $("#other_input").val("");
//document.getElementById("a").style.display = "none" //document.getElementById("a").style.display = "none"
} }
} }
</script> </script>
<%= form_for(softapplication) do |f| %> <%= form_for(softapplication) do |f| %>
<% if softapplication.errors.any? %> <% if softapplication.errors.any? %>
<div id="error_explanation"> <div id="error_explanation">
<h2><%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:</h2> <h2><%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:</h2>
<ul> <ul>
<% softapplication.errors.full_messages.each do |msg| %> <% softapplication.errors.full_messages.each do |msg| %>
<li><%= msg %></li> <li><%= msg %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
<fieldset class="contes-new-box"> <fieldset class="contes-new-box">
<tr style="width:700px; margin-left: -10px"> <tr style="width:700px; margin-left: -10px">
<span><%= l(:label_work_name) %></span> <span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td> <span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span> <span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span>
</tr><br/> </tr><br/>
<br /> <br />
<br /> <br />
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_running_platform) %></span> <span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td> <span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span> <span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br /> <br />
<br /> <br />
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_type) %></span> <span><%= l(:label_work_type) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px"> <td style="width: 100px">
<%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
<% if work_type_opttion.include?([@softapplication.app_type_name,@softapplication.app_type_name]) %> <% if work_type_opttion.include?([@softapplication.app_type_name,@softapplication.app_type_name]) %>
<%= f.select :app_type_name,options_for_select(work_type_opttion,@softapplication.app_type_name), {},{:style => "width:410px;",:onchange => "selectChange(this)"} %> <%= f.select :app_type_name,options_for_select(work_type_opttion,@softapplication.app_type_name), {},{:style => "width:410px;",:onchange => "selectChange(this)"} %>
<span style="font-size: 10px;display: none" id="other_span"> <span style="font-size: 10px;display: none" id="other_span">
<%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %> <%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
<input type="text" style="width: 100px;" id="other_input" name = "other_input"/> <input type="text" style="width: 100px;" id="other_input" name = "other_input"/>
</span> </span>
<% else %> <% else %>
<%= f.select :app_type_name,options_for_select(work_type_opttion,"其他"), {},{:style => "width:410px;",:onchange => "selectChange(this)"} %> <%= f.select :app_type_name,options_for_select(work_type_opttion,"其他"), {},{:style => "width:410px;",:onchange => "selectChange(this)"} %>
<span style="font-size: 10px;" id="other_span"> <span style="font-size: 10px;" id="other_span">
<%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %> <%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
<input type="text" style="width: 100px;" id="other_input" name = "other_input" value="<%= @softapplication.app_type_name%>"/> <input type="text" style="width: 100px;" id="other_input" name = "other_input" value="<%= @softapplication.app_type_name%>"/>
</span> </span>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<br/> <br/>
<br /> <br />
<br /> <br />
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_description) %></span> <span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td> <span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<!--<span><%#= l(:label_softapplication_description_condition)%></span>--> <!--<span><%#= l(:label_softapplication_description_condition)%></span>-->
</tr> </tr>
<br/> <br/>
<br /> <br />
<br /> <br />
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span> <span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td> <span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span> <span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br /> <br />
<br /> <br />
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_work_deposit_project) %></span> <span><%= l(:label_work_deposit_project) %></span>
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option),@softapplication.project_id), :name => 'project', :class => 'grayline3' %></span> <span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option),@softapplication.project_id), :name => 'project', :class => 'grayline3' %></span>
<span><%#= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%></span> <span><%#= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%></span>
</tr> </tr>
<br/> <br/>
<br /> <br />
<br /> <br />
<fieldset style="width: 500px"> <fieldset style="width: 500px">
<p style="padding-left: 60px"> <p style="padding-left: 60px">
<% options = {:author => true, :deletable => true} %> <% options = {:author => true, :deletable => true} %>
<span id="soft_attachments_links"> <span id="soft_attachments_links">
<%= render :partial => 'attachments/links', <%= render :partial => 'attachments/links',
:locals => {:attachments => @softapplication.attachments, :options => options} %> :locals => {:attachments => @softapplication.attachments, :options => options} %>
</span> </span>
</p> </p>
<legend><%=l(:label_upload_softworkpacket_photo)%></legend> <legend><%=l(:label_upload_softworkpacket_photo)%></legend>
<%= render_flash_messages %> <%= render_flash_messages %>
<p id="put-bid-form-partial"> <p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form' %>
</p> </p>
<p style="font-size: 10px">1、<%=l(:label_upload_softapplication_packets_mustpacketed)%><br>2、<%=l(:label_upload_softapplication_photo_condition)%></p> <p style="font-size: 10px;">1、<%=l(:label_upload_softapplication_packets_mustpacketed)%><br>2、<%=l(:label_upload_softapplication_photo_condition)%></p>
<!-- p style="font-size: 10px; color: red"><%#=l(:label_updated_caution)%></p--> <!-- p style="font-size: 10px; color: red"><%#=l(:label_updated_caution)%></p-->
</fieldset> </fieldset>
</fieldset></br> </fieldset></br>
<div class="align-center"><%= submit_tag l(:button_create), :onclick => "return true" %></div> <div class="align-center"><%= submit_tag l(:button_create), :onclick => "return true" %></div>
<% end %> <% end %>

@ -1,15 +1,15 @@
<div id="issues"> <div id="issues">
<% if contests_results.try(:size).to_i > 0 %> <% if contests_results.try(:size).to_i > 0 %>
<hr /> <hr />
<% contests_results.each do |contest| %> <% contests_results.each do |contest| %>
<p class="font_description2"> <p class="font_description2">
<strong><%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}", <strong><%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}",
:controller => "contests",:action => "show",:id => contest.id %></strong> :controller => "contests",:action => "show_contest",:id => contest.id %></strong>
<br /> <br />
<strong><%= l(:label_tags_contest_description) %>:</strong><%= contest.description %> <strong><%= l(:label_tags_contest_description) %>:</strong><%= contest.description %>
<%= contest.updated_on %> <%= contest.updated_on %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>

@ -1,14 +1,14 @@
<!-- added by bai -->
<% option_num = get_option_number(@user,1) %>
<div><%= l(:label_user_score) %></div> <div><%= l(:label_user_score) %></div>
<div> = <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> + <div> = <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> +
<%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %></div> <%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %></div>
<!-- <div>&nbsp;&nbsp;&nbsp;+ <%#= l(:label_user_score_of_influence) %></div> --> <!-- <div>&nbsp;&nbsp;&nbsp;+ <%#= l(:label_user_score_of_influence) %></div> -->
<div> = <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %> <div> = <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %>
+ <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %></div> + <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %></div>
<% if (format("%.2f" ,collaboration(option_num)).to_i + format("%.2f" , influence(option_num) ).to_i + format("%.2f" , skill(option_num)).to_i + format("%.2f" , active(option_num)).to_i) < 0 %> <% if (format("%.2f" ,collaboration(option_num)).to_i + format("%.2f" , influence(option_num) ).to_i + format("%.2f" , skill(option_num)).to_i + format("%.2f" , active(option_num)).to_i) < 0 %>
<div><%= l(:lable_score_less_than_zero) %></div> <div><%= l(:label_score_less_than_zero) %></div>
<% else %> <% else %>
<div> = <%= format("%.2f" ,option_num.total_score).to_i %></div> <div> = <%= format("%.2f" ,option_num.total_score).to_i %></div>
<% end %> <% end %>
<!-- end -->

@ -1,424 +1,336 @@
<% if User.current.id == @user.id %> <% if User.current.id == @user.id %>
<div class="menu-div"> <div class="menu-div">
<div class="menu"> <div class="menu">
<span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span> <span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span>
<ul><%#链接绑定在页面最下方的jQuery%> <ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li> <li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li>
<li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li> <li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li>
<li mode='respond' class="<%= "on" if @state.eql?(2) %>"><%= l :label_user_all_respond %></li> <li mode='respond' class="<%= "on" if @state.eql?(2) %>"><%= l :label_user_all_respond %></li>
</ul> </ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
</script> </script>
</div> </div>
<%#= show_activity @state%> <div style="height:20px"></div>
<div style="height:20px"></div> <%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= form_tag(:controller => 'users', :action => "show") do %> <%= text_field_tag 'user', params[:user], :size => 30 %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px"> <%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
<table width="100%" valign="center"> </div>
<tr> </td>
<td align="right"> </tr>
<div class="project-search"> </table>
<%= text_field_tag 'user', params[:user], :size => 30 %> </div>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %> <% end %>
</div> <% end %>
</td>
</tr> <% unless @state == 2 %>
</table> <% unless @activity.empty? %>
</div> <div id="activity">
<% end %> <% @activity.each do |e| %>
<% end %> <%# 以下一行代码解决有未知的活动无法转换成Model报错%>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% unless @state == 2 %> <% act = e.act %>
<% unless @activity.empty? %> <% unless act.nil? %>
<div id="activity"> <% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
<% @activity.each do |e| %> <table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<%# 以下一行代码解决有未知的活动无法转换成Model报错%> <tr>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %> <td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<% act = e.act %> <td>
<% unless act.nil? %> <table width="580" border="0" class="info-break">
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%> <% case e.act_type %>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <% when 'JournalsForMessage' %>
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td> <td colspan="2" valign="top">
<td> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_have_feedback) %>
<table width="580" border="0" class="info-break"> <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span>
<% case e.act_type %> </td>
<% when 'JournalsForMessage' %> </tr>
<% if User.current.login == e.user.try(:login) %> <tr>
<%# if e.user_id == act.jour.id %> <td colspan="2" width="580">
<tr> <p class="font_description"> <%= textAreailizable act.notes %> </p>
<td colspan="2" valign="top"> <div style="display: inline-block; float: right; margin-top: 0px">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_have_feedback) %> <span><%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %></span>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span> </div>
</td> </td>
</tr> </tr>
<%# else %> <tr>
<!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr> --> <td>
<%# end %> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<% else %> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<tr> </div>
<td colspan="2" valign="top"> <div style="display: inline-block; float: right; margin-top: 0px"></div>
<strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_have_feedback) %><%= </td>
link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span> </tr>
</td> <% when 'Bid' %>
</tr> <tr>
<% end %> <% if act.reward_type == 3 && @show_course == 1%>
<tr> <td colspan="2" valign="top">
<td colspan="2" width="580"> <strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
<p class="font_description"> <%= textAreailizable act.notes %> </p> </td>
<% else %>
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> <td colspan="2" valign="top">
</span></div> <strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td> </td>
</tr> <% end %>
</tr>
<tr> <tr>
<td> <td colspan="2" width="580">
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <p class="font_description"> <%=textAreailizable act, :description %> </p></td>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> </tr>
</div> <tr>
<div style="display: inline-block; float: right; margin-top: 0px"></div> <td>
</td> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
</tr> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<% when 'Bid' %> </div>
<tr> <div style="display: inline-block; float: right; margin-top: 0px">
<% if act.reward_type == 3 && @show_course == 1%> <span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit) %></a>
<% if e.user == User.current %> </div>
<td colspan="2" valign="top"> </td>
<strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> </tr>
</td> <% when 'Journal' %>
<% else %> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp; <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td> </td>
<% end %> </tr>
<% else %> <tr>
<% if e.user == User.current %> <% if act.notes.nil? %>
<td colspan="2" valign="top"> <% desStr = '' %>
<strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> <% else %>
</td> <% desStr= textAreailizable(act, :notes) %>
<% else %> <% end %>
<td colspan="2" valign="top"> <td colspan="2" width="580"><p class="font_description"> <%= desStr %> </p>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp; <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> </td>
</td> </tr>
<% end %> <tr>
<% end %> <td>
</tr> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<tr> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<td colspan="2" width="580"> </div>
<p class="font_description"> <%=textAreailizable act, :description %> </p></td> <div style="display: inline-block; float: right; margin-top: 0px"></div>
</tr> </td>
<tr> </tr>
<td> <% when 'Changeset' %>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <tr>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> <td colspan="2" valign="top">
</div> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span>
<div style="display: inline-block; float: right; margin-top: 0px"> </td>
<span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit) %></a> </tr>
</div> <tr>
</td> <td colspan="2" width="580">
</tr> <p class="font_description"> <%= textAreailizable act,:long_comments %> </p></td>
<% when 'Journal' %> </tr>
<tr> <tr>
<% if e.user == User.current %> <td>
<td colspan="2" valign="top"> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> <span class="font_lighter"> <%= format_time(e.act.committed_on) %></span>
</td> </div>
<% else %> <div style="display: inline-block; float: right; margin-top: 0px">
<td colspan="2" valign="top"> <span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count) %></a>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> </div>
</td> </td>
<% end %> </tr>
</tr> <% when 'Message' %>
<tr> <tr>
<% if act.notes.nil? %> <td colspan="2" valign="top">
<% desStr = '' %> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
<% else %> </td>
<% desStr= textAreailizable(act, :notes) %> </tr>
<% end %> <tr>
<td colspan="2" width="580"><p class="font_description"> <%= desStr %> </p> <td colspan="2" width="580">
</td> <p class="font_description"> <%= textAreailizable(act,:content) %> </p>
</tr> </td>
<tr> </tr>
<td> <tr>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <td>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
</div> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<div style="display: inline-block; float: right; margin-top: 0px"></div> </div>
</td> <div style="display: inline-block; float: right; margin-top: 0px"></div>
</tr> </td>
<% when 'Changeset' %> </tr>
<tr> <% when 'Principal' %>
<% if e.user == User.current %> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span>
</td> </td>
<% else %> </tr>
<td colspan="2" valign="top"> <tr>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %> <td colspan="2" width="580"><p class="font_description"></p></td>
</td> </tr>
<% end %> <tr>
</tr> <td>
<tr> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<td colspan="2" width="580"> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<p class="font_description"> <%= textAreailizable act,:long_comments %> </p></td> </div>
</tr> <div style="display: inline-block; float: right; margin-top: 0px"></div>
<tr> </td>
<td> </tr>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <% when 'News' %>
<span class="font_lighter"> <%= format_time(e.act.committed_on) %></span> <tr>
</div> <td colspan="2" valign="top">
<div style="display: inline-block; float: right; margin-top: 0px"> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
<span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count) %></a> </td>
</div> </tr>
</td> <tr>
</tr> <td colspan="2" width="580">
<% when 'Message' %> <p class="font_description"> <%= textAreailizable act,:description %> </p></td>
<tr> </tr>
<% if e.user == User.current %> <tr>
<td colspan="2" valign="top"> <td>
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
</td> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<% else %> </div>
<td colspan="2" valign="top"> <div style="display: inline-block; float: right; margin-top: 0px">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> <span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count) %></a>
</td> </div>
<% end %> </td>
</tr> </tr>
<tr> <% when 'Issue' %>
<td colspan="2" width="580"> <tr>
<p class="font_description"> <%= textAreailizable(act,:content) %> </p> <td colspan="2" valign="top">
</td> <strong>
</tr> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
<tr> </strong>&nbsp;
<td> <span class="font_lighter">
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <%= l(:label_i_new_activity) %>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> </span>&nbsp;
</div> <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %>
<div style="display: inline-block; float: right; margin-top: 0px"></div> </td>
</td> </tr>
</tr> <tr>
<% when 'Principal' %> <td colspan="2" width="580" style="WORD-BREAK: break-all; WORD-WRAP: break-word">
<tr> <%= textAreailizable act, :description %>
<% if e.user == User.current %> </td>
<td colspan="2" valign="top"> </tr>
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span> <tr>
</td> <td>
<% else %> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<td colspan="2" valign="top"> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span> </div>
</td> <div style="display: inline-block; float: right; margin-top: 0px">
<% end %> <span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count) %></a>
</tr> </div>
<tr> </td>
<td colspan="2" width="580"><p class="font_description"></p></td> </tr>
</tr> <% when 'Contest' %>
<tr> <tr>
<td> <td colspan="2" valign="top">
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> </td>
</div> </tr>
<div style="display: inline-block; float: right; margin-top: 0px"></div> <tr>
</td> <td colspan="2" width="580"><p class="font_description"> <%= textAreailizable act, :description %> </p>
</tr> </td>
<% when 'News' %> </tr>
<tr> <tr>
<% if e.user == User.current %> <td>
<td colspan="2" valign="top"> <div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> <span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
</td> </div>
<% else %> </tr>
<td colspan="2" valign="top"> <% else %>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> <%# f=1 %>
</td> <% end %><!-- < % #case end %> -->
<% end %> </table>
</tr> </td>
<tr> </tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable act,:description %> </p></td> </table>
</tr> <% end %>
<tr> <% end %><!-- < % #unless act.nil? end %> -->
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <% end %><!-- < % #@activity.each do |e| end%> -->
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> </div>
</div> <div class="pagination" style="float:left;">
<div style="display: inline-block; float: right; margin-top: 0px"> <ul> <%= pagination_links_full @activity_pages %> </ul>
<span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count) %></a> </div>
</div> <% else %> <!-- < %# unless @activity.empty? %> -->
</td> <% if @user == User.current %>
</tr> <%= l(:label_user_activities) %>
<% when 'Issue' %> <% else %>
<tr> <p class="font_description">
<% if e.user == User.current %> <%= l(:label_user_activities_other) %>
<td colspan="2" valign="top"> </p>
<strong> <% end %>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <% end %><!-- < %# unless @activity.empty? end %> -->
</strong>&nbsp;
<span class="font_lighter"> <% else %>
<%= l(:label_i_new_activity) %> <% unless @message.empty? %>
</span>&nbsp; <div id="activity">
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% @message.each do |e| -%>
</td> <table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<% else %> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<strong> <td>
<%= link_to(h(e.user), user_path(e.user_id)) %> <table width="580" border="0">
</strong>&nbsp; <tr>
<span class="font_lighter"> <td colspan="2" valign="top">
<%= l(:label_new_activity) %> <strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
</span>&nbsp; <% if e.instance_of?(JournalsForMessage) %>
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% if e.reply_id == User.current.id %>
</td> <% if e.jour_type == 'Bid' %>
<% end %> <%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
</tr> <% elsif e.jour_type == 'User' %>
<tr> <%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<td colspan="2" width="580" style="WORD-BREAK: break-all; WORD-WRAP: break-word"> <% elsif e.jour_type == 'Project' %>
<!-- <%= '在'<<l(:field_project) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<div class="issue-list-description"> <% end %>
<div class="wiki"> <% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
</div> <% end %>
</div> <% else %>
--> <% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= textAreailizable act, :description %> <%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<!-- <p class="font_description"> <%#= textilizable(act.description) %> </p> -->
</td> <% else %>
</tr> <%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<tr> <% end %>
<td> <% end %> </span>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> </td>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> </tr>
</div> <tr>
<div style="display: inline-block; float: right; margin-top: 0px"> <td colspan="2" width="580"><p class="font_description"> <%= textAreailizable e.notes %> </p></td>
<span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count) %></a> </tr>
</div> <tr>
</td> <td align="left"><a class="font_lighter"></a></td>
</tr> <td width="200" align="right" class="a">
<% when 'Contest' %> <span class="font_lighter"><%= format_time e.created_on %></span></td>
<tr> </tr>
<% if e.user == User.current && @show_contest == 1%> </table>
<td colspan="2" valign="top"> </td>
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> </tr>
</td> </table>
<% else %> <% end %>
<td colspan="2" valign="top"> </div>
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td> <div class="pagination" style="float:left;">
<% end %> <ul> <%= pagination_links_full @info_pages %> </ul>
</tr> </div>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable act, :description %> </p> <% else %>
</td> <p class="font_description"><%= l(:label_no_user_respond_you) %></p>
</tr> <% end %>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"> <% end %>
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span> <script type="text/javascript" language="javascript">
</div> $(document).ready(function ($) {
</tr> $("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
<% else %> $('[mode=all]').click(function (event) {
<%# f=1 %> window.location.href = '<%=user_url(@user)%>';
<% end %><!-- < % #case end %> --> });
</table> $('[mode=myself]').click(function (event) {
</td> window.location.href = '<%=user_url(@user, type: 1)%>';
</tr> });
$('[mode=respond]').click(function (event) {
</table> window.location.href = '<%=user_url(@user, type: 2)%>';
<% end %> });
<% end %><!-- < % #unless act.nil? end %> --> });
</script>
<% end %><!-- < % #@activity.each do |e| end%> -->
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @activity_pages %> </ul>
</div>
<% else %> <!-- < %# unless @activity.empty? %> -->
<% if @user == User.current %>
<%= l(:label_user_activities) %>
<% else %>
<p class="font_description">
<%= l(:label_user_activities_other) %>
</p>
<% end %>
<% end %><!-- < %# unless @activity.empty? end %> -->
<% else %>
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage) %>
<% if e.reply_id == User.current.id %>
<% if e.jour_type == 'Bid' %>
<%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= '在'<<l(:field_project) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<% else %>
<%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable e.notes %> </p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter"><%= format_time e.created_on %></span></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @info_pages %> </ul>
</div>
<% else %>
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
<% end %>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function ($) {
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function (event) {
window.location.href = '<%=user_url(@user)%>';
});
$('[mode=myself]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 1)%>';
});
$('[mode=respond]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 2)%>';
});
});
</script>

@ -1,32 +1,32 @@
<% course_list.map do |course| %> <% course_list.map do |course| %>
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <span class=''>
<% unless course.is_public == 1 %> <% unless course.is_public == 1 %>
<span class="private_project"><%= l(:lable_private) %></span> <span class="private_project"><%= l(:label_private) %></span>
<% end %> <% end %>
<%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> <%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
</span> </span>
<span class='font_bolder'> <span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %> <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
<%#=course.try(:teacher).try(:name)%> <%#=course.try(:teacher).try(:name)%>
</span> </span>
</div> </div>
<div class='desc_item text_nowrap'> <div class='desc_item text_nowrap'>
[<%= get_course_term course %>] [<%= get_course_term course %>]
<% if (course.school == nil) %> <% if (course.school == nil) %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% else %> <% else %>
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
<% end %> <% end %>
(<%= course.members.count %>人) (<%= course.members.count %>人)
<%# files_count = course.attachments.count.to_s %> <%# files_count = course.attachments.count.to_s %>
(<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料) (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)
</div> </div>
</li> </li>
<% end %> <% end %>

@ -0,0 +1,8 @@
<% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %>
<%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'},
:class => 'icon icon-add') if User.current.allowed_to?(:add_course,nil, :global => true) %>
<% end %>
<% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => school_id} %>

@ -85,14 +85,14 @@
<%school_course=[]%> <%school_course=[]%>
<% end %> <% end %>
<% if (school_course.count == 0) %> <% if (school_course.count == 0) %>
<span><%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %></span> <span><%= render :partial => 'more_course', :locals => {:school_id => nil}%></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% if User.current.logged? %> <% if User.current.logged? %>
<li> <li>
<%= render :partial => 'no_course_title', :locals => {:course_title => l(:lable_school_no_course)} %> <%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_no_course)} %>
</li> </li>
<%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9, @school_id)} %> <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9, @school_id)} %>
<% else %> <% else %>
@ -103,11 +103,11 @@
<% else %> <% else %>
<% if school_course.count < 10 %> <% if school_course.count < 10 %>
<span> <span>
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %> <%= render :partial => 'more_course', :locals => {:school_id => nil}%>
</span> </span>
<% else %> <% else %>
<span> <span>
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => @school_id} %> <%= render :partial => 'more_course', :locals => {:school_id => @school_id}%>
</span> </span>
<% end %> <% end %>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
@ -115,7 +115,7 @@
<%= render :partial => 'course_list', :locals => {:course_list => school_course} %> <%= render :partial => 'course_list', :locals => {:course_list => school_course} %>
<% if school_course.count < 10 %> <% if school_course.count < 10 %>
<li> <li>
<%= render :partial => 'no_course_title', :locals => {:course_title => l(:lable_school_less_course)} %> <%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_less_course)} %>
</li> </li>
<%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9 - school_course.count, @school_id)} %> <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9 - school_course.count, @school_id)} %>
<% end %> <% end %>

@ -1,164 +1,164 @@
<% @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'>
<div id="identifier-pannel" style="display:none"> <div id="identifier-pannel" style="display:none">
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %> <%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
<div class="weixin-content">微信扫码</div> <div class="weixin-content">微信扫码</div>
</div> </div>
<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? %>
<!-- <span class="font_welcome_trustie"><#%= @first_page.title %></span> <span class="font_welcome_tdescription">, <#%= @first_page.description %></span> --> <!-- <span class="font_welcome_trustie"><#%= @first_page.title %></span> <span class="font_welcome_tdescription">, <#%= @first_page.description %></span> -->
<%= @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-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% #projects = find_miracle_project(10, 3) %> <% #projects = find_miracle_project(10, 3) %>
<% @projects.map do |project| %> <% @projects.map do |project| %>
<!--<%# cache cache_key_for_project(project) do %> --> <!--<%# cache cache_key_for_project(project) do %> -->
<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 style="float: left;"> <div style="float: left;">
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %> <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div style="float: left; margin-left: 10px; width: 380px;"> <div style="float: left; margin-left: 10px; width: 380px;">
<% unless project.is_public %> <% unless project.is_public %>
<span class="private_project"><%= l(:lable_private) %></span> <span class="private_project"><%= l(:label_private) %></span>
<% end %> <% end %>
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>) (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
</div> </div>
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;"> <div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
<span class='font_lighter' title ='<%=project.short_description%>'><%=project.description.truncate(100, omission: '...')%></span> <span class='font_lighter' title ='<%=project.short_description%>'><%=project.description.truncate(100, omission: '...')%></span>
</div> </div>
<div > <div >
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s, <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip", :class => "tooltip",
:id => "tooltip-#{project.id}" %> :id => "tooltip-#{project.id}" %>
</div> </div>
</li> </li>
<!--<%#end %> --> <!--<%#end %> -->
<% end; reset_cycle %> <% end; reset_cycle %>
</ul> </ul>
</div> </div>
</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;">
<ul class="user-welcome-message-list"> <ul class="user-welcome-message-list">
<h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3> <h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;"> <div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%> <%activities = find_all_activities%>
<% activities.each do |event| %> <% activities.each do |event| %>
<!--<%# cache cache_key_for_event(event) do %> --> <!--<%# cache cache_key_for_event(event) do %> -->
<li style="display: block;height:60px; padding-bottom: 4px;"> <li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; "> <div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div> </div>
<div class="inner-right" style="float: right; width:86%; height: 100%; "> <div class="inner-right" style="float: right; width:86%; height: 100%; ">
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %> <span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p> <p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
</div> </div>
</li> </li>
<!--<%#end %> --><!-- cache --> <!--<%#end %> --><!-- cache -->
<% end %> <% end %>
</div> </div>
</ul> </ul>
</div> </div>
<div class="right" style="float: right; width: 48%; "> <div class="right" style="float: right; width: 48%; ">
<ul class="welcome-message-list"> <ul class="welcome-message-list">
<!--<%# cache 'forum_links' do %> --> <!--<%# cache 'forum_links' do %> -->
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;"> <div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);"> <h3 style="color: rgb(21, 188, 207);">
<strong>贴吧动态</strong> <strong>贴吧动态</strong>
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3> <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span> <span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
</div> </div>
<!--<%#end %> --> <!--<%#end %> -->
<div class="welcome-box-list-new memo_activity"> <div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(7) %> <% topics = find_new_forum_topics(7) %>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%> <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<!--<%# cache cache_key_for_topic(topic) do %> --> <!--<%# cache cache_key_for_topic(topic) do %> -->
<li class="message-brief-intro"> <li class="message-brief-intro">
<div class='memo_title text_nowrap'> <div class='memo_title text_nowrap'>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %> <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
</div> </div>
<div class='memo_attr'> <div class='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">
楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> 楼主: <%= 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">
最后回复:<% 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 %> 最后回复:<% 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">
回复(<%= link_to topic.try(:replies_count), topic.event_url %>) 回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span> </span>
</div> </div>
</li> </li>
<!--<%#end %> --> <!-- cache --> <!--<%#end %> --> <!-- cache -->
<% end %> <% end %>
</div> </div>
</ul> </ul>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<%= render partial: 'link_to_another' %> <%= render partial: 'link_to_another' %>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -878,18 +878,18 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
create_table "relative_memos", :force => true do |t| create_table "relative_memos", :force => true do |t|
t.integer "osp_id" t.integer "osp_id"
t.integer "parent_id" t.integer "parent_id"
t.string "subject", :null => false t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false t.text "content", :null => false
t.integer "author_id" t.integer "author_id"
t.integer "replies_count", :default => 0 t.integer "replies_count", :default => 0
t.integer "last_reply_id" t.integer "last_reply_id"
t.boolean "lock", :default => false t.boolean "lock", :default => false
t.boolean "sticky", :default => false t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0 t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0 t.integer "viewed_count_local", :default => 0
t.string "url" t.string "url"
t.string "username" t.string "username"
t.string "userhomeurl" t.string "userhomeurl"
@ -976,11 +976,10 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.string "url" t.string "url"
t.string "title" t.string "title"
t.integer "share_type" t.integer "share_type"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "project_id" t.integer "project_id"
t.integer "user_id" t.integer "user_id"
t.string "description"
end end
create_table "softapplications", :force => true do |t| create_table "softapplications", :force => true do |t|
@ -1086,8 +1085,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "zip_code" t.integer "zip_code"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.string "technical_title"
t.integer "identity" t.integer "identity"
t.string "technical_title"
t.string "student_id" t.string "student_id"
t.string "teacher_realname" t.string "teacher_realname"
t.string "student_realname" t.string "student_realname"
@ -1145,6 +1144,9 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "active" t.integer "active"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "level"
t.integer "file"
t.integer "issue"
end end
create_table "user_statuses", :force => true do |t| create_table "user_statuses", :force => true do |t|

@ -1,42 +1,42 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<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>File not found</title> <title>File not found</title>
<style> <style>
body{ body{
font-family: Trebuchet MS,Georgia,"Times New Roman",serif; font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
color:#303030; color:#303030;
} }
div.container{ div.container{
margin: 0 auto; margin: 0 auto;
width: 80%; width: 80%;
} }
h1{ h1{
font-size:1.5em; font-size:1.5em;
} }
p{ p{
font-size:0.8em; font-size:0.8em;
} }
.hidden{ .hidden{
display: none; display: none;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container" > <div class="container" >
<!--<h1>Sorry, this file can not be downloaded now. </h1>--> <!--<h1>Sorry, this file can not be downloaded now. </h1>-->
<h1><%= l(:lable_file_not_found) %></h1> <h1><%= l(:label_file_not_found) %></h1>
<h3> <a href="http://forge.trustie.net" style=""><%= l(:lable_goto_homepage) %></a> </h3> <h3> <%= link_to l(:label_goto_homepage),{:controller=>'welcome',:action=>'index',:host=>Setting.host_name} %> </h3>
<div class="container" style=""> <div class="container" style="">
<div style="position: relative; right:0;text-align: right;"> <div style="position: relative; right:0;text-align: right;">
<h4><%= l(:lable_trustie_team) %></h4> <h4><%= l(:label_trustie_team) %></h4>
</div> </div>
</div> </div>
<p class="hidden" > <p class="hidden" >
<a href="javascript:history.back()">Back</a> <a href="javascript:history.back()">Back</a>
</p> </p>
</div> </div>
</body> </body>
</html> </html>

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>File not found</title>
<style>
body{
font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
color:#303030;
}
div.container{
margin: 0 auto;
width: 80%;
}
h1{
font-size:1.5em;
}
p{
font-size:0.8em;
}
.hidden{
display: none;
}
</style>
</head>
<body>
<div class="container" >
<!--<h1>Sorry, this file can not be downloaded now. </h1>-->
<h1>该作业没有任何的附件可以下载</h1>
<h3> <a href="http://forge.trustie.net" style="">返回主页</a> </h3>
<div class="container" style="">
<div style="position: relative; right:0;text-align: right;">
<h4>Trustie开发团队.</h4>
</div>
</div>
<p class="hidden" >
<a href="javascript:history.back()">Back</a>
</p>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save