new version

exceptionHandle
huangjingquan 12 years ago
parent 7dbcc1520c
commit 261c3fc337

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

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

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

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

@ -18,12 +18,50 @@ class BidsController < ApplicationController
@offset ||= @bid_pages.reverse_offset @offset ||= @bid_pages.reverse_offset
#@bids = @bids.offset(@offset).limit(@limit).all.reverse #@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 unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse @bids = @bids.offset(@offset).limit(@limit).all.reverse
else else
limit = @bid_count % @limit limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse @bids = @bids.offset(@offset).limit(limit).all.reverse
end 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
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}) # @limit = api_offset_and_limit({:limit => 5})
# @bids = Bid.visible # @bids = Bid.visible
# @bids = @bids.like(params[:name]) if params[:name].present? # @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[:bid_message][:message].size>0
if params[:reference_content] if params[:reference_content]
message = params[:reference_content] + params[:bid_message][:message] message = params[:bid_message][:message] + "\n" + params[:reference_content]
else else
message = params[:bid_message][:message] message = params[:bid_message][:message]
end end
@ -138,8 +176,10 @@ class BidsController < ApplicationController
##删除留言 ##删除留言
def destroy def destroy
JournalsForMessage.delete_message(params[:object_id])
@user = @bid.author @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 @jours = @bid.journals_for_messages.reverse
@limit = 10 @limit = 10
@feedback_count = @jours.count @feedback_count = @jours.count
@ -240,6 +280,32 @@ class BidsController < ApplicationController
end end
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 def more
@jour = @bid.journals_for_messages @jour = @bid.journals_for_messages
@jour.each_with_index {|j,i| j.indice = i+1} @jour.each_with_index {|j,i| j.indice = i+1}
@ -252,6 +318,7 @@ class BidsController < ApplicationController
end end
end end
def back def back
@jour = @bid.journals_for_messages @jour = @bid.journals_for_messages
@jour.each_with_index {|j,i| j.indice = i+1} @jour.each_with_index {|j,i| j.indice = i+1}

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

@ -51,11 +51,45 @@ class MyController < ApplicationController
@user = User.current @user = User.current
@pref = @user.pref @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? if request.post?
@user.safe_attributes = params[:user] @user.safe_attributes = params[:user]
@user.pref.attributes = params[:pref] @user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1') @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
# # 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 if @user.save
@user.pref.save @user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])

@ -14,20 +14,24 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
layout 'base_projects'# by young layout 'base_projects'# by young
menu_item :overview menu_item :overview
menu_item :roadmap, :only => :roadmap menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings 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
before_filter :find_project, :except => [ :index, :list, :new, :create, :copy, :statistics] menu_item l(:label_sort_by_influence), :only => :index
before_filter :authorize, :except => [:new_homework, :homework, :statistics, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] #by huang
# menu_item :files, :only => :files
# menu_tiem :news, :only => :news
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 :authorize_global, :only => [:new, :create]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
#by young #by young
before_filter :member, :file before_filter :member, :file, :statistics, :watcherlist
# #
accept_rss_auth :index accept_rss_auth :index
accept_api_auth :index, :show, :create, :update, :destroy accept_api_auth :index, :show, :create, :update, :destroy
@ -54,10 +58,32 @@ class ProjectsController < ApplicationController
helper :activities helper :activities
helper :documents helper :documents
helper :watchers helper :watchers
# helper :watcherlist
### added by william ### added by william
include ActsAsTaggableOn::TagsHelper 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 def index
#Modified by nie #Modified by nie
@ -68,7 +94,7 @@ class ProjectsController < ApplicationController
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all # @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})
@projects = Project.visible @projects_status = ProjectStatus.visible
# @projects.each do |project| # @projects.each do |project|
# @admin = project.users_by_role[Role.find(3)] # @admin = project.users_by_role[Role.find(3)]
# unless @admin.nil? # unless @admin.nil?
@ -78,11 +104,79 @@ class ProjectsController < ApplicationController
# #
# end # end
# end # end
@projects = Project.visible.like(params[:name]) if params[:name].present? # @projects.each do |project|
@project_count = @projects.count # 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'] @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 #end
respond_to do |format| respond_to do |format|
format.html { format.html {
@ -91,7 +185,6 @@ class ProjectsController < ApplicationController
unless params[:closed] unless params[:closed]
scope = scope.active scope = scope.active
end end
@projects = scope.visible.offset(@offset).limit(@limit).order('created_on DESC').all
} }
format.api { format.api {
# @offset, @limit = api_offset_and_limit # @offset, @limit = api_offset_and_limit
@ -105,10 +198,44 @@ class ProjectsController < ApplicationController
end end
end end
def search
@projects = Project.visible
@projects = @projects.visible.like(params[:name]) if params[:name].present?
@offset, @limit = api_offset_and_limit({:limit => 10})
@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 #Added by young
def homework def homework
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})
@bids = Bid.visible @bids = @project.homeworks
@bids = @bids.like(params[:name]) if params[:name].present? @bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count @bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page'] @bid_pages = Paginator.new @bid_count, @limit, params['page']
@ -131,7 +258,6 @@ class ProjectsController < ApplicationController
end end
#Ended by young #Ended by young
def feedback def feedback
@jours = @project.journals_for_messages.reverse @jours = @project.journals_for_messages.reverse
@limit = 10 @limit = 10
@ -142,31 +268,70 @@ class ProjectsController < ApplicationController
@state = false @state = false
end 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 def new
@course_tag = params[:course] @course_tag = params[:course]
@issue_custom_fields = IssueCustomField.sorted.all @issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all @trackers = Tracker.sorted.all
@project = Project.new @project = Project.new
@project.safe_attributes = params[:project] @project.safe_attributes = params[:project]
##add by xianbo ##add by huang
@course=Course.new @course=Course.new
@course.safe_attributes = params[:course] @course.safe_attributes = params[:course]
##end ##end
render :layout => 'base' render :layout => 'base'
end end
def create def create
@course_tag = params[:project][:project_type] @course_tag = params[:project][:project_type]
if(@course_tag=="1")
@course = Course.new @course = Course.new
@course.extra=params[:project][:identifier] @course.extra=params[:project][:identifier]
@course.safe_attributes = params[:project][:course] @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 @issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all @trackers = Tracker.sorted.all
@project = Project.new @project = Project.new
@project.safe_attributes = params[:project] @project.safe_attributes = params[:project]
@course.save
if validate_parent_id && @project.save if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') @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 # Add current user as a project member if he is not admin
@ -174,6 +339,7 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first 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]) m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id) project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
project_status = ProjectStatus.create(:project_id => @project.id)
@project.members << m @project.members << m
@project.project_infos << project @project.project_infos << project
end end
@ -242,6 +408,8 @@ class ProjectsController < ApplicationController
@subprojects = @project.children.visible.all @subprojects = @project.children.visible.all
@news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").all @news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").all
@trackers = @project.rolled_up_trackers @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?) cond = @project.project_condition(Setting.display_subprojects_issues?)
@open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker) @open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker)
@total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker) @total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker)
@ -301,12 +469,11 @@ class ProjectsController < ApplicationController
# #
@base_courses_tag = @project.project_type @base_courses_tag = @project.project_type
respond_to do |format| 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 format.api
end end
end end
def settings def settings
@issue_custom_fields = IssueCustomField.sorted.all @issue_custom_fields = IssueCustomField.sorted.all
@issue_category ||= IssueCategory.new @issue_category ||= IssueCategory.new
@ -314,8 +481,9 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all @trackers = Tracker.sorted.all
@wiki ||= @project.wiki @wiki ||= @project.wiki
#Added by young #Added by young
@course_tag = params[:course] # @course_tag = params[:course]
if @course_tag == '1' # if @course_tag == '1'
if @project.project_type
render :layout => 'base_courses' render :layout => 'base_courses'
end end
#Ended by young #Ended by young
@ -328,16 +496,22 @@ class ProjectsController < ApplicationController
def member def member
end end
def file def file
# @course_tag = params[:course]
# if @course_tag == '1'
# render :layout => 'base_courses'
# end
# User.current
end end
def statistics
end
#end #end
def update def update
@project.safe_attributes = params[:project] @project.safe_attributes = params[:project]
@Course.safe_attributes=params[:project][:course]
@Course.save
if validate_parent_id && @project.save if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
respond_to do |format| respond_to do |format|
@ -420,4 +594,12 @@ class ProjectsController < ApplicationController
end end
true true
end end
# added by huang
def watcherlist
if @watched
@users -= watched.watcher_users
end
end
end end

@ -12,219 +12,103 @@ class TagsController < ApplicationController
before_filter :require_admin,:only => [:delete,:show_all] before_filter :require_admin,:only => [:delete,:show_all]
$selected_tags = Array.new # $selected_tags = Array.new
$related_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 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_id = params[:obj_id]
@obj_flag = params[:object_flag] @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}) @selected_tags = Array.new
@project_count = @users_results.count @related_tags = nil
@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}) if params[:q]
@project_count = @projects_results.count @selected_tags << params[:q]
@obj_pages = Paginator.new @project_count, @limit, params['page'] else
@offset ||= @obj_pages.offset @do_what = params[:do_what]
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all @tag = params[:tag]
@selected_tags = params[:current_selected_tags]
@selected_tags = @selected_tags.nil? ? Array.new : @selected_tags
when '3' then case @do_what
@issues_results = get_issues_by_tag($selected_tags) when '0' then
@obj = Issue.find_by_id(@obj_id) @selected_tags.delete @tag #数组中删除有多方式 可以改用shift,pop
when '1' then
# 判断是否已存在该tag 主要用来处理分页的情况
unless @selected_tags.include? @tag
@selected_tags << @tag
end
end
end
@offset, @limit = api_offset_and_limit({:limit => @numbers}) @users_tags_num,@projects_tags_num,@issues_tags_num,@bids_tags_num = get_tags_size
@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 @obj,@obj_pages,@results_count,@users_results,
end @projects_results,
@issues_results,
@bids_results = refresh_results(@obj_id,@obj_flag,@selected_tags)
# 这里是做tag推荐用的 用来生产推荐的tags
unless @obj.nil? unless @obj.nil?
@tags = @obj.tag_list @tags = @obj.tag_list
$selected_tags.each do |i| @selected_tags.each do |i|
@tags.delete(i) @tags.delete(i)
end end
$related_tags = @tags @related_tags = @tags
else else
return return
end end
end end
# 增加已选的tag
def add_tag def add_tag
@tag = params[:tag] @tag = params[:tag]
@show_flag = params[:show_flag] @show_flag = params[:show_flag]
$selected_tags << @tag $selected_tags << @tag
$related_tags.delete(@tag) $related_tags.delete(@tag)
@obj_pages = nil # 获取搜索结果
@numbers = Setting.tags_show_search_results @obj,@obj_pages,@users_results,
@projects_results,
# @issues_results = get_issues_by_tag($selected_tags) @issues_results,
# @projects_results = get_projects_by_tag($selected_tags) @bids_results = refresh_results(@obj_id,@show_flag)
# @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 end
# 删除已选tag
def delete_tag def delete_tag
@tag = params[:tag] @tag = params[:tag]
@show_flag = params[:show_flag] @show_flag = params[:show_flag]
$related_tags << @tag $related_tags << @tag
$selected_tags.delete(@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 = get_issues_by_tag($selected_tags) @issues_results,
# @projects_results = get_projects_by_tag($selected_tags) @bids_results = refresh_results(@obj_id,@show_flag)
# @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 end
def show_all def show_all
@tags = ActsAsTaggableOn::Tag.find(:all) @tags = ActsAsTaggableOn::Tag.find(:all)
end end
def for_pagination(results) #完全从数据库删除tag
@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
def delete def delete
if params[:q] if params[:q]
@tag = ActsAsTaggableOn::Tag.find_by_id(params[:q]) @tag = ActsAsTaggableOn::Tag.find_by_id(params[:q])
@tag.delete @tag.delete
@taggings = ActsAsTaggableOn::Tagging.find_all_by_tag_id(@tag.id) @taggings = ActsAsTaggableOn::Tagging.find_all_by_tag_id(@tag.id)
@taggings.each do |tagging| @taggings.each do |tagging|
tagging.delete tagging.delete
end end
@ -233,9 +117,52 @@ class TagsController < ApplicationController
end end
private 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
# 这里为了提高系统的响应速度 把搜索结果放到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 tagged_on_object(object) 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
end end

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

@ -19,13 +19,13 @@ class UsersController < ApplicationController
#Added by young #Added by young
menu_item :activity menu_item :activity
menu_item :user_information, :only => :info 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 :requirement_focus, :only => :watch_bids
menu_item :user_newfeedback, :only => :user_newfeedback menu_item :user_newfeedback, :only => :user_newfeedback
#Ended by young #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, 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] :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
@ -155,15 +155,124 @@ class UsersController < ApplicationController
} }
# @count = Redmine::Activity::Fetcher.new(User.current, :author => @user).scope_select {|t| !has["show_#{t}"].nil?}.events(nil, nil).count # @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 = UserStatus.visible
scope = scope.like(params[:name]) if params[:name].present?
scope = scope.in_group(params[:group_id]) if params[:group_id].present? 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
@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
render :layout => @user_base_tag
}
format.api
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_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page'] @user_pages = Paginator.new @user_count, @limit, params['page']
@offset ||= @user_pages.offset
@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
@user_base_tag = params[:id]?'base_users':'base' @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| respond_to do |format|
format.html { format.html {
@groups = Group.all.sort @groups = Group.all.sort
@ -173,6 +282,7 @@ class UsersController < ApplicationController
end end
end end
### modified by fq ### modified by fq
def show def show
# has = { # has = {
@ -215,6 +325,33 @@ class UsersController < ApplicationController
# @activity_pages = Paginator.new @activity_count, @limit, params['page'] # @activity_pages = Paginator.new @activity_count, @limit, params['page']
# @offset ||= @activity_pages.offset # @offset ||= @activity_pages.offset
# @events_by_day_ = @events.slice(@offset,@limit) # @events_by_day_ = @events.slice(@offset,@limit)
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 if @user == User.current
watcher = User.watched_by(@user) watcher = User.watched_by(@user)
watcher.push(User.current) watcher.push(User.current)
@ -227,6 +364,9 @@ class UsersController < ApplicationController
@activity_pages = Paginator.new @activity_count, @limit, params['page'] @activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset @offset ||= @activity_pages.offset
@activity = activity.offset(@offset).limit(@limit) @activity = activity.offset(@offset).limit(@limit)
@state = 0
end
#Modified by nie #Modified by nie
unless User.current.admin? unless User.current.admin?
@ -250,9 +390,9 @@ class UsersController < ApplicationController
message = [] message = []
if @user == User.current if @user == User.current
message = JournalsForMessage.reference_message(@user.id) 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}) @offset, @limit = api_offset_and_limit({:limit => 10})
@info_count = message.size @info_count = message.size
@info_pages = Paginator.new @info_count, @limit, params['page'] @info_pages = Paginator.new @info_count, @limit, params['page']

@ -14,10 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WatchersController < ApplicationController class WatchersController < ApplicationController
before_filter :require_login, :find_watchables, :only => [:watch, :unwatch] before_filter :require_login, :find_watchables, :only => [:watch, :unwatch]
def watch def watch
set_watcher(@watchables, User.current, true) set_watcher(@watchables, User.current, true)
end end
@ -26,6 +24,41 @@ class WatchersController < ApplicationController
set_watcher(@watchables, User.current, false) set_watcher(@watchables, User.current, false)
end 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] before_filter :find_project, :authorize, :only => [:new, :create, :append, :destroy, :autocomplete_for_user]
accept_api_auth :create, :destroy accept_api_auth :create, :destroy
@ -100,7 +133,27 @@ class WatchersController < ApplicationController
def set_watcher(watchables, user, watching) def set_watcher(watchables, user, watching)
watchables.each do |watchable| watchables.each do |watchable|
watchable.set_watcher(user, watching) 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 end
respond_to do |format| respond_to do |format|
format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}

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

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

@ -34,7 +34,22 @@ module BidsHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_bids_by_tag(tag_name) def get_bids_by_tag(tag_name)
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
end end

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

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

@ -29,7 +29,7 @@ module ProjectsHelper
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural}, {: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 => '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 => '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 => '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 => '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} {:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
@ -38,17 +38,44 @@ module ProjectsHelper
end 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 #Added by young
def course_settings_tabs def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'}, 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 => '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)} tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end end
#Ended by young #Ended by young
def parent_project_select_tag(project) def parent_project_select_tag(project)
selected = project.parent selected = project.parent
# retrieve the requested parent project # retrieve the requested parent project
@ -67,7 +94,7 @@ module ProjectsHelper
def render_project_hierarchy(projects) def render_project_hierarchy(projects)
render_project_nested_lists(projects) do |project| render_project_nested_lists(projects) do |project|
#Modified by young #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 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 else
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") 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 # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_projects_by_tag(tag_name) def get_projects_by_tag(tag_name)
Project.tagged_with(tag_name) Project.tagged_with(tag_name).order('updated_on desc')
end end
end end

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

@ -58,9 +58,58 @@ module UsersHelper
# this method is used to get all projects that tagged one tag # this method is used to get all projects that tagged one tag
# added by william # added by william
def get_users_by_tag(tag_name) def get_users_by_tag(tag_name)
User.tagged_with(tag_name) User.tagged_with(tag_name).order('updated_on desc')
end end
# added by fq # 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 end

@ -46,6 +46,20 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :class => css link_to text, url, :remote => true, :method => method, :class => css
end 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+ # Returns the css class used to identify watch links for a given +object+
def watcher_css(objects) def watcher_css(objects)
objects = Array.wrap(objects) objects = Array.wrap(objects)

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

@ -23,6 +23,11 @@ class Changeset < ActiveRecord::Base
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# end # 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 :issues
has_and_belongs_to_many :parents, has_and_belongs_to_many :parents,
:class_name => "Changeset", :class_name => "Changeset",

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

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

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

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

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

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

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

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

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

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

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

@ -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| %> <%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
@ -20,14 +20,21 @@
<em class="info"><%="#{l(:label_mail_attention)} "%></em></p> <em class="info"><%="#{l(:label_mail_attention)} "%></em></p>
<p><%= f.select :language, lang_options_for_select %></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? %> <% if Setting.openid? %>
<p><%= f.text_field :identity_url %></p> <p><%= f.text_field :identity_url %></p>
<% end %> <% end %>
<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %> <% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
<p><%= custom_field_tag_with_label :user, value %></p> <p><%= custom_field_tag_with_label :user, value %></p>
<% end %> <% end %>
</div> </div>
<%= submit_tag l(:button_submit) %> <%= submit_tag l(:button_submit) %>
<% end %> <% end %>

@ -19,11 +19,17 @@
<% elsif bid.reward_type == 2%> <% elsif bid.reward_type == 2%>
<strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong>
<% else %> <% 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 %> <% 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> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> -->
<span class="font_lighter">(<%= link_to bid.watcher_users.count, respond_path(bid)%>)<%= l(:label_followers) %></span></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> </tr>
</table></td> </table></td>
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td> <td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>

@ -1,7 +1,7 @@
<!-- added by fq --> <!-- added by fq -->
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <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> </tr></table>
@ -11,14 +11,14 @@
<% if journals.size >0 %> <% if journals.size >0 %>
<% remove_allowed = (User.current.id == journals.first.jour_id) %>
<% for journal in journals%> <% for journal in journals%>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<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 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"> <td><table width="580px" border="0">
<tr> <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>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td> <td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
@ -26,17 +26,18 @@
<tr> <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> <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? %> <% 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))%> :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), <%= 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)) if remove_allowed || journal.user_id == User.current.id %></td> :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %></td>
<% else %> <% 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))%> :method => 'post', :title => l(:button_quote))%>
<% end %> <% end %>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>
</table> </table>
<div class="line_under"></div>
<% end %> <% end %>
<% end %> <% end %>

@ -1,7 +1,7 @@
<!-- fq --> <!-- fq -->
<%= render_flash_messages %> <%= render_flash_messages %>
<table width="1000px" border="0" style="padding-left: 15px"> <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? %> <% if User.current.logged? %>
<td> <td>
<div class='icon icon-add'> <div class='icon icon-add'>
@ -20,17 +20,17 @@
<div style="width: 50px; height: 50px;"> <div style="width: 50px; height: 50px;">
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %> <%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
</div></td> </div></td>
<td width="60%"> <td width="60%" valign="top">
<table width="100%"> <table width="100%" valign="top">
<tr> <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> <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> <tr></tr>
<tr> <tr>
<td><%= b_project.project.description %></td> <td valign="top"><%= b_project.project.description %></td>
</tr> </tr>
<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> </tr>
</table></td> </table></td>
<td width="30%"> <td width="30%">
@ -40,7 +40,7 @@
<td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td> <td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
</tr> </tr>
<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> </tr>
</table> </table>
</div></td> </div></td>

@ -28,6 +28,21 @@
</div> </div>
<% end %> <% 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"> <div id="bid-show">
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> <%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div> </div>

@ -5,6 +5,14 @@
<td><table width="100%" border="0"> <td><table width="100%" border="0">
<tr> <tr>
<td><h3><%= link_to(@bid.author.name, user_path(@bid.author))%><%= @bid.name %></h3></td> <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>
<tr> <tr>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%> <% if @bid.reward_type.nil? or @bid.reward_type == 1%>
@ -12,7 +20,7 @@
<% elsif @bid.reward_type == 2%> <% 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> <td><strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= @bid.budget%></span></strong></td>
<% else %> <% 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 %> <% end %>
</tr> </tr>
</table></td> </table></td>
@ -23,7 +31,7 @@
<tr> <tr>
<td></td> <td></td>
</tr> </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> </table>
</div> </div>

@ -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) %> <%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
</div> </div>

@ -1,3 +1,4 @@
<!-- added by baiyu --> <!-- added by baiyu -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -49,6 +50,21 @@ body table tr td p span4 {
body table tr td p span4 { body table tr td p span4 {
font-weight: bold; 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> </style>
</head> </head>
@ -66,7 +82,8 @@ body table tr td p span4 {
<table width="900" border="0"> <table width="900" border="0">
<tr> <tr>
<td>&nbsp;</td> <td><p>&nbsp;</p>
<p><span6>Windows</span6></p></td>
</tr> </tr>
</table> </table>
<table width="900" border="0"> <table width="900" border="0">
@ -126,7 +143,8 @@ body table tr td p span4 {
<td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td> <td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td>
</tr> </tr>
<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>
<tr> <tr>
<td align="left"><p >接着可以定制上下文菜单:</p> <td align="left"><p >接着可以定制上下文菜单:</p>
@ -265,11 +283,59 @@ body table tr td p span4 {
</tr> </tr>
</table> </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"> <table width="900" border="0">
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </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>
<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"> <table width="831" border="0">
<tr> <tr>
<td width="825" align="right">——Trustie团队</td> <td width="825" align="right">——Trustie团队</td>

@ -30,10 +30,10 @@ body p {
body table tr td p { body table tr td p {
color: #333; color: #333;
font-family: "Comic Sans MS", cursive; font-family: "Comic Sans MS", cursive;
font-weight: normal;
} }
body table tr td table tr td span1 { body table tr td table tr td span1 {
color: #09c; color: #09c;
font-weight: bold;
} }
body table tr td span1 { body table tr td span1 {
color: #09c; color: #09c;
@ -45,6 +45,22 @@ span3 {
span4 { span4 {
color: #F00; 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> </style>
</head> </head>
@ -66,6 +82,11 @@ span4 {
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</table>
<table width="900" border="0">
<tr>
<td><span6>Windows</span6></td>
</tr>
</table> </table>
<table width="900" border="0"> <table width="900" border="0">
<tr> <tr>
@ -122,7 +143,8 @@ span4 {
<table width="900" border="0"> <table width="900" border="0">
<tr> <tr>
<td><p>Right-click on the desktop and select the &quot;Settings&quot; in the &quot;TortoiseGit&quot;</p> <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>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>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> <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>
@ -256,11 +278,56 @@ span4 {
</tr> </tr>
</table> </table>
<table width="900" border="0">
<tr>
<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"> <table width="900" border="0">
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </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> </table>
<p>&nbsp;</p>
<table width="831" border="0"> <table width="831" border="0">
<tr> <tr>
<td width="825" align="right">—— By Trustie Team</td> <td width="825" align="right">—— By Trustie Team</td>

@ -1,7 +1,9 @@
<% reply_links = authorize_for('issues', 'edit') -%> <% reply_links = authorize_for('issues', 'edit') -%>
<% for journal in journals %> <% 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"> <table width="660px" border="0" align="center">
<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 colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>

@ -1,6 +1,6 @@
<!--add by huang--> <!--add by huang-->
<h3 style="padding-top:0px;"><%= l(:field_issue) %> <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, <%= 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' %> :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
</div> </div>

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

@ -5,14 +5,15 @@
<div id="account"> <div id="account">
<%= render_menu :account_menu -%> <%= render_menu :account_menu -%>
</div> </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? %> <%= 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? %> <%= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
</div> </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 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 %> <%= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
</div> </div> -->
<!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> --> <!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} --> <!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} -->
<!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> --> <!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->

@ -53,7 +53,7 @@
<% elsif @bid.reward_type == 2%> <% elsif @bid.reward_type == 2%>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td> <td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
<% else %> <% 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 %> <% end %>
</tr> </tr>
<tr> <tr>
@ -62,7 +62,9 @@
</tr> </tr>
</table> </table>
<div> <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> </div>
<div class="user_fans"> <div class="user_fans">

@ -36,6 +36,7 @@
<td align="center"> <td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all"> <div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= textilizable @project.name %> <%= textilizable @project.name %>
<%= join_in_course(@project, User.current)%>
</div> </div>
</td> </td>
</tr> </tr>
@ -52,18 +53,37 @@
<% files_count += version.attachments.count %> <% files_count += version.attachments.count %>
<% end %> <% 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 "#{@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"> <tr class="font_aram">
<td align="center" width="80px"> <%= l(:label_course_student) %></td> <td align="center" width="80px"> <%= " 成员" %></td>
<td align="center" width="80px"> <%= l(:label_homework) %></td> <td align="center" width="80px"> <%= "缺陷" %></td>
<td align="center" width="80px"><%= l(:label_course_data) %></td> <td align="center" width="80px"><%= l(:label_course_data) %></td>
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
</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--> <!--description-->
<div class="inf_user_context"> <div class="inf_user_context">
<div class="font_title_left"> <div class="font_title_left">
@ -115,17 +135,14 @@
</div> </div>
</div> </div>
<div id="content"> <div id="content">
<div>教师名称:<%= @course.name%></div> <div class="tabs_new">
<div>所在单位:并行与分布重点实验室</div>
<div>课程学分:<%=@course.code%></div>
<div>课程学时:<%=@course.time%></div>
<div>XXXXXXXXXXXX</div>
<div class="tabs">
<ul> <ul>
<li><%= link_to(l(:label_overview), project_path(@project))%></li> <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_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_course_file), project_file_path(@project))%></li>
<li><%= link_to(l(:label_settings),{:controller => 'projects', :action => 'settings', :id => @project, :course => 1})%></li></ul> <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> </div>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>

@ -34,7 +34,7 @@
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td> <td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="center"> <td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all"> <div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= textilizable @project.name %> <%= @project.name %>
</div> </div>
<div> <div>
<% unless User.current.member_of? @project %> <% unless User.current.member_of? @project %>
@ -56,12 +56,16 @@
<% end %> <% 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) %></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 "#{@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"> <tr class="font_aram">
<td align="center" width="80px"> <%= l(:label_member) %></td> <td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="80px"> <%= l(:label_project_issues) %></td> <td align="center" width="100px"><%= l(:label_user_watchered) %></td>
<td align="center" width="80px"><%= l(:label_attachment) %></td> <td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<!-- <td align="center" width="58px"><%= l(:label_attachment) %></td> -->
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
@ -79,7 +83,7 @@
<%= textilizable @project.description %> <%= textilizable @project.description %>
</div> </div>
<div class="created_on_project"> <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> </div>
<div class="user_underline"></div> <div class="user_underline"></div>

@ -47,24 +47,24 @@
</table> </table>
<div> <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> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
<!--info--> <!--info-->
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" width="220"> <table style="font-family:微软雅黑" width="240">
<tr> <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>
<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>
<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> </tr>
</table> </table>
@ -75,9 +75,11 @@
<!-- <div class="user_fans"> --> <!-- <div class="user_fans"> -->
<!-- added by william -for tag --> <!-- added by william -for tag -->
<!-- <div class="user_tags"> --> <!-- <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"}%> <%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div> </div>
</div>
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->
@ -103,7 +105,7 @@
<!--fans--> <!--fans-->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <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) %> <% 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> <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 %> <% end %>
@ -123,11 +125,9 @@
<div id="content" style="padding-top: 0px;"> <div id="content" style="padding-top: 0px;">
<div class="tabs_new"> <div class="tabs_new">
<% if @user == User.current %>
<%= render_menu :user_menu_self %>
<%else%>
<%= render_menu :user_menu %> <%= render_menu :user_menu %>
<%end%>
</div> </div>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>

@ -35,7 +35,9 @@
<%= f.text_field :mail, :required => true %> <%= f.text_field :mail, :required => true %>
</p> </p>
<p style="width:426px;padding-left:26px;> <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> </p>
<% if Setting.openid? %> <% if Setting.openid? %>
<p> <p>
@ -55,7 +57,7 @@
<legend onclick="toggleFieldset(this);"> <legend onclick="toggleFieldset(this);">
<%= l(:field_mail_notification)%> <%= l(:field_mail_notification)%>
</legend> </legend>
<div> <div style="padding-left: 26px;"> <!-- modified by ming -->
<p style="width:380px;> <p style="width:380px;>
<%= render :partial => 'users/mail_notifications' %> <%= render :partial => 'users/mail_notifications' %>
</p></div> </p></div>
@ -65,11 +67,11 @@
<legend onclick="toggleFieldset(this);"> <legend onclick="toggleFieldset(this);">
<%= l(:label_preferences)%> <%= l(:label_preferences)%>
</legend> </legend>
<div> <div style="padding-left: 26px;"> <!-- modified by ming -->
<%= render :partial => 'users/preferences' %></div> <%= render :partial => 'users/preferences' %></div>
</fieldset> </fieldset>
<!-- added by william --> <!-- 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);"> <legend onclick="toggleFieldset(this);">
<%= l(:label_user_extensions)%> <%= l(:label_user_extensions)%>
</legend> </legend>

@ -41,7 +41,7 @@
<% @newss.each do |news| %> <% @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;"> <table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <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"> <td><table width="580px" border="0">
<tr> <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> <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> <td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= news.created_on %></span></td> <td align="left"><span class="font_lighter"> <%= format_time(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 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> </tr>
</table></td> </table></td>
</tr> </tr>

@ -22,33 +22,27 @@
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>
<% end %> <% 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 id="comments" style="margin-bottom:16px;">
<div style="margin-bottom:15px"> <div style="margin-bottom:15px">
<span class="font_description"> <%= @news.description %> </span> <span class="font_description"> <%= @news.description %> </span>
<br/>
<%= link_to_attachments @news %>
<br/>
<!--add comment--> <!--add comment-->
<% if @news.commentable? %> <% if @news.commentable? %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> <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 %> <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box"> <div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %> <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %> <%= wikitoolbar_for 'comment_comments' %>
</div> </div>
<p><%= submit_tag l(:button_add) %></p> <p>
<%= submit_tag l(:button_add) %>
</p>
<% end %> <% end %>
<% end %> <% end %>
@ -68,13 +62,16 @@
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td> <td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td>
<td><table width="580px" border="0"> <td>
<table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong><%=link_to_user(comment.author) if comment.respond_to?(:author) %> <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>
</strong> <span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"> <%= textilizable(comment.comments) %></p></td> <td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable(comment.comments) %>
</p></td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= @news.created_on %></span></td> <td align="left"><span class="font_lighter"> <%= @news.created_on %></span></td>

@ -12,9 +12,10 @@
<% end %></p> <% end %></p>
<p style="margin-left:-10px;"><%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %></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| %> <%= 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 :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 :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 %> <% end %>
<p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> <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> <p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>

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

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

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

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

@ -1,7 +1,7 @@
<!--Added by nie--> <!--Added by nie-->
<div class="project-block"> <div class="project-block">
<div class="img-tag"> <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>
<div class="wiki-description"> <div class="wiki-description">
<p> <p>
@ -10,10 +10,10 @@
</div> </div>
<div class="information"> <div class="information">
<p class="stats"> <p class="stats">
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', 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>
<p class="stats"> <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>
<p class="stats"> <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)) %> <%= 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>
<div class="add-info"> <div class="add-info">
<div class="main-language"> <div class="main-language">
<!-- add by huang -->
<% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %>
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %> <%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
<!-- end -->
<!-- <%= content_tag('span', "#{l(:default_role_manager)}: ") %> -->
<% @admin = @project.project_infos%> <% @admin = @project.project_infos%>
<% if @admin.size > 0 %> <% if @admin.size > 0 %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %> <%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>

@ -1,24 +1,34 @@
<!-- fq --> <!-- fq -->
<h3><%= l(:label_user_response) %></h3> <h3><%= l(:label_user_response) %></h3>
<%= render_flash_messages %>
<% if @jour.size >0 %> <% if @jour.size >0 %>
<% for journal in @jour%> <% for journal in @jour%>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<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 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"> <td>
<table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <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>
<span class="font_lighter">对项目进行了反馈</span>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td> <td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable journal.notes%>
</p></td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td> <td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a"> <td width="200" align="right" class="a">
</td> <% 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> </tr>
</table></td> </table></td>
</tr> </tr>

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

@ -2,7 +2,7 @@
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %> <% end %>
<%= form_tag(projects_path, :method => :get) do %> <%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<div class="project-search-block"> <div class="project-search-block">
<table width="100%" valign="center"> <table width="100%" valign="center">
<tr> <tr>
@ -19,6 +19,22 @@
</div> </div>
<% end %> <% 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"> <div id="projects-index">
<%= render_project_hierarchy(@projects)%> <%= render_project_hierarchy(@projects)%>
</div> </div>

@ -1,8 +1,8 @@
<h3><%=l(:label_course_new_homework)%></h3> <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"> <div class="box tabular">
<%= render :partial => 'bids/form', :locals => { :f => f } %> <%= render :partial => 'homework_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= javascript_tag "$('#bid_name').focus();" %> <%= javascript_tag "$('#bid_name').focus();" %>
<% end %> <% end %>

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

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

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

@ -42,5 +42,9 @@
</div> </div>
</div> </div>
<% else %> <% 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 %> <% end %>

@ -44,7 +44,12 @@
<% for tracker in @trackers %> <% for tracker in @trackers %>
<li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>: <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, <%= 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> </li>
<% end %> <% end %>
</ul> </ul>

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

@ -76,8 +76,9 @@
<% end %> <% end %>
<% 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 %> <% content_for :header_tags do %>

@ -3,7 +3,7 @@
<div class="box tabular settings"> <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 :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> <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 %> <% locale = User.current.language.blank? ? ::I18n.locale : User.current.language %>

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

@ -2,14 +2,14 @@
<ul style="list-style-type: none"> <ul style="list-style-type: none">
<% for rt in related_tags %> <% for rt in related_tags %>
<li> <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"> <span id="tag">
<%= rt %> <%= rt %>
</span> </span>
<% @issue_size = Issue.tagged_with("#{rt}").size %> <!-- 这里用例计数某类对象的所有该tag总数 -->
<% @project_size = Project.tagged_with(rt).size %> <%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => rt }%>
<% @user_size = User.tagged_with("#{rt}").size %>
(<%= @user_size + @project_size + @issue_size %>)
</li> </li>
<% end %> <% end %>
</ul> </ul>

@ -2,12 +2,11 @@
<ul style="list-style-type: none"> <ul style="list-style-type: none">
<% for sg in selected_tags %> <% for sg in selected_tags %>
<li> <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> <span id="tag"><%= sg %> </span>
<% @issue_size = Issue.tagged_with("#{sg}").size %> <%= render :partial => 'sidebar_tags',:locals => {:show_flag => obj_flag,:sg => sg }%>
<% @project_size = Project.tagged_with(sg).size %>
<% @user_size = User.tagged_with("#{sg}").size %>
(<%= @user_size + @project_size + @issue_size %>)
</li> </li>
<% end %> <% end %>
</ul> </ul>

@ -3,9 +3,11 @@
<hr /> <hr />
<% bids_results.each do |bid| %> <% bids_results.each do |bid| %>
<p class="font_description2"> <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 /> <br />
<strong><%= l(:label_tags_bid_description) %>:</strong><%= bid.description %> <strong><%= l(:label_tags_bid_description) %>:</strong><%= bid.description %>
<%= bid.updated_on %>
</p> </p>
<div class="line_under"></div> <div class="line_under"></div>
<% end %> <% end %>

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

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

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

@ -4,6 +4,7 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags ,:show_flag => @show_flag })%>') :locals => {:related_tags => $related_tags ,:show_flag => @show_flag })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results, $('#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 })%>')

@ -4,5 +4,7 @@ $('#related_tags').html('<%= j(render :partial => "related_tags",
:locals => {:related_tags => $related_tags,:show_flag => @show_flag })%>') :locals => {:related_tags => $related_tags,:show_flag => @show_flag })%>')
$('#show_results').html('<%= j(render :partial => "tag_search_results",:locals => {:issues_results => @issues_results, $('#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 })%>')

@ -2,12 +2,14 @@
<div> <div>
<h3><strong><%= l(:label_tags_selected) %></strong></h3> <h3><strong><%= l(:label_tags_selected) %></strong></h3>
<div id="selected_tags"> <div id="selected_tags">
<%= render :partial => "selected_tags",:locals => {:selected_tags => $selected_tags,:show_flag => @obj_flag}%> <%= render :partial => "selected_tags",:locals => {
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div> </div>
<h3><strong><%= l(:label_tags_related) %></strong></h3> <h3><strong><%= l(:label_tags_related) %></strong></h3>
<div id="related_tags"> <div id="related_tags">
<%= render :partial => "related_tags",:locals => {:related_tags => $related_tags,:show_flag => @obj_flag }%> <%= render :partial => "related_tags",:locals => {:related_tags => @related_tags,
:selected_tags => @selected_tags,:obj_flag => @obj_flag,:obj_id => @obj_id }%>
</div> </div>
</div> </div>
<% end %> <% end %>
@ -23,8 +25,11 @@
</div> </div>
<div id="show_results"> <div id="show_results">
<%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_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}%> :projects_results => @projects_results,:users_results => @users_results ,
:bids_results=>@bids_results,:show_flag => @obj_flag}%>
</div> </div>
</div> </div>
<% end %> <% end %>

@ -5,7 +5,7 @@
<div id="show_all_tags"> <div id="show_all_tags">
<% for tag in @tags %> <% for tag in @tags %>
<span id="tag" class="tag<%= tag.id %>"> <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> </span>
<% end %> <% end %>
<% end %> <% end %>

@ -5,7 +5,7 @@
<h3><%= l(:label_user_plural)%></h3> <h3><%= l(:label_user_plural)%></h3>
<%= form_tag(users_path, :method => :get) do %> <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<fieldset> <fieldset>
<legend> <legend>
<%= l(:label_filter_plural) %> <%= l(:label_filter_plural) %>
@ -72,7 +72,7 @@
<div class="project-search-block"> <div class="project-search-block">
<span><%= l(:label_user_plural)%></span> <span><%= l(:label_user_plural)%></span>
<%= form_tag(users_path, :method => :get) do %> <%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
<!-- <fieldset> <!-- <fieldset>
<legend> <legend>
<%= l(:label_filter_plural) %> <%= l(:label_filter_plural) %>
@ -84,7 +84,22 @@
<% end %> <% end %>
</div> </div>
</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"> <div class="autoscroll">
<% for user in @users -%> <% for user in @users -%>
@ -99,18 +114,18 @@
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %> <%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
</div> </div>
<div style="margin-top: 20px;margin-left:66px"> <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) %> <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
</div> </div>
<div class="user-bottom"> <div class="user-bottom">
<% unless user.memberships.empty? %> <% 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 %> <% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %> <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %> <% end %>
<% 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>
</div> </div>
<% end -%> <% end -%>

@ -13,12 +13,12 @@
<% if e.instance_of?(JournalsForMessage)%> <% if e.instance_of?(JournalsForMessage)%>
<% if e.reply_id == User.current.id%> <% if e.reply_id == User.current.id%>
<%if e.jour_type == 'Bid'%> <%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 %> <% 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 %> <% end %>
<% else %> <% 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 %> <% end %>
<% else %> <% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %> <% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>

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

@ -1,3 +1,7 @@
<% if User.current.id == @user.id%>
<%= show_activity @state%>
<% end %>
<% unless @state == 2%>
<% unless @activity.empty? %> <% unless @activity.empty? %>
<div id="activity"> <div id="activity">
<% @activity.each do |e| %> <% @activity.each do |e| %>
@ -13,9 +17,9 @@
<% when 'Bid' %> <% when 'Bid' %>
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<tr> <tr>
@ -28,13 +32,15 @@
<td> <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> <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' %> <% when 'Journal' %>
<!-- modified by bai -->
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<!-- end -->
<tr> <tr>
<td colspan="2" width="580" > <td colspan="2" width="580" >
<p class="font_description"> <p class="font_description">
@ -47,9 +53,9 @@
<% when 'Changeset' %> <% when 'Changeset' %>
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<tr> <tr>
@ -64,9 +70,9 @@
<% when 'Message' %> <% when 'Message' %>
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<tr> <tr>
@ -75,15 +81,32 @@
<%= textilizable act.content %> <%= textilizable act.content %>
</p></td> </p></td>
</tr> </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> <tr>
<td> <td>
<div style="display: inline-block; float: right; margin-top: 0px"></div> <div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'News' %> <% when 'News' %>
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<tr> <tr>
@ -96,13 +119,15 @@
<td> <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> <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' %> <% when 'Issue' %>
<!-- modified by bai -->
<tr> <tr>
<% if e.user == User.current%> <% 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 %> <% 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 %> <% end %>
</tr> </tr>
<!-- end -->
<tr> <tr>
<td colspan="2" width="580" > <td colspan="2" width="580" >
<p class="font_description"> <p class="font_description">
@ -143,3 +168,62 @@
</p> </p>
<% end %> <% end %>
<% 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 %>

@ -1,5 +1,5 @@
<!--add by huang--> <!--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"> <div class="inf_user_image">
<% for user in @user.watcher_users %> <% for user in @user.watcher_users %>
<ul class="list_watch"><li> <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 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"> <td><table width="580px" border="0">
<tr> <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> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"> <td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %> <% 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 %> <% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %> <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %> <% end %>

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

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

@ -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 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"> <td><table width="580px" border="0">
<tr> <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> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"> <td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %> <% 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 %> <% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %> <%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %> <% end %>

@ -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;"> <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> <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> <td>
<table width="100%" border="0"> <table width="100%" border="0">
<tr> <tr>
@ -16,14 +16,26 @@
<tr> <tr>
<td width="500"> <td width="500">
<table border="0"> <table border="0">
<tr> <tr><td>
<td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> <% if bid.reward_type.nil? or bid.reward_type == 1%>
<td class="font_lighter">(<%= bid.biding_projects.count%>)<%= l(:label_biding_project) %></td> <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>
<td class="font_lighter">(<%= bid.commit %>)<%= l(:label_responses) %></td> <% elsif bid.reward_type == 2%>
<td class="font_lighter">(<%= bid.watcher_users.count%>)<%= l(:label_followers) %></td> <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> </tr>
</table></td> </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>
<tr> <tr>
<td> <td>

@ -1,5 +1,5 @@
<!--modified by young--> <!--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) %> <%= link_to l(:label_version_new), new_project_version_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %>
</div> </div>

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

@ -1,5 +1,2 @@
<% selector = ".#{watcher_css(watched)}" %> <% selector = ".#{watcher_css(watched)}" %>
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); $("<%= 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) }
) %>');

@ -139,9 +139,9 @@ software development and software crowdsourcing.</td></tr>
<!--add by huang--> <!--add by huang-->
<div style="height:280px;"> <div style="height:280px;">
<div class="welcone_left"> <div class="welcone_left">
<table width="400px"> <table width="388px">
<tr> <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>
<!-- <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> <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 %> <% else %>
<div> <div>
<!--info--> <!--info-->
<!-- modified by bai -->
<table width="200" border="0"> <table width="200" border="0">
<tr> <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>
<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 <td rowspan="2" style="padding-left: 20px"><%=link_to image_tag(url_to_avatar(User.current), :class => 'avatar'), user_path(User.current) %></td>
<%= 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><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>
<tr> <tr>
<td><% unless User.current.memberships.empty? %> <td align="left"><% unless User.current.memberships.empty? %>
<%= l(:label_welcome_page_to, :project_count => "#{User.current.memberships.count}") %> <!-- <% for member in User.current.memberships %> <%= 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) ? '' : '' %> <%= link_to_project(member.project) %><%= (User.current.memberships.last == member) ? '' : '' %>
<% end %> --> <% end %></td> <% end %> --> <% end %></td>
</tr> </tr>
</table> </table>
<!-- end -->
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

@ -21,12 +21,12 @@
<td align="left"><span class="font_lighter"> <%= format_time journal.created_on %></span></td> <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 %> <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))%> :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> :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 %> <% 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))%> :method => 'post', :title => l(:button_quote))%>
<% end %> <% end %>
</tr> </tr>

@ -2,12 +2,12 @@
<style> <style>
input[type="submit"].bid_btn { input[type="submit"].bid_btn {
vertical-align: middle; vertical-align: middle;
width: 60px; width: 60px;/*modified by ming*/
height: 30px; height: 25px;
line-height: 18px; line-height: 19px;
font-size: 14px; font-size: 14px;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
border: 1px solid rgb(148, 148, 148); border: 1px solid rgb(148, 148, 148);
@ -17,12 +17,12 @@
/*margin-right: -4px;*/ /*margin-right: -4px;*/
} }
input[type="button"].bid_btn { input[type="button"].bid_btn {
width: 60px; width: 60px;/*modified by ming*/
height: 30px; height: 25px;
line-height: 18px; line-height: 19px;
font-size: 14px; font-size: 14px;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
border: 1px solid rgb(148, 148, 148); border: 1px solid rgb(148, 148, 148);

@ -223,6 +223,7 @@ en:
field_firstname: First name field_firstname: First name
field_lastname: Last name field_lastname: Last name
field_mail: Email field_mail: Email
field_job_category: Job category # added by bai
field_filename: File field_filename: File
field_filesize: Size field_filesize: Size
field_downloads: Downloads field_downloads: Downloads
@ -482,6 +483,7 @@ en:
label_user_new: New user label_user_new: New user
label_user_anonymous: Anonymous label_user_anonymous: Anonymous
label_project: Project label_project: Project
label_activity_project: 'Project: ' #added by bai
label_project_new: New project label_project_new: New project
label_project_plural: Projects label_project_plural: Projects
label_x_projects: label_x_projects:
@ -551,6 +553,7 @@ en:
label_overall_activity: Overall activity label_overall_activity: Overall activity
label_user_activity: "%{value}'s activity" label_user_activity: "%{value}'s activity"
label_new: New label_new: New
label_new_user: registered a new account
label_logged_as: Logged in as label_logged_as: Logged in as
label_environment: Environment label_environment: Environment
label_authentication: Authentication label_authentication: Authentication
@ -660,6 +663,7 @@ en:
label_in_more_than: in more than label_in_more_than: in more than
label_in_the_next_days: in the next label_in_the_next_days: in the next
label_in_the_past_days: in the past label_in_the_past_days: in the past
label_in_users: 'in the user '
label_greater_or_equal: '>=' label_greater_or_equal: '>='
label_less_or_equal: '<=' label_less_or_equal: '<='
label_between: between label_between: between
@ -1091,14 +1095,14 @@ en:
#modify by mkz #modify by mkz
#by young #by young
label_requirement: Calls label_requirement: Calls
label_requirement_focus: Requirement focus label_requirement_focus: Calls # modified by bai
label_developer: Users label_developer: Users
label_investor: Investor label_investor: Investor
label_theme: Theme label_theme: Theme
label_logged_as_new: Current user label_logged_as_new: Current user
button_register: Register button_register: Register
issue_list: Issue list issue_list: Issue list
lastest_respond: Lastest respond lastest_respond: Lastest reply
label_news_lastest: Lastest news label_news_lastest: Lastest news
label_version_display_settings: Display settings label_version_display_settings: Display settings
label_versions_progress: Complete schedule label_versions_progress: Complete schedule
@ -1113,12 +1117,19 @@ en:
label_file_new: Download label_file_new: Download
label_user_edit: "Edit information" label_user_edit: "Edit information"
label_user_info: "User information" #huang 添加 label_user_info: "User information" #huang 添加
label_user_watcher: "Followers" # huang添加的 label_user_watcher: "Following" # huang添加的 # modified by bai
label_user_fans: "Fans" label_user_fans: "Followed by" # modified by bai
# modify by men
label_x_user_fans:
zero: fan
one: fan
other: fans
#end
label_user_commits: "Code commits" label_user_commits: "Code commits"
label_user_watchered: "Followed" # huang添加的 label_user_watchered: "Followed by" # huang添加的
label_user_newfeedback: "Leave a message" ## huang添加的 label_user_newfeedback: "Messages" ## huang添加的 # modified by bai
label_user_login: "Lastest login:" label_user_login: "Last login:"
label_user_mail: "E-mail:" label_user_mail: "E-mail:"
label_user_joinin: "Join date:" label_user_joinin: "Join date:"
label_user_activities: "You have no activities,come and join us!" label_user_activities: "You have no activities,come and join us!"
@ -1138,7 +1149,7 @@ en:
button_follow: Follow button_follow: Follow
label_delete_confirm: Confirm delete label_delete_confirm: Confirm delete
label_more_tags: More label_more_tags: More
label_tags_bid: call name label_tags_bid: Call name
label_tags_bid_description: call description label_tags_bid_description: call description
label_tags_issue_description: issue description label_tags_issue_description: issue description
label_tags_all_objects: all objects label_tags_all_objects: all objects
@ -1150,45 +1161,90 @@ en:
label_message: message board label_message: message board
field_add: Add before %{time} field_add: Add before %{time}
button_more: More button_more: More
label_user_response: User responses label_user_response: Feedbacks # modified by bai
label_bidding_project: projects label_bidding_project: projects
button_bidding: I will participate in it button_bidding: I will participate in it
label_new_call: New call label_new_call: New call
label_user_information: "My information" label_user_information: My informations
#Customer addedAdded by nie #Customer addedAdded by nie
label_create_time: Created time label_create_time: Created time
label_current_contributors: current contributors label_current_contributors: current contributors
#modify by men
label_x_current_contributors:
zero: current contributor
one: current contributor
other: current contributors
#end
label_lines_of_code: lines of code label_lines_of_code: lines of code
label_since_last_commits: since last commit label_since_last_commits: since last commit
label_users_on_trustie: User label_users_on_trustie: User
label_front: first page label_front: first page
label_commit_on: commit times label_commit_on: commit times
label_follow_people: followers #modify by men
label_member_since: join label_x_commit_on:
label_contribute_to: Participate %{project_count} projects zero: commit time
label_total_commit: Together %{total_commit} numbers of committing one: commit time
other: commit times
#end
label_follow_people: following # modified by bai
#modify by men
label_x_follow_people:
zero: follower
one: follower
other: followers
#end
label_member_since: joined
label_contribute_to: Participates %{project_count} projects
#modify by men
label_x_contribute_to:
zero: Participates %{count} project
one: Participates %{count} project
other: Participates %{count} projects
#end
label_total_commit: Totally %{total_commit} commits # modified by bai
#modify by men
label_x_total_commit:
zero: Totally %{count} commit
one: Totally %{count} commit
other: Totally %{count} commits
#end
label_upload_profile: Upload avatar label_upload_profile: Upload avatar
label_type_as: Type as label_type_as: Type as
label_status_as: Status as label_status_as: Status as
label_priority_as: Priority as label_priority_as: Priority as
label_member_list: Member list label_member_list: Member list
label_author_name: Posted by %{author_name} label_author_name: Posted by %{author_name}
label_comments_count: (%{count} numbers of comments) label_comments_count: (%{count} comments)
label_post_on: posts on label_post_on: posts on
label_find_all_comments: view all comments label_find_all_comments: view all comments
label_updated_time_on: " Updated on %{value} " label_updated_time_on: " Updated on %{value} "
label_call_list: Calls list label_call_list: Calls list
label_requirement_list: Requirement list label_requirement_list: Requirement list
label_biding_project: projects label_x_biding_project: #modify by men
label_responses: comments zero: project
label_followers: followers one: project
other: projects
#end
label_x_responses: #modify by men
zero: comment
one: comment
other: comments
#end
label_x_followers: #modified by men
zero: follower
one: follower
other: followers
#end
label_price: price label_price: price
label_RMB_sign: label_RMB_sign:
label_investment_budget: Investment budget label_investment_budget: Investment budget
label_investment_time_limit: Investment time limit label_investment_time_limit: Investment time limit
label_my_respond: My respond label_my_respond: Feedbacks # modified by bai
label_respond_requirement: has commented this call label_respond_requirement: has commented this call
label_deadline: deadline yyyy-mm-dd label_deadline: deadline yyyy-mm-dd
label_requirement_name: give your requirement a name ~~ label_requirement_name: give your requirement a name ~~
@ -1200,7 +1256,9 @@ en:
label_leave_me_message: left a message to me label_leave_me_message: left a message to me
label_leave_others_message: leave message to him/her label_leave_others_message: leave message to him/her
label_leave_a_message: Leave him/her a message label_leave_a_message: Leave him/her a message
label_new_activity: has new activity label_new_activities: ' has new activity in' # modified by bai
label_new_activity: ' has new activity in'
label_i_new_activity: ' have new activity in'
label_create_project: had participated in label_create_project: had participated in
label_praise: praise label_praise: praise
label_cancel_praise: cancel praise label_cancel_praise: cancel praise
@ -1215,8 +1273,14 @@ en:
label_milestone_description: Review the commits, branches and versions of your project label_milestone_description: Review the commits, branches and versions of your project
label_features: Features label_features: Features
label_has_praisers: praisers(%{count}) label_has_praisers: praisers(%{count})
label_has_watchers: watchers(%{count}) label_has_watchers: following(%{count}) # modified by bai
label_has_fans: fans(%{count}) label_has_fans: followed by(%{count}) # modified by bai
#modify by men
label_x_has_fans:
zero: fan(%{count})
one: fan(%{count})
other: fans(%{count})
#end
label_me: me label_me: me
label_my: my label_my: my
label_i: I label_i: I
@ -1227,7 +1291,7 @@ en:
label_password: password label_password: password
label_about_requirement: about requirement label_about_requirement: about requirement
label_about_issue: about issue label_about_issue: about issue
label_quote_my_words: quoted my words label_quote_my_words: ' quoted my words'
label_have_respond: had a respond label_have_respond: had a respond
label_welcome: Welcome label_welcome: Welcome
@ -1285,7 +1349,7 @@ en:
label_money: money label_money: money
label_reward_1: others label_reward_1: others
label_bids_credit: credit label_bids_credit: credit
label_bids_credit_number: numbers label_bids_credit_number: points
field_budget: reward field_budget: reward
field_deadline: deadline field_deadline: deadline
label_tags_selected: Selected Tags label_tags_selected: Selected Tags
@ -1300,7 +1364,7 @@ en:
label_bid_project: projects label_bid_project: projects
label_project_no_follow: The project hasn't been followed now label_project_no_follow: The project hasn't been followed now
label_no_bid_project: has no participate project label_no_bid_project: has no participate project
label_bids_reward_method: method of reward label_bids_reward_method: reward
label_bids_reward_what: input what for reward label_bids_reward_what: input what for reward
label_call_bonus: bonus label_call_bonus: bonus
label_bids_form_new_description: Publish a requirement,a competition or a course work. label_bids_form_new_description: Publish a requirement,a competition or a course work.
@ -1310,14 +1374,43 @@ en:
label_user_login_tips: You havn't logged in,for leaving message please login first label_user_login_tips: You havn't logged in,for leaving message please login first
label_user_login_new: login label_user_login_new: login
label_project_sort: the way of sorting label_project_sort: the way of sorting
label_sort_by_time: sorting by time #modified by bai
label_sort_by_active: sorting by active label_sort_by_time: sorted by time
label_sort_by_influence: sorting by influence label_sort_by_active: sorted by active
label_sort_by_influence: sorted by influence
#end
label_bids_published: published label_bids_published: published
label_bids_published_ago: ago label_bids_published_ago: ago
label_welcome_trustie: Trustie forge label_welcome_trustie: Trustie forge
label_welcome_trustie_description: a socialized collaboration platform for project management, collaborative research, software development and software crowdsourcing for creative university students and entrepreneurs. label_welcome_trustie_description: a socialized collaboration platform for project management, collaborative research, software development and software crowdsourcing for creative university students and entrepreneurs.
label_user_project: Projects
label_bid_respond_quote: Respond
label_bid_if_agreement: If you like me, please press me #bai
label_bid_respond_delete: Delete
label_newfeedback_message: messages
label_newfeedback_quote: Respond
label_newfeedback_delete: Delete
label_user_all_activity: All activities
label_user_activity_myself: About me
label_user_all_respond: All replies
label_layouts_feedback: Messages
label_welcome_participate: participates
#modify by men
label_x_welcome_participate:
zero: participate
one: participate
other: participates
#end
label_welcome_participate_project: projects
label_projects_feedback: responded to the project
label_projects_feedback_respond: Respond
label_projects_feedback_respond_success: Respond success
button_projects_feedback_respond: Respond
label_projects_feedback_respond_content: Please input your words
label_in_issues: in the issue
label_in_bids: in the call
label_in_users: in the user
label_user_create_project: has created
label_course: Course label_course: Course
label_course_new: New course label_course_new: New course
label_public_info: If you don't choose public, only the project's members can see the project. label_public_info: If you don't choose public, only the project's members can see the project.

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

Loading…
Cancel
Save