From 3d344ee5028d3cedf709aaf2ddc5028d0d41b20e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Apr 2017 10:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E7=82=B9=E5=87=BB=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E4=BB=BB=E5=8A=A1=E5=8F=B3=E4=BE=A7=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB=E6=97=81?= =?UTF-8?q?=E8=BE=B9=E5=85=B6=E4=BB=96=E5=8C=BA=E5=9F=9F=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E5=8E=BB=E8=87=AA=E5=8A=A8=E6=94=B6=E7=BC=A9=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=82=B9=E5=87=BB=E5=85=A8=E9=83=A8=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E8=BD=BD=E5=85=A5=E4=B8=AD,=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E5=90=8E=E5=8F=B0=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 3 +++ app/views/games/show.html.erb | 19 ++++++++++++++++++- app/views/layouts/base_myshixun.html.erb | 20 +++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index c03f48a8d..c40e0af95 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -25,6 +25,9 @@ class GamesController < ApplicationController # @praise 判断是否点赞 # @praise 判断是否踩 def show + # 展示全部实训 + @games = @myshixun.games.includes(:challenge) + @games_count = @games.count @game_challenge = @game.challenge (@myshixun.games.count == @game_challenge.position && @game.status ==2) ? @had_done = 1 : @had_done = 0 @praise = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?", @game_challenge.id, @game_challenge.class.to_s, User.current.id).first diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 1de9e3220..40696988d 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -5,13 +5,13 @@ '/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>
+ <%= render :partial => "games_list" %>
<%= render :partial => 'games/game_show' %>
\ No newline at end of file diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index 841c48d66..06113480d 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -34,7 +34,7 @@
当前任务
  • - +
    全部任务
    <%= @myshixun.games.count %>
  • @@ -75,6 +75,7 @@ // 点击全部任务左侧tab样式切换 var c = 0; // 设置全部任务展开样式,与不展开时的样式 + var fadein = 0; //控制全部任务的渐入浅出效果 $("#all_task_tab").click(function(){ if( c == 0){ $("#all_task_tab").addClass('leftnav-active'); @@ -83,6 +84,23 @@ $("#all_task_tab").removeClass('leftnav-active'); c = 0; } + if(fadein == 0){ + $("#all_task_show").css("background", "rgba(0,0,0,0.3)"); + $("#all_task_show").show(); + $("#all_task_index").css("left","-420px").stop().animate({ + left: 0 + }, 400, function(){ + fadein = 1; + }); + }else{ + $("#all_task_show").css("background","rgba(0,0,0,0)"); + $("#all_task_index").css("left", 0).stop().animate({ + left: "-505px" + }, 400, function(){ + $("#all_task_show").hide(); + fadein = 0; + }); + } }); $("#current_task_tab").click(function(){ $("#current_task_tab").addClass('leftnav-active');