game index

This commit is contained in:
huang 2017-03-29 15:04:24 +08:00
parent ff20a493e5
commit bfdb109b64
3 changed files with 17 additions and 17 deletions

View File

@ -8,7 +8,7 @@ class GamesController < ApplicationController
include ApplicationHelper include ApplicationHelper
def index def index
@games = @myshixun.games @games = @myshixun.games.includes(:challenge)
@games_count = @games.count @games_count = @games.count
respond_to do |format| respond_to do |format|
format.html format.html

View File

@ -7,7 +7,7 @@
<div class="content clearfix CELL _FLEX COLS ml15 mr15"> <div class="content clearfix CELL _FLEX COLS ml15 mr15">
<div class="content-info col-width CELL" id="tpi_contents_info"> <div class="content-info col-width CELL" id="tpi_contents_info">
<div class="panel-header clearfix" id="contents_top"> <div class="panel-header clearfix" id="contents_top">
<h3 class="fl">第<%= @game.stage %>关:<%= @game.subject %></h3> <h3 class="fl">第<%= @game_challenge.position %>关:<%= @game_challenge.subject %></h3>
<div class="fr mt5"> <div class="fr mt5">
<a href="javascript:void(0);" onclick="extend_game_description();"><i class="fa fa-expand font-14 fl color-grey"></i></a> <a href="javascript:void(0);" onclick="extend_game_description();"><i class="fa fa-expand font-14 fl color-grey"></i></a>
</div> </div>
@ -27,17 +27,17 @@
<div class="cl"></div> <div class="cl"></div>
<div id="tab_con_1" class="tab-info" > <div id="tab_con_1" class="tab-info" >
<div class="tab-info-inner" id="task_pass_contents"> <div class="tab-info-inner" id="task_pass_contents">
<%= h @game.task_pass.try(:html_safe) %> <%= h @game_challenge.task_pass.try(:html_safe) %>
</div> </div>
</div> </div>
<div id="tab_con_2" class="undis tab-info"> <div id="tab_con_2" class="undis tab-info">
<div class="tab-info-inner" id="task_pass_contents"> <div class="tab-info-inner" id="task_pass_contents">
<%= h @game.ready_knowledge.try(:html_safe) %> <%= h @game_challenge.ready_knowledge.try(:html_safe) %>
</div> </div>
</div> </div>
<div id="tab_con_3" class="undis tab-info"> <div id="tab_con_3" class="undis tab-info">
<div class="tab-info-inner" style="line-height: 1.9" id="game_answer_show"></div> <div class="tab-info-inner" style="line-height: 1.9" id="game_answer_show"></div>
<div class="undis" id="hidden_game_answer"><%= @game.answer.html_safe %></div> <div class="undis" id="hidden_game_answer"><%= @game_challenge.answer.html_safe %></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -8,10 +8,10 @@
<div class=" clearfix panel-inner"> <div class=" clearfix panel-inner">
<% if game.status == 0 %> <% if game.status == 0 %>
<div class="fl"> <div class="fl">
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第<%= game.stage %>关</span> <h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第<%= game.challenge.try(:position) %>关</span>
<%= link_to game.subject, myshixun_game_path(game, :myshixun_id => @myshixun), :remote => true %></h4> <%= link_to game.challenge.try(:subject), myshixun_game_path(game, :myshixun_id => @myshixun), :remote => true %></h4>
<p class="ml15 mt15 color-grey"> <p class="ml15 mt15 color-grey">
<span class=" mr10">已闯关:<%= had_pass(@myshixun) %>人</span> <span class=" mr10">已闯关:<%#= had_pass(@myshixun) %>人</span>
<span class=" mr10">平均耗时0小时28分</span> <span class=" mr10">平均耗时0小时28分</span>
</p> </p>
</div> </div>
@ -19,31 +19,31 @@
<div class="cl"></div> <div class="cl"></div>
<% elsif game.status == 1 %> <% elsif game.status == 1 %>
<div class="fl"> <div class="fl">
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第<%= game.stage %>关</span> <h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第<%= game.challenge.try(:position) %>关</span>
<%= game.subject %></h4> <%= game.challenge.try(:subject) %></h4>
<p class="ml15 mt15 color-grey"> <p class="ml15 mt15 color-grey">
<span class=" mr10">已闯关:<%= had_pass(@myshixun) %>人</span> <span class=" mr10">已闯关:<%#= had_pass(@myshixun) %>人</span>
<span class=" mr10">平均耗时0小时28分</span> <span class=" mr10">平均耗时0小时28分</span>
</p> </p>
</div> </div>
<a href="#" class=" fr link-color-green">正在解决中</a> <a href="#" class=" fr link-color-green">正在解决中</a>
<div class="cl"></div> <div class="cl"></div>
<% elsif game.status == 2 %> <% elsif game.status == 2 %>
<h4 class="fl panel-inner-title "><i class="fa fa-check-circle font-18 color-green mr5"></i><span class="color-red">第<%= game.stage %>关</span> <h4 class="fl panel-inner-title "><i class="fa fa-check-circle font-18 color-green mr5"></i><span class="color-red">第<%= game.challenge.try(:position) %>关</span>
<%= link_to game.subject, myshixun_game_path(game, :myshixun_id => @myshixun), :remote => true %></h4> <%= link_to game.challenge.try(:subject), myshixun_game_path(game, :myshixun_id => @myshixun), :remote => true %></h4>
<p class="fr "><i class="fa fa-trophy color-yellow font-16 mr5 "></i><span class=" color-grey">NO.120</span></p> <p class="fr "><i class="fa fa-trophy color-yellow font-16 mr5 "></i><span class=" color-grey">NO.120</span></p>
<div class="cl"></div> <div class="cl"></div>
<p class="ml15 mt15 color-grey"> <p class="ml15 mt15 color-grey">
<span class=" mr10">开始时间:<%= format_time(game.created_at) %></span> <span class=" mr10">开始时间:<%= format_time(game.created_at) %></span>
<span class=" mr10">完成时间:<%= format_time(game.updated_at) %></span> <span class=" mr10">完成时间:<%= format_time(game.updated_at) %></span>
<span class=" mr10">耗时:<%= game_avg_hour(game.created_at, game.updated_at) %>小时<%= game_avg_min(game.created_at, game.updated_at) %>分</span> <span class=" mr10">耗时:<%#= game_avg_hour(game.created_at, game.updated_at) %>小时<%= game_avg_min(game.created_at, game.updated_at) %>分</span>
<span class=" mr10">测评次数:<%= avg_my_pass game %>次</span> <span class=" mr10">测评次数:<%#= avg_my_pass game %>次</span>
<span class=" mr10">得分:<%= game.final_score %>分</span> <span class=" mr10">得分:<%= game.final_score %>分</span>
</p> </p>
<% elsif game.status == 3 %> <% elsif game.status == 3 %>
<div class="fl"> <div class="fl">
<h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第<%= game.stage %>关</span> <h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第<%= game.challenge.try(:position) %>关</span>
<%= game.subject %></h4> <%= game.challenge.try(:subject) %></h4>
<p class="ml15 mt15 color-grey"> <p class="ml15 mt15 color-grey">
<span class=" mr10">已闯关:<%= had_pass(@myshixun) %>人</span> <span class=" mr10">已闯关:<%= had_pass(@myshixun) %>人</span>
<span class=" mr10">平均耗时0小时28分</span> <span class=" mr10">平均耗时0小时28分</span>