From fc864a4a86988d9432079a29ed1f3a1a5b277d5f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 18 Aug 2017 19:30:43 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 54bd78446..b3d04f197 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -49,11 +49,8 @@ -
- - - -
+
+
<%= file_update_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>
- +
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %> diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index 9eacf107a..2b5e6831a 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -16,7 +16,7 @@ <%= yield :header_tags -%> - +
diff --git a/app/views/layouts/base_shixun.html.erb b/app/views/layouts/base_shixun.html.erb index 43fabec25..170293b43 100644 --- a/app/views/layouts/base_shixun.html.erb +++ b/app/views/layouts/base_shixun.html.erb @@ -15,7 +15,7 @@ <%= yield :header_tags -%> - +
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %> diff --git a/app/views/layouts/base_subject.html.erb b/app/views/layouts/base_subject.html.erb index 1b27ea123..0af65c9d1 100644 --- a/app/views/layouts/base_subject.html.erb +++ b/app/views/layouts/base_subject.html.erb @@ -18,7 +18,7 @@ <%= yield :header_tags -%> - +
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %> diff --git a/app/views/shixuns/_form.html.erb b/app/views/shixuns/_form.html.erb index 903d2083f..224eb23c9 100644 --- a/app/views/shixuns/_form.html.erb +++ b/app/views/shixuns/_form.html.erb @@ -1,5 +1,5 @@ <%= stylesheet_link_tag '/editormd/css/editormd' %> -<%= javascript_include_tag '/editormd/editormd.min.js' %> +<%= javascript_include_tag '/editormd/editormd' %>
diff --git a/public/editormd/editormd.js b/public/editormd/editormd.js index 42bd32616..18ebd0bd3 100644 --- a/public/editormd/editormd.js +++ b/public/editormd/editormd.js @@ -4451,7 +4451,7 @@ } editormd.dialogZindex += 2; - + $("body").removeAttr("style"); return dialog; }; diff --git a/public/javascripts/edu/shixun.js b/public/javascripts/edu/shixun.js index c440b21d3..459901f88 100644 --- a/public/javascripts/edu/shixun.js +++ b/public/javascripts/edu/shixun.js @@ -1,5 +1,5 @@ $(function() { - $("#search_not_collaborators").live('input', function (e) { + $("#search_not_collaborators").on('input', function (e) { throttle(search_not_teacher_f, window, e); }); }); diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 6f52eb44c..c72b7be36 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -1,5 +1,6 @@ @charset "utf-8"; -html,body{ font-size:14px; line-height:2.0; height:100%;} +body{font-size:14px; line-height:2.0;} +html{height:100%;} .newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;} .newMain{ margin: 0 auto; padding-bottom: 155px; } .newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px} diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 4e87d1d4a..5e56e2105 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -1,5 +1,6 @@ /************新版公共****************/ -html,body{ font-size:14px; line-height:2.0; height:100%;} +body{font-size:14px; line-height:2.0;} +html{height:100%;} /*.newContainer{ min-height:100%; height: auto !important; height: 100%; position: relative;} .newMain{ margin: 0 auto; padding-bottom: 155px; } .newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px} From 78f1fd3d1d819667de1bb4df13d5b86ab05de5d4 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Aug 2017 16:27:28 +0800 Subject: [PATCH 22/24] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=9A=84=E7=95=99=E8=A8=80=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 | 2 +- app/models/apply_action.rb | 2 +- .../_trial_authorization_list.html.erb | 5 ++++- .../_trial_authorization_passed_list.html.erb | 5 ++++- app/views/welcome/_two_btn_mask_pop.html.erb | 18 +++++++++++++++--- config/routes.rb | 2 +- ...2080604_add_apply_reason_to_apply_action.rb | 5 +++++ public/javascripts/edu/account.js | 14 ++++++++++++++ public/stylesheets/css/edu-user.css | 2 ++ 9 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20170822080604_add_apply_reason_to_apply_action.rb diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 6f838f5a5..61d2b13fb 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -581,7 +581,7 @@ class AccountController < ApplicationController def apply_trail apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first if apply_action.blank? - ApplyAction.create(:user_id => User.current.id, :status => 0, :container_type => "TrialAuthorization") + ApplyAction.create(:user_id => User.current.id, :status => 0, :container_type => "TrialAuthorization", :apply_reason => params[:apply_reason]) end respond_to do |format| format.js diff --git a/app/models/apply_action.rb b/app/models/apply_action.rb index 2adb74869..508371521 100644 --- a/app/models/apply_action.rb +++ b/app/models/apply_action.rb @@ -1,7 +1,7 @@ # status:0 审核中 1 同意 2 拒绝 3 撤销 class ApplyAction < ActiveRecord::Base default_scope :order => 'updated_at desc' - attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status + attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status, :apply_reason belongs_to :user end diff --git a/app/views/managements/_trial_authorization_list.html.erb b/app/views/managements/_trial_authorization_list.html.erb index 1d6500be8..5c3125ac7 100644 --- a/app/views/managements/_trial_authorization_list.html.erb +++ b/app/views/managements/_trial_authorization_list.html.erb @@ -13,7 +13,7 @@ 拒绝 同意 -
  • +
  • <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> <%= user.try(:user_extensions).school.name %><%= user.try(:user_extensions).department ? ' - '+user.try(:user_extensions).department.name.to_s : '' %> <% end %> @@ -26,6 +26,9 @@ <%= user_certification_status(user) %> <%= pro_certification_status(user) %>
  • +
  • + 申请理由:<%= authorization.apply_reason %> +
  • diff --git a/app/views/managements/_trial_authorization_passed_list.html.erb b/app/views/managements/_trial_authorization_passed_list.html.erb index 8b621340c..6f2b4d0ea 100644 --- a/app/views/managements/_trial_authorization_passed_list.html.erb +++ b/app/views/managements/_trial_authorization_passed_list.html.erb @@ -12,7 +12,7 @@ <%= time_from_now(authorization.updated_at) %> <%= authorization.status == 1 ? "已同意" : "已拒绝" %>
  • -
  • +
  • <% if !user.try(:user_extensions).school_id.blank? && user.try(:user_extensions).try(:school) %> <%= user.try(:user_extensions).school.name %><%= user.try(:user_extensions).department ? ' - '+user.try(:user_extensions).department.name.to_s : '' %> <% end %> @@ -25,6 +25,9 @@ <%= user_certification_status(user) %> <%= pro_certification_status(user) %>
  • +
  • + 申请理由:<%= authorization.apply_reason %> +
  • <% if authorization.status == 2 %>
  • 原因:<%= authorization.reason.blank? ? "空" : authorization.reason %>
  • <% end %> diff --git a/app/views/welcome/_two_btn_mask_pop.html.erb b/app/views/welcome/_two_btn_mask_pop.html.erb index e18e0916c..6b7c7b5b4 100644 --- a/app/views/welcome/_two_btn_mask_pop.html.erb +++ b/app/views/welcome/_two_btn_mask_pop.html.erb @@ -8,7 +8,7 @@ url2:左侧按钮的链接 按钮如果不要跳转 传javascript:void(0), 如果按钮使用js效果使用其id进行绑定,不要写在公共的js里面 --> -
    +

    提示

    @@ -30,10 +30,22 @@
    <% else %> <% end %> +
    +
    + <%= form_tag(url1, :remote => true,:name=>"apply_trail_form",:id=>'apply_trail_form') do %> + +
    +
    +

    请填写推荐人信息或申请理由

    + 确定 +
    +
    + <% end %> +
    diff --git a/config/routes.rb b/config/routes.rb index 2eee88236..ffe1461e2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -763,7 +763,7 @@ RedmineApp::Application.routes.draw do match 'account/avatar', :to => 'account#avatar', :via => :get, :as => "avatar_account" match 'account/authentication', :to => 'account#authentication', :via => :get, :as => "authentication_account" match 'account/professional_certification', :to => 'account#professional_certification', :via => :get, :as => "professional_certification_account" - match 'account/apply_trail', :to => 'account#apply_trail', :via => :get, :as => "apply_trail_account" + match 'account/apply_trail', :to => 'account#apply_trail', :via => :post, :as => "apply_trail_account" match 'account/user_auth', :to => 'account#user_auth', :via => :get, :as => "user_auth_account" match 'account/security_settings', :to => 'account#security_settings', :via => :get, :as => "security_settings" match 'account/change_psd', :to => 'account#change_psd', :via => :get, :as => "change_psd" diff --git a/db/migrate/20170822080604_add_apply_reason_to_apply_action.rb b/db/migrate/20170822080604_add_apply_reason_to_apply_action.rb new file mode 100644 index 000000000..682113c52 --- /dev/null +++ b/db/migrate/20170822080604_add_apply_reason_to_apply_action.rb @@ -0,0 +1,5 @@ +class AddApplyReasonToApplyAction < ActiveRecord::Migration + def change + add_column :apply_actions, :apply_reason, :text + end +end diff --git a/public/javascripts/edu/account.js b/public/javascripts/edu/account.js index 5af2ed0cd..39ff433fa 100644 --- a/public/javascripts/edu/account.js +++ b/public/javascripts/edu/account.js @@ -69,6 +69,20 @@ $(function(){ $("#user_auth_submit_a").on('click',function(){ submit_user_auth(); }); + + $("#mask-left-btn").on('click', function(){ + $("#apply_reason_form").show(); + }); + + $("#apply_trail_submit_btn").on('click', function(){ + if($("#apply_reason").val().trim() == ""){ + $("#hint_message").show(); + } else{ + $("#hint_message").hide(); + $("#apply_trail_form").submit(); + $('.task-popup-warp').remove(); + } + }); }); function cancel_edit_account(status) { diff --git a/public/stylesheets/css/edu-user.css b/public/stylesheets/css/edu-user.css index bbd9de4f8..242d9d834 100644 --- a/public/stylesheets/css/edu-user.css +++ b/public/stylesheets/css/edu-user.css @@ -239,3 +239,5 @@ input.new_loggin_input_test{ -webkit-box-shadow: 0 0 0px 1000px white inset; ou .panel-cer-content .edu-table tr td{padding: 0px;border: none;border: 1px solid #ccc;padding: 6px 10px;} .panel-cer-content .edu-table tr td:nth-child(1){text-align:right;width: 25%;color: #666666} .panel-cer-content .edu-table tr td:nth-child(2){text-align:left;color: #333333;} + +.reUploadDetail{border:1px solid #dddddd; padding: 0 5px; float:left; resize:none; width:418px; height:80px; overflow-y:auto;outline: none;} \ No newline at end of file From f16d71dd63576cd7d5c77b1effdaebacd173be3f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 22 Aug 2017 16:39:09 +0800 Subject: [PATCH 23/24] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E8=AF=84=E6=B5=8B=E4=B8=AD=EF=BC=8C=E7=84=B6=E5=90=8E=E5=85=B3?= =?UTF-8?q?=E6=8E=89=E5=AE=9E=E8=AE=AD=E5=90=8Etpm=E5=B0=B1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E2=80=9C=E8=AF=84=E6=B5=8B=E4=B8=AD=E2=80=9D=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E8=BF=98=E6=98=AF=E6=AD=A3=E5=9C=A8=E6=8C=91?= =?UTF-8?q?=E6=88=98=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/challenges_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/challenges_helper.rb b/app/helpers/challenges_helper.rb index dd63cc007..3adece07d 100644 --- a/app/helpers/challenges_helper.rb +++ b/app/helpers/challenges_helper.rb @@ -18,7 +18,7 @@ module ChallengesHelper when 0 "".html_safe when 1 - "评测中" + "".html_safe when 2 "".html_safe when 3,nil From de1c18084afe29d1b0300ab5333c4dc0b5a72f30 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 22 Aug 2017 16:50:07 +0800 Subject: [PATCH 24/24] =?UTF-8?q?gitlab=20hook=E8=B7=AF=E7=94=B1=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- config/routes.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index b3125efcd..df8b0697e 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -15,7 +15,7 @@ class ShixunsController < ApplicationController DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) # push代码的时候会触发gitlab hook - def gitlab_hook + def ghook shixun_modify_status_without_publish(@shixun, 1) render :json => {status: "success"} end @@ -485,7 +485,7 @@ class ShixunsController < ApplicationController gproject = s.create_shixun(@shixun, repository) raise "版本库创建失败" if @shixun.gpid.blank? # 若和gitlab没同步成功,则抛出异常 g = Gitlab.client - hook_url = Setting.protocol + "://" + Setting.host_name + "/shixuns/#{@shixun.identifier}" + "/ghooks" + hook_url = Setting.protocol + "://" + Setting.host_name + "/shixuns/#{@shixun.identifier}" + "/ghook" g.add_project_hook(@shixun.gpid, hook_url) redirect_to shixun_path @shixun, notice: l(:notice_successful_create) rescue Exception => e diff --git a/config/routes.rb b/config/routes.rb index 2eee88236..ddba971d5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,7 +101,7 @@ RedmineApp::Application.routes.draw do get 'entry_edit' match 'entry_update' get 'shixun_discuss' - match 'gitlab_hook' + match 'ghook' end collection do get 'shixun_courses'