mattvanhorn/BJJLife

View on GitHub
app/views/academies/search.html.haml

Summary

Maintainability
Test Coverage
#academies.grid
  = standard_header

  .main
    .row
      - if flash[:notice]
        .notice= flash[:notice]

    .row
      = simple_form_for AcademySearch.new, :method => :get do |form|
        = form.input :location
        = form.button :submit

    .row
      .search-results
        %h4= t('.search_results')
        %a{:name => 'search_results'}
        - if academies.nearest.any?
          %ul.academies
            - academies.nearest.each do |group|
              = group.render(self)
        - else
          No results


  .sidebar
    = link_to t('.add_academy_link'), new_academy_path, :class => 'btn'
    %p= t('academies.jump_to_state')
    %ul
      - academies.by_state.each do |group|
        %li= link_to group.label, "#{academies_path}##{group.anchor}"