new version

This commit is contained in:
huangjingquan 2013-09-12 10:41:15 +08:00
parent 7dbcc1520c
commit 261c3fc337
126 changed files with 2839 additions and 819 deletions

View File

@ -20,8 +20,6 @@ group :openid do
end
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
platforms :jruby do
# jruby-openssl is bundled with JRuby 1.7.0
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/

View File

@ -42,7 +42,7 @@ class AccountController < ApplicationController
redirect_to home_url
elsif request.post?
logout_user
redirect_to signin_path
redirect_to home_url
end
# display the logout form
end
@ -147,6 +147,13 @@ class AccountController < ApplicationController
else
register_manually_by_administrator(@user)
end
#added by bai
unless @user.id.nil?
UserExtensions.create(:identity => params[:identity].to_i, :user_id => @user.id)
end
#end
end
end
end
@ -181,6 +188,8 @@ class AccountController < ApplicationController
if user.nil?
invalid_credentials
elsif user.status == 2
invalid_credentials_new
elsif user.new_record?
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
else
@ -271,12 +280,18 @@ class AccountController < ApplicationController
flash.now[:error] = l(:notice_account_invalid_creditentials)
end
def invalid_credentials_new
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}"
flash.now[:error] = l(:notice_account_invalid_creditentials_new)
end
# Register a user for email activation.
#
# Pass a block for behavior when a user fails to save
def register_by_email_activation(user, &block)
token = Token.new(:user => user, :action => "register")
if user.save and token.save
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
Mailer.register(token).deliver
flash[:notice] = l(:notice_account_register_done)
redirect_to signin_path
@ -293,6 +308,7 @@ class AccountController < ApplicationController
user.activate
user.last_login_on = Time.now
if user.save
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
self.logged_user = user
flash[:notice] = l(:notice_account_activated)
redirect_to my_account_path
@ -306,6 +322,7 @@ class AccountController < ApplicationController
# Pass a block for behavior when a user fails to save
def register_manually_by_administrator(user, &block)
if user.save
UserStatus.create(:user_id => user.id ,:changsets_count => 0, :watchers_count => 0)
# Sends an email to the administrators
Mailer.account_activation_request(user).deliver
account_pending

View File

@ -18,12 +18,50 @@ class BidsController < ApplicationController
@offset ||= @bid_pages.reverse_offset
#@bids = @bids.offset(@offset).limit(@limit).all.reverse
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
# unless @offset == 0
# @bids = @bids.offset(@offset).limit(@limit).all.reverse
# else
# limit = @bid_count % @limit
# @bids = @bids.offset(@offset).limit(limit).all.reverse
# end
#added by nie
if params[:bid_sort_type].present?
case params[:bid_sort_type]
when '0'
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
@s_state = 0
when '1'
unless @offset == 0
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
end
@s_state = 1
when '2'
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(@limit).all.reverse
end
@s_state = 0
end
else
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
unless @offset == 0
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
end
@s_state = 1
end
#end
# @limit = api_offset_and_limit({:limit => 5})
# @bids = Bid.visible
# @bids = @bids.like(params[:name]) if params[:name].present?
@ -107,7 +145,7 @@ class BidsController < ApplicationController
if params[:bid_message][:message].size>0
if params[:reference_content]
message = params[:reference_content] + params[:bid_message][:message]
message = params[:bid_message][:message] + "\n" + params[:reference_content]
else
message = params[:bid_message][:message]
end
@ -138,8 +176,10 @@ class BidsController < ApplicationController
##删除留言
def destroy
JournalsForMessage.delete_message(params[:object_id])
@user = @bid.author
if User.current.admin? || User.current.id == @user.id
JournalsForMessage.delete_message(params[:object_id])
end
@jours = @bid.journals_for_messages.reverse
@limit = 10
@feedback_count = @jours.count
@ -185,37 +225,37 @@ class BidsController < ApplicationController
def new_bid
@bid = Bid.new
@bid.safe_attributes = params[:bid]
# if params[:bid_title]
# # if params[:bid_budget].to_s =~ /^(\d+)$|^(\d+).([0-9]{2})$/
# unless params[:bid_reward_type] == "0"
# if params[:bid_deadline].to_s =~ /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
# bid = Bid.creat_bids(params[:bid_budget], params[:bid_deadline], params[:bid_title] , params[:bid_description], params[:bid_reward_type].to_i)
# unless bid.watched_by?(User.current)
# if bid.add_watcher(User.current)
# flash[:notice] = l(:label_bid_succeed)
# end
# end
# else
# flash[:error] = l(:label_wrong_date)
# end
# else
# flash[:error] = "wrong"
# end
# # else
# # flash[:error] = l(:label_wrong_budget)
# # end
# end
# @limit = 5
# @bid_count = Bid.count
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
# @offset ||= @bid_pages.offset
# @bids = Bid.offset(@offset).limit(@limit).all
# respond_to do |format|
# # format.html
# format.html { redirect_to :back }
# format.js
# # format.api { render_api_ok }
# end
# if params[:bid_title]
# # if params[:bid_budget].to_s =~ /^(\d+)$|^(\d+).([0-9]{2})$/
# unless params[:bid_reward_type] == "0"
# if params[:bid_deadline].to_s =~ /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
# bid = Bid.creat_bids(params[:bid_budget], params[:bid_deadline], params[:bid_title] , params[:bid_description], params[:bid_reward_type].to_i)
# unless bid.watched_by?(User.current)
# if bid.add_watcher(User.current)
# flash[:notice] = l(:label_bid_succeed)
# end
# end
# else
# flash[:error] = l(:label_wrong_date)
# end
# else
# flash[:error] = "wrong"
# end
# # else
# # flash[:error] = l(:label_wrong_budget)
# # end
# end
# @limit = 5
# @bid_count = Bid.count
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
# @offset ||= @bid_pages.offset
# @bids = Bid.offset(@offset).limit(@limit).all
# respond_to do |format|
# # format.html
# format.html { redirect_to :back }
# format.js
# # format.api { render_api_ok }
# end
end
def create_bid
@ -240,6 +280,32 @@ class BidsController < ApplicationController
end
end
def create_homework
@bid = Bid.new
@bid.name = params[:bid][:name]
@bid.description = params[:bid][:description]
@bid.reward_type = 3
# @bid.budget = params[:bid][:budget]
@bid.deadline = params[:bid][:deadline]
@bid.budget = 0
@bid.author_id = User.current.id
@bid.commit = 0
# @bid.
if @bid.save
HomeworkForCourse.create(:project_id => params[:course_id], :bid_id => @bid.id)
unless @bid.watched_by?(User.current)
if @bid.add_watcher(User.current)
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_path(@bid)
else
@bid.safe_attributes = params[:bid]
render :action => 'new_bid'
end
end
def more
@jour = @bid.journals_for_messages
@jour.each_with_index {|j,i| j.indice = i+1}
@ -252,6 +318,7 @@ class BidsController < ApplicationController
end
end
def back
@jour = @bid.journals_for_messages
@jour.each_with_index {|j,i| j.indice = i+1}

View File

@ -0,0 +1,39 @@
class CourseController < ApplicationController
before_filter :require_login, :only => [:join, :unjoin]
def join
if User.current.logged?
course = Project.find(params[:object_id])
if params[:course_password] == '123'
members = []
members << Member.new(:role_ids => [5], :user_id => User.current.id)
course.members << members
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
else
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
def unjoin
if User.current.logged?
@member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id)
@member.first.destroy
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
joined.each do |join|
join.delete
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
end

View File

@ -51,11 +51,45 @@ class MyController < ApplicationController
@user = User.current
@pref = @user.pref
# if @user.user_extensions.nil?
# se = UserExtebsions.new
# se.user_id = @user.id
# se.occupation = params[:occupation]
# se.save
# else
# # = @user.user_extensions
# end
# @occupation = UserExtensions.occupation
# @occupation.save
if request.post?
@user.safe_attributes = params[:user]
@user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
# # UserExtensions.create(:user_id => @user.id, :occupation => params[:occupation])
# else
# ue = @user.user_extensions
# ue.occupation = params[:occupation]
# ue.save
# end
# added by bai
if @user.UserExtensions.nil?
se = UserExtensions.new
se.user_id = @user.id
se.occupation = params[:occupation]
se.save
else
se = @user.user_extensions
se.occupation = params[:occupation]
se.save
end
# end
if @user.save
@user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])

View File

@ -14,20 +14,24 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ProjectsController < ApplicationController
layout 'base_projects'# by young
menu_item :overview
menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings
menu_item :homework, :only => :homework
menu_item l(:label_sort_by_time), :only => :index
menu_item l(:label_sort_by_active), :only => :index
menu_item l(:label_sort_by_influence), :only => :index
#by huang
# menu_item :files, :only => :files
# menu_tiem :news, :only => :news
before_filter :find_project, :except => [ :index, :list, :new, :create, :copy, :statistics]
before_filter :authorize, :except => [:new_homework, :homework, :statistics, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback]
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join]
before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback]
before_filter :authorize_global, :only => [:new, :create]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
#by young
before_filter :member, :file
before_filter :member, :file, :statistics, :watcherlist
#
accept_rss_auth :index
accept_api_auth :index, :show, :create, :update, :destroy
@ -54,10 +58,32 @@ class ProjectsController < ApplicationController
helper :activities
helper :documents
helper :watchers
# helper :watcherlist
### added by william
include ActsAsTaggableOn::TagsHelper
# Lists visible projects
# def index
# respond_to do |format|
# format.html {
# scope = Project
# unless params[:closed]
# scope = scope.active
# end
# @projects = scope.visible.order('lft').all
# }
# format.api {
# @offset, @limit = api_offset_and_limit
# @project_count = Project.visible.count
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
# }
# format.atom {
# projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
# render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
# }
# end
# end
def index
#Modified by nie
@ -68,35 +94,102 @@ class ProjectsController < ApplicationController
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
@offset, @limit = api_offset_and_limit({:limit => 10})
@projects = Project.visible
@projects_status = ProjectStatus.visible
# @projects.each do |project|
# @admin = project.users_by_role[Role.find(3)]
# unless @admin.nil?
# @admin.each do |user|
# ProjectInfo.create(:user_id => user.id, :project_id => project.id)
# end
#
# end
# @admin = project.users_by_role[Role.find(3)]
# unless @admin.nil?
# @admin.each do |user|
# ProjectInfo.create(:user_id => user.id, :project_id => project.id)
# end
@projects = Project.visible.like(params[:name]) if params[:name].present?
@project_count = @projects.count
#
# end
# end
# @projects.each do |project|
# ProjectStatus.create(:changesets_count => project.changesets.count, :project_id => project.id, :watchers_count => project.watcher_users.count)
# end
#@projects_status = Project.visible.like(params[:name]) if params[:name].present?
@project_count = @projects_status.count
@project_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @project_pages.offset
@projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all
@offset ||= @project_pages.reverse_offset
#@projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all
if params[:project_sort_type].present?
case params[:project_sort_type]
when '0'
@offset ||= @project_pages.reverse_offset
unless @offset == 0
@projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse
else
limit = @project_count % @limit
if limit == 0
limit = @limit
end
@projects_status = @projects_status.offset(@offset).limit(limit).all.reverse
end
@s_type = 0
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]
when '1'
@offset ||= @project_pages.reverse_offset
unless @offset == 0
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse
else
limit = @project_count % @limit
if limit == 0
limit = @limit
end
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 1
#@projects = @projects[@offset, @limit]
when '2'
@offset ||= @project_pages.reverse_offset
unless @offset == 0
@projects_status = @projects_status.reorder('watchers_count').offset(@offset).limit(@limit).all.reverse
else
limit = @project_count % @limit
if limit == 0
limit = @limit
end
@projects_status = @projects_status.reorder('watchers_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 2
end
else
@offset ||= @project_pages.reverse_offset
unless @offset == 0
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse
else
limit = @project_count % @limit
if limit == 0
limit = @limit
end
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 1
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]
end
@projects = []
@projects_status.each do |obj|
@projects << Project.find_by_id("#{obj.project_id}")
end
#end
respond_to do |format|
respond_to do |format|
format.html {
render :layout => 'base'
scope = Project
unless params[:closed]
scope = scope.active
scope = scope.active
end
@projects = scope.visible.offset(@offset).limit(@limit).order('created_on DESC').all
}
format.api {
# @offset, @limit = api_offset_and_limit
# @project_count = Project.visible.count
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
# @offset, @limit = api_offset_and_limit
# @project_count = Project.visible.count
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
}
format.atom {
projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
@ -105,10 +198,44 @@ class ProjectsController < ApplicationController
end
end
#Added by young
def homework
def search
@projects = Project.visible
@projects = @projects.visible.like(params[:name]) if params[:name].present?
@offset, @limit = api_offset_and_limit({:limit => 10})
@bids = Bid.visible
@project_count = @projects.visible.count
@project_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @project_pages.offset
@projects = @projects.visible.offset(@offset).limit(@limit).all
respond_to do |format|
format.html {
render :layout => 'base'
scope = Project
unless params[:closed]
scope = scope.active
end
}
format.api {
# @offset, @limit = api_offset_and_limit
# @project_count = Project.visible.count
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
}
format.atom {
projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
}
end
end
# added by fq
def new_join
@course = Project.find(params[:object_id])
end
#Added by young
def homework
@offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @project.homeworks
@bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page']
@ -122,15 +249,14 @@ class ProjectsController < ApplicationController
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
render :layout => 'base_courses'
end
end
def new_homework
def new_homework
@homework = Bid.new
@homework.safe_attributes = params[:bid]
render :layout => 'base_courses'
end
#Ended by young
end
#Ended by young
def feedback
@jours = @project.journals_for_messages.reverse
@ -142,31 +268,70 @@ class ProjectsController < ApplicationController
@state = false
end
def project_respond
if params[:project_respond].size>0
jour = JournalsForMessage.find(params[:reference_id]) if params[:reference_id]
if jour
user = jour.user
text = jour.notes
else
user = User.current
text = []
end
# Replaces pre blocks with [...]
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
reference_content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
reference_content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
# reference_message = JournalForMessage.find(params[:reference_id])
message = params[:project_respond] + "\n" + reference_content
user.add_jour(User.current, message, user.id)
flash[:notice]=l(:label_projects_feedback_respond_success)
# if a_message.size > 5
# @message = a_message[-5, 5]
# else
# @message = a_message
# end
# @message_count = a_message.count
end
respond_to do |format|
format.html { redirect_to :back }
#format.api { render_api_ok }
end
# redirect_to project_feedback_path(@project)
end
def new
@course_tag = params[:course]
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
##add by xianbo
##add by huang
@course=Course.new
@course.safe_attributes = params[:course]
##end
render :layout => 'base'
end
def create
@course_tag = params[:project][:project_type]
@course = Course.new
@course.extra=params[:project][:identifier]
@course.safe_attributes = params[:project][:course]
@course_tag = params[:project][:project_type]
if(@course_tag=="1")
@course = Course.new
@course.extra=params[:project][:identifier]
@course.safe_attributes = params[:project][:course]
@course.save
# project = ProjectInfo.create(:user_id => User.current.id, :project_id => @project.id)
# project_status = ProjectStatus.create(:project_id => @project.id)
end
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
@course.save
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
# Add current user as a project member if he is not admin
@ -174,8 +339,9 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
@project.members << m
@project.project_infos << project
project_status = ProjectStatus.create(:project_id => @project.id)
@project.members << m
@project.project_infos << project
end
respond_to do |format|
format.html {
@ -227,21 +393,23 @@ class ProjectsController < ApplicationController
end
end
rescue ActiveRecord::RecordNotFound
# source_project not found
# source_project not found
render_404
end
end
# Show @project
def show
# try to redirect to the requested menu item
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return
return
end
@users_by_role = @project.users_by_role
@subprojects = @project.children.visible.all
@news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").all
@trackers = @project.rolled_up_trackers
@user = User.find_by_id(ProjectInfo.find_by_project_id(@project.id).user_id)
cond = @project.project_condition(Setting.display_subprojects_issues?)
@open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker)
@total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker)
@ -251,7 +419,7 @@ class ProjectsController < ApplicationController
end
@key = User.current.rss_key
#新增内容
#新增内容
@days = Setting.activity_days_default.to_i
if params[:from]
@ -268,12 +436,12 @@ class ProjectsController < ApplicationController
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
# 决定显示所用用户或单个用户活动
# 决定显示所用用户或单个用户活动
@activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
:with_subprojects => @with_subprojects,
:author => @author)
@activity.scope_select {|t| !has["show_#{t}"].nil?}
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
#Added by young
events = @activity.events(@date_from, @date_to)
@ -284,8 +452,8 @@ class ProjectsController < ApplicationController
events = events.slice(@offset,@limit)
#Ended by young
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
# documents
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
# documents
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
documents = @project.documents.includes(:attachments, :category).all
case @sort_by
when 'date'
@ -295,18 +463,17 @@ class ProjectsController < ApplicationController
when 'author'
@grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author}
else
@grouped = documents.group_by(&:category)
@grouped = documents.group_by(&:category)
end
@document = @project.documents.build
#
#
@base_courses_tag = @project.project_type
respond_to do |format|
format.html{render :layout => 'base_courses' if @base_courses_tag }
format.html{render :layout => 'base_courses' if @base_courses_tag==1}
format.api
end
end
def settings
@issue_custom_fields = IssueCustomField.sorted.all
@issue_category ||= IssueCategory.new
@ -314,11 +481,12 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all
@wiki ||= @project.wiki
#Added by young
@course_tag = params[:course]
if @course_tag == '1'
# @course_tag = params[:course]
# if @course_tag == '1'
if @project.project_type
render :layout => 'base_courses'
end
#Ended by young
#Ended by young
end
def edit
@ -328,16 +496,22 @@ class ProjectsController < ApplicationController
def member
end
def file
# @course_tag = params[:course]
# if @course_tag == '1'
# render :layout => 'base_courses'
# end
# User.current
end
def statistics
end
#end
def update
@project.safe_attributes = params[:project]
@Course.safe_attributes=params[:project][:course]
@Course.save
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
respond_to do |format|
@ -397,9 +571,9 @@ class ProjectsController < ApplicationController
format.html { redirect_to admin_projects_path }
format.api { render_api_ok }
end
else
render :layout => "base"
end
else
render :layout => "base"
end
# hide project in layout
@project = nil
end
@ -415,9 +589,17 @@ class ProjectsController < ApplicationController
parent = parent_id.blank? ? nil : Project.find_by_id(parent_id.to_i)
unless @project.allowed_parents.include?(parent)
@project.errors.add :parent_id, :invalid
return false
return false
end
end
true
end
# added by huang
def watcherlist
if @watched
@users -= watched.watcher_users
end
end
end

View File

@ -12,219 +12,103 @@ class TagsController < ApplicationController
before_filter :require_admin,:only => [:delete,:show_all]
$selected_tags = Array.new
$related_tags = Array.new
# $selected_tags = Array.new
# $related_tags = Array.new
NUMBERS = Setting.tags_show_search_results
# 接收参数解释:
# params[:q]这是在其他页面点击tag跳转到该页面后的结果显示 ;params[:selected_tags]这是在过滤页面增删tag进行过滤传过来的参数
# 最后是2个过滤何种数据显示结果的控制参数params[:obj_id],params[:object_falg]
# 0代表删除tag 1代表增加tag
def index
$selected_tags = []
$related_tags = []
$selected_tags << params[:q]
@issues_tags_num = Issue.tag_counts.size
@projects_tags_num = Project.tag_counts.size
@users_tags_num = User.tag_counts.size
@bids_tags_num = Bid.tag_counts.size
# 这里为了提高系统的响应速度 把搜索结果放到case中去了
@users_results = nil
@projects_results = nil
@issues_results = nil
@bids_results = nil
@obj_pages = nil
@obj_id = params[:obj_id]
@obj_flag = params[:object_flag]
@numbers = Setting.tags_show_search_results
case @obj_flag
when '1' then
@users_results = get_users_by_tag($selected_tags)
@obj = User.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @users_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@users_results = @users_results.offset(@offset).limit(@limit).all
when '2' then
@projects_results = get_projects_by_tag($selected_tags)
@obj = Project.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @projects_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all
when '3' then
@issues_results = get_issues_by_tag($selected_tags)
@obj = Issue.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @issues_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@issues_results = @issues_results.offset(@offset).limit(@limit).all
when '4'
@bids_results = get_bids_by_tag($selected_tags)
@obj = Bid.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @bids_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@bids_results = @bids_results.offset(@offset).limit(@limit).all
@selected_tags = Array.new
@related_tags = nil
if params[:q]
@selected_tags << params[:q]
else
@obj = nil
@do_what = params[:do_what]
@tag = params[:tag]
@selected_tags = params[:current_selected_tags]
@selected_tags = @selected_tags.nil? ? Array.new : @selected_tags
case @do_what
when '0' then
@selected_tags.delete @tag #数组中删除有多方式 可以改用shift,pop
when '1' then
# 判断是否已存在该tag 主要用来处理分页的情况
unless @selected_tags.include? @tag
@selected_tags << @tag
end
end
end
@users_tags_num,@projects_tags_num,@issues_tags_num,@bids_tags_num = get_tags_size
# 获取搜索结果
@obj,@obj_pages,@results_count,@users_results,
@projects_results,
@issues_results,
@bids_results = refresh_results(@obj_id,@obj_flag,@selected_tags)
# 这里是做tag推荐用的 用来生产推荐的tags
unless @obj.nil?
@tags = @obj.tag_list
$selected_tags.each do |i|
@selected_tags.each do |i|
@tags.delete(i)
end
$related_tags = @tags
@related_tags = @tags
else
return
return
end
end
# 增加已选的tag
def add_tag
@tag = params[:tag]
@show_flag = params[:show_flag]
$selected_tags << @tag
$related_tags.delete(@tag)
@obj_pages = nil
@numbers = Setting.tags_show_search_results
# @issues_results = get_issues_by_tag($selected_tags)
# @projects_results = get_projects_by_tag($selected_tags)
# @users_results = get_users_by_tag($selected_tags)
case @show_flag
when '1' then
@users_results = get_users_by_tag($selected_tags)
@obj = User.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @users_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@users_results = @users_results.offset(@offset).limit(@limit).all
when '2' then
@projects_results = get_projects_by_tag($selected_tags)
@obj = Project.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @projects_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all
when '3' then
@issues_results = get_issues_by_tag($selected_tags)
@obj = Issue.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @issues_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@issues_results = @issues_results.offset(@offset).limit(@limit).all
when '4'
@bids_results = get_bids_by_tag($selected_tags)
@obj = Bid.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @bids_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@bids_results = @bids_results.offset(@offset).limit(@limit).all
else
@obj = nil
end
# 获取搜索结果
@obj,@obj_pages,@users_results,
@projects_results,
@issues_results,
@bids_results = refresh_results(@obj_id,@show_flag)
end
# 删除已选tag
def delete_tag
@tag = params[:tag]
@show_flag = params[:show_flag]
$related_tags << @tag
$selected_tags.delete(@tag)
@obj_pages = nil
@numbers = Setting.tags_show_search_results
# 获取搜索结果
@obj,@obj_pages,@results_count,@users_results,
@projects_results,
@issues_results,
@bids_results = refresh_results(@obj_id,@show_flag)
# @issues_results = get_issues_by_tag($selected_tags)
# @projects_results = get_projects_by_tag($selected_tags)
# @users_results = get_users_by_tag($selected_tags)
case @show_flag
when '1' then
@users_results = get_users_by_tag($selected_tags)
@obj = User.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @users_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@users_results = @users_results.offset(@offset).limit(@limit).all
when '2' then
@projects_results = get_projects_by_tag($selected_tags)
@obj = Project.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @projects_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all
when '3' then
@issues_results = get_issues_by_tag($selected_tags)
@obj = Issue.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @issues_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@issues_results = @issues_results.offset(@offset).limit(@limit).all
when '4'
@bids_results = get_bids_by_tag($selected_tags)
@obj = Bid.find_by_id(@obj_id)
@offset, @limit = api_offset_and_limit({:limit => @numbers})
@project_count = @bids_results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
@bids_results = @bids_results.offset(@offset).limit(@limit).all
else
@obj = nil
end
end
def count(name)
end
def show_all
@tags = ActsAsTaggableOn::Tag.find(:all)
end
def for_pagination(results)
@offset, @limit = api_offset_and_limit({:limit => 2})
@project_count = results.count
@obj_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @obj_pages.offset
results = results.offset(@offset).limit(@limit).order('lft').all
end
#完全从数据库删除tag
def delete
if params[:q]
@tag = ActsAsTaggableOn::Tag.find_by_id(params[:q])
@tag.delete
@taggings = ActsAsTaggableOn::Tagging.find_all_by_tag_id(@tag.id)
@taggings.each do |tagging|
tagging.delete
end
@ -233,9 +117,52 @@ class TagsController < ApplicationController
end
private
# 这里用来刷新搜索结果的区域
# 函数的返回值 前2字段用来处理获取其他tag和分页 另外4个返回值为过滤结果
def refresh_results(obj_id,obj_flag,selected_tags)
@users_results = nil
@projects_results = nil
@issues_results = nil
@bids_results = nil
@obj_pages = nil
@obj = nil
def tagged_on_object(object)
# 这里为了提高系统的响应速度 把搜索结果放到case中去了
case obj_flag
when '1' then
@obj = User.find_by_id(obj_id)
@obj_pages,@users_results,@results_count = for_pagination(get_users_by_tag(selected_tags))
when '2' then
@obj = Project.find_by_id(obj_id)
@obj_pages,@projects_results,@results_count = for_pagination(get_projects_by_tag(selected_tags))
when '3' then
@obj = Issue.find_by_id(obj_id)
@obj_pages,@issues_results,@results_count = for_pagination(get_issues_by_tag(selected_tags))
when '4' then
@obj_pages,@bids_results,@results_count = for_pagination(get_bids_by_tag(selected_tags))
@obj = Bid.find_by_id(obj_id)
else
@obj = nil
end
return @obj,@obj_pages,@results_count,@users_results,@projects_results,@issues_results,@bids_results
end
def for_pagination(results)
@offset, @limit = api_offset_and_limit({:limit => NUMBERS }) # 设置每页显示的个数
@results_count = results.count
@obj_pages = Paginator.new @results_count, @limit, params['page'] # 3个参数分别是总数每页显示数目第几页
@offset ||= @obj_pages.offset
results = results.offset(@offset).limit(@limit).all # 这里默认设置为按时间排序
return @obj_pages,results, @results_count
end
#获取有某类对象的tag总数
def get_tags_size
@issues_tags_num = Issue.tag_counts.size
@projects_tags_num = Project.tag_counts.size
@users_tags_num = User.tag_counts.size
@bids_tags_num = Bid.tag_counts.size
return @users_tags_num,@projects_tags_num,@issues_tags_num,@bids_tags_num
end
end

View File

@ -0,0 +1,5 @@
class TeachersController < ApplicationController
def show
end
end

View File

@ -19,13 +19,13 @@ class UsersController < ApplicationController
#Added by young
menu_item :activity
menu_item :user_information, :only => :info
menu_item :project, :only => :user_projects
menu_item :user_project, :only => :user_projects
menu_item :requirement_focus, :only => :watch_bids
menu_item :user_newfeedback, :only => :user_newfeedback
#Ended by young
before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:edit,:update]
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:edit,:update]
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership,
:destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
@ -155,15 +155,84 @@ class UsersController < ApplicationController
}
# @count = Redmine::Activity::Fetcher.new(User.current, :author => @user).scope_select {|t| !has["show_#{t}"].nil?}.events(nil, nil).count
scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present?
scope = scope.in_group(params[:group_id]) if params[:group_id].present?
scope = UserStatus.visible
scope = scope.in_group(params[:group_id]) if params[:group_id].present?
# scope.each do |user|
# UserStatus.create(:changesets_count => user.changesets.count, :watchers_count => user.watcher_users.count, :user_id => user.id)
# end
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@offset ||= @user_pages.offset
@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
#@offset ||= @user_pages.offset
#@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
@user_base_tag = params[:id]?'base_users':'base'
if params[:user_sort_type].present?
case params[:user_sort_type]
when '0'
@offset ||= @user_pages.reverse_offset
unless @offset == 0
@users_statuses = scope.offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit
if limit == 0
limit = @limit
end
@users_statuses = scope.offset(@offset).limit(limit).all.reverse
end
@s_type = 0
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]
when '1'
@offset ||= @user_pages.reverse_offset
unless @offset == 0
@users_statuses = scope.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit
if limit == 0
limit = @limit
end
@users_statuses = scope.reorder('changesets_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 1
#sort {|x,y| y.user_status.changesets_count <=> x.user_status.changesets_count}
#@users = @users[@offset, @limit]
when '2'
@offset ||= @user_pages.reverse_offset
unless @offset == 0
@users_statuses = scope.reorder('watchers_count').offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit
if limit == 0
limit = @limit
end
@users_statuses = scope.reorder('watchers_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 2
#@users = @users[@offset, @limit]
end
else
@offset ||= @user_pages.reverse_offset
unless @offset == 0
@users_statuses = scope.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit
if limit == 0
limit = @limit
end
@users_statuses = scope.reorder('changesets_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 1
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]
end
@users = []
@users_statuses.each do |obj|
@users << User.find_by_id("#{obj.user_id}")
end
respond_to do |format|
format.html {
@groups = Group.all.sort
@ -173,6 +242,47 @@ class UsersController < ApplicationController
end
end
def search
sort_init 'login', 'asc'
sort_update %w(login firstname lastname mail admin created_on last_login_on)
case params[:format]
when 'xml', 'json'
@offset, @limit = api_offset_and_limit({:limit => 15})
else
@limit = 15#per_page_option
end
@status = params[:status] || 1
has = {
"show_changesets" => true
}
scope = User.logged.status(@status)
scope = scope.like(params[:name]) if params[:name].present?
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id]?'base_users':'base'
@offset ||= @user_pages.reverse_offset
unless @offset == 0
@users = scope.offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit
if limit == 0
limit = @limit
end
@users = scope.offset(@offset).limit(limit).all.reverse
end
respond_to do |format|
format.html {
@groups = Group.all.sort
render :layout => @user_base_tag
}
format.api
end
end
### modified by fq
def show
# has = {
@ -215,18 +325,48 @@ class UsersController < ApplicationController
# @activity_pages = Paginator.new @activity_count, @limit, params['page']
# @offset ||= @activity_pages.offset
# @events_by_day_ = @events.slice(@offset,@limit)
if @user == User.current
case params[:type]
when "1"
if @user == User.current
activity = Activity.where('user_id = ?', User.current.id).order('id desc')
@offset, @limit = api_offset_and_limit({:limit => 10})
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset
@activity = activity.offset(@offset).limit(@limit)
@state = 1
end
when "2"
message = []
if @user == User.current
message = JournalsForMessage.reference_message(@user.id)
message += Journal.reference_message(@user.id)
end
@offset, @limit = api_offset_and_limit({:limit => 10})
@activity_count = message.size
@info_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @info_pages.offset
messages = message.sort {|x,y| y.created_on <=> x.created_on }
@message = messages[@offset, @limit]
@state = 2
else
if @user == User.current
watcher = User.watched_by(@user)
watcher.push(User.current)
activity = Activity.where('user_id in (?)', watcher).order('id desc')
else
else
activity = Activity.where('user_id = ?', @user.id).order('id desc')
end
@offset, @limit = api_offset_and_limit({:limit => 10})
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset
@activity = activity.offset(@offset).limit(@limit)
@state = 0
end
@offset, @limit = api_offset_and_limit({:limit => 10})
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset
@activity = activity.offset(@offset).limit(@limit)
#Modified by nie
unless User.current.admin?
@ -250,9 +390,9 @@ class UsersController < ApplicationController
message = []
if @user == User.current
message = JournalsForMessage.reference_message(@user.id)
message += Journal.reference_message(@user.id) end
message += Journal.reference_message(@user.id)
end
@offset, @limit = api_offset_and_limit({:limit => 10})
@info_count = message.size
@info_pages = Paginator.new @info_count, @limit, params['page']

View File

@ -14,10 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController
before_filter :require_login, :find_watchables, :only => [:watch, :unwatch]
def watch
set_watcher(@watchables, User.current, true)
end
@ -26,6 +24,41 @@ class WatchersController < ApplicationController
set_watcher(@watchables, User.current, false)
end
def join
if User.current.logged?
course = Project.find(params[:object_id])
if params[:course_password] == '123'
members = []
members << Member.new(:role_ids => [5], :user_id => User.current.id)
course.members << members
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
else
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
def unjoin
if User.current.logged?
@member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id)
@member.first.destroy
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
joined.each do |join|
join.delete
end
end
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
end
end
before_filter :find_project, :authorize, :only => [:new, :create, :append, :destroy, :autocomplete_for_user]
accept_api_auth :create, :destroy
@ -86,7 +119,7 @@ class WatchersController < ApplicationController
end
rescue
render_404
end
end
def find_watchables
klass = Object.const_get(params[:object_type].camelcase) rescue nil
@ -100,7 +133,27 @@ class WatchersController < ApplicationController
def set_watcher(watchables, user, watching)
watchables.each do |watchable|
watchable.set_watcher(user, watching)
@user = watchable # added by william
# @user = watchable # added by william
if watching
# 修改 user和project的状态
if watchable.instance_of?(User)
#写user_statuses表
UserStatus.find_by_user_id(watchable.id).update_watchers_count(1)
elsif watchable.instance_of?(Project)
#写project_statuese表
ProjectStatus.find_by_project_id(watchable.id).update_watchers_count(1)
end
else
# 修改 user和project的状态
if watchable.instance_of?(User)
#写user_statuses表
UserStatus.find_by_user_id(watchable.id).update_watchers_count(-1)
elsif watchable.instance_of?(Project)
#写project_statuese表 :project_status
ProjectStatus.find_by_project_id(watchable.id).update_watchers_count(-1)
end
end
end
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}

View File

@ -6,7 +6,7 @@ class WordsController < ApplicationController
if params[:new_form][:user_message].size>0
unless params[:user_id].nil?
if params[:reference_content]
message = params[:reference_content] + params[:new_form][:user_message]
message = params[:new_form][:user_message] + "\n" + params[:reference_content]
else
message = params[:new_form][:user_message]
end
@ -37,7 +37,9 @@ class WordsController < ApplicationController
end
def destroy
JournalsForMessage.delete_message(params[:object_id])
if User.current.admin? || User.current.id == @user.id
JournalsForMessage.delete_message(params[:object_id])
end
@jours = @user.journals_for_messages.reverse
@limit = 10
@feedback_count = @jours.count
@ -71,6 +73,10 @@ class WordsController < ApplicationController
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
@content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
# @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
# @content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404

View File

@ -219,7 +219,8 @@ module ApplicationHelper
if projects.any?
ancestors = []
original_project = @project
projects.sort_by(&:lft).each do |project|
#modified by nie
projects.each do |project|
# set the project environment to please macros.
@project = project
if (ancestors.empty? || project.is_descendant_of?(ancestors.last))

View File

@ -34,7 +34,22 @@ module BidsHelper
# this method is used to get all projects that tagged one tag
# added by william
def get_bids_by_tag(tag_name)
Bid.tagged_with(tag_name)
Bid.tagged_with(tag_name).order('updated_on desc')
end
def sort_bid(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0'), :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0')))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
end

View File

@ -33,7 +33,7 @@ module GroupsHelper
s = content_tag('div', principals_check_box_tags('user_ids[]', principals), :id => 'principals')
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false){|text, parameters, options|
link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
}

View File

@ -377,7 +377,7 @@ module IssuesHelper
# this method is used to get all projects that tagged one tag
# added by william
def get_issues_by_tag(tag_name)
Issue.tagged_with(tag_name)
Issue.tagged_with(tag_name).order('updated_on desc')
end
end

View File

@ -24,17 +24,17 @@ module JournalsHelper
destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1))
links = []
if !journal.notes.blank?
links << link_to(image_tag('comment.png'),
links << link_to(l(:button_quote),
{:controller => 'journals', :action => 'new', :id => issue, :journal_id => journal},
:remote => true,
:method => 'post',
:title => l(:button_quote)) if options[:reply_links]
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
links << link_to_in_place_notes_editor(l(:button_edit), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
:title => l(:button_edit)) if editable
#Added by young
if destroyable
links << link_to(image_tag('delete.png'), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' },
links << link_to(l(:button_delete), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' },
:title => l(:button_delete))
end
end

View File

@ -21,7 +21,7 @@ module MembersHelper
def render_principals_for_new_members(project)
scope = Principal.active.sorted.not_member_of(project).like(params[:q])
principal_count = scope.count
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page']#by young
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] #by young
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
s = content_tag('div', principals_check_box_tags('membership[user_ids][]', principals), :id => 'principals')

View File

@ -29,7 +29,7 @@ module ProjectsHelper
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural},
{:name => 'versions', :action => :manage_versions, :partial => 'projects/settings/versions', :label => :label_version_plural},
{:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/issue_categories', :label => :label_issue_category_plural},
{:name => 'wiki', :action => :manage_wiki, :partial => 'projects/settings/wiki', :label => :label_wiki},
# {:name => 'wiki', :action => :manage_wiki, :partial => 'projects/settings/wiki', :label => :label_wiki},
{:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
{:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
@ -38,17 +38,44 @@ module ProjectsHelper
end
def sort_project(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2')))
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0'), :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2')))
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0')))
when 2
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0')))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
#Added by young
def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
{:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural}
# {:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
#Ended by young
def parent_project_select_tag(project)
selected = project.parent
# retrieve the requested parent project
@ -67,7 +94,7 @@ module ProjectsHelper
def render_project_hierarchy(projects)
render_project_nested_lists(projects) do |project|
#Modified by young
if project.project_type
if (project.project_type==1)
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")+"<span style='color:#F00;'>(#{l(:label_course)})</span>".html_safe
else
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
@ -103,7 +130,7 @@ module ProjectsHelper
# this method is used to get all projects that tagged one tag
# added by william
def get_projects_by_tag(tag_name)
Project.tagged_with(tag_name)
Project.tagged_with(tag_name).order('updated_on desc')
end
end

View File

@ -0,0 +1,2 @@
module TeachersHelper
end

View File

@ -58,9 +58,58 @@ module UsersHelper
# this method is used to get all projects that tagged one tag
# added by william
def get_users_by_tag(tag_name)
User.tagged_with(tag_name)
User.tagged_with(tag_name).order('updated_on desc')
end
# added by fq
# <div class="pagination" >
# <ul>
# <li><%= link_to("所有动态", {:controller => 'users', :action => 'show'}) %></li>
# <li><%= link_to("只看自己", {:controller => 'users', :action => 'show', :type => 1}) %></li>
# <li><%= link_to("所有反馈", {:controller => 'users', :action => 'show', :type => 2}) %></li>
# </ul></div>
def show_activity(state)
content = ''.html_safe
case state
when 0
s = content_tag('span', l(:label_user_all_activity), :class => "current-page")
content << content_tag('li', s)
content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
when 1
s = content_tag('span', l(:label_user_activity_myself), :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
content << content_tag('li', s, :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
when 2
s = content_tag('span', l(:label_user_all_respond), :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
content << content_tag('li', s, :class => "current-page")
end
content_tag('div', content, :class => "pagination")
end
# added by huang
def sort_user(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2')))
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0'), :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2')))
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0')))
when 2
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0')))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
#end
end

View File

@ -46,6 +46,20 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :class => css
end
def join_in_course(course, user)
return '' unless user && user.logged?
joined = user.join_in?(course)
text = joined ? '退出课程' : '加入课程'
url_t = join_path(:object_id => course.id)
url_f = try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
if joined
link_to text, url_t, :remote => true, :method => method, :id => 'join', :confirm => l(:text_are_you_sure)
else
link_to text, url_f, :remote => true, :method => method, :id => 'join'
end
end
# Returns the css class used to identify watch links for a given +object+
def watcher_css(objects)
objects = Array.wrap(objects)

View File

@ -9,13 +9,15 @@ class Bid < ActiveRecord::Base
has_many :projects, :through => :biding_projects
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy
has_many :courses, :through => :homework_for_courses, :source => :project
NAME_LENGTH_LIMIT = 60
DESCRIPTION_LENGTH_LIMIT = 250
validates_length_of :name, :maximum => NAME_LENGTH_LIMIT
validates_length_of :description, :maximum => DESCRIPTION_LENGTH_LIMIT
validates_presence_of :author_id, :name, :deadline, :budget
validates_presence_of :author_id, :name, :deadline
# validates_presence_of :deadline, :message => 'test'
# validates_format_of :deadline, :with =>
validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
@ -55,6 +57,10 @@ class Bid < ActiveRecord::Base
'budget',
'deadline'
# safe_attributes 'name',
# 'description',
# 'deadline'
def add_jour(user, notes, reference_user_id = 0)
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
end

View File

@ -23,6 +23,11 @@ class Changeset < ActiveRecord::Base
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# end
#Added by nie
has_one :project_status, :dependent => :destroy
has_one :users_status
#end
has_and_belongs_to_many :issues
has_and_belongs_to_many :parents,
:class_name => "Changeset",

View File

@ -1,15 +1,16 @@
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
attr_accessible :code, :extra, :name, :state, :tea_id, :time
belongs_to :project, :class_name => 'Project', :foreign_key => :tea_id
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location
belongs_to :project, :class_name => 'Project', :foreign_key => :extra
has_many :bid
validates_presence_of :code, :time
validates_presence_of :code, :time, :location, :name
safe_attributes 'extra',
'time',
'name',
'extra',
'code'
'code',
'location'
end

View File

@ -0,0 +1,8 @@
class HomeworkForCourse < ActiveRecord::Base
attr_accessible :bid_id, :project_id
belongs_to :bid
belongs_to :project
end

View File

@ -53,13 +53,20 @@ class Project < ActiveRecord::Base
has_many :changesets, :through => :repository
# added by fq
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy
has_many :homeworks, :through => :homework_for_courses, :source => :bid
has_many :students_for_courses, :dependent => :destroy
has_many :student, :through => :students_for_courses, :source => :user
# end
#ADDED BY NIE
has_many :project_infos, :dependent => :destroy
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
#end
has_one :wiki, :dependent => :destroy
##added by xianbo
has_one :course, :dependent => :destroy
has_one :course, :dependent => :destroy ,:order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
accepts_nested_attributes_for :course
##end
# Custom field for the project issues
@ -86,7 +93,7 @@ class Project < ActiveRecord::Base
:author => nil
############################added by william
acts_as_taggable
scope :by_join_date, order("created_at DESC")
scope :by_join_date, order("created_on DESC")
###################added by liuping 关注
acts_as_watchable
@ -689,6 +696,7 @@ class Project < ActiveRecord::Base
'project_type'
safe_attributes 'enabled_module_names',
:if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) }

View File

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

View File

@ -0,0 +1,10 @@
class StudentsForCourse < ActiveRecord::Base
attr_accessible :course_id, :student_id
belongs_to :course, :class_name => 'Project', :foreign_key => :course_id
belongs_to :student, :class_name => 'User', :foreign_key => :student_id
validates_presence_of :course_id, :student_id
validates_uniqueness_of :student_id, :scope => :course_id
end

13
app/models/teacher.rb Normal file
View File

@ -0,0 +1,13 @@
class Teacher < ActiveRecord::Base
attr_accessible :course_code, :couurse_time, :location, :tea_name
include Redmine::SafeAttributes
belongs_to :project
safe_attributes'tea_name',
'location',
'couurse_time',
'course_code',
'extra'
end

View File

@ -82,12 +82,16 @@ class User < Principal
has_many :bids, :foreign_key => 'author_id', :dependent => :destroy
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
has_many :journal_replies
has_many :activities
has_many :journal_replies, :dependent => :destroy
has_many :activities, :dependent => :destroy
has_many :students_for_courses, :dependent => :destroy
has_many :courses, :through => :students_for_courses, :source => :project
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
#####
######added by nie
has_many :project_infos, :dependent => :destroy
has_one :user_status, :dependent => :destroy
#####
scope :logged, lambda { where("#{User.table_name}.status <> #{STATUS_ANONYMOUS}") }
@ -98,10 +102,10 @@ class User < Principal
acts_as_customizable
############################added by william
acts_as_taggable
scope :by_join_date, order("created_at DESC")
scope :by_join_date, order("created_on DESC")
############################# added by liuping 关注
acts_as_watchable
has_one :user_extensions
has_one :user_extensions,:dependent => :destroy
## end
attr_accessor :password, :password_confirmation
@ -128,6 +132,9 @@ class User < Principal
before_create :set_mail_notification
before_save :update_hashed_password
before_destroy :remove_references_before_destroy
# added by fq
after_create :act_as_activity
# end
scope :in_group, lambda {|group|
group_id = group.is_a?(Group) ? group.id : group.to_i
@ -145,6 +152,17 @@ class User < Principal
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true)
end
### fq
def join_in?(course)
joined = StudentsForCourse.where('student_id = ? and course_id = ?', self.id, course.id)
if joined.size > 0
true
else
false
end
end
## end
def count_new_jour
count = self.new_jours.count
end
@ -200,7 +218,7 @@ class User < Principal
user = find_by_login(login)
if user
# user is already in local database
return nil unless user.active?
#return nil unless user.active?
return nil unless user.check_password?(password)
else
# user is not yet registered, try to authenticate with available sources
@ -669,6 +687,10 @@ class User < Principal
private
def act_as_activity
self.acts << Activity.new(:user_id => self.id)
end
# Removes references that are not handled by associations
# Things that are not deleted are reassociated with the anonymous user
def remove_references_before_destroy

View File

@ -1,6 +1,6 @@
class UserExtensions < ActiveRecord::Base
belongs_to :user
attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code
attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code,:identity
#this method was used to update the table user_extensions
def update_user_extensions(birthday=nil,brief_introduction=nil,
gender=nil,location=nil,occupation=nil,work_experience=nil,zip_code=nil)

20
app/models/user_status.rb Normal file
View File

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

View File

@ -18,6 +18,10 @@
class Watcher < ActiveRecord::Base
belongs_to :watchable, :polymorphic => true
belongs_to :user
#Added by nie
has_one :project_status
has_one :users_status
#end
validates_presence_of :user
validates_uniqueness_of :user_id, :scope => [:watchable_type, :watchable_id]

View File

@ -26,13 +26,15 @@
</td>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<td colspan="2" >
<span style="float: left"><% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
<% end %></span>
<span style="float: right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/></span>
</td>
</tr>
</table>

View File

@ -1,4 +1,4 @@
<h3><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
<h3><%=l(:label_register)%> <%=link_to l(:label_loginkk), signin_url if Setting.openid? %></h3>
<%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %>
@ -20,14 +20,21 @@
<em class="info"><%="#{l(:label_mail_attention)} "%></em></p>
<p><%= f.select :language, lang_options_for_select %></p>
<!-- added by bai -->
<p><em class="info"><%= l(:label_identity) %><%= select_tag 'identity', "<option value = '0'>#{l(:label_teacher)}</option><option value = '1'>#{l(:label_student)}</option><option value = '2'>#{l(:label_other)}</option>".html_safe %></em></p>
<!-- end -->
<% if Setting.openid? %>
<p><%= f.text_field :identity_url %></p>
<% end %>
<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
<p><%= custom_field_tag_with_label :user, value %></p>
<% end %>
</div>
<%= submit_tag l(:button_submit) %>
<% end %>

View File

@ -13,19 +13,25 @@
<tr>
<td width="500">
<table border="0">
<tr><td>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<tr><td>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
<% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<% else %>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%><%= l(:label_bids_credit_number) %></span></strong>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<% end %>
<span class="font_lighter">(<%= link_to bid.biding_projects.count, project_for_bid_path(bid)%>)<%= l(:label_biding_project) %></span>
<span class="font_lighter">(<%= link_to bid.commit, respond_path(bid)%>)<%= l(:label_responses) %></span>
<span class="font_lighter">(<%= link_to bid.watcher_users.count, respond_path(bid)%>)<%= l(:label_followers) %></span></td>
</tr>
</table></td>
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
</td>
</tr>
<tr><td>
<span class="font_lighter"><%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%=link_to bid.commit, respond_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%=link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span>
</td>
</tr>
</table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
</tr>
<tr>

View File

@ -1,7 +1,7 @@
<!-- added by fq -->
<table width="660px" border="0" align="center">
<tr>
<td class="font_lighter" style="font-size: 18px;"><%=l(:label_user_response)%></td>
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_user_response)%></td>
</tr></table>
@ -11,14 +11,14 @@
<% if journals.size >0 %>
<% remove_allowed = (User.current.id == journals.first.jour_id) %>
<% for journal in journals%>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span><%= link_to "##{journal.indice}", respond_path(bid), :class => "journal-link" %> </td>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span></td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
@ -26,17 +26,18 @@
<tr>
<td align="left"><span class="font_lighter"><%= l(:label_bids_published) %>&nbsp;<%= time_tag(journal.created_on).html_safe %>&nbsp;<%= l(:label_bids_published_ago) %></span></td>
<% if @user==User.current|| User.current.admin? %>
<td width="200" align="right" class="a"><%= link_to(image_tag('comment.png'), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
<td width="200" align="right" class="a"><%= link_to(l(:label_bid_respond_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<%= link_to(image_tag('delete.png'), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) if remove_allowed || journal.user_id == User.current.id %></td>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %></td>
<% else %>
<td width="200" align="right" class="a"><%= link_to(image_tag('comment.png'), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
<td width="200" align="right" class="a"><%= link_to(l(:label_bid_respond_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<% end %>
</tr>
</table></td>
</tr>
</table>
<div class="line_under"></div>
<% end %>
<% end %>

View File

@ -1,7 +1,7 @@
<!-- fq -->
<%= render_flash_messages %>
<table width="1000px" border="0" style="padding-left: 15px">
<td class="font_lighter" style="font-size: 18px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
<% if User.current.logged? %>
<td>
<div class='icon icon-add'>
@ -20,17 +20,17 @@
<div style="width: 50px; height: 50px;">
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
</div></td>
<td width="60%">
<table width="100%">
<td width="60%" valign="top">
<table width="100%" valign="top">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(b_project.project.name, project_path(b_project.project)) %></strong><a class="font_lighter"><%= l(:label_join_bidding)%></a></td>
</tr>
<tr></tr>
<tr>
<td><%= b_project.project.description %></td>
<td valign="top"><%= b_project.project.description %></td>
</tr>
<tr>
<td><a class="font_lighter"><%= b_project.created_at%></a></td>
<td valign="top"><a class="font_lighter"><%= b_project.created_at%></a></td>
</tr>
</table></td>
<td width="30%">
@ -40,7 +40,7 @@
<td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
</tr>
<tr>
<td><%= l(:label_bidding_reason) %><%= b_project.description %></td>
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason) %><%= b_project.description %></td>
</tr>
</table>
</div></td>

View File

@ -28,6 +28,21 @@
</div>
<% end %>
<%= sort_bid(@s_state)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %>
</li>
<li>
<%= link_to l(:label_sort_by_active), calls_path(:bid_sort_type => '1') %>
</li>
<!-- <li>
<%= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
</li> -->
<!-- </ul>
</div> -->
<div id="bid-show">
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>

View File

@ -5,6 +5,14 @@
<td><table width="100%" border="0">
<tr>
<td><h3><%= link_to(@bid.author.name, user_path(@bid.author))%><%= @bid.name %></h3></td>
<td>
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
</span>
</td>
</tr>
<tr>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
@ -12,7 +20,7 @@
<% elsif @bid.reward_type == 2%>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= @bid.budget%></span></strong></td>
<% else %>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%><%= l(:label_bids_credit_number) %></span></strong></td>
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong></td>
<% end %>
</tr>
</table></td>
@ -23,7 +31,7 @@
<tr>
<td></td>
</tr>
<tr><td style="font-size: 15px; color: rgb(0,0,0);"><%= @bid.description %></td></tr>
<tr><td style="font-size: 13px; color: rgb(0,0,0);"><%= @bid.description %></td></tr>
</table>
</div>

View File

@ -1,4 +1,4 @@
<div class="contextual">
<div class="contextual" style="padding-right: 440px;padding-top: 5px;">
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
</div>

View File

@ -1,3 +1,4 @@
<!-- added by baiyu -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -49,6 +50,21 @@ body table tr td p span4 {
body table tr td p span4 {
font-weight: bold;
}
body table tr td span5 {
color: #F00;
}
body table tr td span5 {
font-weight: bold;
}
body table tr td p span6 {
color: #33F;
font-weight: bold;
}
body table tr td span6 {
color: #33F;
font-weight: bold;
font-size: 24px;
}
</style>
</head>
@ -66,7 +82,8 @@ body table tr td p span4 {
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
<td><p>&nbsp;</p>
<p><span6>Windows</span6></p></td>
</tr>
</table>
<table width="900" border="0">
@ -126,7 +143,8 @@ body table tr td p span4 {
<td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td>
</tr>
<tr>
<td align="left">Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到。 </td>
<td align="left">Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到,<span5> 其中的name和email要和forge.trustie.net上的登陆名和密码保持一致</span5>
,方便代码贡献统计 )。 </td>
</tr>
<tr>
<td align="left"><p >接着可以定制上下文菜单:</p>
@ -265,11 +283,59 @@ body table tr td p span4 {
</tr>
</table>
<table width="901" border="0">
<tr>
<td width="895"><span6>Linux</span6></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1、安装</span1></td>
</tr>
<tr>
<td>如果你用的是Linux你可以用你的本地包管理系统native package management system)来安装。</td>
</tr>
<tr>
<td><p><span>$ yum install git-core </span> </p>
<p>在redhat等系统下用yum</p>
<p><span>$apt-get install git-core</span></p>
<p>在debianubuntu等系统下用apt-get</p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>2、配置</span1></td>
</tr>
<tr>
<td><p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;&#8220;your_name&#8221;</span></p>
<p><span>$git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;&#8220;your_email&#8221;&nbsp;</span> </p>
<p>Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到,
<span5> 其中的name和email要和forge.trustie.net上的登陆名和密码保持一致</span5>
,方便代码贡献统计 )。</p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>3、代码提交方法</span1></td>
</tr>
<tr>
<td><p>cd file1</p>
<p><span>$ git add file1</span></p>
<p><span>$ git init</span></p>
<p><span>$ git commit -a</span></p>
<p><span>$ git remote add [name] [版本库里给的URL去掉http]</span></p>
<p><span>$ git push [name] master</span></p>
<p>输入password后即可上传。</p></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="831" border="0">
<tr>
<td width="825" align="right">——Trustie团队</td>

View File

@ -30,10 +30,10 @@ body p {
body table tr td p {
color: #333;
font-family: "Comic Sans MS", cursive;
font-weight: normal;
}
body table tr td table tr td span1 {
color: #09c;
font-weight: bold;
}
body table tr td span1 {
color: #09c;
@ -45,6 +45,22 @@ span3 {
span4 {
color: #F00;
}
body table tr td p span5 {
color: #F00;
}
body table tr td p span5 {
font-weight: bold;
}
body table tr td table tr td span6 {
color: #33F;
font-weight: bold;
font-size: 24px;
}
body table tr td span6 {
color: #33F;
font-weight: bold;
font-size: 24px;
}
</style>
</head>
@ -67,6 +83,11 @@ span4 {
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span6>Windows</span6></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1. Installation</span1></td>
@ -122,7 +143,8 @@ span4 {
<table width="900" border="0">
<tr>
<td><p>Right-click on the desktop and select the &quot;Settings&quot; in the &quot;TortoiseGit&quot;</p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository). </p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, <span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5>
). </p>
<p>Then you can customize the &quot;Context Menu&quot;:</p>
<p>Please check the &quot;<span>Clone</span>&quot;,&quot;<span>Sync</span>&quot; and &quot;<span>Commit</span>&quot; options in the &quot;<span>Context Menu</span>&quot;,</p>
<p>check the &quot;<span>Import Svn Ignore</span>&quot;, &quot;<span>Show Reflog</span>&quot;, &quot;<span>Browse References</span>&quot;, &quot;<span>Stash Apply</span>&quot; and &quot;<span>Submodule Sync</span>&quot; in the &quot;<span>Set Extend Menu Item</span>&quot;.</p></td>
@ -258,9 +280,54 @@ span4 {
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
<td><span6>Linux</span6></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1.Installation</span1></td>
</tr>
<tr>
<td><p>If you are useing Linux, you can install git through native package management system.</p>
<p><span>$ yum install git-core</span></p>
<p>if you are using redhat, you should type &quot;yum&quot;.</p>
<p><span>$apt-get install git-core</span></p>
<p>if you are using debian or ubuntu, you should type &quot;apt-get&quot;.</p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>2. Configuration</span1></td>
</tr>
<tr>
<td><p><span>$git config --global user.name &ldquo;your_name&rdquo;M</span></p>
<p><span>$git config --global user.email &ldquo;your_email&rdquo;</span> </p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository,
<span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5>
). </p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>3. How to commit</span1></td>
</tr>
<tr>
<td><p>cd file1</p>
<p><span>$ git add file1</span></p>
<p><span>$ git init</span></p>
<p><span>$ git commit -a</span></p>
<p><span>$ git remote add [name] [The URL which we give you in our websitewith out http]</span></p>
<p><span>$ git push [name] master</span></p>
<p>The last step is enter your password. </p></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="831" border="0">
<tr>
<td width="825" align="right">—— By Trustie Team</td>

View File

@ -1,7 +1,9 @@
<% reply_links = authorize_for('issues', 'edit') -%>
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
<!-- modified by bai -->
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>" style=" word-wrap: break-word; word-break: break-all">
<!-- end -->
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>

View File

@ -1,6 +1,6 @@
<!--add by huang-->
<h3 style="padding-top:0px;"><%= l(:field_issue) %>
<div style="padding-bottom: 10px;float:right;font-size:11px;">
<div style="padding-bottom: 10px;padding-right:440px;float:right;font-size:11px;">
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
</div>

View File

@ -1,5 +1,5 @@
$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>');
$(.splitcontent).style("display", "block")
<% if User.current.allowed_to?(:log_time, @issue.project) %>
$('#log_time').show();
<% else %>

View File

@ -5,14 +5,15 @@
<div id="account">
<%= render_menu :account_menu -%>
</div>
<%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
<div style="float: right; margin-top: 13px;">
<!-- <div style="float: right; margin-top: 13px;">
<%= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
</div>
<div align="center" style="float: right; margin-right: -25px; margin-top: 6px; background: #ea7125; width: 12px;border-radius:7px; font-size: 8px; color: #fff; font-weight: bold">
</div> -->
<!-- <div align="center" style="float: right; margin-right: -25px; margin-top: 6px; background: #ea7125; width: 12px;border-radius:7px; font-size: 8px; color: #fff; font-weight: bold">
<%= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
</div>
</div> -->
<!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} -->
<!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->

View File

@ -53,7 +53,7 @@
<% elsif @bid.reward_type == 2%>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
<% else %>
<td><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%><%= l(:label_bids_credit_number) %></td>
<td><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></td>
<% end %>
</tr>
<tr>
@ -62,7 +62,9 @@
</tr>
</table>
<div>
<%= l(:label_followers) %> (<%= link_to @bid.watcher_users.count, home_path %>) &nbsp;<%= l(:label_bidding_project) %>(<%= link_to @bid.biding_projects.count, project_for_bid_path(@bid) %>)&nbsp;<%=l(:label_responses)%>(<%= link_to @bid.commit, respond_path(@bid)%>)
<%= link_to l(:label_followers)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
<%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>&nbsp;
<%= link_to l(:label_responses)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div>
</div>
<div class="user_fans">

View File

@ -36,6 +36,7 @@
<td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= textilizable @project.name %>
<%= join_in_course(@project, User.current)%>
</div>
</td>
</tr>
@ -52,18 +53,37 @@
<% files_count += version.attachments.count %>
<% end %>
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'%></td>
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
<td class="font_index"><%=link_to files_count, project_files_path(@project) %></td>
<tr class="font_aram">
<td align="center" width="80px"> <%= l(:label_course_student) %></td>
<td align="center" width="80px"> <%= l(:label_homework) %></td>
<td align="center" width="80px"> <%= " 成员" %></td>
<td align="center" width="80px"> <%= "缺陷" %></td>
<td align="center" width="80px"><%= l(:label_course_data) %></td>
</tr>
</table>
<div class="user_underline"></div>
</div>
<!--info-->
<div class="inf_user_context">
<table style="font-family:微软雅黑" width="220">
<tr>
<td style="padding-left: 8px" width="80px">教师名称:</td><td class="font_lighter_sidebar" width="140px"><%= @course.name%></td>
</tr>
<tr>
<td style="padding-left: 8px">所在单位:</td><td class="font_lighter_sidebar"><%= @course.location%></td>
</tr>
<tr>
<td style="padding-left: 8px">课程学分:</td><td class="font_lighter_sidebar"><%= @course.code%></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">课程学时:</td><td class="font_lighter_sidebar"><%= @course.time%></td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!--description-->
<div class="inf_user_context">
<div class="font_title_left">
@ -115,17 +135,14 @@
</div>
</div>
<div id="content">
<div>教师名称:<%= @course.name%></div>
<div>所在单位:并行与分布重点实验室</div>
<div>课程学分:<%=@course.code%></div>
<div>课程学时:<%=@course.time%></div>
<div>XXXXXXXXXXXX</div>
<div class="tabs">
<div class="tabs_new">
<ul>
<li><%= link_to(l(:label_overview), project_path(@project))%></li>
<li><%= link_to(l(:label_homework), {:controller => 'projects', :action => 'homework'})%></li>
<li><%= link_to(l(:label_repository), { :controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li>
<li><%= link_to(l(:label_settings),{:controller => 'projects', :action => 'settings', :id => @project, :course => 1})%></li></ul>
<li><%= link_to(l(:label_course_file), project_file_path(@project))%></li>
<li><%= link_to "课程通知", {:controller => 'news', :action => 'index'} %></li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
<li><%= link_to(l(:label_settings),{:controller => 'projects', :action => 'settings', :id => @project})%></li></ul>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>

View File

@ -34,7 +34,7 @@
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= textilizable @project.name %>
<%= @project.name %>
</div>
<div>
<% unless User.current.member_of? @project %>
@ -45,7 +45,7 @@
</table>
</div>
<!--parameter-->
<!--parameter -->
<div class="user_fans">
<table width="240" border="0">
@ -56,12 +56,16 @@
<% end %>
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
<td class="font_index"><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist" %></td>
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
<td class="font_index"><%=link_to files_count, project_files_path(@project) %></td>
<!-- <td class="font_index"><%=link_to files_count, project_files_path(@project) %></td> -->
<tr class="font_aram">
<td align="center" width="80px"> <%= l(:label_member) %></td>
<td align="center" width="80px"> <%= l(:label_project_issues) %></td>
<td align="center" width="80px"><%= l(:label_attachment) %></td>
<td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="100px"><%= l(:label_user_watchered) %></td>
<td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> -->
</tr>
</table>
<div class="user_underline"></div>
@ -79,7 +83,7 @@
<%= textilizable @project.description %>
</div>
<div class="created_on_project">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= @project.created_on %>
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %>
</div>
</div>
<div class="user_underline"></div>

View File

@ -47,24 +47,24 @@
</table>
<div>
<%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%=link_to User.watched_by(@user.id).count ,:controller=>"users", :action=>"user_watchlist"%></strong>) &nbsp;
<strong class="font_small_watch"><%=link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%></strong> &nbsp;
<%= l(:label_user_fans) %> (<strong class="font_small_watch"><%=link_to @user.watcher_users(@user.id).count, :controller=>"users", :action=>"user_fanslist" %></strong>)
<strong class="font_small_watch"><%=link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users(@user.id).count.to_s+")", :controller=>"users", :action=>"user_fanslist" %></strong>
</div>
</div>
<div class="user_underline"></div>
<!--info-->
<div class="inf_user_context">
<table style="font-family:微软雅黑" width="220">
<table style="font-family:微软雅黑" width="240">
<tr>
<td style="padding-left: 8px" width="80px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" width="140px"><%= format_date(@user.created_on) %></td>
<td style="padding-left: 8px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_date(@user.created_on) %></td>
</tr>
<tr>
<td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar"><%= format_date(@user.last_login_on) %></td>
<td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_date(@user.last_login_on) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style=" word-wrap: break-word; word-break: break-all"><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td>
<td valign="top" style="padding-left: 8px;"><%= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td>
</tr>
</table>
@ -75,8 +75,10 @@
<!-- <div class="user_fans"> -->
<!-- added by william -for tag -->
<!-- <div class="user_tags"> -->
<div id="tags" style="padding-left: 8px">
<div class="user_tags">
<div id="tags">
<%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
</div>
<!-- </div> -->
<!-- </div> -->
@ -103,7 +105,7 @@
<!--fans-->
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_user_fans) %></strong>
<strong><%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %></strong>
<% if show_more_fans?(@user) %>
<div style="font-size: 11px; display: inline; float: right; margin-top: 5px; margin-right: 20px" ><%= link_to l(:label_more), :controller => "users", :action => "user_fanslist"%></div>
<% end %>
@ -123,11 +125,9 @@
<div id="content" style="padding-top: 0px;">
<div class="tabs_new">
<% if @user == User.current %>
<%= render_menu :user_menu_self %>
<%else%>
<%= render_menu :user_menu %>
<%end%>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>

View File

@ -35,7 +35,9 @@
<%= f.text_field :mail, :required => true %>
</p>
<p style="width:426px;padding-left:26px;>
<%= f.select :language, lang_options_for_select %>
<%= f.select :language, :Chinese简体中文 => :zh, :English => :en%>
</p>
<p><%= l(:field_occupation)%><%= text_field_tag "occupation"%>
</p>
<% if Setting.openid? %>
<p>
@ -55,7 +57,7 @@
<legend onclick="toggleFieldset(this);">
<%= l(:field_mail_notification)%>
</legend>
<div>
<div style="padding-left: 26px;"> <!-- modified by ming -->
<p style="width:380px;>
<%= render :partial => 'users/mail_notifications' %>
</p></div>
@ -65,11 +67,11 @@
<legend onclick="toggleFieldset(this);">
<%= l(:label_preferences)%>
</legend>
<div>
<div style="padding-left: 26px;"> <!-- modified by ming -->
<%= render :partial => 'users/preferences' %></div>
</fieldset>
<!-- added by william -->
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;display: none;">
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;display: none">
<legend onclick="toggleFieldset(this);">
<%= l(:label_user_extensions)%>
</legend>

View File

@ -41,7 +41,7 @@
<% @newss.each do |news| %>
<table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(news.author), :class => "avatar") %></td>
<td colspan="2" valign="top" width="50" ><%=link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_newshare)%></span> <%= link_to h(news.title), news_path(news) %></td>
@ -50,8 +50,8 @@
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= news.created_on %></span></td>
<td width="200" align="right" class="a"><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
<td align="left"><span class="font_lighter"> <%= format_time(news.created_on) %></span></td>
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td>
</tr>
</table></td>
</tr>

View File

@ -1,88 +1,85 @@
<div class="contextual">
<%= watcher_link(@news, User.current) %>
<%= link_to(l(:button_edit),
edit_news_path(@news),
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
<%= watcher_link(@news, User.current) %>
<%= link_to(l(:button_edit),
edit_news_path(@news),
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
</div>
<h3><strong><%=h @news.title %></strong></h3>
<h3><strong><%= h @news.title %></strong></h3>
<% if authorize_for('news', 'edit') %>
<div id="edit-news" style="display:none;">
<%= labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<% end %>
<div id="preview" class="wiki"></div>
<%= labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<!-- <div id="comments" style="margin-bottom:16px;">
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
<% @comments.each do |comment| %>
<% next if comment.new_record? %>
<div class="contextual">
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
</div>
<h4><%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %></h4>
<%= textilizable(comment.comments) %>
<% end if @comments.any? %>
</div> -->
<!--add by huang: show subnew-->
<div id="comments" style="margin-bottom:16px;">
<div style="margin-bottom:15px">
<span class="font_description"><%= @news.description %></span>
<div style="margin-bottom:15px">
<span class="font_description"> <%= @news.description %> </span>
<br/>
<%= link_to_attachments @news %>
<br/>
<!--add comment-->
<% if @news.commentable? %>
<p>
<%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>
</p>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %>
</div>
<p>
<%= submit_tag l(:button_add) %>
</p>
<% end %>
<% end %>
<!--add comment-->
<% if @news.commentable? %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %>
</div>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
<% end %>
<% html_title @news.title -%>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<!--dispaly comments-->
<div class="line_heng"></div>
</div>
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
<% comments = @comments.reverse %>
<% comments.each do |comment| %>
<% next if comment.new_record? %>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%=link_to_user(comment.author) if comment.respond_to?(:author) %>
</strong> <span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"> <%= textilizable(comment.comments) %></p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= @news.created_on %></span></td>
<td width="200" align="right" class="a"><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
</tr>
</table></td>
</tr>
</table>
<% end if @comments.any? %>
<% html_title @news.title -%>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<!--dispaly comments-->
<div class="line_heng"></div>
</div>
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
<% comments = @comments.reverse %>
<% comments.each do |comment| %>
<% next if comment.new_record? %>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to_user(comment.author) if comment.respond_to?(:author) %> </strong><span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable(comment.comments) %>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= @news.created_on %></span></td>
<td width="200" align="right" class="a"><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
</tr>
</table></td>
</tr>
</table>
<% end if @comments.any? %>
</div>

View File

@ -12,9 +12,10 @@
<% end %></p>
<p style="margin-left:-10px;"><%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<%= f.fields_for @course do |m| %>
<p style="margin-left:-10px;"><%= m.text_field :name,:required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :time, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :code, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :name, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<p style="margin-left:-10px;"><%= m.text_field :location, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<% end %>
<p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p>
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>

View File

@ -0,0 +1,36 @@
<!-- fq -->
<script type="text/javascript" language="javascript">
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
var text = $('#' + id);
var text_t = $('#' + id_t);
if (text.val() == 0) {
text_t.attr("placeholder", label_reward);
}
if (text.val() == 1) {
text_t.attr("placeholder", label_money);
}
if (text.val() == 3) {
text_t.attr("placeholder", label_credit);
}
if (text.val() == 2) {
text_t.attr("placeholder", label_content);
}
return content;
}
</script>
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<p><%= l(:label_bids_form_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_requirement_name)}" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_requirement_description)}" %></p>
<!-- <p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('bid_deadline')%>
</p>
<p><%= hidden_field_tag 'course_id', @project.id%>
</p>

View File

@ -0,0 +1,81 @@
<!-- fq -->
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 80px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("../images/button/bg106.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -5px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<script type="text/javascript" language="javascript">
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
</script>
<%= form_tag({:controller => 'bids',
:action => 'new_bid',
:remote => true,
:method => :post,
:id => 'new-bid-form'}) do %>
<table border="0" width="600px" style="border-left: 1px solid #acaeb1; border-right: 1px solid #acaeb1;
border-top: 1px solid #acaeb1; border-bottom: 1px solid #acaeb1; margin-top: 30px; margin-left: 30px;">
<tr>
<td colspan="2"><%= text_field_tag 'bid_title', "#{l(:label_requirement_name)}", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_title', '#{l(:label_requirement_name)}')", :onblur => "showInfo('bid_title', '#{l(:label_requirement_name)}')"%></td>
</tr>
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<tr>
<td colspan="2"><%= text_area_tag 'bid_description', "#{l(:label_requirement_description)}", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6,
:onfocus => "clearInfo('bid_description', '#{l(:label_requirement_description)}')", :onblur => "showInfo('bid_description', '#{l(:label_requirement_description)}')" %></td>
</tr>
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<!-- <tr>
<td width="22%"><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '2'>#{l(:label_reward_1)}</option><option value = '3'>#{l(:label_bids_credit)}</option>".html_safe, :class => 'noline' %></td>
<td><%= text_field_tag 'bid_budget', "#{l(:label_requirement_bargain_money)}", :class => 'noline', :required => true,
:onfocus => "clearInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')", :onblur => "showInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')" %>
</td>
</tr> -->
<tr>
<td colspan="2"><div class="tableline"></div></td>
</tr>
<tr>
<td colspan="2"><%= text_field_tag 'bid_deadline', "#{l(:label_deadline)}", :class => 'noline', :required => true,
:onfocus => "clearInfo('bid_deadline', '#{l(:label_deadline)}')", :onblur => "showInfo('bid_deadline', '#{l(:label_deadline)}')"%>
<%= calendar_for('bid_deadline')%></td>
</tr>
</table>
<table id="bidding_table" border="0" width="600" style="margin-top: 10px; margin-left: 30px;">
<tr>
<td align="right"> <%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> </td>
</tr>
</table>
<%end%>

View File

@ -0,0 +1,16 @@
<h3 class="title">请输入课程密码</h3>
<%= form_tag({:controller => 'watchers',
:action => 'join',
:object_id => course.id},
:remote => true,
:method => :post,
:id => 'new-watcher-form') do %>
<%= text_field_tag 'course_password', nil%>
<p class="buttons">
<%= submit_tag l(:button_add), :name => nil, :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>

View File

@ -0,0 +1,8 @@
<%= form_tag({:controller => 'projects',
:action => 'project_respond'}) do %>
<%= text_area_tag 'project_respond', "", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6, :placeholder => l(:label_projects_feedback_respond_content) %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%> </td>
<%end%>

View File

@ -1,7 +1,7 @@
<!--Added by nie-->
<div class="project-block">
<div class="img-tag">
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
<%=link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %>
</div>
<div class="wiki-description">
<p>
@ -10,10 +10,10 @@
</div>
<div class="information">
<p class="stats">
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_follow_people)) %>
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</p>
<p class="stats">
<%= content_tag('span', "#{@project.users.count}", :class => "info") %><%= content_tag('span', l(:label_current_contributors)) %>
<%= content_tag('span', "#{@project.users.count}", :class => "info") %><%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
</p>
<p class="stats">
<%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %><%= content_tag('span', l(:label_since_last_commits)) %>
@ -25,7 +25,14 @@
</div>
<div class="add-info">
<div class="main-language">
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<!-- add by huang -->
<% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %>
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
<!-- end -->
<!-- <%= content_tag('span', "#{l(:default_role_manager)}: ") %> -->
<% @admin = @project.project_infos%>
<% if @admin.size > 0 %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>

View File

@ -1,27 +1,37 @@
<!-- fq -->
<h3><%= l(:label_user_response) %></h3>
<%= render_flash_messages %>
<% if @jour.size >0 %>
<% for journal in @jour%>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong>
<span class="font_lighter">对项目进行了反馈</span>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a">
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to journal.user, user_path(journal.user)%></strong><span class="font_lighter"><%= l(:label_projects_feedback) %></span></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable journal.notes%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a">
<% ids = 'project_respond_form_'+journal.id.to_s%>
<%= toggle_link l(:label_projects_feedback_respond), ids, {:focus => 'project_respond'} %> </td>
</tr>
<tr>
<td colspan='2'>
<div id=<%= ids%> style="display: none">
<%= render :partial => 'new_respond', :locals => {:journal => journal} %>
</div></td>
</tr>
</table></td>
</tr>
</table>
<div class="line_under"></div>
<% end %>

View File

@ -22,12 +22,6 @@
</div>
<% if User.current.logged? %>
<div id="put-bid-form" style="display: none">
<%= render :partial => 'bids/new_bid' %>
</div>
<% end %>
<div id="bid-show">
<%= render :partial => 'bids/bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>

View File

@ -2,7 +2,7 @@
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<%= form_tag(projects_path, :method => :get) do %>
<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
@ -19,6 +19,22 @@
</div>
<% end %>
<%= sort_project(@s_type)%>
<!-- <div class="pagination_list">
<ul>
<li>
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
</li>
</ul>
</div> -->
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>
</div>

View File

@ -1,8 +1,8 @@
<h3><%=l(:label_course_new_homework)%></h3>
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_bid'} do |f| %>
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework'} do |f| %>
<div class="box tabular">
<%= render :partial => 'bids/form', :locals => { :f => f } %>
<%= render :partial => 'homework_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= javascript_tag "$('#bid_name').focus();" %>
<% end %>

View File

@ -0,0 +1,3 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', :locals => {:course => @course}) %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');

View File

@ -0,0 +1,67 @@
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px"><%= l(:label_project_plural)%></span></td>
<td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
</div></td>
</tr>
</table>
</div>
<%end%>
<!-- <div class="pagination_list">
<ul>
<li>
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
</li>
</ul>
</div> -->
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>
</div>
<!-- <p class="pagination"><%= pagination_links_full @project_pages%></p> -->
<div class="pagination">
<ul>
<%= pagination_links_full @project_pages %>
</ul>
</div>
<% if User.current.logged? %>
<p style="text-align:right;">
<span class="my-project"><%= l(:label_my_projects) %></span>
</p>
<% end %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<% end %>
<% content_for :sidebar do %>
<%= form_tag({}, :method => :get) do %>
<h3><%= l(:label_project_plural) %></h3>
<label for="closed"><%= check_box_tag 'closed', 1, params[:closed] %> <%= l(:label_show_closed_projects) %></label>
<p>
<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
</p>
<% end %>
<% end %>
<% html_title(l(:label_project_plural)) -%>

View File

@ -1,5 +1,5 @@
<h3><%=l(:label_settings)%></h3>
<% if @course_tag %>
<% if @project.project_type %>
<%= render_tabs course_settings_tabs %>
<% else %>
<%= render_tabs project_settings_tabs %>

View File

@ -42,5 +42,9 @@
</div>
</div>
<% else %>
<p class="font_description"><%= l(:label_project_no_activity) %></p>
<p class="font_description">
<table width="660"><tr><td><%=link_to image_tag(url_to_avatar(@user), :class => "avatar"), user_path(@user)%></td><td colspan="2">
<table width="580">
<tr><td ><%=link_to @user.login.to_s,user_path(@user) %> <%= l(:label_user_create_project) %> <%=link_to @project.name %><strong> !</strong></td></tr>
<tr><td class="font_lighter" style="float: right"><%= format_time(@project.created_on) %></table></td></tr></table></p>
<% end %>

View File

@ -44,7 +44,12 @@
<% for tracker in @trackers %>
<li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>:
<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
:total => @total_issues_by_tracker[tracker].to_i) %>
:total => @total_issues_by_tracker[tr
<li><%= l(:default_tracker_bug) %></li>
<% end %>
<% if tracker.[4]%>
<li><%= l(:default_tracker_mission) %></li>
<% end %>
</li>
<% end %>
</ul>

View File

@ -0,0 +1,33 @@
<!--add by huang-->
<h3><%= l(:label_user_watcher)%></h3>
<div class="inf_user_image">
<% for user in @project.watcher_users %> <!-- @project.watcher_users.count -->
<ul class="list_watch">
<li>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" width="580px" ><p><%= content_tag "div", link_to_user(user), :class =>"project_avatar_name" %></p>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
</p></td>
</tr>
<tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td>
</tr>
</table></td>
</tr>
</table></li></ul>
<% end %>
</div>

View File

@ -76,8 +76,9 @@
<% end %>
<% end %>
<%= l(:label_how_commit_code) %>&nbsp;<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path)%>&nbsp;<%= link_to('English', en_usage_path)%>
<!-- added by bai -->
<strong><span style="color: #099;"><%= l(:label_how_commit_code) %></span></strong>&nbsp;<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "usage")%>&nbsp;|&nbsp;<%= link_to('English', en_usage_path, :class => "usage")%>
<!-- end -->
<% content_for :header_tags do %>

View File

@ -3,7 +3,7 @@
<div class="box tabular settings">
<p><%= setting_select :ui_theme, Redmine::Themes.themes.collect {|t| [t.name, t.id]}, :blank => :label_default, :label => :label_theme %></p>
<p><%= setting_select :default_language, lang_options_for_select(false) %></p>
<p><%= setting_select :default_language, :Chinese简体中文 => :zh, :English => :en %></p>
<p><%= setting_select :start_of_week, [[day_name(1),'1'], [day_name(6),'6'], [day_name(7),'7']], :blank => :label_language_based %></p>
<% locale = User.current.language.blank? ? ::I18n.locale : User.current.language %>

View File

@ -0,0 +1,5 @@
<div class="pagination" style="float:right;">
<%=
pagination_links_full obj_pages,:per_page_links => true,:remote=>true
%>
</div>

View File

@ -2,14 +2,14 @@
<ul style="list-style-type: none">
<% for rt in related_tags %>
<li>
<%= link_to image_tag("/images/sidebar/add.png"),:action => "add_tag",:remote => true,:tag => rt,:show_flag => show_flag %>
<%= link_to image_tag("/images/sidebar/add.png"),:action => "index",
:current_selected_tags => selected_tags,:tag => rt,:do_what => "1",
:obj_id => obj_id,:object_flag => obj_flag %>
<span id="tag">
<%= rt %>
</span>
<% @issue_size = Issue.tagged_with("#{rt}").size %>
<% @project_size = Project.tagged_with(rt).size %>
<% @user_size = User.tagged_with("#{rt}").size %>
(<%= @user_size + @project_size + @issue_size %>)
<!-- 这里用例计数某类对象的所有该tag总数 -->
<%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => rt }%>
</li>
<% end %>
</ul>

View File

@ -2,12 +2,11 @@
<ul style="list-style-type: none">
<% for sg in selected_tags %>
<li>
<%= link_to image_tag("/images/sidebar/minus.png"),:action => "delete_tag",:remote=>true,:tag => sg,:show_flag => show_flag %>
<%= link_to image_tag("/images/sidebar/minus.png"),:action => "index",
:current_selected_tags => selected_tags ,:tag => sg,:do_what => "0",
:obj_id => obj_id,:object_flag => obj_flag %>
<span id="tag"><%= sg %> </span>
<% @issue_size = Issue.tagged_with("#{sg}").size %>
<% @project_size = Project.tagged_with(sg).size %>
<% @user_size = User.tagged_with("#{sg}").size %>
(<%= @user_size + @project_size + @issue_size %>)
<%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => sg }%>
</li>
<% end %>
</ul>

View File

@ -3,9 +3,11 @@
<hr />
<% bids_results.each do |bid| %>
<p class="font_description2">
<strong><%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}",:controller => "bids",:action => "show",:id => bid.id %></strong>
<strong><%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}",
:controller => "bids",:action => "show",:id => bid.id %></strong>
<br />
<strong><%= l(:label_tags_bid_description) %>:</strong><%= bid.description %>
<%= bid.updated_on %>
</p>
<div class="line_under"></div>
<% end %>

View File

@ -0,0 +1,10 @@
<% case show_flag%>
<% when '1' then %>
(<%= User.tagged_with("#{sg}").size %>)
<%when '2' then %>
(<%= Project.tagged_with(sg).size %>)
<% when '3' then %>
(<%= Issue.tagged_with("#{sg}").size %>)
<% when '4' then %>
(<%= Bid.tagged_with("#{sg}").size %>)
<% end %>

View File

@ -27,8 +27,6 @@
<% end %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
@ -40,6 +38,4 @@
<div><%= l(:label_tags_no) %></div>
<% end %>
<% end %>

View File

@ -2,29 +2,28 @@
<% unless show_flag.nil? %>
<% case %>
<% when show_flag == '1' %>
<strong><%=l(:label_user)%><strong>
<strong><%=l(:label_user)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_users",:locals => {:users_results => users_results}%>
<% when show_flag == '2'%>
<strong><%=l(:label_project)%></strong>
<strong><%=l(:label_project)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_projects",:locals => {:projects_results => projects_results }%>
<% when show_flag == '3'%>
<strong><%=l(:label_issue)%></strong>
<strong><%=l(:label_issue)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_issues",:locals => {:issues_results => issues_results }%>
<% when show_flag == '4'%>
<strong><%= l(:label_requirement)%></strong>
<strong><%= l(:label_requirement)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_bids",:locals => {:bids_results => bids_results}%>
<% else %>
<strong><%= l(:label_tags_all_objects)%></strong>
<!-- 这里为显示搜有过滤结果预留了默认设置 -->
<%= render :partial => "show_issues",:locals => {:issues_results => issues_results }%>
<%= render :partial => "show_users",:locals => {:users_results => users_results }%>
<%= render :partial => "show_projects",:locals => {:projects_results => projects_results }%>
<%= render :partial => "show_bids",:locals => {:bids_results => bids_results}%>
<% end %>
<% else %>
<span>no data.</span>
<span>no data...</span>
<% end %>
</ul>
<div class="pagination" style="float:right;">
<ul>
<%= pagination_links_full @obj_pages %>
<ul>
</div>
<%= render :partial => "pagination",:locals => {:obj_pages => @obj_pages} %>

View File

@ -4,6 +4,7 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags ,:show_flag => @show_flag })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results,:bids_results => @bids_results ,:show_flag => @show_flag })%>')
:projects_results => @projects_results,:users_results => @users_results,
:bids_results => @bids_results ,:show_flag => @show_flag,:obj_pages => @obj_pages })%>')

View File

@ -4,5 +4,7 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags,:show_flag => @show_flag })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results,:bids_results => @bids_results ,:show_flag => @show_flag })%>')
:projects_results => @projects_results,:users_results => @users_results,
:bids_results => @bids_results ,:show_flag => @show_flag ,:obj_pages => @obj_pages })%>')

View File

@ -1,14 +1,16 @@
<% content_for :sidebar do %>
<div>
<h3><strong><%= l(:label_tags_selected) %></strong></h3>
<div id="selected_tags">
<%= render :partial => "selected_tags",:locals => {:selected_tags => $selected_tags,:show_flag => @obj_flag}%>
</div>
<h3><strong><%= l(:label_tags_selected) %></strong></h3>
<div id="selected_tags">
<%= render :partial => "selected_tags",:locals => {
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div>
<h3><strong><%= l(:label_tags_related) %></strong></h3>
<div id="related_tags">
<%= render :partial => "related_tags",:locals => {:related_tags => $related_tags,:show_flag => @obj_flag }%>
</div>
<h3><strong><%= l(:label_tags_related) %></strong></h3>
<div id="related_tags">
<%= render :partial => "related_tags",:locals => {:related_tags => @related_tags,
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div>
</div>
<% end %>
<% content_for :content do %>
@ -16,15 +18,18 @@
<h3><strong><%= l(:label_tags_search_result) %></strong></h3>
<div align="right">
<%= l(:label_tags_numbers) %>
<%= l(:label_issue_plural) %>(<%= @issues_tags_num %>)|
<%= l(:label_project_plural) %>(<%= @projects_tags_num %>)|
<%= l(:label_user_plural) %>(<%= @users_tags_num %>)|
<%= l(:label_issue_plural) %>(<%= @issues_tags_num %>) |
<%= l(:label_project_plural) %>(<%= @projects_tags_num %>) |
<%= l(:label_user_plural) %>(<%= @users_tags_num %>) |
<%= l(:label_tags_call)%>(<%= @bids_tags_num %>)
</div>
<div id="show_results">
<%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results ,:bids_results=>@bids_results,:show_flag => @obj_flag}%>
</div>
<div id="show_results">
<%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
:projects_results => @projects_results,:users_results => @users_results ,
:bids_results=>@bids_results,:show_flag => @obj_flag}%>
</div>
</div>
<% end %>

View File

@ -5,7 +5,7 @@
<div id="show_all_tags">
<% for tag in @tags %>
<span id="tag" class="tag<%= tag.id %>">
<%= link_to tag.name,:remote=>true,:action=>"delete",:q => tag.id%>
<%= link_to tag.name,:remote=>true,:action=>"delete",:q => tag.id,:confirm => "Are you Sure?"%>
</span>
<% end %>
<% end %>

View File

@ -5,7 +5,7 @@
<h3><%= l(:label_user_plural)%></h3>
<%= form_tag(users_path, :method => :get) do %>
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<fieldset>
<legend>
<%= l(:label_filter_plural) %>
@ -72,7 +72,7 @@
<div class="project-search-block">
<span><%= l(:label_user_plural)%></span>
<%= form_tag(users_path, :method => :get) do %>
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<!-- <fieldset>
<legend>
<%= l(:label_filter_plural) %>
@ -84,14 +84,29 @@
<% end %>
</div>
</div>
&nbsp;
<%= sort_user(@s_type)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), users_path(:user_sort_type => '0') %>
</li>
<li>
<%= link_to l(:label_sort_by_active), users_path(:user_sort_type => '1') %>
</li>
<li>
<%= link_to l(:label_sort_by_influence), users_path(:user_sort_type => '2') %>
</li>
</ul>
</div> -->
<div class="autoscroll">
<% for user in @users -%>
<% unless user.id == 1%>
<div class="well">
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %>
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
<!-- <%= get_avatar?(user) ? (link_to image_tag(avatar_image(user), :class => 'avatar'), user_path(user), :class => "avatar") : (link_to image_tag("/images/12_50.png", :class => 'avatar'), user_path(user), :class => "avatar") %> -->
<div>
@ -99,18 +114,18 @@
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
</div>
<div style="margin-top: 20px;margin-left:66px">
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
</div>
<div class="user-bottom">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
<%= user.changesets.count == 0 ? '' : ",#{l(:label_total_commit, :total_commit => user.changesets.count)}" %>
<%= user.changesets.count == 0 ? '' : ",#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
</div>
</div>
<% end -%>

View File

@ -13,12 +13,12 @@
<% 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) %>
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% else %>
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%><%= l(:label_quote_my_words) %>
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%><%= l(:label_have_respond) %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>

View File

@ -0,0 +1,140 @@
<% if User.current.admin? %>
<div class="contextual">
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
</div>
<h3><%= l(:label_user_plural)%></h3>
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend>
<label for='status'><%= l(:field_status) %>:</label>
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<% if @groups.present? %>
<label for='group_id'><%= l(:label_group) %>:</label>
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
<% end %>
<label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list">
<thead>
<tr>
<%= sort_header_tag('login', :caption => l(:field_login)) %>
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
<%= sort_header_tag('mail', :caption => l(:field_mail)) %>
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
<th></th>
</tr>
</thead>
<tbody>
<% for user in @users -%>
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
<td class="firstname"><%= h(user.firstname) %></td>
<td class="lastname"><%= h(user.lastname) %></td>
<td class="email"><%= mail_to(h(user.mail)) %></td>
<td align="center"><%= checked_image user.admin? %></td>
<td class="created_on" align="center"><%= format_time(user.created_on) %></td>
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
<td class="buttons"> <%= change_status_link(user) %>
<%= delete_link user_path(user, :back_url => users_path(params)) unless User.current == user %> </td>
</tr>
<% end -%>
</tbody>
</table>
</div>
<div class="pagination">
<ul>
<%= pagination_links_full @user_pages, @user_count %>
<ul>
</div>
<% html_title(l(:label_user_plural)) -%>
<% else %>
<!-- <div class="contextual">
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
</div> -->
<div class="project-search-block">
<span><%= l(:label_user_plural)%></span>
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<!-- <fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend> -->
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
<!-- </fieldset> -->
<% end %>
</div>
</div>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), users_path(:user_sort_type => '0') %>
</li>
<li>
<%= link_to l(:label_sort_by_active), users_path(:user_sort_type => '1') %>
</li>
<li>
<%= link_to l(:label_sort_by_influence), users_path(:user_sort_type => '2') %>
</li>
</ul>
</div> -->
<div class="autoscroll">
<% for user in @users -%>
<% unless user.id == 1%>
<div class="well">
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
<!-- <%= get_avatar?(user) ? (link_to image_tag(avatar_image(user), :class => 'avatar'), user_path(user), :class => "avatar") : (link_to image_tag("/images/12_50.png", :class => 'avatar'), user_path(user), :class => "avatar") %> -->
<div>
<%= link_to image_tag(url_to_avatar(user), :class => 'avatar'), user_path(user) %>
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
</div>
<div style="margin-top: 20px;margin-left:66px">
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
</div>
<div class="user-bottom">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
<%= user.changesets.count == 0 ? '' : ",#{l(:label_total_commit, :total_commit => user.changesets.count)}" %>
</div>
</div>
<% end -%>
<% end -%>
</div>
<div class="pagination">
<ul>
<%= pagination_links_full @user_pages, @user_count %>
<ul>
</div>
<% html_title(l(:label_user_plural)) -%>
<% end -%>

View File

@ -1,3 +1,7 @@
<% if User.current.id == @user.id%>
<%= show_activity @state%>
<% end %>
<% unless @state == 2%>
<% unless @activity.empty? %>
<div id="activity">
<% @activity.each do |e| %>
@ -13,9 +17,9 @@
<% when 'Bid' %>
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", 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 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("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<% else %>
<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_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<% end %>
</tr>
<tr>
@ -28,13 +32,15 @@
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><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></div>
<% when 'Journal' %>
<!-- modified by bai -->
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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 colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(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}"} %></td>
<% else %>
<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("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to( 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}"} %></td>
<% end %>
</tr>
<!-- end -->
<tr>
<td colspan="2" width="580" >
<p class="font_description">
@ -47,9 +53,9 @@
<% when 'Changeset' %>
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", 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>
<td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
<% else %>
<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(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
<% end %>
</tr>
<tr>
@ -64,9 +70,9 @@
<% when 'Message' %>
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", 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}"}) %></td>
<td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{act.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}"}) %></td>
<% else %>
<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("#{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}"}) %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{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}"}) %></td>
<% end %>
</tr>
<tr>
@ -75,15 +81,32 @@
<%= textilizable act.content %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'Principal' %>
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span></td>
<% else %>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span></td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'News' %>
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", 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} %></td>
<td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %></td>
<% else %>
<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_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %></td>
<% end %>
</tr>
<tr>
@ -96,13 +119,15 @@
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><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>
<% when 'Issue' %>
<!-- modified by bai -->
<tr>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<td colspan="2" valign="top"><strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<% else %>
<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("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<% end %>
</tr>
<!-- end -->
<tr>
<td colspan="2" width="580" >
<p class="font_description">
@ -143,3 +168,62 @@
</p>
<% end %>
<% end %>
<% else %>
<!-- fq -->
<% 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>
<!-- fq -->
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(e.user), :class => "avatar"), user_path(e.user), :class => "avatar" %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage)%>
<% if e.reply_id == User.current.id%>
<%if e.jour_type == 'Bid'%>
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% else %>
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id))%><%= l(:label_have_respond) %>
<% else %>
<%= l(:label_in_issues)%><%= link_to(e.issue.subject, issue_path(e.issue))%><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span></td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable 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>
<!-- <tr><div class="line_under"></div></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 %>

View File

@ -1,5 +1,5 @@
<!--add by huang-->
<h3><%= l(:label_user_fans)%></h3>
<h3><%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)%></h3>
<div class="inf_user_image">
<% for user in @user.watcher_users %>
<ul class="list_watch"><li>
@ -8,13 +8,13 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>

View File

@ -3,7 +3,7 @@
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
</div>
<div style="border-bottom: 1px dashed rgb(204, 204, 204);font-size: 14px; font-family: 微软雅黑; padding-bottom: 10px; font-weight: bold; color:#807a76">
留言<%= @feedback_count%>
<%= l(:label_newfeedback_message) %><%= @feedback_count%>
</div>
<div id="message" style="font-size: 14px;">

View File

@ -6,7 +6,7 @@
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>
<table width="580" border="0">
<tr>
@ -20,8 +20,8 @@
</p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"> <%= format_date(membership.created_on) %></a></td>
<td align="right" class="a"><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
</tr>
</table></td>
</tr>

View File

@ -8,13 +8,13 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>

View File

@ -7,7 +7,7 @@
<table width="90%" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px; margin-top: 30px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(bid.author), :class => 'avatar'), :class => "avatar" %></td>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(bid.author), :class => 'avatar'),user_path(bid.author), :class => "avatar" %></td>
<td>
<table width="100%" border="0">
<tr>
@ -16,14 +16,26 @@
<tr>
<td width="500">
<table border="0">
<tr>
<td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td>
<td class="font_lighter">(<%= bid.biding_projects.count%>)<%= l(:label_biding_project) %></td>
<td class="font_lighter">(<%= bid.commit %>)<%= l(:label_responses) %></td>
<td class="font_lighter">(<%= bid.watcher_users.count%>)<%= l(:label_followers) %></td>
<tr><td>
<% if bid.reward_type.nil? or bid.reward_type == 1%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong>
<% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<% else %>
<strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong>
<% end %>
<!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
</td>
</tr>
<tr><td>
<span class="font_lighter"><%= l(:label_biding_project) %>(<strong><%=link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_responses) %>(<strong><%=link_to bid.commit, respond_path(bid) %></strong>)</span>
<span class="font_lighter"><%= l(:label_followers) %>(<strong><%=link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span>
</td>
</tr>
</table></td>
<td width="200" align="right" class="a"><a class="font_lighter"> <%= format_time bid.created_on %></a></td>
<td width="220" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td><!-- modified by ming -->
</tr>
<tr>
<td>

View File

@ -1,5 +1,5 @@
<!--modified by young-->
<div class="contextual">
<div class="contextual" style="padding-right:440px;margin-top:0px;">
<%= link_to l(:label_version_new), new_project_version_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %>
</div>

View File

@ -0,0 +1,3 @@
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');

View File

@ -1,5 +1,2 @@
<% selector = ".#{watcher_css(watched)}" %>
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
$('#fans_num').html('<%= j(render :partial => "/watchers/fans_num",:locals => {:fans_num => get_fans_num(@user) }
) %>');

View File

@ -139,9 +139,9 @@ software development and software crowdsourcing.</td></tr>
<!--add by huang-->
<div style="height:280px;">
<div class="welcone_left">
<table width="400px">
<table width="388px">
<tr>
<td><span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> </span><span class="font_welcome_Cdescription">, <%= l(:label_welcome_trustie_description) %></span></td>
<td><span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_description) %></span></td>
</tr>
<!-- <tr>
<td class="font_welcome_Edescription">Trustie forge,a socialized collaboration platform for project management,software development and software crowdsourcing for creative university students and entrepreneurs.</td>
@ -186,23 +186,27 @@ software development and software crowdsourcing.</td></tr>
<% else %>
<div>
<!--info-->
<table width="200" border="0">
<!-- modified by bai -->
<table width="200" border="0">
<tr>
<td colspan="2" class="font_welcome_Cdescription" style=" word-wrap: break-word; word-break: break-all"><%= l(:label_welcome) %> <strong class="font_small_watch"><%=link_to User.current.lastname<<User.current.firstname, user_path(User.current) %></strong> <%= l(:label_join) %></td>
<td colspan="2" align="center" class="font_welcome_Cdescription" ><%= l(:label_welcome) %> <strong class="font_small_watch" style=" word-wrap: break-word; word-break: break-all"><%=link_to User.current.lastname<<User.current.firstname, user_path(User.current) %></strong> <%= l(:label_join) %></td>
</tr>
<tr>
<td rowspan="2" align="left"><%=link_to image_tag(url_to_avatar(User.current), :class => 'avatar'), user_path(User.current) %></td>
<td><%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= link_to User.watched_by(User.current).count, user_path(User.current) %></strong>)&nbsp
<%= l(:label_user_fans) %>(<strong class="font_small_watch"><%=link_to User.current.watcher_users(User.current.id).count, user_path(User.current) %></strong>)</td>
<td rowspan="2" style="padding-left: 20px"><%=link_to image_tag(url_to_avatar(User.current), :class => 'avatar'), user_path(User.current) %></td>
<td><strong class="font_small_watch"><%= link_to l(:label_user_watcher)+"("+User.watched_by(User.current).count.to_s+")", user_path(User.current) %></strong>&nbsp
<strong class="font_small_watch"><%=link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+User.current.watcher_users(User.current.id).count.to_s+")", user_path(User.current) %></strong></td>
</tr>
<tr>
<td><% unless User.current.memberships.empty? %>
<%= l(:label_welcome_page_to, :project_count => "#{User.current.memberships.count}") %> <!-- <% for member in User.current.memberships %>
<td align="left"><% unless User.current.memberships.empty? %>
<%= l(:label_x_welcome_participate, :count => User.current.memberships.count) %> <strong class="font_small_watch"><%= link_to User.current.memberships.count, {:controller => 'users', :action => 'user_projects', :id => User.current} %></strong> <%= l(:label_welcome_participate_project)%>
<!-- <% for member in User.current.memberships %>
<%= link_to_project(member.project) %><%= (User.current.memberships.last == member) ? '' : '' %>
<% end %> --> <% end %></td>
</tr>
</table>
<!-- end -->
</div>
<% end %>
<% end %>

View File

@ -21,12 +21,12 @@
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a"> <% if @user == User.current %>
<%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
<%= link_to(l(:label_newfeedback_quote), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<%= link_to(image_tag('delete.png'), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user},
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) if remove_allowed || journal.jour_id == User.current.id %></td>
<% else %>
<%= link_to(image_tag('comment.png'), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
<%= link_to(l(:label_newfeedback_quote), {:controller => 'words', :action => 'new', :id => user, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%>
<% end %>
</tr>

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