weathermen/soundstorm

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

Summary

Maintainability
Test Coverage
!!!
%html
  = render 'head'
  %body
    %header.header
      .header__logo
        = link_to app_title, root_path
      .header__search
        = search_form(search_path) do |f|
          = f.search_field :q, search_field_options
      .header__navigation
        %nav.navigation
          - if user_signed_in?
            = nav_link_to current_user do
              .profile-link
                = image_tag current_user.avatar_image(resize: 25)
                = t('.nav.profile', name: current_user.name)
            = nav_link_to :timeline, root_path
            = nav_link_to :library, likes_path
            = nav_link_to :upload, new_track_path
            = nav_link_to :settings, edit_user_registration_path
            = nav_link_to :logout, destroy_user_session_path, method: :delete
          - else
            = nav_link_to :login, new_user_session_path
            = nav_link_to :signup, new_user_registration_path
    %main.page
      %section.page__flash.flash-messages{ data: { controller: 'flash' } }
        - flash.each do |type, message|
          - unless type.to_sym == :timedout
            = render 'flash_message', type: type, message: message
      %section.page__content
        = yield
    %footer.footer
      %nav.navigation.footer__navigation
        %span.navigation__item.footer__version
          #{Soundstorm} v#{Soundstorm::VERSION}
        = link_to Soundstorm::BLOG_URL, class: 'navigation__link' do
          = t('.footer.blog')
        = link_to Soundstorm::SOURCE_URL, class: 'navigation__link' do
          = t('.footer.source')
        = link_to Soundstorm::DOCS_URL, class: 'navigation__link' do
          = t('.footer.documentation')