Skip to content

Commit

Permalink
Feature/more jobs link (#200)
Browse files Browse the repository at this point in the history
* SRCH-234 - More jobs links displayed when no results

* update css to correct indentation for jobs results
  • Loading branch information
peggles2 authored Dec 17, 2018
1 parent e7d2322 commit 3486dd1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/searches/_results.less
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@
}
}

#no-job-results {
margin: 10px 12px 12px;
font-size: @font-size-default;
}

#no-results {
.content-block();
font-size: @font-size-default;
Expand Down
2 changes: 1 addition & 1 deletion app/models/govbox_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def init_jobs

if job_results.present?
@jobs = JobResultsPostProcessor.new(results: job_results)&.post_processed_results
@modules << 'JOBS'
end
@modules << 'JOBS' if Jobs.query_eligible?(@query)
end
end

Expand Down
20 changes: 12 additions & 8 deletions app/views/searches/_jobs.mobile.haml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#jobs.search.collapsible.collapsed.focus-on-next-sibling{ tabindex: -1 }
.content-block-item.content-block-item-header

= usajobs_logo
%h3{ class: jobs_content_heading_css_classes }
= job_openings_header(search.affiliate.agency)

- search.jobs.each_with_index do |job, index|
= render partial: 'job', locals: { affiliate: search.affiliate, job: job, position: index + 1 }
- if search.jobs.count > 3
.content-block-item.content-block-item-footer.content-trigger
= render partial: 'show_more_show_less'
- if search.jobs.present?
- search.jobs.each_with_index do |job, index|
= render partial: 'job', locals: { affiliate: search.affiliate, job: job, position: index + 1 }
- if search.jobs.count > 3
.content-block-item.content-block-item-footer.content-trigger
= render partial: 'show_more_show_less'
- else
#no-job-results
= t(:no_job_results)
.content-block-item.content-block-item-footer
.see-more= link_to_more_jobs search
.see-more
= link_to_more_jobs search

3 changes: 1 addition & 2 deletions app/views/searches/index.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
= render partial: 'alert', locals: { affiliate: @affiliate } if @affiliate.alert && @affiliate.alert.renderable?
- if @search.results.blank?
= render partial: 'no_results', locals: { search: @search }

= spelling_suggestion(@search, @search_options)
= matching_site_limits @search, @search_params if @search.results.present?
= render partial: 'best_bets', locals: { search: @search } if @search.has_best_bets?
= render partial: 'med_topic', locals: { search: @search } if @search.med_topic.present?
= render partial: 'jobs', locals: { search: @search } if @search.jobs.present?
= render partial: 'jobs', locals: { search: @search } if @search.modules.include? 'JOBS'
= render partial: 'tweets', locals: { search: @search } if @search.has_tweets?
= render partial: 'govbox_video_news_items', locals: { search: @search, search_params: @search_params } if @search.has_video_news_items?
= render partial: 'govbox_news_items', locals: { search: @search } if @search.has_fresh_news_items?
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ en:
job_openings: "Job Openings"
at_agency: "at %{agency}"
federal_job_openings: "Federal Job Openings"
no_job_results: "No job openings in your region match your query"

searches:
by: by
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ es:
job_openings: "Trabajos"
at_agency: "en %{agency} (en inglés)"
federal_job_openings: "Trabajos en el Gobierno (en inglés)"
no_job_results: "Ninguna oferta de trabajo en su región coincide con su búsqueda"

searches:
by: de
Expand Down
22 changes: 19 additions & 3 deletions features/mobile_searches.feature
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,11 @@ Feature: Searches using mobile device

Scenario: Job search
Given the following Affiliates exist:
| display_name | name | contact_email | contact_name | jobs_enabled |
| English site | usagov | admin@agency.gov | John Bar | 1 |
When I am on usagov's mobile search page
| display_name | name | contact_email | contact_name |locale | jobs_enabled |
| English site | en.agency.gov | admin@agency.gov | John Bar | en | 1 |
| Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | 1 |

When I am on en.agency.gov's mobile search page
And I fill in "Enter your search term" with "jobs"
And I press "Search"
Then I should see "Federal Job Openings"
Expand All @@ -460,6 +462,20 @@ Feature: Searches using mobile device
And I should see an image link to "USAJobs.gov" with url for "https://www.usajobs.gov/"
And I should see a link to "More federal job openings on USAJobs.gov" with url for "https://www.usajobs.gov/Search/Results?hp=public"

When I am on en.agency.gov's mobile search page
And I fill in "Enter your search term" with "blablah jobs"
And I press "Search"
Then I should see an image link to "USAJobs.gov" with url for "https://www.usajobs.gov/"
And I should see "No job openings in your region match your query"
And I should see a link to "More federal job openings on USAJobs.gov" with url for "https://www.usajobs.gov/Search/Results?hp=public"

When I am on es.agency.gov's mobile search page
And I fill in "Ingrese su búsqueda" with "blablah trabajo"
And I press "Buscar"
Then I should see an image link to "USAJobs.gov" with url for "https://www.usajobs.gov/"
And I should see "Ninguna oferta de trabajo en su región coincide con su búsqueda"
And I should see a link to "​Más trabajos en el gobierno federal en USAJobs.gov" with url for "https://www.usajobs.gov/Search/Results?hp=public"

Scenario: When using tablet device
Given I am using a mobile device
And the following Affiliates exist:
Expand Down

0 comments on commit 3486dd1

Please sign in to comment.