From cbfb72bd5bd45170dcbf6c21d0a259589b68adbf Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Mar 2015 14:32:29 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/new.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/files/new.html.erb b/app/views/files/new.html.erb index be9bcd722..efdc35dcd 100644 --- a/app/views/files/new.html.erb +++ b/app/views/files/new.html.erb @@ -1,5 +1,5 @@
-

<%=l(:label_attachment_new)%>

+

<%= l(:label_course_file) %>

<%= error_messages_for 'attachment' %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 9b4c22b75..6456b0090 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -112,11 +112,11 @@
<% if @project.project_type == 0 %> <%= l(:label_project_grade)%> : - <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', - :action => 'show_projects_score', - :remote => true, - :id => @project.id }, - :style => "color: #EC6300;")%> + <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', + :action => 'show_projects_score', + :remote => true, + :id => @project.id }, + :style => "color: #EC6300;") %> <% end %>
From 0525b03e65fd14eea225c001fc58a7089591eff7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 11 Mar 2015 14:50:06 +0800 Subject: [PATCH 02/13] =?UTF-8?q?zh.yml=E5=88=A0=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 2 -- config/locales/zh.yml | 3 --- 2 files changed, 5 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 55a372f7f..6cb331676 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -384,9 +384,7 @@ en: # steam the student label_current_group: Current group # DTS Test tool - project_module_dts: DTS Test tool label_module_share: DTS Test tool - field_dts_test: DTS Test tool # Feedback module label_technical_support: Support : label_feedback: Feedback diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bed4f138d..020a197dd 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -530,7 +530,6 @@ zh: project_module_calendar: 日历 project_module_gantt: 甘特图 project_module_course: 课程 - project_module_dts: DTS测试工具 label_module_share: DTS测试工具 project_module_code_review: 代码审查 label_user: 用户 @@ -1965,8 +1964,6 @@ zh: label_course_brief_introduction: 课程简介 field_teacher_name: 教 师 - field_dts_test: DTS测试工具 - label_newbie_faq: '新手指引 & 问答' label_hot_project: '热门项目' label_borad_project: 项目讨论区 From 14fe487835bab35d8bc1f1e7672604b64f15ff60 Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 11 Mar 2015 14:52:07 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=B0=86app=E4=B8=AA=E4=BA=BA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E5=8A=A8=E6=80=81=E6=8E=A5=E5=8F=A3=E4=B8=AD=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E7=95=99=E8=A8=80=E5=BD=92=E7=B1=BB=E5=88=B0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BA=86=E4=BD=9C=E4=B8=9A=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index c0d3d2f83..09cc5d59d 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -382,7 +382,7 @@ class CoursesService end latest_bid_message = messages.first unless latest_bid_message.nil? - latest_course_dynamics << {:type => 2,:time => latest_bid_message.created_on,:message => '最近更新了留言'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} + latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => '最近更新了作业'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} end #每个作业中学生最后提交的作业 homeworks = [] From 11c8c0510a0d77882b08cbe214197e5aefe4a9d9 Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 11 Mar 2015 15:13:41 +0800 Subject: [PATCH 04/13] =?UTF-8?q?app=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/mobile_version.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/mobile_version.html.erb b/app/views/admin/mobile_version.html.erb index cc6490f90..2a03ac003 100644 --- a/app/views/admin/mobile_version.html.erb +++ b/app/views/admin/mobile_version.html.erb @@ -36,7 +36,7 @@ <% end %> -<% if @versions.first.attachments.any?%> +<% if !@versions.first.nil? && @versions.first.attachments.any?%> <% options = {:author => true, :deletable => true } %> <%= render :partial => 'attachments/links', :locals => {:attachments => @versions.first.attachments, :options => options, :is_float => true} %> <% end %> From 078d2fa48875f99ab63471048be2e8fab6741dbb Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Mar 2015 15:14:13 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=A1=A3=E4=B8=BA=E7=A9=BA=E6=83=85=E5=86=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=20=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=96=87=E4=BB=B6=E6=9C=AF=E8=AF=AD=E6=94=B9?= =?UTF-8?q?=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/documents/index.html.erb | 2 +- app/views/files/new.html.erb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index e0c39eb33..73a3a6f2a 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -28,7 +28,7 @@
<% if @grouped.empty? %> -

+

<%= l(:label_no_data) %>

<% end %> diff --git a/app/views/files/new.html.erb b/app/views/files/new.html.erb index efdc35dcd..fad22b192 100644 --- a/app/views/files/new.html.erb +++ b/app/views/files/new.html.erb @@ -8,11 +8,10 @@ <% if @versions.any? %>

-<%= select_tag "version_id", content_tag('option', '') + - options_from_collection_for_select(@versions, "id", "name") %>

+ <%= select_tag "version_id", content_tag('option', '') + options_from_collection_for_select(@versions, "id", "name") %>

<% end %> -

<%= render :partial => 'attachments/form' %>

+

<%= render :partial => 'attachments/form' %>

<%= submit_tag l(:button_add) %> <% end %> From 27e72c1f390eb6252bffaaf1906da4da07ca6789 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 11 Mar 2015 15:14:23 +0800 Subject: [PATCH 06/13] =?UTF-8?q?#2000=20=E5=A2=9E=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=AF=8F=E4=B8=AA=E6=A8=A1=E5=9D=97=E7=9A=84=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_newissue_index.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 22 +++++++++++++++------- app/views/projects/_tools_expand.html.erb | 16 +++++++++++++++- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/app/views/issues/_newissue_index.html.erb b/app/views/issues/_newissue_index.html.erb index b89ba41a2..4b282aa8f 100644 --- a/app/views/issues/_newissue_index.html.erb +++ b/app/views/issues/_newissue_index.html.erb @@ -2,7 +2,7 @@

问题跟踪

- <% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %> + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> <% if User.current.member_of?(@project) %> <%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new, diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 9b4c22b75..e61e75018 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -137,13 +137,16 @@ - + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + + <% end%> + <% unless @project.enabled_modules.where("name = 'boards'").empty? %> + <% end%> + <% unless @project.enabled_modules.where("name = 'files'").empty? %> + <% end%> + <% unless @project.enabled_modules.where("name = 'repository'").empty? %> + <% end %>
-<%= paginate @events_pages, :window => 3%> \ No newline at end of file +<%= paginate @events_pages, :left => 3, :right => 3%> \ No newline at end of file From de233cb52a5d8341ddbbb8836c1f0a904a03a13e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Mar 2015 15:30:24 +0800 Subject: [PATCH 09/13] =?UTF-8?q?issue2012,=E5=88=86=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/kaminari_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index 5505662f3..1f07c0af5 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -23,7 +23,7 @@ Kaminari.configure do |config| # config.default_per_page = 25 # config.max_per_page = nil - config.window = 2 + config.window = 0 # config.outer_window = 3 # config.left = 2 # config.right = 2 From 88ee202a4ca5f5a150114530a0fe6d29d1e33b26 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Mar 2015 15:30:36 +0800 Subject: [PATCH 10/13] =?UTF-8?q?issue2012,=E5=88=86=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/kaminari/_gap.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb index a45dfdaa0..01b6cc640 100644 --- a/app/views/kaminari/_gap.html.erb +++ b/app/views/kaminari/_gap.html.erb @@ -5,4 +5,6 @@ per_page: number of items to fetch per page remote: data-remote -%> - + +<%= raw(t 'views.pagination.truncate') %> + \ No newline at end of file From 437fc243ade5952ce8e6b12bb8e9c7bfeae97b4e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Mar 2015 15:47:10 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E7=BB=99=E6=AF=8F=E4=B8=AA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=B7=BB=E5=8A=A0=E4=B8=80=E6=9D=A1=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=9C=89menber=EF=BC=8C=E6=9C=80=E6=97=A9=E5=8A=A0=E8=BF=9B?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=E5=B0=B1=E7=AE=97=E5=88=9B=E5=A7=8B=E4=BA=BA?= =?UTF-8?q?,=E5=B9=B6=E7=BB=99projects=E8=A1=A8=E7=9A=84=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...project_create_info_to_forge_activities.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/migrate/20150311013036_add_project_create_info_to_forge_activities.rb diff --git a/db/migrate/20150311013036_add_project_create_info_to_forge_activities.rb b/db/migrate/20150311013036_add_project_create_info_to_forge_activities.rb new file mode 100644 index 000000000..9476db117 --- /dev/null +++ b/db/migrate/20150311013036_add_project_create_info_to_forge_activities.rb @@ -0,0 +1,21 @@ +# Time 2015-03-11 14:25:45 +# Author lizanle +# Description 给每个项目添加一条初始创建信息,如果有menber,最早加进来的就算创始人,并给projects表的更新创建人 +class AddProjectCreateInfoToForgeActivities < ActiveRecord::Migration + def change + Project.all.each do |e| + user = e.members.order("members.created_on asc").first + next if user.nil? + execute("insert into forge_activities(forge_act_id, + forge_act_type, + project_id, + user_id, + created_at, + updated_at) + values(#{e.id},'ProjectCreateInfo',#{e.id},#{user.user_id}, + '#{user.created_on.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}', + '#{user.created_on.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')") + execute("update projects set user_id=#{user.user_id} where id =#{e.id}") + end + end +end From d7c550b15bcb79e37a3501cd85943ccc20f74a64 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 11 Mar 2015 15:51:25 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E7=BB=99projects=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=9A=84=E6=97=B6=E5=80=99=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 052df384e..61d89a553 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -180,6 +180,7 @@ class ProjectsController < ApplicationController @project = Project.new @project.safe_attributes = params[:project] @project.organization_id = params[:organization_id] + @project.user_id = User.current.id if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') # Add current user as a project member if he is not admin From 8f0af4c00d2fc461cc5dc30b9d192d40248fcdf0 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 11 Mar 2015 16:42:02 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E9=99=86=E6=83=85=E5=86=B5=E4=B8=8B=E9=80=9A=E8=BF=87?= =?UTF-8?q?URL=E8=AE=BF=E9=97=AE=E4=B8=8D=E5=85=81=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 21 ++++++++++++++++----- app/views/layouts/base_projects.html.erb | 8 ++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 052df384e..954006e42 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -347,16 +347,27 @@ class ProjectsController < ApplicationController end #发送邮件邀请新用户 def invite_members_by_mail - @is_zhuce =false - respond_to do |format| - format.html - format.js + if User.current.member_of?(@project) || User.current.admin? + @is_zhuce = false + respond_to do |format| + format.html + format.js + end + else + render_403 end end # 邀请Trustie注册用户 def invite_members - @member ||= @project.members.new + if User.current.member_of?(@project) || User.current.admin? + @member ||= @project.members.new + respond_to do |format| + format.html + end + else + render_403 + end end def edit diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 6456b0090..e3172b8cf 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -140,27 +140,27 @@