ChaelCodes/HuntersKeepers

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

Summary

Maintainability
Test Coverage
<div class="columns">
  <div class="column">
    <h1>
      <b><%= @hunter.retired? ? '(Retired)' : '' %></b>
      <%= @hunter.name %>, 
      <%= link_to_playbook(@hunter) %>
    </h1>
    <p><i><%= @hunter.playbook.description %></i></p>
    <p>
      <strong>Rating:</strong> <%= display_rating @hunter %>
    </p>

    <p>
      <strong>Harm:</strong>
      <%= @hunter.harm %> <%= @hunter.unstable? ? 'UNSTABLE' : '' %>
    </p>

    <p>
      <strong>Luck:</strong>
      <%= @hunter.luck %>
    </p>

    <p>
      <strong>Experience:</strong>
      <%= @hunter.experience %>
      <span v-if="<%= @hunter.experience %> >= 5">
        <%= link_to 'Take an Improvement', new_hunter_hunters_improvement_path(hunter_id: @hunter.id) %>
      </span>
    </p>
  </div>
  <div class="column">
    <p>
      <h4>Moves</h4>
      <roll-hunter-moves hunter-id=<%= "#{@hunter.id}" %>></roll-hunter-moves>
      <%# <%= render "moves/moves", moves: @hunter.moves.not_basic, hunter: @hunter %>
    </p>
  </div>
  <div class="column">
    <p>
      <h4>Gear</h4>
      <%= render "gears/gears", gears: @hunter.gears %>
    </p>
    <p>
      <% if @hunter.hunter_backstory %>
        <%= render 'hunter_backstories/hunter_backstory', playbook: @hunter.playbook, hunter_backstory: @hunter.hunter_backstory %>
      <% else %>
        <%= link_to 'New Hunter Backstory', new_hunter_hunter_backstory_url(hunter_id: @hunter.id) %>
      <% end %>
    </p>
  </div>
</div>
<%= link_to 'Edit', edit_hunter_path(@hunter), class: "button is-primary" %>
<%= link_to 'Back', hunters_path, class: "button" %>