From 28c20c966ed4c70aebede52db2d8a416761da375 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 1 Jul 2016 19:28:55 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_show_users.html.erb | 2 +- app/views/tags/index.html.erb | 2 +- public/stylesheets/courses.css | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/tags/_show_users.html.erb b/app/views/tags/_show_users.html.erb index d8b172ba9..ab6570a2a 100644 --- a/app/views/tags/_show_users.html.erb +++ b/app/views/tags/_show_users.html.erb @@ -2,7 +2,7 @@ <% if users_results.try(:size).to_i > 0 %>
<% users_results.each do |user| %> -

+

<%= l(:label_tags_user_name) %><%= link_to ("#{user.name}"), :controller => "users",:action => "show",:id => user.id%>
diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 947366eeb..038768a41 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -16,7 +16,7 @@ <% content_for :content do %>

<%= l(:label_tags_search_result) %>

-
+
<%= l(:label_tags_numbers) %>: <%= l(:label_issue_plural) %>(<%= @issues_tags_num %>) | <%= l(:label_project_plural) %>(<%= @projects_tags_num %>) | diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index d6026537e..1df2a2ece 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1428,4 +1428,5 @@ a.pages-big{ width:50px;} .W300 {width:300px !important;} .W600{ width:600px;} -.syllabus_input {width: 290px; border: 1px solid #64bdd9; height: 30px;} +.syllabus_input {width: 290px; border: 1px solid #64bdd9; height: 30px;} +.syllabus_input option {max-width:260px;} From 8cc4b7a87864bf67046d7438ac41c086d4c85c13 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 1 Jul 2016 20:00:23 +0800 Subject: [PATCH 2/7] public questions --- app/controllers/projects_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8664a1372..54ab3b2c3 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -653,12 +653,14 @@ class ProjectsController < ApplicationController def update @project.safe_attributes = params[:project] @project.organization_id = params[:organization_id] - params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0 - params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0 + params[:project][:is_public] == "on" ? @project.is_public = 1 : @project.is_public = 0 + params[:project][:hidden_repo] == "on" ? @project.hidden_repo = 1 : @project.hidden_repo = 0 # 更新公开私有时同步gitlab公开私有 - if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? true : false) + if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? 1 : 0) + logger.info("########################=>#{params[:project][:is_public]}") g = Gitlab.client - params[:project][:is_public] ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch]) + params[:project][:is_public] == "on" ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch]) + logger.info("88888888888888888888888=>#{params[:project][:is_public] == "on"}") end # end if validate_parent_id && @project.save From 134aa55e04807356886a4acfd262a8aa4e9c1e93 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 1 Jul 2016 20:16:06 +0800 Subject: [PATCH 3/7] authoriod --- app/views/quality_analysis/_result_list.html.erb | 8 +++++++- app/views/repositories/show.html.erb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/quality_analysis/_result_list.html.erb b/app/views/quality_analysis/_result_list.html.erb index 51d91c04f..b0b8abafe 100644 --- a/app/views/quality_analysis/_result_list.html.erb +++ b/app/views/quality_analysis/_result_list.html.erb @@ -21,7 +21,13 @@
  • <%= qa.branch %>
  • <%= qa.language %>
  • <%= qa.path %>
  • -
  • <%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true %>
  • + <% if User.current.try(:login) == qa.author_login %> +
  • + <%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %> +
  • + <% else %> +
  • 编辑
  • + <% end %>
    <% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 8164a103f..05f25822b 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -5,7 +5,7 @@ ZIP下载 <%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %> <%# if User.current.member_of?(@project) %> - <% if quality_analysis(User.current.try(:login), @repository.id).nil? && is_project_manager?(User.current.id, @project.id) && @project.is_public? %> + <% if quality_analysis(User.current.try(:login), @repository.id).nil? && User.current.member_of?(@project) && @project.is_public? %> <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %> <% end %> <%# end %> From 61b5a100eb7b95d74861f11e6bd79e7c33bbe0d6 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 1 Jul 2016 20:25:58 +0800 Subject: [PATCH 4/7] delete log messages --- app/controllers/projects_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 54ab3b2c3..cb86f1165 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -657,10 +657,8 @@ class ProjectsController < ApplicationController params[:project][:hidden_repo] == "on" ? @project.hidden_repo = 1 : @project.hidden_repo = 0 # 更新公开私有时同步gitlab公开私有 if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? 1 : 0) - logger.info("########################=>#{params[:project][:is_public]}") g = Gitlab.client params[:project][:is_public] == "on" ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch]) - logger.info("88888888888888888888888=>#{params[:project][:is_public] == "on"}") end # end if validate_parent_id && @project.save From 70e26927cba70f4f81cf2091ad4fbd035f51ee5e Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 1 Jul 2016 20:38:33 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=97=E6=A0=B7=E6=94=B9=E4=B8=BA=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 12 ++++++------ app/views/courses/join.js.erb | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index f6bf59af0..f59beb7e5 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -324,15 +324,15 @@ class CoursesService define_error [ 0, '加入成功', 1, '密码错误', - 2, '课程已过期 请联系课程管理员重启课程。', - 3, '您已经加入了课程', - 4, '您加入的课程不存在', + 2, '班级已过期 请联系班级管理员重启班级。', + 3, '您已经加入了班级', + 4, '您加入的班级不存在', 5, '您还未登录', 6, '申请成功,请等待审核完毕', 7, '您已经发送过申请了,请耐心等待', - 8, '您已经是该课程的教师了', - 9, '您已经是该课程的教辅了', - 10, '您已经是该课程的管理员了', + 8, '您已经是该班级的教师了', + 9, '您已经是该班级的教辅了', + 10, '您已经是该班级的管理员了', '未知错误,请稍后再试' ] end diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb index 04a77f87b..ac8b717d1 100644 --- a/app/views/courses/join.js.erb +++ b/app/views/courses/join.js.erb @@ -10,12 +10,12 @@ window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/co <% elsif @state == 1 %> alert("密码错误"); <% elsif @state == 2 %> -alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)"); +alert("班级已过期\n请联系班级管理员重启班级。(在配置班级处)"); <% elsif @state == 3 %> -alert("您已经加入了课程"); +alert("您已经加入了班级"); window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 4 %> -alert("您加入的课程不存在"); +alert("您加入的班级不存在"); <% elsif @state == 5 %> alert("您还未登录"); <% elsif @state == 6 %> @@ -25,15 +25,15 @@ hidden_join_course_form(); alert("您已经发送过申请了,请耐心等待"); hidden_join_course_form(); <% elsif @state == 8%> -alert("您已经是该课程的教师了"); +alert("您已经是该班级的教师了"); hidden_join_course_form(); window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 9%> -alert("您已经是该课程的教辅了"); +alert("您已经是该班级的教辅了"); hidden_join_course_form(); window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 10%> -alert("您已经是该课程的管理员了"); +alert("您已经是该班级的管理员了"); hidden_join_course_form(); window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% else %> From 6ac7d322b9715130e420935e215ddf5e8724ae97 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 1 Jul 2016 21:31:50 +0800 Subject: [PATCH 6/7] some added --- app/controllers/quality_analysis_controller.rb | 3 ++- app/views/quality_analysis/_console_output.html.erb | 6 +++--- app/views/quality_analysis/index.html.erb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 2c55f780c..bec66aeff 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -165,6 +165,7 @@ class QualityAnalysisController < ApplicationController # resource_id: login + @repository.id def index begin + @branch = params[:branch] @resource_id = params[:resource_id] @sonar_address = Redmine::Configuration['sonar_address'] @jenkins_address = Redmine::Configuration['jenkins_address'] @@ -177,7 +178,7 @@ class QualityAnalysisController < ApplicationController else if params[:current_build_status] == "failure" job_name = params[:job_name] - @console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text') + @console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"] end complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read @complexity =JSON.parse(complexity_date).first diff --git a/app/views/quality_analysis/_console_output.html.erb b/app/views/quality_analysis/_console_output.html.erb index 45115b9fe..372f7ec8d 100644 --- a/app/views/quality_analysis/_console_output.html.erb +++ b/app/views/quality_analysis/_console_output.html.erb @@ -2,7 +2,7 @@

    质量分析

    -

    - <%= h @console_build.to_json.html_safe %> -

    +
    + <%=h @console_build %> +
    diff --git a/app/views/quality_analysis/index.html.erb b/app/views/quality_analysis/index.html.erb index 19b5c5eea..7925f6120 100644 --- a/app/views/quality_analysis/index.html.erb +++ b/app/views/quality_analysis/index.html.erb @@ -2,7 +2,7 @@ <%= render :partial => "result_list" %> <% else %> <% if params[:current_build_status].nil? || params[:current_build_status] == "success" %> - <%= render :partial => "show", :locals => {:branch => params[:branch]} %> + <%= render :partial => "show", :locals => {:branch => @branch} %> <% else %> <% if params[:build_console_result] %> 运行结果超时 From 447e624f3640ad870e695661628c78836a49fa11 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 1 Jul 2016 21:38:37 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=A4=A7=E7=BA=B2bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/syllabuses_helper.rb | 12 ++++++------ app/views/courses/private_or_public.js.erb | 4 ++-- app/views/layouts/_syllabus_base_info.html.erb | 6 +++--- app/views/syllabuses/_syllabus_course_list.html.erb | 2 +- app/views/users/_user_course_list.html.erb | 2 +- app/views/users/_user_syllabus_list.html.erb | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/helpers/syllabuses_helper.rb b/app/helpers/syllabuses_helper.rb index 00331e0dc..7e815950b 100644 --- a/app/helpers/syllabuses_helper.rb +++ b/app/helpers/syllabuses_helper.rb @@ -48,17 +48,17 @@ module SyllabusesHelper option6 = [] option1 << "请选择" - option1 << 1 + option1 << 0 option2 << "公共必修课" - option2 << 2 + option2 << 1 option3 << "学科必修课" - option3 << 3 + option3 << 2 option4 << "专业选修课" - option4 << 4 + option4 << 3 option5 << "实践必修课" - option5 << 5 + option5 << 4 option6 << "实践选修课" - option6 << 6 + option6 << 5 type << option1 type << option2 diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb index 4e512a6a0..82180c452 100644 --- a/app/views/courses/private_or_public.js.erb +++ b/app/views/courses/private_or_public.js.erb @@ -9,9 +9,9 @@ } <% else %> <% if @course.is_public? %> - $("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); + $("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); <% else %> - $("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); + $("#show_course_<%= @course.id %>").attr("title","私有班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); <% end %> $("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true}, :id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>'); diff --git a/app/views/layouts/_syllabus_base_info.html.erb b/app/views/layouts/_syllabus_base_info.html.erb index cf4926d82..ae6da2ac3 100644 --- a/app/views/layouts/_syllabus_base_info.html.erb +++ b/app/views/layouts/_syllabus_base_info.html.erb @@ -4,7 +4,7 @@ <% end %>
  • <%=syllabus.user.show_name %>
  • - <% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 %> + <% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
  • <%=syllabus.syllabus_type_str %>
  • <% end %> <% unless syllabus.credit.nil? || syllabus.credit == '' %> @@ -26,7 +26,7 @@
  • <%=syllabus.pre_course %>
  • <% end %> - <% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == '' %> + <% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
  • <% end %> <% if syllabus.credit.nil? || syllabus.credit == '' %> @@ -48,7 +48,7 @@
  • <% end %> -<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%> +<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%> <% end %>