Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-08-08 16:42:41 +08:00
commit ea0b7ef3f1
22 changed files with 136 additions and 68 deletions

View File

@ -119,8 +119,8 @@ class AccountController < ApplicationController
@user = User.new @user = User.new
@user.safe_attributes = user_params @user.safe_attributes = user_params
if params[:identity] == "2" # 2 企业 if params[:identity] == "2" # 2 企业
#@user.firstname = params[:enterprise_name] @user.firstname = params[:enterprise_name]
#@user.lastname = l(:field_enterprise) @user.lastname = l(:field_enterprise)
end end
@user.admin = false @user.admin = false
@user.register @user.register
@ -140,6 +140,15 @@ class AccountController < ApplicationController
@user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation]
end end
if(@cache_identityy == "")
flash.now[:error]= l(:label_identity)+l(:'activerecord.errors.messages.empty')
return
end
if(@cache_city == "")
flash.now[:error]= l(:label_location)+l(:'activerecord.errors.messages.empty')
return
end
case Setting.self_registration case Setting.self_registration
when '1' when '1'
register_by_email_activation(@user) register_by_email_activation(@user)

View File

@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MyController < ApplicationController class MyController < ApplicationController
layout "users_base"
before_filter :require_login before_filter :require_login
helper :issues helper :issues

View File

@ -880,6 +880,18 @@ class ProjectsController < ApplicationController
end end
end end
def exit_project
@project = Project.find params[:id]
if User.current.login?
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
if members != nil
members.destroy
end
respond_to do |format|
format.js
end
end
end
private private
def memberAccess def memberAccess
@ -1026,4 +1038,5 @@ class ProjectsController < ApplicationController
end end
#gcmend #gcmend
end end

View File

@ -56,6 +56,7 @@ class UsersController < ApplicationController
include WordsHelper include WordsHelper
include GitlabHelper include GitlabHelper
include UserScoreHelper include UserScoreHelper
helper :user_score
# added by liuping 关注 # added by liuping 关注

View File

@ -372,8 +372,8 @@ module UserScoreHelper
result.post_issue = 0 result.post_issue = 0
result.total_score = 0 result.total_score = 0
result.score_type =type result.score_type =type
unless project_id.nil? unless project.nil?
result.project_id = project_id result.project_id = project.id
end end
else else
result = option_number.first result = option_number.first
@ -416,12 +416,26 @@ module UserScoreHelper
def memo_num(user,project=nil) def memo_num(user,project=nil)
if project.nil? if project.nil?
Message.includes(:author).joins(:board).where("#{Message.table_name}.parent_id IS NULL and #{Message.table_name}.author_id = '#{user.id}' and #{Board.table_name}.project_id != -1").all.count #+ Memo.includes(:author).where("parent_id IS NULL and author_id = '#{user.id}'").all.count Message.includes(:author).joins(:board).where("#{Message.table_name}.parent_id IS NULL and #{Message.table_name}.author_id = '#{user.id}' and #{Board.table_name}.project_id != -1").all.count #+ Memo.includes(:author).where("parent_id IS NULL and author_id = '#{user.id}'").all.count
#user.messages.where("parent_id IS NULL").count
else else
Message.includes(:author).joins(:board).where("#{Message.table_name}.parent_id IS NULL and #{Message.table_name}.author_id = '#{user.id}' and #{Board.table_name}.project_id = #{project.id}").all.count Message.includes(:author).joins(:board).where("#{Message.table_name}.parent_id IS NULL and #{Message.table_name}.author_id = '#{user.id}' and #{Board.table_name}.project_id = #{project.id}").all.count
end end
end end
def memo_score(user,project=nil)
if project.nil?
User.find_by_sql("SELECT `users`.id,(SELECT COUNT(*) * 2 FROM `messages` JOIN `boards` ON boards.project_id != -1 AND messages.board_id = boards.id
WHERE messages.parent_id IS NULL AND messages.author_id = `users`.id) AS m_count
FROM `users` where id = #{user.id}")
else
User.find_by_sql("SELECT `users`.id,(SELECT COUNT(*) * 2 FROM `messages` JOIN `boards` ON boards.project_id = '#{project.id}' AND messages.board_id = boards.id
WHERE messages.parent_id IS NULL AND messages.author_id = `users`.id) AS m_count
FROM `users` where id = #{user.id}")
end
end
#更新对缺陷留言数 #更新对缺陷留言数
def update_messges_for_issue(user,type,project=nil) def update_messges_for_issue(user,type,project=nil)
option_number = get_option_number(user,type) option_number = get_option_number(user,type)
@ -437,6 +451,14 @@ module UserScoreHelper
end end
end end
def messges_for_issue_score(user,project=nil)
if project.nil?
User.find_by_sql("SELECT users.id,(SELECT COUNT(*) FROM journals WHERE journals.user_id = users.id AND journals.notes IS NOT NULL AND journals.notes != '') AS m_score FROM users where id = #{user.id}")
else
User.find_by_sql("SELECT users.id,(SELECT COUNT(*) FROM journals join issues on #{Journal.table_name}.journalized_type = 'Issue' and #{Journal.table_name}.journalized_id = #{Issue.table_name}.id WHERE journals.user_id = users.id AND journals.notes IS NOT NULL AND journals.notes != ''and #{Issue.table_name}.project_id = '#{project.id}') AS m_score FROM users where id = #{user.id}")
end
end
#更新更改缺陷状态状态次数 #更新更改缺陷状态状态次数
def update_issues_status(user,type,project=nil) def update_issues_status(user,type,project=nil)
option_number = get_option_number(user,type) option_number = get_option_number(user,type)
@ -508,8 +530,8 @@ module UserScoreHelper
def tread_num(user,project=nil) def tread_num(user,project=nil)
if project.nil? if project.nil?
result0 = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 0 and user_id = '#{user.id}'").all.count result0 = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 0 and user_id = '#{user.id}'").all.count
pts = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 0").all pts = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 0").all
result = [] result = []
result1 = [] result1 = []
result2 = [] result2 = []
@ -521,18 +543,18 @@ module UserScoreHelper
target_user = obj.author target_user = obj.author
level = UserLevels.get_level(pt.user)#pt.user.get_level level = UserLevels.get_level(pt.user)#pt.user.get_level
project = pt.project project = pt.project
if level == 1 && target_user.id = user.id if level == 1 && target_user.id == user.id
result << pt result << pt
elsif level == 2 && target_user.id = user.id elsif level == 2 && target_user.id == user.id
result1 << pt result1 << pt
elsif level == 3 && target_user.id = user.id elsif level == 3 && target_user.id == user.id
result2 << pt result2 << pt
end end
end end
[:tread=>result0,:tead_by_one => result.count,:tread_by_two => result1.count,:tread_by_three =>result2.count] {:tread=>result0,:tead_by_one => result.count,:tread_by_two => result1.count,:tread_by_three =>result2.count}
else else
result0 = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 0 and user_id = '#{user.id}'").all.count result0 = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 0 and user_id = '#{user.id}'").all.count
pts = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 0").all pts = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 0").all
result = [] result = []
result1 = [] result1 = []
result2 = [] result2 = []
@ -547,15 +569,15 @@ module UserScoreHelper
target_user = obj.author target_user = obj.author
level = UserLevels.get_level(pt.user)#pt.user.get_level level = UserLevels.get_level(pt.user)#pt.user.get_level
project = pt.project project = pt.project
if level == 1 && target_user.id = user.id if level == 1 && target_user.id == user.id
result << pt result << pt
elsif level == 2 && target_user.id = user.id elsif level == 2 && target_user.id == user.id
result1 << pt result1 << pt
elsif level == 3 && target_user.id = user.id elsif level == 3 && target_user.id == user.id
result2 << pt result2 << pt
end end
end end
[:tread=>result0,:tead_by_one => result.count,:tread_by_two => result1.count,:tread_by_three =>result2.count] {:tread=>result0,:tead_by_one => result.count,:tread_by_two => result1.count,:tread_by_three =>result2.count}
end end
end end
@ -572,7 +594,7 @@ module UserScoreHelper
def praise_num(user,project=nil) def praise_num(user,project=nil)
if !project.nil? if !project.nil?
pts = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 1").all pts = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 1").all
result = [] result = []
result1 = [] result1 = []
result2 = [] result2 = []
@ -587,17 +609,17 @@ module UserScoreHelper
target_user = obj.author target_user = obj.author
level = UserLevels.get_level(pt.user)#pt.user.get_level level = UserLevels.get_level(pt.user)#pt.user.get_level
project = pt.project project = pt.project
if level == 1 && target_user.id = user.id if level == 1 && target_user.id == user.id
result << pt result << pt
elsif level == 2 && target_user.id = user.id elsif level == 2 && target_user.id == user.id
result1 << pt result1 << pt
elsif level == 3 && target_user.id = user.id elsif level == 3 && target_user.id == user.id
result2 << pt result2 << pt
end end
end end
[:praise_by_one => result.count,:praise_by_two => result1.count,:praise_by_three => result2.count] {:praise_by_one => result.count,:praise_by_two => result1.count,:praise_by_three => result2.count}
else else
pts = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 1").all pts = PraiseTread.where("praise_tread_object_type IN ( 'Issue','Message') and praise_or_tread = 1").all
result = [] result = []
result1 = [] result1 = []
result2 = [] result2 = []
@ -612,15 +634,15 @@ module UserScoreHelper
target_user = obj.author target_user = obj.author
level = UserLevels.get_level(pt.user)#pt.user.get_level level = UserLevels.get_level(pt.user)#pt.user.get_level
project = pt.project project = pt.project
if level == 1 && target_user.id = user.id if level == 1 && target_user.id == user.id
result << pt result << pt
elsif level == 2 && target_user.id = user.id elsif level == 2 && target_user.id == user.id
result1 << pt result1 << pt
elsif level == 3 && target_user.id = user.id elsif level == 3 && target_user.id == user.id
result2 << pt result2 << pt
end end
end end
[:praise_by_one => result.count,:praise_by_two => result1.count,:praise_by_three => result2.count] {:praise_by_one => result.count,:praise_by_two => result1.count,:praise_by_three => result2.count}
end end
end end

View File

@ -246,4 +246,7 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method ,:class=>css link_to text, url, :remote => true, :method => method ,:class=>css
end end
end def exit_project_link(project)
link_to("退出项目",exit_cur_project_path(project.id),:remote => true )
end
end

View File

@ -21,8 +21,8 @@ class Repository < ActiveRecord::Base
include Redmine::Ciphering include Redmine::Ciphering
include Redmine::SafeAttributes include Redmine::SafeAttributes
# Maximum length for repository identifiers # Maximum length for repository ideflashntifiers
IDENTIFIER_MAX_LENGTH = 255 IDENTIFIER_MAX_LENGTH = 254
belongs_to :project belongs_to :project
has_many :changesets, :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC" has_many :changesets, :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC"
@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base
validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
# donwcase letters, digits, dashes, underscores but not digits only # donwcase letters, digits, dashes, underscores but not digits only
validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]+$/, :allow_blank => true validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true
# Checks if the SCM is enabled when creating a repository # Checks if the SCM is enabled when creating a repository
validate :repo_create_validation, :on => :create validate :repo_create_validation, :on => :create

View File

@ -1,4 +1,4 @@
<% if @events_by_day.size >0 %> <% if @events_by_day != nil && @events_by_day.size >0 %>
<div class="content-title-top-avtive"> <div class="content-title-top-avtive">
<!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> --> <!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> -->
<p class="subtitle"> <p class="subtitle">

View File

@ -50,15 +50,18 @@
var _v= obj; var _v= obj;
if(_v==100) if(_v==100)
{ {
//alert(3); //var select=$("select[id='issue_status_id']");
$("select[id='issue_status_id']").find("option[value='3']").attr("selected","selected");
} }
else if(_v==0) else if(_v==0)
{ {
//alert(1); //alert(1);
$("select[id='issue_status_id']").find("option[value='1']").attr("selected","selected");
} }
else if(_v!=100&&_v!=0) else if(_v!=100&&_v!=0)
{ {
// alert(2); // alert(2);
$("select[id='issue_status_id']").find("option[value='2']").attr("selected","selected");
} }
} }
</script> </script>

View File

@ -27,7 +27,7 @@
#@nav_dispaly_user_label = 1 #@nav_dispaly_user_label = 1
end end
%> %>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div class="welcome_logo"> <div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%> <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>
</div> </div>
@ -44,8 +44,8 @@
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%> <% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=true%> <% hasCourse=true%>
<li id="course_loggedas_li"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %> <li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
<ul class="course_sub_menu"> <ul class="course_sub_menu">
<% User.current.courses.each do |course| %> <% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %> <% if !course_endTime_timeout?(course) %>
<li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %></li> <li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %></li>
@ -56,7 +56,7 @@
<% end -%> <% end -%>
<% end %> <% end %>
<li id="project_loggedas_li"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %> <li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<% if hasCourse %> <% if hasCourse %>
<ul class="project_sub_menu" style="top: 35px"> <ul class="project_sub_menu" style="top: 35px">
@ -68,7 +68,7 @@
<% end %> <% end %>
</ul> </ul>
</li> </li>
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%> <li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
</li> </li>
</ul> </ul>
</li> </li>
@ -76,9 +76,9 @@
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged?%> <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged?%>
</li> </li>
</ul> </ul>
</div> </div>
<% end -%> <% end -%>
<%#= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> <%#= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%> <%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
<%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %> <%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %>
</div> </div>

View File

@ -0,0 +1,20 @@
<div style="margin-left: 20px;">
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <!--added by linchun-->
<span class="icon-fav icon"></span><%= watcher_link(@project, User.current) %>
<% end %>
</div>
<!--添加项目申请-->
<div style="margin-left: 20px;">
<% if ( !(User.current.member_of? @project) && User.current.login?) %>
<span class="icon-fav icon"></span>
<%= applied_link(@project, User.current) %>
<% end %>
</div>
<!--添加退出项目-->
<div style="margin-left: 20px;">
<% if ((User.current.member_of? @project) && User.current.login?) %>
<%= exit_project_link(@project) %>
<% end %>
</div>

View File

@ -74,20 +74,9 @@
<% end %> <% end %>
<!-- end --> <!-- end -->
</div> </div>
<div style="margin-left: 20px;"> <div id="join_exit_project_div">
<%= render 'layouts/join_exit_project' %>
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <!--added by linchun-->
<span class="icon-fav icon"></span><%= watcher_link(@project, User.current) %>
<% end %>
</div>
<!--添加项目申请-->
<div style="margin-left: 20px;">
<% if ( !(User.current.member_of? @project) && User.current.login?) %>
<span class="icon-fav icon"></span>
<%= applied_link(@project, User.current) %>
<% end %>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -13,7 +13,7 @@
<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
<%= submit_tag l(:button_apply) %> <%= submit_tag l(:label_button_ok) %>
</div> </div>
<% end %> <% end %>

View File

@ -9,8 +9,8 @@
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %> <%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
</p><!--by young--> </p><!--by young-->
<p style="display: none"><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH, <p style="display: none" ><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
value:"#{User.current.id.to_s + '_' +format_time(Time.now).to_s}" %> value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
<% unless @project.identifier_frozen? %> <% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em> <em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p> <% end %></p>

View File

@ -0,0 +1 @@
$('#join_exit_project_div').html("<%= escape_javascript(render(:partial => 'layouts/join_exit_project')) %>");

View File

@ -1,7 +1,7 @@
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> <% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path--> <% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
<% if @project.repositories.any? %> <% if @project.repositories.any? %>
<table class="list"> <table class="list" style="table-layout: fixed;">
<thead> <thead>
<tr> <tr>
<th><%= l(:field_identifier) %></th> <th><%= l(:field_identifier) %></th>
@ -14,16 +14,16 @@
<tbody> <tbody>
<% @project.repositories.sort.each do |repository| %> <% @project.repositories.sort.each do |repository| %>
<tr class="<%= cycle 'odd', 'even' %>"> <tr class="<%= cycle 'odd', 'even' %>">
<td> <td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="<%= repository.identifier %>">
<%= link_to repository.identifier, <%= link_to repository.identifier,
{:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %> {:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %>
</td> </td>
<td align="center"><%= checked_image repository.is_default? %></td> <td align="center"><%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td> <td align="center"><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%> <%if repository.scm_name=="Git"%>
<td>http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %><%=h repository.url.slice(project_path_cut, repository.url.length) %></td><!--Modified by tanxianbo--> <td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %><%=h repository.url.slice(project_path_cut, repository.url.length) %>">http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %><%=h repository.url.slice(project_path_cut, repository.url.length) %></td><!--Modified by tanxianbo-->
<%else %> <%else %>
<td><%=h repository.url %></td> <td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h repository.url %></td>
<% end %> <% end %>
<td class="buttons" style="text-align:left"> <td class="buttons" style="text-align:left">

View File

@ -12,7 +12,7 @@
<p><%= f.check_box :is_default, :label => :field_repository_is_default %></p> <p><%= f.check_box :is_default, :label => :field_repository_is_default %></p>
<p style="display: none"><%= f.text_field :identifier, :required => true, :disabled => @repository.identifier_frozen?, <p style="display: none"><%= f.text_field :identifier, :required => true, :disabled => @repository.identifier_frozen?,
value:"#{User.current.id.to_s + '_' +format_time(Time.now).to_s}"%> value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}"%>
<% unless @repository.identifier_frozen? %> <% unless @repository.identifier_frozen? %>
<em class="info" ><%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_repository_identifier_info).html_safe %></em> <em class="info" ><%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_repository_identifier_info).html_safe %></em>
<% end %></p> <% end %></p>

View File

@ -1,5 +1,6 @@
<%= l(:label_user_grade)%>: <%= l(:label_user_grade)%>:
<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_i, {:controller => 'users', <!-- user.user_score_attr.total_score -->
<%= link_to(format("%.2f" ,user_scores(user,1).total_score ).to_i, {:controller => 'users',
:action => 'show_new_score', :action => 'show_new_score',
:remote => true, :remote => true,
:id => user.id :id => user.id

View File

@ -132,7 +132,7 @@
</ul> </ul>
</div> </div>
<% else %> <% else %>
<% if school_course.count < 9 %> <% if school_course.count < 10 %>
<span> <span>
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %> <%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
</span> </span>
@ -181,7 +181,7 @@
</li> </li>
<%end%> <%end%>
<% end; reset_cycle %> <% end; reset_cycle %>
<% if school_course.count < 9 %> <% if school_course.count < 10 %>
<li> <li>
<h1></h1> <h1></h1>
@ -189,7 +189,7 @@
该学校开设课程较少,您可以查看其他学校课程 该学校开设课程较少,您可以查看其他学校课程
</p> </p>
</li> </li>
<% find_all_new_hot_course(9 - school_course.count, @school_id).map do |course| %> <% find_all_new_hot_course(10 - school_course.count, @school_id).map do |course| %>
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>

View File

@ -1158,6 +1158,7 @@ en:
#huang #huang
label_file_new: Download label_file_new: Download
label_user_edit: "Edit information" label_user_edit: "Edit information"
label_my_course: "My Course"
label_user_info: "User information" #huang 添加 label_user_info: "User information" #huang 添加
label_user_watcher: "Following" # huang添加的 # modified by bai label_user_watcher: "Following" # huang添加的 # modified by bai
label_user_fans: "Followed by" # modified by bai label_user_fans: "Followed by" # modified by bai
@ -1196,6 +1197,7 @@ en:
label_tags_issue_description: issue description label_tags_issue_description: issue description
label_tags_all_objects: all objects label_tags_all_objects: all objects
label_apply_project: Apply Project label_apply_project: Apply Project
label_exit_project: Exit Project
label_apply_project_waiting: "Application has been submitted, please wait for administrator review." label_apply_project_waiting: "Application has been submitted, please wait for administrator review."
label_unapply_project: Unsubscribe label_unapply_project: Unsubscribe

View File

@ -315,7 +315,7 @@ zh:
field_auth_source: 认证模式 field_auth_source: 认证模式
field_hide_mail: 隐藏我的邮件地址 field_hide_mail: 隐藏我的邮件地址
field_comments: 注释 field_comments: 注释
field_url: URL field_url: 路径
field_start_page: 起始页 field_start_page: 起始页
field_subproject: 子项目 field_subproject: 子项目
field_hours: 小时 field_hours: 小时
@ -979,7 +979,7 @@ zh:
label_change_properties: 修改属性 label_change_properties: 修改属性
label_general: 一般 label_general: 一般
label_more: 更多>> label_more: 更多>>
label_scm: SCM label_scm: 管理系统
label_plugins: 插件 label_plugins: 插件
label_ldap_authentication: LDAP 认证 label_ldap_authentication: LDAP 认证
label_downloads_abbr: D/L label_downloads_abbr: D/L
@ -1409,6 +1409,7 @@ zh:
label_tags_issue_description: 问题描述 label_tags_issue_description: 问题描述
label_tags_all_objects: 所有 label_tags_all_objects: 所有
label_apply_project: 申请加入 label_apply_project: 申请加入
label_exit_project: 退出项目
label_apply_project_waiting: 已处理申请,请等待管理员审核 label_apply_project_waiting: 已处理申请,请等待管理员审核
label_unapply_project: 取消申请 label_unapply_project: 取消申请
@ -1552,6 +1553,7 @@ zh:
label_have_respond: 进行了反馈 label_have_respond: 进行了反馈
label_welcome: 欢迎 label_welcome: 欢迎
label_join: 加入Trustie label_join: 加入Trustie
label_repository_path: 库路径
label_board_description: 七嘴八舌,汇聚众人智慧,为您排忧解难! label_board_description: 七嘴八舌,汇聚众人智慧,为您排忧解难!
label_create_course_description: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源! label_create_course_description: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!
label_welcome_page_to: 参与了 %{project_count} 个项目! label_welcome_page_to: 参与了 %{project_count} 个项目!

View File

@ -510,6 +510,7 @@ RedmineApp::Application.routes.draw do
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
get 'projects/:id/repository', :to => 'repositories#show', :path => nil get 'projects/:id/repository', :to => 'repositories#show', :path => nil
get 'projects/:id/exit', :to => 'projects#exit_project', :as => 'exit_cur_project'
# additional routes for having the file name at the end of url # additional routes for having the file name at the end of url
get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment' get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'