rtopitt/bolao2014

View on GitHub
app/views/my_bet/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for(:title) { t('.title') } %>

<div class="row">
  <div class="small-12 column">
    <h2><%= t '.title' %></h2>
    <p><%= t '.current_score' %>: <%= @bet.points %></p>
  </div>
</div>

<div class="row">
  <div class="small-12 column">
    <%= render partial: 'my_bet/payment', locals: {bet: @bet} %>
  </div>
</div>

<div class="row">
  <div class="small-6 column">
    <% if @matches.any? %>
      <p class="panel callout radius"><strong><%= t('.you_have_matches_to_bet', count: @matches.size, link: link_to(t('.do_it_now'), my_match_bet_path(@matches.first))).html_safe %>!</strong></p>
    <% end %>
  </div>
  <div class="small-6 column">
    <% if @questions.any? %>
      <p class="panel callout radius"><strong><%= t('.you_have_questions_to_bet', count: @questions.size, link: link_to(t('.do_it_now'), my_question_bet_path(@questions.first))).html_safe %>!</strong></p>
    <% end %>
  </div>
</div>

<div class="row">
  <div class="small-6 column">
    <h3>
      <%= Match.model_name.human(count: 2) %>
      <small>(<%= link_to t('common.view'), my_bet_matches_path %>)</small>
    </h3>
    <p><%= t '.matches_betted', count: @bet.matches_count %> (<%= link_to t('common.view'), my_bet_matches_path(filter: :betted) %>)</p>
    <p><%= t '.matches_to_bet', count: @matches.size %> (<%= link_to t('common.view'), my_bet_matches_path(filter: :to_bet) %>)</p>
  </div>
  <div class="small-6 column">
    <h3>
      <%= Question.model_name.human(count: 2) %>
      <small>(<%= link_to t('common.view'), my_bet_questions_path %>)</small>
    </h3>
    <p><%= t '.questions_betted', count: @bet.questions_count %> (<%= link_to t('common.view'), my_bet_questions_path(filter: :betted) %>)</p>
    <p><%= t '.questions_to_bet', count: @questions.size %> (<%= link_to t('common.view'), my_bet_questions_path(filter: :to_bet) %>)</p>
  </div>
</div>