From f53e820774413c72662d29f79a19913fed59a930 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Jul 2017 15:04:30 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E6=88=91=E5=B7=B2=E7=BB=8F=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=AC=AC2=E5=85=B3=E6=9C=AA=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=AC=AC3=E5=85=B3=EF=BC=8C=E9=80=80=E5=87=BA=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E5=90=8E=E7=BB=A7=E7=BB=AD=E5=AE=9E=E6=88=98=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E8=BF=98=E6=98=AF=E7=AC=AC1=E5=85=B3?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E8=AF=A5=E6=98=AF=E5=BD=93=E5=89=8D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=AC=AC2=E5=85=B3=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 3 ++- app/views/games/_repository.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index 5e57b85e9..cf0579655 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -60,7 +60,8 @@ class Myshixun < ActiveRecord::Base games = self.games current_game = games.select{|game| game.status == 1 || game.status == 0}.first if current_game.blank? - passed_games = games.select{|game| game.status == 2} + game_id = '(' + games.map(&:id).join(',') + ')' + passed_games = games.find_by_sql("SELECT *, (SELECT c.position from `challenges` c where g.challenge_id = c.id) as pos FROM `games` g where g.status = 2 and g.id in #{game_id} ORDER BY pos desc") current_game = passed_games.first end return current_game diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 8e60e8224..db45a4e4f 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -84,7 +84,7 @@ // 本地版 var html_local =""; console.log(html); - $("#codotab_con_2").html(html); + $("#codotab_con_2").html(html_local); var h = $("#games_repository_contents").height() - $("#top_repository").height() - 10; $("#game_webssh").css("min-height", h); HoverLi_new(2); From 7f489c12a72392cf8e2443aa895dc0bcdcc8bbe0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Jul 2017 15:05:15 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88WEBSSH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index db45a4e4f..8e60e8224 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -84,7 +84,7 @@ // 本地版 var html_local =""; console.log(html); - $("#codotab_con_2").html(html_local); + $("#codotab_con_2").html(html); var h = $("#games_repository_contents").height() - $("#top_repository").height() - 10; $("#game_webssh").css("min-height", h); HoverLi_new(2); From ee23e794411ace2090dc67da7ad54d6f3a4a0a61 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 25 Jul 2017 16:30:40 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 99626c6cb..002ed0db7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -164,7 +164,7 @@ module ApplicationHelper # 实训语言的种类 def shixun_language - ["Java", "C", "C++", "Python", "MySQL/Java"] + ["Java", "C", "C++", "Python", "MySQL/Java","JFinal","Docker","Ethoernet","Dynamips"] end # 实训试用专业 From 607ab2c76798db702e34fa47cfa0e78ca14f185c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Jul 2017 16:55:52 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index f4b8c6c91..abab48f3b 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -48,6 +48,8 @@ class MyshixunsController < ApplicationController jenkins_shixuns = Redmine::Configuration['jenkins_shixuns'] uri = URI("#{jenkins_shixuns}/jenkins-exec/webssh/deleteSSH") user_id = User.current.id + logger.info("#############################") + logger.info("game_id:" + @_params[:id]) params = {gameID:@_params[:id]} # @_params[:id] 是webssh传过来的gameId res = uri_exec uri, params if res && res['code'].to_i != 0 From 8b2885e4088daaaa266af3a83eff6796049a1550 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 25 Jul 2017 17:29:31 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E5=85=89=E6=A0=87=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_task_pass_form.html.erb | 8 +++----- app/views/subjects/show.html.erb | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/views/challenges/_task_pass_form.html.erb b/app/views/challenges/_task_pass_form.html.erb index 91dc9d557..e85e9301e 100644 --- a/app/views/challenges/_task_pass_form.html.erb +++ b/app/views/challenges/_task_pass_form.html.erb @@ -25,11 +25,9 @@ - - - - - +
  • + +
  • 保存 <% if params[:action] == "new" %> diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 113680a8c..7b6ac4f87 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -8,6 +8,7 @@ $(".edit-produce").on("click",function(){ $(".subject-produce").attr("contenteditable","true"); $("#subject-produce").focus(); + getC($('#subject-produce')); }) $(".subject-produce").on("keydown",function(ev){ if(ev.keyCode==13 || ev.keyCode==108){ @@ -17,6 +18,16 @@ $(".subject-produce").on("blur",function(){ $(".subject-produce").attr("contenteditable","false"); }) + function getC(that){ + if(document.all){ + that.range=document.selection.createRange(); + that.range.select(); + that.range.moveStart("character",-1); + }else{ + that.range=window.getSelection().getRangeAt(0); + that.range.setStart(that.range.startContainer,that.html().length); + } + }
    From 37b908771cb9c8cd57cf3cc1a057e78756ce8d1f Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Wed, 26 Jul 2017 10:06:27 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=82=E6=A0=B7=E5=BC=8F=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- app/views/games/_game_show.html.erb | 38 ++++++++++++++++++++++++++-- app/views/games/_repository.html.erb | 21 ++++++++------- public/stylesheets/css/taskstyle.css | 12 +++++---- 4 files changed, 56 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 8033bf210..57e9d17f7 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,7 @@ group :development, :test do gem 'pry-byebug' gem "test-unit", "~>3.0" end - gem 'rspec-rails', '~> 3.0' + # gem 'rspec-rails', '~> 3.0' gem 'factory_girl_rails' end diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index e4285c23d..b446e1b92 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -110,6 +110,7 @@ \ No newline at end of file diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index d0a403e6e..9aa7296f2 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -145,12 +145,14 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f .-scroll{ overflow:auto;} .-flex-basic0{flex-basis: 0%!important; display: none} /*王昌------------拖拽增加样式---------------修改*/ -.-flex-basic40{flex-basis: auto;} -.-flex-basic50{flex-basis: auto;} -.b-label{width:2px;cursor:e-resize;} -.h-center{height:2px;cursor:n-resize;background:#2b2b2b;z-index:9999;} +.-flex-basic40{flex-basis:auto;} +.-flex-basic50{flex-basis:auto;} +.b-label{width:4px;cursor:ew-resize;background:#2b2b2b;} +.h-center{height:4px;cursor:ns-resize;background:#0b1746;z-index:9999;} +.-brother{width:100%;height:100%;position:absolute;left:0;top:0;z-index:999;} +.-bg-weightblack{background:#000;} /*---------------------------------------------*/ -.-flex-basic60{flex-basis: 70%;} +.-flex-basic60{flex-basis: auto;} .-flex-basic100{flex-basis: 100%!important;} .-header-title{ max-width:500px; font-weight: normal;} .-header-right{ background:#333;border-radius:25px; padding:5px 15px; height: 30px; position: absolute; right:10px;line-height: 30px;} From a4050c6da9a570a4899c4e4c4d340b75c99364dd Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 26 Jul 2017 10:21:38 +0800 Subject: [PATCH 07/15] =?UTF-8?q?TPI=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 3 ++- public/stylesheets/css/taskstyle.css | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 36252f55e..36178e65a 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -71,13 +71,14 @@ g_l('codotab_con_'+i).className='undis'; } + n == 2 ? $("#games_repository_contents").removeClass("-bg-black").addClass("-bg-weightblack") + : $("#games_repository_contents").removeClass("-bg-weightblack").addClass("-bg-black"); g_l('codotab_con_'+n).className='dis -relative'; g_l('codetab_nav_'+n).className='blacktab_hover'; }; $('#codetab_nav_2').on("click", function(){ - $.ajax({ url: "<%= open_webssh_myshixun_path(@myshixun) %>", success: function(data){ diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 904b395de..2b4195e3f 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -148,7 +148,7 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f .-flex-basic40{flex-basis:auto;} .-flex-basic50{flex-basis:auto;} .b-label{width:4px;cursor:ew-resize;background:#2b2b2b;} -.h-center{height:4px;cursor:ns-resize;background:#0b1746;z-index:9999;} +.h-center{height:4px;cursor:ns-resize;background:#33485F;z-index:9999;} .-brother{width:100%;height:100%;position:absolute;left:0;top:0;z-index:999;} .-bg-weightblack{background:#000;} /*---------------------------------------------*/ From df36063fe63368bcf11f4bbf1b798799631b3342 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 26 Jul 2017 10:30:47 +0800 Subject: [PATCH 08/15] webssh --- app/views/games/_game_show.html.erb | 2 ++ app/views/games/_repository.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index b446e1b92..c00b73db4 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -136,6 +136,7 @@ $(function(){ ); doc.bind('mousemove',function(e){ // console.log(dragging); + $(".-brother").show();// 代码行的遮罩显示 if(dragging) { clickX = e.pageX; @@ -194,6 +195,7 @@ $(function(){ flag = false; dragging = false; e.cancelBubble = true; + $(".-brother").hide(); // 代码行的遮罩隐藏 }); }) /*-----------------------------------------------------------------------------------*/ diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 36178e65a..8930f2d64 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -86,9 +86,9 @@ return; }else{ // 测试版 - var html = "
    "; + var html = "
    "; // 本地版 - var html_local ="
    "; + var html_local ="
    "; $("#codotab_con_2").html(html); var h = $("#games_repository_contents").height() - $("#top_repository").height() - 10; $("#game_webssh").css("min-height", h); From 32c3a9ea700a9c2ffac6d6679bfffb4909c9861c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 26 Jul 2017 11:16:16 +0800 Subject: [PATCH 09/15] =?UTF-8?q?tpi=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/taskstyle.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 2b4195e3f..d29284567 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -152,7 +152,7 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f .-brother{width:100%;height:100%;position:absolute;left:0;top:0;z-index:999;} .-bg-weightblack{background:#000;} /*---------------------------------------------*/ -.-flex-basic60{flex-basis: auto;} +.-flex-basic60{flex-basis: 55%;} .-flex-basic100{flex-basis: 100%!important;} .-header-title{ max-width:500px; font-weight: normal;} .-header-right{ background:#333;border-radius:25px; padding:5px 15px; height: 30px; position: absolute; right:10px;line-height: 30px;} From f0043373e7fcb169836c0ce9b3454d05e1d9a179 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 26 Jul 2017 11:18:23 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E9=80=89=E5=A4=9A=E9=80=89=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_edit_task_pass.html.erb | 5 +- app/views/challenges/_task_pass_form.html.erb | 74 ++++++++++++++++++- app/views/subjects/show.html.erb | 11 --- public/stylesheets/css/edu-user.css | 2 +- public/stylesheets/css/taskstyle.css | 10 +++ 5 files changed, 84 insertions(+), 18 deletions(-) diff --git a/app/views/challenges/_edit_task_pass.html.erb b/app/views/challenges/_edit_task_pass.html.erb index 0e602d69d..57fcd4b48 100644 --- a/app/views/challenges/_edit_task_pass.html.erb +++ b/app/views/challenges/_edit_task_pass.html.erb @@ -31,11 +31,12 @@ <% end %> <% end %> +
      +
    • +
    <%# if @challenge.st == 1 %> - - <%# end %>
  • @@ -25,9 +31,14 @@
  • -
  • - -
  • + +
  • 保存 <% if params[:action] == "new" %> @@ -66,7 +77,62 @@ imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url }); + + var bt = baidu.template; + bt.LEFT_DELIMITER = ''; + + $("#shixun_form").on('click', 'a.option_icon_add', function () { + var html = bt('t:set-option-list', null); + $(this).parent().parent('.clearfix').before(html); + var inputs = document.getElementsByName("option_inputs_label"); + var inputs_spans = document.getElementsByName("option_span"); + for (var j = 0; j < inputs_spans.length; j++) { + if(j >= 0 && j <= 26){ + $(inputs_spans[j]).html(String.fromCharCode(65 + j)); + } + } + for (var i = 0; i < inputs.length; i++) { + autoTextarea(inputs[i], 0, 140); + } + $(inputs[inputs.length - 1]).focus(); + }); + $("#shixun_form").on('click', 'a.option_icon_remove', function () { + $(this).parent('.clearfix').remove(); + var inputs_spans = document.getElementsByName("option_span"); + for (var j = 0; j < inputs_spans.length; j++) { + if(j >= 0 && j <= 26){ + if(j >= 0 && j <= 26){ + $(inputs_spans[j]).html(String.fromCharCode(65 + j)); + } + } + } + }); }); + //设置选项答案 + function selectchoice(item){ + //判断是否选中,如果选中,再次点击的时候取消选中 + if($(item).hasClass('check-option-bg')){ + $(item).removeClass('check-option-bg'); + }else{ + if(true){ + //单选 + $(".select-choice").removeClass('check-option-bg'); + $(item).addClass('check-option-bg'); + }else{ + //多选 + $(item).addClass('check-option-bg'); + } + } + $("#current-option").html(""); + if($(".check-option-bg").length>0){ + for(var i=0;i<$(".check-option-bg").length;i++){ + $("#current-option").html($("#current-option").html()+$(".check-option-bg").eq(i).html()); + } + }else{ + $("#current-option").html("请点击正确选项"); + } + } window.onload = function(){ $("#challenge_task_pass [type=\"latex\"]").bind("click", function(){ taskpass_editormd.cm.replaceSelection("```latex"); diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 7b6ac4f87..113680a8c 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -8,7 +8,6 @@ $(".edit-produce").on("click",function(){ $(".subject-produce").attr("contenteditable","true"); $("#subject-produce").focus(); - getC($('#subject-produce')); }) $(".subject-produce").on("keydown",function(ev){ if(ev.keyCode==13 || ev.keyCode==108){ @@ -18,16 +17,6 @@ $(".subject-produce").on("blur",function(){ $(".subject-produce").attr("contenteditable","false"); }) - function getC(that){ - if(document.all){ - that.range=document.selection.createRange(); - that.range.select(); - that.range.moveStart("character",-1); - }else{ - that.range=window.getSelection().getRangeAt(0); - that.range.setStart(that.range.startContainer,that.html().length); - } - }
    diff --git a/public/stylesheets/css/edu-user.css b/public/stylesheets/css/edu-user.css index dba560039..9e5fea434 100644 --- a/public/stylesheets/css/edu-user.css +++ b/public/stylesheets/css/edu-user.css @@ -102,7 +102,7 @@ .-task-con-int .passageway .hascon .expand{display:block;;height:70px;line-height:70px;text-align:center;color:#5faee3;} .-task-con-int .passageway .hascon .expand:hover{ color:#5faee3;} .bg_shadow{-webkit-box-shadow: 0 0 10px #ccc;-moz-box-shadow: 0 0 10px #ccc;box-shadow: 0 0 10px #ccc;} -.new_expand{display:block;;height:70px;line-height:70px;text-align:center;color:#5faee3; background: #fafbfb} +.new_expand{display:block;;height:70px;line-height:70px;text-align:center;color:#5faee3; background: #FFFFFF} .new_expand:hover{ color:#5faee3;} /*--------------------------------------箭头动画效果-----------------------------------*/ .-task-con-int .passageway .hint .zhuan{ diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 82ea7b9da..aded92ff9 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -98,6 +98,7 @@ input.panel-form-width-100{ padding:5px;width:100%; height:40px; min-width:700px textarea.panel-form-width-100{ padding:5px;width:100%; height:150px; min-width:700px;} textarea.panel-form-width-40{ padding:5px;width:100%; height: 40px; min-width:700px;} textarea.panel-form-width-690{ padding:5px;width:90%; height:150px; min-width:700px;} +textarea.panel-form-width2-690{ padding:5px;width:90%; height:40px; min-width:700px;} .panel-form-width-670{ width: 670px; padding:5px;} .panel-form-height-150{ height: 150px;} .panel-form-height-30{height: 30px;} @@ -329,3 +330,12 @@ a.shixun-task-ban-btn{background-color: #c2c4c6;display: inline-block;font-weigh .comment-input{width: 90%;padding: 0px 10px;} .comment-input textarea{border: none !important;width:86%; outline: none;height: 30px;border-radius: 4px;margin-right: 10px;padding-left: 5px;float:left} .comment_position{ position: absolute;bottom: 8px;} + +/*-------新建阶段添加选项部分----------*/ +.option-item{border:1px solid #e2e2e2;} +.add-option-item{border:1px dashed #e2e2e2;} +.option-item,.add-option-item{display: block;width: 38px;height: 38px;text-align: center;line-height: 38px;border-radius: 4px} +.check-option-bg{background: #ee4a1f;color: #ffffff!important;border: 1px solid #ee4a1f} +.add-option-input{padding: 5px;width: 90%;height: 40px;min-width: 700px;border: 1px dashed #e2e2e2;} +.add-option-input a{display: block;width: 100%;height: 100%;cursor: pointer} +.position-delete{position: absolute;right: -17px;top: 12px;cursor: pointer} From 9961fcf511e4e8b9467cf160c39a61d6c09734e5 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Wed, 26 Jul 2017 14:18:42 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_game_show.html.erb | 33 ++-------------------------- public/stylesheets/css/taskstyle.css | 2 +- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index c00b73db4..35755bb00 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -110,7 +110,6 @@ \ No newline at end of file diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 98298e1b4..1ab903787 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -18,6 +18,7 @@ $(".subject-produce").html(""); }; $("#subject-produce").focus(); + getC($("#subject-produce")); }); $(".subject-produce").on("keydown",function(ev){ if(ev.keyCode==13 || ev.keyCode==108){ @@ -38,6 +39,16 @@ $("#subject-produce").removeClass("color-light-grey"); } }) + function getC(that){ + if(document.all){ + that.range=document.selection.createRange(); + that.range.select(); + that.range.moveStart("character",-1); + }else{ + that.range=window.getSelection().getRangeAt(0); + that.range.setStart(that.range.startContainer,that.html().length); + } + }
    diff --git a/public/stylesheets/css/edu-subject.css b/public/stylesheets/css/edu-subject.css index 9ea88df50..c1fe54c60 100644 --- a/public/stylesheets/css/edu-subject.css +++ b/public/stylesheets/css/edu-subject.css @@ -70,8 +70,7 @@ li.li-width10{width: 10%;text-align: left} .allback{background-color:#FFFFFF} -.last-all-count{width: 20%;text-align: right;} -.last-all-count li{float: left;width: 33.3%;} +.last-all-count{text-align: right;} .course-option{width: 570px;padding: 10px;background-color: #FFFFFF;} .magic-radio + label:before, .magic-checkbox + label:before{top: 11px;left: 5px;} From 182dc3f4211fa2d71a6adc9fc3a436b3c1b05085 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 26 Jul 2017 15:15:47 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index d75511204..e73ce0214 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -88,7 +88,6 @@ class SubjectsController < ApplicationController end def publish - @subject.update_attributes(:status => 1) apply = ApplyAction.where(:container_type => "ApplySubject", :container_id => @subject.id).order("created_at desc").first if apply && apply.status == 0 @status = 0 @@ -96,6 +95,7 @@ class SubjectsController < ApplicationController if Shixun.where(:id => @subject.stage_shixuns.map(&:shixun_id), :status => [0, 1]).count > 0 @status = 2 else + @subject.update_attributes(:status => 1) ApplyAction.create(:container_type => "ApplySubject", :container_id => @subject.id, :user_id => User.current.id, :status => 0) notes = User.current.show_name.to_s + " 申请发布课程实训:#{@subject.name}" JournalsForMessage.create(:jour_id => 1, :jour_type => 'Principal', :user_id => User.current.id, :notes => notes, :private => 1, :reply_id => 0)