From f3fe5d918e46b0876115e64ddb37f56aedf1c48f Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Thu, 7 Aug 2014 15:54:05 +0800 Subject: [PATCH 01/14] =?UTF-8?q?#832=20=E7=8A=B6=E6=80=81=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E9=97=AE=E9=A2=98=E7=9A=84=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_attributes.html.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index e44578243..b17283f3b 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -50,15 +50,18 @@ var _v= obj; 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) { - //alert(1); + //alert(1); + $("select[id='issue_status_id']").find("option[value='1']").attr("selected","selected"); } else if(_v!=100&&_v!=0) { // alert(2); + $("select[id='issue_status_id']").find("option[value='2']").attr("selected","selected"); } } From 387d4820590cb4a97e93cfdaaed302663baa0b7f Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Thu, 7 Aug 2014 15:58:00 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=97=A0=E5=9C=B0=E5=8C=BA=E3=80=81=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E5=8F=AF=E6=B3=A8=E5=86=8C=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index c05d1172c..c1b38fa39 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -140,6 +140,15 @@ class AccountController < ApplicationController @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] 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 when '1' register_by_email_activation(@user) From af683f917dd11b87fe5ba5c43d2d78bf40ca150a Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Thu, 7 Aug 2014 16:09:50 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=90=8D=E9=9D=9E=E6=B3=95=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=88=90=E5=8A=9F=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 57a818270..c2736dd30 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base 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) # 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 validate :repo_create_validation, :on => :create From d087c5231462359ddc12828f83a060db6a627e5f Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Thu, 7 Aug 2014 16:20:46 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index deb590d1f..d7d579dd1 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -1,4 +1,4 @@ -<% if @events_by_day.size >0 %> +<% if @events_by_day != nil && @events_by_day.size >0 %>
From d9a9867f964fb48546e52bfd6168fa42cc788b51 Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Thu, 7 Aug 2014 16:41:31 +0800 Subject: [PATCH 05/14] =?UTF-8?q?#815=20=E4=B8=AD=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ab754feaf..572862174 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -315,7 +315,7 @@ zh: field_auth_source: 认证模式 field_hide_mail: 隐藏我的邮件地址 field_comments: 注释 - field_url: URL + field_url: 路径 field_start_page: 起始页 field_subproject: 子项目 field_hours: 小时 @@ -979,7 +979,7 @@ zh: label_change_properties: 修改属性 label_general: 一般 label_more: 更多>> - label_scm: SCM + label_scm: 管理系统 label_plugins: 插件 label_ldap_authentication: LDAP 认证 label_downloads_abbr: D/L @@ -1552,6 +1552,7 @@ zh: label_have_respond: 进行了反馈 label_welcome: 欢迎 label_join: 加入Trustie! + label_repository_path: 库路径 label_board_description: 七嘴八舌,汇聚众人智慧,为您排忧解难! label_create_course_description: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源! label_welcome_page_to: 参与了 %{project_count} 个项目! From cb4869fd20efda4ada60d33f0e91f6bd7ba0b789 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Thu, 7 Aug 2014 17:16:00 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=90=8D=E9=95=BF255=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=97=B6=E5=BC=82=E5=B8=B8=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E7=89=88=E6=9C=AC=E5=BA=93=E5=90=8D=E9=95=BF=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository.rb | 4 ++-- app/views/projects/settings/_repositories.html.erb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index c2736dd30..260069f94 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -21,8 +21,8 @@ class Repository < ActiveRecord::Base include Redmine::Ciphering include Redmine::SafeAttributes - # Maximum length for repository identifiers - IDENTIFIER_MAX_LENGTH = 255 + # Maximum length for repository ideflashntifiers + IDENTIFIER_MAX_LENGTH = 254 belongs_to :project has_many :changesets, :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC" diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index 4ad14bf84..f4b505065 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -1,7 +1,7 @@ <% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> <% ip = RepositoriesHelper::REPO_IP_ADDRESS %> <% if @project.repositories.any? %> -
<%= l(:field_identifier) %> | @@ -14,16 +14,16 @@||||||
---|---|---|---|---|---|---|
+ | <%= checked_image repository.is_default? %> | -<%=h repository.scm_name %> | +<%=h repository.scm_name %> | <%if repository.scm_name=="Git"%> -http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %><%=h repository.url.slice(project_path_cut, repository.url.length) %> | + <%else %> -<%=h repository.url %> | + <% end %>
From eac85b338fb891f6b103bd4e660ba4bae9cc8e83 Mon Sep 17 00:00:00 2001
From: zhanghaitao <562681745@qq.com>
Date: Thu, 7 Aug 2014 17:56:29 +0800
Subject: [PATCH 07/14] =?UTF-8?q?=E6=A0=87=E7=A4=BA=E9=94=99=E8=AF=AF?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/_form.html.erb | 4 ++--
app/views/repositories/_form.html.erb | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb
index 7c84bf84b..512c2df82 100644
--- a/app/views/projects/_form.html.erb
+++ b/app/views/projects/_form.html.erb
@@ -9,8 +9,8 @@
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
- <%= f.check_box :is_default, :label => :field_repository_is_default %> From 70a1839e74d1b39c26113226eb4587f0bcbee4e7 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Fri, 8 Aug 2014 09:30:48 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=95=8C=E9=9D=A2-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95=EF=BC=88?= =?UTF-8?q?=E6=88=91=E7=9A=84=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E3=80=81=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99=EF=BC=89=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 14 +++++++------- config/locales/en.yml | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index fafc49c0a..3a7a6a8ee 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -27,7 +27,7 @@ #@nav_dispaly_user_label = 1 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? -%> <%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 33e1eda9b..1d7b01d4f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1158,6 +1158,7 @@ en: #huang label_file_new: Download label_user_edit: "Edit information" + label_my_course: "My Course" label_user_info: "User information" #huang 添加 label_user_watcher: "Following" # huang添加的 # modified by bai label_user_fans: "Followed by" # modified by bai From b5e8b1280680d50661df52db7cf98fc842728746 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 8 Aug 2014 11:32:15 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9F=A5=E8=AF=A2=E6=8C=89=E9=92=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=A1=AE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/password.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/my/password.html.erb b/app/views/my/password.html.erb index 5e2b1989c..2808a8742 100644 --- a/app/views/my/password.html.erb +++ b/app/views/my/password.html.erb @@ -13,7 +13,7 @@<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %> -<%= submit_tag l(:button_apply) %> +<%= submit_tag l(:label_button_ok) %> <% end %> From 683cd9f9189f5651f7d723986010cd2984502039 Mon Sep 17 00:00:00 2001 From: z9hang
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
@@ -132,7 +132,7 @@
<% else %>
- <% if school_course.count < 9 %>
+ <% if school_course.count < 10 %>
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
@@ -181,7 +181,7 @@
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
From 6037421c7ded5579ab56fc00ca6063c1c62ad050 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Fri, 8 Aug 2014 15:45:06 +0800
Subject: [PATCH 13/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=AD=A6=E6=A0=A1=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/course.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index d48f11774..7cab331b6 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -101,7 +101,7 @@
<% end %>
- <% find_all_new_hot_course(10, @school_id).map do |course| %>
+ <% find_all_new_hot_course(9, @school_id).map do |course| %>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
From 0028c1142640b49ba78f0a339b79fede7d8016be Mon Sep 17 00:00:00 2001
From: linhk <304431313@.com>
Date: Fri, 8 Aug 2014 16:43:34 +0800
Subject: [PATCH 14/14] =?UTF-8?q?=E9=80=80=E5=87=BA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 4 ++--
app/controllers/projects_controller.rb | 13 ++++++++++++
app/helpers/watchers_helper.rb | 5 ++++-
app/views/layouts/_join_exit_project.html.erb | 20 +++++++++++++++++++
app/views/layouts/base_projects.html.erb | 15 ++------------
app/views/projects/exit_project.js.erb | 1 +
config/locales/en.yml | 1 +
config/locales/zh.yml | 1 +
config/routes.rb | 1 +
9 files changed, 45 insertions(+), 16 deletions(-)
create mode 100644 app/views/layouts/_join_exit_project.html.erb
create mode 100644 app/views/projects/exit_project.js.erb
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index c1b38fa39..4174f427e 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -119,8 +119,8 @@ class AccountController < ApplicationController
@user = User.new
@user.safe_attributes = user_params
if params[:identity] == "2" # 2 企业
- #@user.firstname = params[:enterprise_name]
- #@user.lastname = l(:field_enterprise)
+ @user.firstname = params[:enterprise_name]
+ @user.lastname = l(:field_enterprise)
end
@user.admin = false
@user.register
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 3f6827159..1bc75d9d1 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -892,6 +892,18 @@ class ProjectsController < ApplicationController
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
def memberAccess
@@ -1038,4 +1050,5 @@ class ProjectsController < ApplicationController
end
#gcmend
+
end
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index ea72e8184..be5609d7c 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -246,4 +246,7 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method ,:class=>css
end
- end
+ def exit_project_link(project)
+ link_to("退出项目",exit_cur_project_path(project.id),:remote => true )
+ end
+ end
diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
new file mode 100644
index 000000000..c43ad55a2
--- /dev/null
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -0,0 +1,20 @@
+
-
+
+ <% if ( !(User.current.member_of? @project) && User.current.login?) %>
+ <%= watcher_link(@project, User.current) %>
+ <% end %>
+
+
+
+ <% if ( !(User.current.member_of? @project) && User.current.login?) %>
+
+ <%= applied_link(@project, User.current) %>
+ <% end %>
+
+
+
+
+ <% if ((User.current.member_of? @project) && User.current.login?) %>
+ <%= exit_project_link(@project) %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 004aabc51..eea7a0f61 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -74,20 +74,9 @@
<% end %>
-
- <% if ( !(User.current.member_of? @project) && User.current.login?) %>
- <%= watcher_link(@project, User.current) %>
- <% end %>
-
-
-
- <% if ( !(User.current.member_of? @project) && User.current.login?) %>
-
- <%= applied_link(@project, User.current) %>
- <% end %>
+
+ <%= render 'layouts/join_exit_project' %>
-
|
diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb
index b9a3a6c83..1fabf47c8 100644
--- a/app/views/repositories/_form.html.erb
+++ b/app/views/repositories/_form.html.erb
@@ -12,7 +12,7 @@