Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/welcome/index.html.erbcourse_group
commit
3ef05e64b8
@ -1,373 +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|
|
||||||
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.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) &&
|
||||||
@attachment.container.board && @attachment.container.board.course ) )
|
@attachment.container.board && @attachment.container.board.course ) )
|
||||||
if @attachment.container.is_a?(News)
|
if @attachment.container.is_a?(News)
|
||||||
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
||||||
elsif @attachment.container.is_a?(Message)
|
elsif @attachment.container.is_a?(Message)
|
||||||
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
|
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
|
||||||
elsif @course.nil?
|
elsif @course.nil?
|
||||||
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
||||||
else
|
else
|
||||||
format.html { redirect_to_referer_or course_path(@course) }
|
format.html { redirect_to_referer_or course_path(@course) }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @project.nil?
|
if @project.nil?
|
||||||
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
||||||
else
|
else
|
||||||
format.html { redirect_to_referer_or project_path(@project) }
|
format.html { redirect_to_referer_or project_path(@project) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_homework
|
def delete_homework
|
||||||
@bid = @attachment.container.bid
|
@bid = @attachment.container.bid
|
||||||
# Make sure association callbacks are called
|
# Make sure association callbacks are called
|
||||||
container = @attachment.container
|
container = @attachment.container
|
||||||
@attachment.container.attachments.delete(@attachment)
|
@attachment.container.attachments.delete(@attachment)
|
||||||
#if container.attachments.empty?
|
#if container.attachments.empty?
|
||||||
#container.delete
|
#container.delete
|
||||||
#end
|
#end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to_referer_or respond_path(@bid) }
|
format.html { redirect_to_referer_or respond_path(@bid) }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#删除竞赛作品的附件
|
#删除竞赛作品的附件
|
||||||
def delete_softapplications
|
def delete_softapplications
|
||||||
@attachment = Attachment.find params[:id]
|
@attachment = Attachment.find params[:id]
|
||||||
@softapplication = @attachment.container if @attachment!=nil
|
@softapplication = @attachment.container if @attachment!=nil
|
||||||
@attachment.container.attachments.delete(@attachment) if @attachment!=nil
|
@attachment.container.attachments.delete(@attachment) if @attachment!=nil
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to_referer_or edit_softapplication_path(@softapplication) }
|
format.html { redirect_to_referer_or edit_softapplication_path(@softapplication) }
|
||||||
#format.js
|
#format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def autocomplete
|
def autocomplete
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
if params[:project_id]
|
if params[:project_id]
|
||||||
@project = Project.find_by_id(params[:project_id])
|
@project = Project.find_by_id(params[:project_id])
|
||||||
elsif params[:course_id]
|
elsif params[:course_id]
|
||||||
@course = Course.find_by_id(params[:course_id])
|
@course = Course.find_by_id(params[:course_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_exist_file_to_project
|
def add_exist_file_to_project
|
||||||
classname = params[:class_name]
|
classname = params[:class_name]
|
||||||
class_id = params[:class_id]
|
class_id = params[:class_id]
|
||||||
attachments = params[:attachment][:attach]
|
attachments = params[:attachment][:attach]
|
||||||
|
|
||||||
obj = Object.const_get(classname).find_by_id(class_id)
|
obj = Object.const_get(classname).find_by_id(class_id)
|
||||||
attachments.collect do |attach_id|
|
attachments.collect do |attach_id|
|
||||||
ori = Attachment.find_by_id(attach_id)
|
ori = Attachment.find_by_id(attach_id)
|
||||||
next if ori.blank?
|
next if ori.blank?
|
||||||
attach_copied_obj = ori.copy
|
attach_copied_obj = ori.copy
|
||||||
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
||||||
attach_copied_obj.container = obj
|
attach_copied_obj.container = obj
|
||||||
attach_copied_obj.created_on = Time.now
|
attach_copied_obj.created_on = Time.now
|
||||||
attach_copied_obj.author_id = User.current.id
|
attach_copied_obj.author_id = User.current.id
|
||||||
if attach_copied_obj.attachtype == nil
|
if attach_copied_obj.attachtype == nil
|
||||||
attach_copied_obj.attachtype = 1
|
attach_copied_obj.attachtype = 1
|
||||||
end
|
end
|
||||||
@obj = obj
|
@obj = obj
|
||||||
@save_flag = attach_copied_obj.save
|
@save_flag = attach_copied_obj.save
|
||||||
@save_message = attach_copied_obj.errors.full_messages
|
@save_message = attach_copied_obj.errors.full_messages
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
@save_flag = false
|
@save_flag = false
|
||||||
@save_message = [] << l(:error_attachment_empty)
|
@save_message = [] << l(:error_attachment_empty)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_exist_file_to_course
|
def add_exist_file_to_course
|
||||||
class_id = params[:class_id]
|
class_id = params[:class_id]
|
||||||
attachments = params[:attachment][:attach]
|
attachments = params[:attachment][:attach]
|
||||||
|
|
||||||
obj = Course.find_by_id(class_id)
|
obj = Course.find_by_id(class_id)
|
||||||
attachments.collect do |attach_id|
|
attachments.collect do |attach_id|
|
||||||
ori = Attachment.find_by_id(attach_id)
|
ori = Attachment.find_by_id(attach_id)
|
||||||
next if ori.blank?
|
next if ori.blank?
|
||||||
attach_copied_obj = ori.copy
|
attach_copied_obj = ori.copy
|
||||||
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
||||||
attach_copied_obj.container = obj
|
attach_copied_obj.container = obj
|
||||||
attach_copied_obj.created_on = Time.now
|
attach_copied_obj.created_on = Time.now
|
||||||
attach_copied_obj.author_id = User.current.id
|
attach_copied_obj.author_id = User.current.id
|
||||||
if attach_copied_obj.attachtype == nil
|
if attach_copied_obj.attachtype == nil
|
||||||
attach_copied_obj.attachtype = 4
|
attach_copied_obj.attachtype = 4
|
||||||
end
|
end
|
||||||
@obj = obj
|
@obj = obj
|
||||||
@save_flag = attach_copied_obj.save
|
@save_flag = attach_copied_obj.save
|
||||||
@save_message = attach_copied_obj.errors.full_messages
|
@save_message = attach_copied_obj.errors.full_messages
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
@save_flag = false
|
@save_flag = false
|
||||||
@save_message = [] << l(:error_attachment_empty)
|
@save_message = [] << l(:error_attachment_empty)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def find_project
|
def find_project
|
||||||
@attachment = Attachment.find(params[:id])
|
@attachment = Attachment.find(params[:id])
|
||||||
# Show 404 if the filename in the url is wrong
|
# Show 404 if the filename in the url is wrong
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
|
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
|
||||||
if @attachment.container_type == 'Course'
|
if @attachment.container_type == 'Course'
|
||||||
@course = @attachment.course
|
@course = @attachment.course
|
||||||
elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course
|
elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course
|
||||||
@course = @attachment.container.course
|
@course = @attachment.container.course
|
||||||
else
|
else
|
||||||
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication'
|
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication'
|
||||||
@project = @attachment.project
|
@project = @attachment.project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks that the file exists and is readable
|
# Checks that the file exists and is readable
|
||||||
def file_readable
|
def file_readable
|
||||||
if @attachment.readable?
|
if @attachment.readable?
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable."
|
logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable."
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_authorize
|
def read_authorize
|
||||||
if @attachment.container_type == "HomeworkAttach" || @attachment.container_type == 'Bid'
|
if @attachment.container_type == "HomeworkAttach" || @attachment.container_type == 'Bid'
|
||||||
true
|
true
|
||||||
#User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access
|
#User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access
|
||||||
else
|
else
|
||||||
@attachment.visible? ? true : deny_access
|
@attachment.visible? ? true : deny_access
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_authorize
|
def delete_authorize
|
||||||
@attachment.deletable? ? true : deny_access
|
@attachment.deletable? ? true : deny_access
|
||||||
end
|
end
|
||||||
|
|
||||||
def detect_content_type(attachment)
|
def detect_content_type(attachment)
|
||||||
content_type = attachment.content_type
|
content_type = attachment.content_type
|
||||||
if content_type.blank?
|
if content_type.blank?
|
||||||
content_type = Redmine::MimeType.of(attachment.filename)
|
content_type = Redmine::MimeType.of(attachment.filename)
|
||||||
end
|
end
|
||||||
content_type.to_s
|
content_type.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_without_softapplication
|
def login_without_softapplication
|
||||||
referer = request.headers['Referer']
|
referer = request.headers['Referer']
|
||||||
require_login unless referer =~ /softapplication/
|
require_login unless referer =~ /softapplication/
|
||||||
end
|
end
|
||||||
|
|
||||||
def renderTag
|
def renderTag
|
||||||
@attachmentNew = Attachment.find(params[:attchmentId])
|
@attachmentNew = Attachment.find(params[:attchmentId])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
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/> "
|
#@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/> "
|
||||||
#@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
|
||||||
|
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_to 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
|
||||||
|
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 >= 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(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
link_to(' '.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()",:onmouseover => 'this.focus()' %>
|
<%= 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>   
|
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>   
|
||||||
<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>
|
||||||
|
|
||||||
<%= 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,10 +1,12 @@
|
|||||||
<!-- huang -->
|
<!-- huang -->
|
||||||
<h3><%=l(:label_newtype_contest)%></h3>
|
<h3><%=l(:label_newtype_contest)%></h3>
|
||||||
|
|
||||||
<%= labelled_form_for @contest, :url => {:controller => 'contests', :action => 'create_contest'}, method: :post do |f| %>
|
<%= labelled_form_for @contest,
|
||||||
|
:url => {:controller => 'contests', :action => 'create_contest'},
|
||||||
|
method: :post do |f| %>
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<%= render :partial => 'form_contest', :locals => { :f => f } %>
|
<%= render :partial => 'form_contest', :locals => { :f => f } %>
|
||||||
<%= submit_tag l(:button_create) %>
|
<%= submit_tag l(:button_create) %>
|
||||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
@ -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(:label_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>
|
||||||
|
@ -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(:label_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,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>
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -1,51 +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"> * </span></label><br/>
|
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> * </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"> * </span></label><br/>
|
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> * </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"> * </span></label>
|
||||||
<% if !replying && !@message.new_record? && @message.safe_attribute?('board_id') %>
|
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||||
<p><label><%= l(:label_board) %></label><br />
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
<%# modify by nwb%>
|
</p>
|
||||||
<% if @message.project %>
|
<p>
|
||||||
<%= f.select :board_id, boards_options_for_select(@message.project.boards) %>
|
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
|
||||||
<% elsif @message.course %>
|
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %></p>
|
||||||
<%= f.select :board_id, boards_options_for_select(@message.course.boards) %>
|
|
||||||
<% end %>
|
<!--[eoform:message]-->
|
||||||
</p>
|
|
||||||
<% end %>
|
<p><%= l(:label_attachment_plural) %><br />
|
||||||
<p><label for="message_subject"><%= l(:field_description) %><span class="required"> * </span></label>
|
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p>
|
||||||
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
</div>
|
||||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
|
||||||
</p>
|
|
||||||
<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]-->
|
|
||||||
|
|
||||||
<p><%= l(:label_attachment_plural) %><br />
|
|
||||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<%#= wikitoolbar_for 'message_content' %>
|
<%#= wikitoolbar_for 'message_content' %>
|
@ -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,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,71 +1,71 @@
|
|||||||
|
|
||||||
<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 %>
|
<% 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" , documents_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;">
|
||||||
«
|
«
|
||||||
<% 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 -%>
|
||||||
»
|
»
|
||||||
|
|
||||||
<%= 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 l(:label_button_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 l(:label_button_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)) -%>
|
||||||
|
@ -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 @@
|
|||||||
|
|
||||||
<% option_num = get_option_number(@user,1) %>
|
<% 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> + <%#= l(:label_user_score_of_influence) %></div> -->
|
<!-- <div> + <%#= 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(:label_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 %>
|
||||||
|
|
||||||
|
@ -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> <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> <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> </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> <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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_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>
|
||||||
<% 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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>
|
||||||
<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>
|
||||||
</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> <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> <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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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>
|
|
||||||
<span class="font_lighter">
|
<% else %>
|
||||||
<%= l(:label_i_new_activity) %>
|
<% unless @message.empty? %>
|
||||||
</span>
|
<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>
|
<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>
|
<% 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)) %> <%= 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)) %> <%= 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)) %> <%= 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)) %> <%= 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> <span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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)) %> <%= l(:label_quote_my_words) %>
|
|
||||||
<% elsif e.jour_type == 'User' %>
|
|
||||||
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %> <%= l(:label_quote_my_words) %>
|
|
||||||
<% elsif e.jour_type == 'Project' %>
|
|
||||||
<%= '在'<<l(:field_project) %><%= link_to(e.jour.name, feedback_path(e.jour)) %> <%= l(:label_reply_plural) %>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %> <%= 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(:label_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) %>
|
||||||
|
|
||||||
<% 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 %>
|
||||||
|
|
||||||
|
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => school_id} %>
|
@ -1,52 +0,0 @@
|
|||||||
# Default setup is given for MySQL with ruby1.9. If you're running Redmine
|
|
||||||
# with MySQL and ruby1.8, replace the adapter name with `mysql`.
|
|
||||||
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
|
|
||||||
# Line indentation must be 2 spaces (no tabs).
|
|
||||||
|
|
||||||
production:
|
|
||||||
adapter: mysql2
|
|
||||||
database: redmine
|
|
||||||
host: localhost
|
|
||||||
username: root
|
|
||||||
password: ""
|
|
||||||
encoding: utf8
|
|
||||||
|
|
||||||
development:
|
|
||||||
adapter: mysql2
|
|
||||||
database: redmine_development
|
|
||||||
host: 10.107.17.20
|
|
||||||
username: root
|
|
||||||
password: "1234"
|
|
||||||
encoding: utf8
|
|
||||||
|
|
||||||
# Warning: The database defined as "test" will be erased and
|
|
||||||
# re-generated from your development database when you run "rake".
|
|
||||||
# Do not set this db to the same as development or production.
|
|
||||||
test:
|
|
||||||
adapter: mysql2
|
|
||||||
database: redmine_test
|
|
||||||
host: 10.107.17.20
|
|
||||||
username: root
|
|
||||||
password: "1234"
|
|
||||||
encoding: utf8
|
|
||||||
|
|
||||||
# PostgreSQL configuration example
|
|
||||||
#production:
|
|
||||||
# adapter: postgresql
|
|
||||||
# database: redmine
|
|
||||||
# host: localhost
|
|
||||||
# username: postgres
|
|
||||||
# password: "postgres"
|
|
||||||
|
|
||||||
# SQLite3 configuration example
|
|
||||||
#production:
|
|
||||||
# adapter: sqlite3
|
|
||||||
# database: db/redmine.sqlite3
|
|
||||||
|
|
||||||
# SQL Server configuration example
|
|
||||||
#production:
|
|
||||||
# adapter: sqlserver
|
|
||||||
# database: redmine
|
|
||||||
# host: localhost
|
|
||||||
# username: jenkins
|
|
||||||
# password: jenkins
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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(:label_file_not_found) %></h1>
|
<h1><%= l(:label_file_not_found) %></h1>
|
||||||
<h3> <%= link_to l(:label_goto_homepage),{:controller=>'welcome',:action=>'index',:host=>Setting.host_name} %> </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(:label_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…
Reference in new issue