From d006c2691b5eef53a4b4fca0d32c9386265cd429 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Tue, 13 Oct 2015 13:54:31 +0800
Subject: [PATCH 01/14] =?UTF-8?q?issue=E6=A8=A1=E5=9D=97=E4=B8=AD=EF=BC=8C?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98=E6=97=B6=EF=BC=8C=E7=BB=99?=
=?UTF-8?q?=E5=87=BA=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E2=80=9C=E8=AF=B7?=
=?UTF-8?q?=E8=BE=93=E5=85=A5=E9=97=AE=E9=A2=98=E5=90=8D=E7=A7=B0=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/index.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index 670f5c51a..29c038226 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -47,7 +47,7 @@
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
From 69ad8495c794bcd05ebc8b519c468b69eccea9a6 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Wed, 14 Oct 2015 17:28:13 +0800
Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=EF=BC=8C=E8=AF=84=E9=98=85=E4=BA=86?=
=?UTF-8?q?=E6=9F=90=E4=BD=9C=E8=AF=84=E7=9A=84=E6=B6=88=E6=81=AF=E5=86=85?=
=?UTF-8?q?=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 1b9b175ea..ba1806d69 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -281,9 +281,15 @@
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
- <%= ma.content.html_safe %>
课程名称:<%= ma.course.name %>(<%= ma.course.term %>)
作业标题:<%=ma.course_message.student_work.homework_common.name %>
+
<%= ma.content.html_safe %>
+
+ 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。
+
+
+ 期待你取得更大的进步!
+
<% end %>
<%= time_tag(ma.created_at).html_safe %>
From a45722b0f5cf3f476f6fff6aa049ff1fd85b5c64 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 15 Oct 2015 09:11:26 +0800
Subject: [PATCH 03/14] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=BB=BA=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../settings/_new_repositories.html.erb | 179 +++++++++---------
1 file changed, 92 insertions(+), 87 deletions(-)
diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb
index 410bd8c32..0859e5e19 100644
--- a/app/views/projects/settings/_new_repositories.html.erb
+++ b/app/views/projects/settings/_new_repositories.html.erb
@@ -8,93 +8,98 @@
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %>
<% if @project.repositories.any? %>
-
-
-
- <%= l(:field_identifier) %> |
- <%= l(:field_repository_is_default) %> |
- <%= l(:label_scm) %> |
- <%= l(:label_repository_path) %> |
- |
- |
-
- <% @project.repositories.sort.each do |repository| %>
-
-
- <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> |
- <%= checked_image repository.is_default? %> |
- <%=h repository.scm_name %> |
- <%if repository.scm_name=="Git"%>
-
+ |
+
+ <%= l(:field_identifier) %> |
+ <%= l(:field_repository_is_default) %> |
+ <%= l(:label_scm) %> |
+ <%= l(:label_repository_path) %> |
+ |
+ |
+
+ <% @project.repositories.sort.each do |repository| %>
+
+
+ <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> |
+ <%= checked_image repository.is_default? %> |
+ <%=h repository.scm_name %> |
+ <%if repository.scm_name=="Git"%>
+ <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%> |
- <%else %>
- <%=h truncate(repository.url,:length=>10) %> |
- <% end %>
-
- <% if repository.scm_name=="Git"%>
- <%if User.current.allowed_to?(:manage_repository, @project) %>
- <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
- <% end %>
- <% end %>
- |
-
- <% if repository.login.to_s==User.current.login.to_s %>
- <%= delete_new_link repository_path(repository) %>
- <% end %> |
-
- <% end %>
-<% else %>
- <%= l(:label_no_data) %>
-<% end %>
-
-
-
-
-
- <% course_tag = @project.project_type %>
- <% if User.current.allowed_to?(:manage_repository, @project) %>
-
- <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %>
- <% end %>
-
-
-
-<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
-
-
- -
-
- <%= select_tag('repository_scm',
- options_for_select(["Git"],@repository.class.name.demodulize),
- :data => {:remote => true, :method => 'get'})%>
- <% if @repository && ! @repository.class.scm_available %>
- <%= l(:text_scm_command_not_available) %>
- <% end %>
-
-
- <% unless judge_main_repository(@project) %>
- -
-
- <%= f.check_box :is_default, :label => "", :no_label => true %>
-
- <% end %>
- -
-
-
-
- <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
- <% unless @repository.identifier_frozen? %>
- <%=l(:text_length_between,:min=>1,:max=>254)<
+ <%else %>
+
<%=h truncate(repository.url,:length=>10) %> |
+ <% end %>
+
+ <% if repository.scm_name=="Git"%>
+ <%if User.current.allowed_to?(:manage_repository, @project) %>
+ <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
+ <% end %>
+ <% end %>
+ |
+
+ <% if repository.login.to_s==User.current.login.to_s %>
+ <%= delete_new_link repository_path(repository) %>
+ <% end %> |
+
<% end %>
-
- -
-
- <%= f.password_field :upassword, :label=> "", :no_label => true%>
- <%= l(:label_upassword_info)%>
-
-
-
-
<%=l(:button_save)%>
-
<%=l(:button_cancel)%>
-
+
+
+<% else %>
+ <%= l(:label_repository_no_data) %>
<% end %>
+
+<%# 新建版本库 %>
+<% if @project.repositories.count == 0 %>
+
+
+ <% course_tag = @project.project_type %>
+ <% if User.current.allowed_to?(:manage_repository, @project) %>
+
+ <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %>
+ <% end %>
+
+
+
+ <%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
+
+
+ -
+
+ <%= select_tag('repository_scm',
+ options_for_select(["Git"],@repository.class.name.demodulize),
+ :data => {:remote => true, :method => 'get'})%>
+ <% if @repository && ! @repository.class.scm_available %>
+ <%= l(:text_scm_command_not_available) %>
+ <% end %>
+
+
+ <% unless judge_main_repository(@project) %>
+ -
+
+ <%= f.check_box :is_default, :label => "", :no_label => true %>
+
+ <% end %>
+ -
+
+
+
+ <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
+ <% unless @repository.identifier_frozen? %>
+ <%=l(:text_length_between,:min=>1,:max=>254)<
+ <% end %>
+
+ -
+
+ <%= f.password_field :upassword, :label=> "", :no_label => true%>
+ <%= l(:label_upassword_info)%>
+
+
+
+
<%=l(:button_save)%>
+
<%=l(:button_cancel)%>
+
+ <% end %>
+
+<% end %>
+
From 939906388630615c8bffce2ba5038c76d5355e57 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 15 Oct 2015 09:18:56 +0800
Subject: [PATCH 04/14] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=BA=93=E6=8E=A7=E5=88=B6=E5=B1=82=E5=8F=8A=E5=9B=BD=E9=99=85?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 21 +++++++++++++--------
config/locales/commons/zh.yml | 3 ++-
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 126b269bb..f2f10d5b6 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -46,16 +46,21 @@ class RepositoriesController < ApplicationController
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def new
- scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
- @repository = Repository.factory(scm)
- @repository.is_default = @project.repository.nil?
- @repository.project = @project
- @course_tag = params[:course]
- if @course_tag == 1
- render :layout => 'base_courses'
+ if @project.repositories.count == 0
+ scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
+ @repository = Repository.factory(scm)
+ @repository.is_default = @project.repository.nil?
+ @repository.project = @project
+ @course_tag = params[:course]
+ if @course_tag == 1
+ render :layout => 'base_courses'
+ else
+ render :layout => 'base_projects'
+ end
else
- render :layout => 'base_projects'
+ render_403
end
+
end
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index 7cbb223c6..61bad2a00 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -199,7 +199,8 @@ zh:
label_descripition_blank: 描述不能为空
label_subject_empty: 主题不能为空
- label_no_data: 没有任何数据可供显示
+ label_no_data: 没有任何数据可供显示
+ label_repository_no_data: 您还没有创建版本库,每个项目只允许创建一个版本库!
# 项目、课程、用户公用
label_settings: 配置
label_information_plural: 信息
From b261eed24cfe13c7211d6a80c8e09b0670064ae1 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 15 Oct 2015 09:56:05 +0800
Subject: [PATCH 05/14] =?UTF-8?q?=E6=8F=90=E5=8F=96=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E8=AF=84=E5=88=86=E6=B6=88=E6=81=AF=E7=9A=84=E8=AF=84=E5=88=86?=
=?UTF-8?q?=E5=8F=8A=E8=AF=84=E8=AF=AD=EF=BC=8C=E7=94=A8=E9=80=82=E5=BD=93?=
=?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index ba1806d69..9c426f495 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -283,7 +283,14 @@
课程名称:<%= ma.course.name %>(<%= ma.course.term %>)
作业标题:<%=ma.course_message.student_work.homework_common.name %>
-
<%= ma.content.html_safe %>
+ <% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
+
+ 作品评分:<%= content[0] %>
+
+ <% if content.size > 1 %>
+
作品评语:
+
<%= content[1] %>
+ <% end %>
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。
From 554927d51789b3cb0bac44d2068e4118be096ca5 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 15 Oct 2015 10:07:46 +0800
Subject: [PATCH 06/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E9=A1=B9=E7=9B=AE=E5=8A=A8?=
=?UTF-8?q?=E6=80=81=E7=BA=A7=E8=81=94=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/project.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/models/project.rb b/app/models/project.rb
index 0cd6af35b..fcc96c404 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -91,8 +91,10 @@ class Project < ActiveRecord::Base
has_many :tags, :through => :project_tags, :class_name => 'Tag'
has_many :project_tags, :class_name => 'ProjectTags'
+ # 动态级联删除
+ has_many :forge_activities, :class_name => 'ForgeActivity', :dependent => :destroy
# 关联虚拟表
- has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy
+ has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy
belongs_to :organization
From d0ea49d1e982d8e6d888a6d92d2255f2f09454c9 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 15 Oct 2015 10:48:46 +0800
Subject: [PATCH 07/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=BD=AE=E9=A1=B6=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=BD=BF=E7=94=A8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/boards_controller.rb | 2 +-
app/views/boards/_project_show.html.erb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb
index 434ea4470..22881b8f2 100644
--- a/app/controllers/boards_controller.rb
+++ b/app/controllers/boards_controller.rb
@@ -103,7 +103,7 @@ class BoardsController < ApplicationController
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
#现在发布帖子的时候置顶功能已经没有了。所以取消这个置顶排序 #{Message.table_name}.sticky DESC,
@topics = @board.topics.
- reorder("#{Message.table_name}.created_on desc").
+ reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 4f022261f..3cfd4ae72 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -51,9 +51,9 @@
:data => {:confirm => l(:text_are_you_sure)},
:class => 'talk_edit fr',
:style => ' margin-right: 10px;') if topic.destroyable_by?(User.current) %>
- <%# if topic.sticky? %>
-
- <%# end %>
+ <% if topic.sticky? %>
+ <%= l(:label_board_sticky)%>
+ <% end %>