porkchopclub/porkchop

View on GitHub
app/views/layouts/_header.html.haml

Summary

Maintainability
Test Coverage
.site-header-wrap
  %nav.site-header
    = image_tag "header-paddle.svg", class: 'site-header-paddle'
    %h1.site-header-title
      = link_to "/" do
        PorkChop<span>.club</span>
    .site-header-padding
    .site-header-controls
      - if current_player
        - if current_player.active?
          = link_to play_path, method: :delete, class: "red" do
            %span.label Take me out
            = fa_icon "user-times"
        - else
          = link_to play_path, method: :post, class: "green" do
            %span.label Put me in
            = fa_icon "user-plus"

        = link_to destroy_player_session_path, method: :delete, class: "blue" do
          %span.label Log out
          = fa_icon "sign-out"

        = link_to edit_player_registration_path, class: "green" do
          = fa_icon "cog"
      - else
        = link_to "Log in", new_player_session_path, class: "red"