assemblymade/coderwall

View on GitHub
app/views/opportunities/index.html.haml

Summary

Maintainability
Test Coverage
- content_for :javascript do
  = javascript_include_tag 'jobs.js'

- content_for :credits do
  - cc_attribution_for_location_photo(params[:location])

- content_for :mixpanel do
  = record_view_event('jobs page')

%section.jobs-top{ style: "background: #343131 url('#{location_photo_path(params[:location])}') no-repeat top center; background-size: 100% 226px;" }
  #dimmer
  .inside
    .heading-outside
      .heading
        %h3= params[:skill].try(:titleize)
        %h1
          %span= job_location_string(params[:location].titleize)
    .top-box
      .post-box.cf
        %p.post-text
          Starting at $99 for 30 days
        %a.post-job.track{ href: add_job_or_signin_path, 'data-action' => 'add job', 'data-from' => 'jobs page (post a job)', 'data-properties' => { 'location' => params[:location] }.to_json }
          Post a job
      .blurb
        %p
          Jobs at companies attracting the best developers to help them solve unique challenges in an awesome environment.
.inside-main-content.cf
  %form{:action => '/jobs', :method => 'get', :id => 'filter-jobs'}
    .filter-outside
      .filter-option.keywords
        = text_field_tag(:q, params[:q], :placeholder => 'Job role, language, skills', :class => 'query')
        .query-icon
      .filter-option
        .custom-select
          %select.location{:name => 'location'}
            %option{:value => 'Worldwide', :selected => params[:location] == "Worldwide"}= "Worldwide"
            - @locations.each do |location|
              %option{:value => location.parameterize, :selected => params[:location] == location}= location
      .filter-option
        = label_tag(:remote, nil, :class => "checkbox") do
          = check_box_tag(:remote, true, @remote_allowed)
          = "Only Remote"
      .filter-option.submit
        = submit_tag(:search, :class => 'submit-btn')
  %ul.jobs
    - @jobs.each do |job|
      = render(job, locals: { job: job })
  - if @jobs_left > 20
    = link_to 'more jobs', jobs_path(q: params[:q], location: params[:location].parameterize, skill: params[:skill], remote: @remote_allowed, page: @page+1), remote: true, class: "new-more", 'data-action' => 'view more jobs', 'data-from' => 'jobs page', 'data-properties' => {'location' => params[:location]}.to_json