AgileVentures/MetPlus_PETS

View on GitHub
app/views/jobs/_searched_job_list.html.haml

Summary

Maintainability
Test Coverage
#searched-job-list
  %table.table.table-hover
    %thead
      %tr
        %th
          = sort_link(@query, :title, {}, { class: 'searched_jobs_pagination',
                                            remote: true })
        %th
          = sort_link(@query, :description, {}, { class: 'searched_jobs_pagination',
                                                  remote: true })
        %th
          = sort_link(@query, :company_name, 'Company', {},
                      { class: 'searched_jobs_pagination', remote: true })
        %th
          = sort_link(@query, :address_state, {}, { class: 'searched_jobs_pagination',
                                                    remote: true })
        %th
          = sort_link(@query, :address_city, {}, { class: 'searched_jobs_pagination',
                                                   remote: true })
        %th
          = sort_link(@query, :status, {}, { class: 'searched_jobs_pagination',
                                             remote: true })
    %tbody
      - @jobs.each do |job|
        %tr
          %td
            = link_to highlight(job.title, @title_words), job_path(job)
          %td
            = highlight(truncate(job.description, length: 200), @description_words)
          %td
            = job.company.name
          %td
            - if job.address
              = job.address.state
          %td
            - if job.address
              = job.address.city
          %td
            %span.label{ class: "label-#{job.status}" }
              #{job.status.capitalize}

  = render partial: 'shared/paginate_footer',
           locals: { entities: @jobs,
                     paginate_class: 'searched_jobs_pagination',
                     items_count: @items_count,
                     url: jobs_path }