Commit feef191b authored by Tony Kwok's avatar Tony Kwok 💬

initial push for testing/review

parent 198c75e7
Pipeline #48835106 passed with stages
in 13 minutes and 39 seconds
......@@ -178,6 +178,34 @@ GreenhouseIo.configure do |config|
config.organization = 'Gitlab'
end
greenhouse = GreenhouseIo::JobBoard.new
departments_data = greenhouse.departments
jobs_data = greenhouse.jobs(content: 'true')
job_listings_data = []
departments_data[:departments].each do |department|
# next unless department[:child_ids].empty?
jobs = []
department[:child_ids].each do |team|
team_data = greenhouse.department(team)
jobs << { id: team_data[:id], name: team_data[:name], jobs: team_data[:jobs] }
end
job_listings_data << { id: department[:id], name: department[:name], teams: jobs }
end
proxy "/jobs/apply/index.html", '/jobs/apply/template.html',
locals: { jobListingsData: job_listings_data }, ignore: true
# create routes to job page using job-listing template
if jobs_data[:jobs].any?
jobs_data[:jobs].each do |job|
proxy "/jobs/apply/#{job[:title].downcase.strip.tr(' ', '-').gsub(/[^\w-]/, '')}-#{job[:id]}/index.html",
"/jobs/apply/job-listing/template.html",
locals: { job: job },
ignore: true
end
end
# GitLab Projects
proxy '/handbook/engineering/projects/index.html',
'/handbook/engineering/projects/template.html',
......
(function() {
$('#select-department').on('change', function() {
if (this.value === 'all') {
$('h4.department-title, h5.office-title, div.job-container').removeClass('hidden');
$('h4.department-title, h5.team-title, div.job-container').removeClass('hidden');
$('div.jobs-counter').addClass('hidden');
} else {
var dataSelection = ($('#select-department').find('option:selected').data('type') === 'department') ?
'[data-department="' + this.value + '"]' : '[data-office="' + this.value + '"]';
'[data-department="' + this.value + '"]' : '[data-team="' + this.value + '"]';
$('div.job-container, div.jobs-counter').removeClass('hidden');
$('h4.department-title, h5.office-title').addClass('hidden');
$('h4.department-title, h5.team-title').addClass('hidden');
$('div.job-container').not(dataSelection).addClass('hidden');
$('div.jobs-counter #counter').text($('div.job-container:visible').length + ' jobs');
......
---
layout: job-listing
suppress_header: true
extra_css:
- jobs.css
---
- content_for(:title){job[:title] + " - Join GitLab and work from anywhere "}
......@@ -22,31 +22,28 @@ extra_js:
%a{href: '/jobs/faq#country-hiring-guidelines'} these
%a{href: '/jobs/faq'} Please see this page for more details and other FAQs.
- greenhouse = GreenhouseIo::JobBoard.new
- departments = greenhouse.departments
.container{id: 'job-filter'}
%h6 Department
%select{id: 'select-department'}
%option{value: 'all'}= "All Departments"
- departments[:departments].each do |department|
- if department[:parent_id] == nil && !department[:child_ids].empty?
%option{value: "#{department[:id]}", data: {type: 'department'}}= department[:name]
- department[:child_ids].each do |item|
- office = greenhouse.department(item)
- if (!office[:jobs].empty?)
%option{value: "#{office[:id]}", data: {type: 'office'}}= office[:name]
- if !jobListingsData.empty?
- jobListingsData.each do |department|
- if !department[:teams].empty?
%option{value: "#{department[:id]}", data: {type: 'department'}}= department[:name]
- if !department[:teams].empty?
- department[:teams].each do |team|
- if !team[:jobs].empty?
%option{value: "#{team[:id]}", data: {type: 'team'}}= team[:name]
.container{id: 'job-listing'}
.jobs-counter.hidden
%h5#counter
- departments[:departments].each do |department|
- if department[:parent_id] == nil && !department[:child_ids].empty?
- jobListingsData.each do |department|
- if !department[:teams].empty?
%h4.department-title{data: {department: department[:id]}}= department[:name]
- department[:child_ids].each do |item|
- office = greenhouse.department(item)
- if (!office[:jobs].empty?)
%h5.office-title{data: {office: office[:id]}, style: 'padding-left: 20px'}= office[:name]
- office[:jobs].each do |job|
.job-container{data: {department: department[:id], office: office[:id]}, style: 'padding-left: 40px'}
%a{href: "#{job[:absolute_url]}"}= job[:title]
%h6= job[:location][:name]
- department[:teams].each do |team|
%h5.team-title{data: {team: team[:id]}, style: 'padding-left: 20px'}= team[:name]
- team[:jobs].each do |job|
.job-container{data: {department: department[:id], team: team[:id]}, style: 'padding-left: 40px'}
%a{href: "/jobs/apply/#{job[:title].downcase.strip.tr(' ', '-').gsub(/[^\w-]/, '')}-#{job[:id].to_s}"}= job[:title]
%h6= job[:location][:name]
!!! 5
%html{lang: "en"}
%head
= partial "includes/layout/head"
%body.blank-body
= partial "includes/google/gtm"
.container.listing-container
.content.tile{id: 'job-listing'}
%a{href: "#"} Back to GitLab Jobs
%h3= job[:title]
%h4= job[:location][:name]
%h5 Department: #{job[:departments].first[:name]}
= partial "includes/layout/footer"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment