From 3a9ef1cfff13f554871cb90de8abcd8e1cb4cfb7 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 10 Nov 2014 09:22:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index acbcbc2fa..629793c46 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -23,7 +23,7 @@ (<%= @jours_count %>)
  • - <%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %> + -->
  • <% else %> From dd95335a6711e755199b79b9f6a5dbb17041f7ea Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 10 Nov 2014 10:21:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD500=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 +- app/views/bids/_homework_list.html.erb | 2 +- .../views/code_review/_body_bottom.html.erb | 164 +++++++++--------- .../views/code_review/_html_header.html.erb | 58 +++---- 4 files changed, 113 insertions(+), 113 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index e617829b6..18ed80a34 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -32,7 +32,7 @@ class ZipdownController < ApplicationController send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile rescue Exception => e - render file: 'public/no_file_found.html' , :layout => 'course_base' + render file: 'public/no_file_found.html' end #下载某一学生的作业的所有文件 diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 629793c46..acbcbc2fa 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -23,7 +23,7 @@ (<%= @jours_count %>)
  • - --> + <%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
  • <% else %> diff --git a/plugins/redmine_code_review/app/views/code_review/_body_bottom.html.erb b/plugins/redmine_code_review/app/views/code_review/_body_bottom.html.erb index 6c295f17c..1bb03fda0 100644 --- a/plugins/redmine_code_review/app/views/code_review/_body_bottom.html.erb +++ b/plugins/redmine_code_review/app/views/code_review/_body_bottom.html.erb @@ -1,82 +1,82 @@ -<% -# Code Review plugin for Redmine -# Copyright (C) 2010 Haruyuki Iida -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --%> - -<% -is_target = false - -if project and controller and project.module_enabled?(:code_review) - is_target = true - is_target = false unless User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, project) - setting = CodeReviewProjectSetting.find(:first, :conditions => ['project_id = ?', project.id]) - is_target = false unless setting - is_target = false if(setting && setting.tracker_id == nil) - action_name = controller.action_name - is_target = false unless action_name - is_target = false unless (controller.class.name == 'RepositoriesController' or controller.class.name == 'AttachmentsController') - if (is_target == true) - context = {:project => project, :controller => controller, :requrest => request} - %> - <% if (controller.class.name == 'AttachmentsController') %> - <%= render :partial => 'code_review/change_attachement_view', :locals => context %> - <% elsif (action_name == 'show' or action_name == 'revisions') %> - <%= render :partial => 'code_review/change_repository_view', :locals => context %> - <% elsif (action_name == 'revision') %> - <%= render :partial => 'code_review/change_revision_view', :locals => context %> - <% elsif (action_name == 'diff' or action_name == 'entry' or action_name == 'annotate')%> - <%if (controller.params[:rev].blank? or controller.params[:rev] == 'master')%> - <%= render :partial => 'code_review/change_entry_norevision_view', :locals => context %> - <% else - changeset = @repository.find_changeset_by_name(controller.params[:rev]) - %> - <% unless changeset %> - <%= render :partial => 'code_review/change_entry_norevision_view', :locals => context %> - <% else - parameters = request.parameters - rev_to = parameters['rev_to'] unless parameters['rev_to'].blank? - review_id = parameters['review_id'] - rev = parameters['rev'] - path = parameters['path'] - - - repository_id = @repository.identifier_param if @repository.respond_to?("identifier_param") - url = url_for :controller => 'code_review', :action => 'update_diff_view', :id => project, :repository_id => repository_id - %> -
    -
    - - <% end %> - - <% end %> - <% end %> - <% - end -end --%> - - - +<% +# Code Review plugin for Redmine +# Copyright (C) 2010 Haruyuki Iida +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-%> + +<% +is_target = false + +if project and project.is_a?(Project) and controller and project.module_enabled?(:code_review) + is_target = true + is_target = false unless User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, project) + setting = CodeReviewProjectSetting.find(:first, :conditions => ['project_id = ?', project.id]) + is_target = false unless setting + is_target = false if(setting && setting.tracker_id == nil) + action_name = controller.action_name + is_target = false unless action_name + is_target = false unless (controller.class.name == 'RepositoriesController' or controller.class.name == 'AttachmentsController') + if (is_target == true) + context = {:project => project, :controller => controller, :requrest => request} + %> + <% if (controller.class.name == 'AttachmentsController') %> + <%= render :partial => 'code_review/change_attachement_view', :locals => context %> + <% elsif (action_name == 'show' or action_name == 'revisions') %> + <%= render :partial => 'code_review/change_repository_view', :locals => context %> + <% elsif (action_name == 'revision') %> + <%= render :partial => 'code_review/change_revision_view', :locals => context %> + <% elsif (action_name == 'diff' or action_name == 'entry' or action_name == 'annotate')%> + <%if (controller.params[:rev].blank? or controller.params[:rev] == 'master')%> + <%= render :partial => 'code_review/change_entry_norevision_view', :locals => context %> + <% else + changeset = @repository.find_changeset_by_name(controller.params[:rev]) + %> + <% unless changeset %> + <%= render :partial => 'code_review/change_entry_norevision_view', :locals => context %> + <% else + parameters = request.parameters + rev_to = parameters['rev_to'] unless parameters['rev_to'].blank? + review_id = parameters['review_id'] + rev = parameters['rev'] + path = parameters['path'] + + + repository_id = @repository.identifier_param if @repository.respond_to?("identifier_param") + url = url_for :controller => 'code_review', :action => 'update_diff_view', :id => project, :repository_id => repository_id + %> +
    +
    + + <% end %> + + <% end %> + <% end %> + <% + end +end +-%> + + + diff --git a/plugins/redmine_code_review/app/views/code_review/_html_header.html.erb b/plugins/redmine_code_review/app/views/code_review/_html_header.html.erb index bc277caf5..d34e43795 100644 --- a/plugins/redmine_code_review/app/views/code_review/_html_header.html.erb +++ b/plugins/redmine_code_review/app/views/code_review/_html_header.html.erb @@ -1,30 +1,30 @@ -<% -# Code Review plugin for Redmine -# Copyright (C) 2010-2012 Haruyuki Iida -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --%> -<% if @project and @project.module_enabled?('code_review') %> - <% - baseurl = Redmine::Utils.relative_url_root - - -%> - <%= javascript_include_tag(baseurl + "/plugin_assets/redmine_code_review/javascripts/code_review.js") %> - <%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/jstoolbar.js') %> - <%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/textile.js') %> - <%= javascript_include_tag(baseurl + "/javascripts/jstoolbar/lang/jstoolbar-#{@project.current_language}.js") %> - <%= stylesheet_link_tag(baseurl + "/plugin_assets/redmine_code_review/stylesheets/code_review.css") %> - <%= stylesheet_link_tag(baseurl + "/stylesheets/jstoolbar.css") %> +<% +# Code Review plugin for Redmine +# Copyright (C) 2010-2012 Haruyuki Iida +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-%> +<% if @project and @project.is_a?(Project) and @project.module_enabled?('code_review') %> + <% + baseurl = Redmine::Utils.relative_url_root + + -%> + <%= javascript_include_tag(baseurl + "/plugin_assets/redmine_code_review/javascripts/code_review.js") %> + <%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/jstoolbar.js') %> + <%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/textile.js') %> + <%= javascript_include_tag(baseurl + "/javascripts/jstoolbar/lang/jstoolbar-#{@project.current_language}.js") %> + <%= stylesheet_link_tag(baseurl + "/plugin_assets/redmine_code_review/stylesheets/code_review.css") %> + <%= stylesheet_link_tag(baseurl + "/stylesheets/jstoolbar.css") %> <% end %> \ No newline at end of file From b707cbae16c515aea216263171c03a01a2a28ad0 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 10 Nov 2014 10:37:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=AF=84=E5=88=86=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E4=B8=A4=E4=BD=8D=E5=B0=8F=E6=95=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_homework.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 2f1028feb..c4be4777c 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -35,7 +35,7 @@
  • <%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>: - <%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : homework.m_score) : (homework.s_score.nil? ? l(:label_without_score) : homework.s_score)%> + <%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : format("%.2f",homework.m_score)) : (homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score))%>
  • <% if is_teacher %> From 9bd1af954138fc5e54a61233fd108043ffe616d1 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 10 Nov 2014 15:09:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=20#1480=20=E9=A1=B9=E7=9B=AE=E7=95=99?= =?UTF-8?q?=E8=A8=80=E5=8C=BA=E5=9B=9E=E5=A4=8D=E6=97=B6=E9=97=B4=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/helpers/application_helper.rb | 7 ++++--- app/views/projects/_history.html.erb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8544b2cf3..1d528c183 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -578,12 +578,13 @@ module ApplicationHelper return ss end - def time_tag(time) + def time_tag(time, *args) + options = args.extract_options! text = distance_of_time_in_words(Time.now, time) if @project - link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)}, :title => format_time(time)) + link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)},options.reverse_merge(:title => format_time(time))) else - content_tag('acronym', text, :title => format_time(time)) + content_tag('acronym', text, options.reverse_merge(:title => format_time(time))) end end diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index beb31f830..38ee59e38 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -30,7 +30,7 @@ <%= l(:label_bids_published) %>  - <%= time_tag(journal.created_on).html_safe %>  + <%= time_tag(journal.created_on,:style => "float:initial").html_safe %>  <%= l(:label_bids_published_ago) %>