Careers templates should extend base-protocol.html (Fixes #11027) (#11028)

This commit is contained in:
Alex Gibson 2021-12-23 09:18:42 +00:00 коммит произвёл GitHub
Родитель 3f6505a3ff
Коммит 6d43b8c523
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
22 изменённых файлов: 153 добавлений и 146 удалений

Просмотреть файл

@ -1,3 +1,3 @@
media/js/libs/**/*.js
media/js/ie/libs/**/*.js
media/js/careers/*.js
media/js/careers/libs/*.js

Просмотреть файл

@ -14,8 +14,8 @@ venv
media/js/libs/**/
media/js/ie/libs/**/
# Ignore careers JS files for now
media/js/careers/*
# Ignore pre-built careers JS files for now
media/js/careers/libs/*
# Ignore file types:
# https://github.com/prettier/prettier/issues/6356 blocks formating scss/css.

Просмотреть файл

@ -4,74 +4,49 @@
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}
{% set default_slug = "Mozilla Careers — Feel good about your work again" %}
<!DOCTYPE html>
<html lang="{{ LANG }}"
dir="{{ DIR }}"
class="no-js"
{% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %}>
<head>
{# meta #}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ meta_title|default(default_slug, true)|safe }}">
<meta property="og:description" content="{{ meta_description|default(default_slug, true)|safe }}">
<meta property="og:image" content="{% filter trim|absolute_url %}{{ static('img/careers/moz-m.png') }}{% endfilter %}">
<meta property="og:image:alt" content="{{ meta_title|default(default_slug, true)|safe }}">
<meta name="twitter:title" content="{{ meta_title|default(default_slug, true)|safe }}">
<meta name="twitter:description" content="{{ meta_description|default(default_slug, true)|safe }}">
<meta name="twitter:image" content="{% filter trim|absolute_url %}{{ static('img/careers/moz-m.png') }}{% endfilter %}">
<meta name="twitter:card" content="summary">
<meta name="description" content="{{ meta_description|default(default_slug, true)|safe }}">
<title>{{ meta_title|default(default_slug, true)|safe }}</title>
{% extends "base-protocol-mozilla.html" %}
{# css #}
{% block site_css %}
{{ css_bundle('careers') }}
{% endblock %}
{% block page_title %}Mozilla Careers — Feel good about your work again{% endblock %}
{% block page_title_suffix %}{% endblock %}
{# js #}
{{ js_bundle('careers-dnt-helper') }}
<script src="{{ static('js/careers/protocol-base.min.js') }}"></script>
<script src="{{ static('js/careers/protocol-utils.min.js') }}"></script>
<script src="{{ static('js/careers/protocol-supports.min.js') }}"></script>
{% block page_image %}{{ static('img/careers/moz-m.png') }}{% endblock %}
{# icons #}
<link rel="shortcut icon" type="image/png" href="{{ static('img/careers/favicon.ico') }}"/>
{% block site_css %}
{{ css_bundle('careers') }}
{% endblock %}
{# feeds #}
<link rel="alternate" type="application/rss+xml"
href="{{ url('careers.feed') }}" title="Current Mozilla job openings" />
{% block site_js %}
<!--[if !IE]><!-->
{{ js_bundle('lib') }}
<script src="{{ static('js/careers/libs/protocol-base.min.js') }}"></script>
<script src="{{ static('js/careers/libs/protocol-utils.min.js') }}"></script>
<script src="{{ static('js/careers/libs/protocol-supports.min.js') }}"></script>
{{ js_bundle('data') }}
<!--<![endif]-->
{% endblock %}
{% include 'includes/google-analytics.html' %}
{% block extrahead %}
<link rel="alternate" type="application/rss+xml" href="{{ url('careers.feed') }}" title="Current Mozilla job openings" />
{% endblock %}
</head>
<body id="{% block body_id %}{% endblock %}" class="{% block body_class %}{% endblock %}"
{%- block body_data %}
{%- endblock %}>
{% block site_header %}
{% include "careers/includes/header.html" %}
{% endblock %}
{% include "careers/includes/header.html" %}
{% block content %}
<div id="wrapper" class="mzp-l-content mzp-t-mozilla">
<main role="main">
{% block careers_content %}{% endblock %}
</main>
</div>
{% endblock %}
<div id="wrapper" class="mzp-l-content mzp-t-mozilla">
<main role="main">
{% block site_footer %}
{% include "careers/includes/footer.html" %}
{% endblock %}
{% block content %}{% endblock %}
</main>
</div><!-- /#wrapper -->
{% block site_footer %}
{% include "careers/includes/footer.html" %}
{% endblock %}
{# js #}
{% block site_js %}
<script src="{{ static('js/careers/protocol-navigation.min.js') }}"></script>
<script src="{{ static('js/careers/protocol-menu.min.js') }}"></script>
<script src="{{ static('js/careers/base.js') }}"></script>
{% endblock %}
</body>
</html>
{% block js %}
<script src="{{ static('js/careers/libs/protocol-navigation.min.js') }}"></script>
<script src="{{ static('js/careers/libs/protocol-menu.min.js') }}"></script>
{{ js_bundle('careers-base') }}
{% endblock %}

Просмотреть файл

@ -6,19 +6,18 @@
{% extends "careers/base.html" %}
{% set meta_title = "Mozilla Careers &mdash; Feel good about your work again." %}
{% set meta_description = "Mozilla Careers &mdash; Feel good about your work again. At Mozilla, you can pursue your future while working to protect the future of the internet for everyone, everywhere." %}
{% block page_title %}Mozilla Careers — Feel good about your work again.{% endblock %}
{% block page_desc %}At Mozilla, you can pursue your future while working to protect the future of the internet for everyone, everywhere.{% endblock %}
{% block body_class %}benefits-page{% endblock %}
{% block content %}
{% block careers_content %}
<section class="mzp-c-hero mzp-t-dark page-hero"></section>
<section class="mzp-l-content">
<h2>Benefits</h2>
<p>
To ensure our employees and their families feel safe, cared for, and supported, we offer world-class benefits, including:
To ensure our employees and their families feel safe, cared for, and supported, we offer world-class benefits, including:
</p>
<ul class="mzp-u-list-styled">
<li>Flexible work environment (nearly half of Mozillians work remotely)</li>
@ -26,7 +25,7 @@
<li>Generous medical, dental and vision coverage for you and your family (including no payroll deductions in most countries)</li>
<li>Reimbursement for professional development (up to $3,000 USD/year)</li>
<li>A work setup including the latest hardware and software of your choice</li>
<li>Wellness programs—we reimburse up to $1700 USD/year for a variety of expenses like child and elder care, mental wellness, and personal enrichment</li>
<li>Wellness programs—we reimburse up to $1700 USD/year for a variety of expenses like child and elder care, mental wellness, and personal enrichment</li>
</ul>
</section>
@ -35,5 +34,4 @@
<a class="mzp-c-button" href="{{ url('careers.listings') }}">Apply Now</a>
</div>
</div>
{% endblock %}

Просмотреть файл

@ -6,11 +6,10 @@
{% extends "careers/base.html" %}
{% set meta_title = "Mozilla Careers &mdash; Feel good about your work again." %}
{% set meta_description = "Mozilla Careers &mdash; Feel good about your work again. At Mozilla, you can pursue your future while working to protect the future of the internet for everyone, everywhere." %}
{% block content %}
{% block page_title %}Mozilla Careers — Feel good about your work again.{% endblock %}
{% block page_desc %}At Mozilla, you can pursue your future while working to protect the future of the internet for everyone, everywhere.{% endblock %}
{% block careers_content %}
<section class="mzp-c-hero mzp-t-dark page-hero">
<div class="mzp-l-content">
<div class="mzp-c-hero-body">
@ -381,5 +380,4 @@
</li>
</ul>
</section>
{% endblock %}

Просмотреть файл

@ -6,13 +6,12 @@
{% extends "careers/base.html" %}
{% set meta_title = "Mozilla Careers &mdash; Experience an internship at Mozilla" %}
{% set meta_description = "Mozilla Careers &mdash; Interns at Mozilla work alongside industry leaders on meaningful projects like online privacy protection." %}
{% block page_title %}Mozilla Careers — Experience an internship at Mozilla{% endblock %}
{% block page_desc %}Interns at Mozilla work alongside industry leaders on meaningful projects like online privacy protection.{% endblock %}
{% block body_class %}internships-page{% endblock %}
{% block content %}
{% block careers_content %}
<section class="mzp-l-content mzp-c-hero mzp-t-dark">
<div class="mzp-c-hero-body">
<h1 class="mzp-c-hero-title">Make an Impact</h1>
@ -127,7 +126,6 @@
</div>
</section>
<section class="internships-grey-section">
<div class="l-internships-apply mzp-l-content c-section-heading">
<h2>Application process</h2>
@ -220,5 +218,4 @@
internship</a>
</div>
</section>
{% endblock %}

Просмотреть файл

@ -6,13 +6,12 @@
{% extends "careers/base.html" %}
{% set meta_title = "Mozilla Careers &mdash; All open positions at Mozilla" %}
{% set meta_description = "Mozilla Careers &mdash; We have a mighty mandate, serving hundreds of millions of people. Add a culture of exploration, and there is always a new way to learn and grow here." %}
{% block page_title %}Mozilla Careers — All open positions at Mozilla{% endblock %}
{% block page_desc %}We have a mighty mandate, serving hundreds of millions of people. Add a culture of exploration, and there is always a new way to learn and grow here.{% endblock %}
{% block body_class %}listings-page{% endblock %}
{% block content %}
{% block careers_content %}
<section class="mzp-c-hero mzp-t-dark page-hero">
<div class="mzp-l-content">
<div class="mzp-c-hero-body">
@ -30,7 +29,7 @@
<section class="mzp-l-content">
<h2>Listings</h2>
<form id="listings-filters">
<form id="listings-filters" class="hide-from-legacy-ie">
<div class="listings-filter listings-filter-location">
{{ form.location }}
<label for="id_location" class="visually-hidden">Location</label>
@ -76,8 +75,6 @@
</section>
{% endblock %}
{% block site_js %}
{{ super() }}
<script src="{{ static('js/careers/listings.js') }}"></script>
<script src="{{ static('js/careers/filters.js') }}"></script>
{% endblock %}
{% block js %}
{{ js_bundle('careers-listings') }}
{% endblock %}

Просмотреть файл

@ -6,12 +6,12 @@
{% extends "careers/base.html" %}
{% set meta_title = "Mozilla Careers &mdash; " + position.title + " &mdash; Open Positions" %}
{% set meta_description = "Mozilla Careers &mdash; " + meta_description|truncate(175, end='…') %}
{% block page_title %}Mozilla Careers — {{ position.title }} — Open Positions{% endblock %}
{% block page_desc %}{{ meta_description|truncate(175, end='…') }}{% endblock %}
{% block body_class %}position-page{% endblock %}
{% block content %}
{% block careers_content %}
<section class="job-post" id="job-post">
<div class="job-row">
<div>
@ -19,8 +19,8 @@
<strong>{{ position.title }}</strong>
</div>
<div class="title-location">
at
{% if position.is_mofo %}
at
{% if position.is_mofo %}
Mozilla Foundation
{% else %}
Mozilla Corporation
@ -126,5 +126,4 @@
</div>
</div>
</section>
{% endblock %}

Просмотреть файл

@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
/* -------------------------------------------------------------------------- */

Просмотреть файл

@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
.internships-page .mzp-c-button {
margin: 60px 0;

Двоичные данные
media/img/careers/favicon.ico

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 17 KiB

Просмотреть файл

@ -1,3 +1,9 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
(function (Mzp) {
'use strict';

Просмотреть файл

@ -1,24 +1,37 @@
(function() {
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
(function () {
'use strict';
/**
* Monitors inputs and filters a list of positions when they change.
*/
function PositionFilters(typeInput, teamInput, locationInput, positionTable) {
function PositionFilters(
typeInput,
teamInput,
locationInput,
positionTable
) {
this.typeInput = typeInput;
this.teamInput = teamInput;
this.locationInput = locationInput;
this.positionTable = positionTable;
this.emptyFilterMessage = document.getElementById('empty-filter-message');
this.emptyFilterMessage = document.getElementById(
'empty-filter-message'
);
}
PositionFilters.prototype = {
/**
* Bind onFilterChange to the change events for each input.
*/
bindEvents: function() {
bindEvents: function () {
var self = this;
var callback = function() {
var callback = function () {
self.onFilterChange();
};
@ -30,17 +43,18 @@
/**
* When a filter changes, refresh the position list.
*/
onFilterChange: function() {
onFilterChange: function () {
var i;
// collection of tr.position elements
var positions = this.positionTable.getElementsByClassName('position');
var positions =
this.positionTable.getElementsByClassName('position');
var positionsVisible = false;
var querystring = '';
var filters = {
'position_type': this.typeInput.value,
'team': this.teamInput.value,
'location': this.locationInput.value
position_type: this.typeInput.value,
team: this.teamInput.value,
location: this.locationInput.value
};
// Hide table and show all positions.
@ -70,7 +84,10 @@
// Get rid of unset filters.
for (var k in filters) {
if (filters.hasOwnProperty(k) && !filters[k]) {
if (
Object.prototype.hasOwnProperty.call(filters, k) &&
!filters[k]
) {
delete filters[k];
}
}
@ -81,11 +98,12 @@
}
// Preserve Google Analytics parameters.
var ga_parameters = window.location.search.substr(1).split('&').filter(
function(parameter) {
var ga_parameters = window.location.search
.substr(1)
.split('&')
.filter(function (parameter) {
return parameter.indexOf('utm_') === 0;
}
);
});
if (querystring.length && ga_parameters.length) {
querystring += '&';
@ -98,7 +116,11 @@
}
// Replace history state with this filtered state.
window.history.replaceState(filters, 'Filtered', location.pathname + querystring);
window.history.replaceState(
filters,
'Filtered',
location.pathname + querystring
);
this.positionTable.classList.remove('hidden');
},
@ -106,11 +128,11 @@
/**
* Hide any positions that do have the correct value for the given field.
*/
filterPositions: function(field, value) {
if (!value)
return;
filterPositions: function (field, value) {
if (!value) return;
var positions = this.positionTable.getElementsByClassName('position');
var positions =
this.positionTable.getElementsByClassName('position');
for (var i = 0; i < positions.length; i++) {
var data = positions.item(i).dataset[field];
@ -121,11 +143,11 @@
}
},
filterLocations: function(value) {
if (!value)
return;
filterLocations: function (value) {
if (!value) return;
var positions = this.positionTable.getElementsByClassName('position');
var positions =
this.positionTable.getElementsByClassName('position');
for (var i = 0; i < positions.length; i++) {
var data = positions.item(i).dataset.location;
@ -137,16 +159,23 @@
if (data.indexOf(value + ',') === -1) {
positions.item(i).classList.add('hidden');
}
} else if (data.indexOf(value + ',') === -1 && data.indexOf('All Offices,') === -1) {
} else if (
data.indexOf(value + ',') === -1 &&
data.indexOf('All Offices,') === -1
) {
positions.item(i).classList.add('hidden');
}
};
}
}
};
var inputs = document.getElementById('listings-filters').elements;
var filters = new PositionFilters(inputs.position_type, inputs.team, inputs.location,
document.getElementById('listings-positions'));
var filters = new PositionFilters(
inputs.position_type,
inputs.team,
inputs.location,
document.getElementById('listings-positions')
);
filters.bindEvents();
filters.onFilterChange(); // Trigger sorting on initial load for querystring arguments.
})();

Просмотреть файл

@ -1,5 +0,0 @@
(function() {
'use strict';
var docElement = document.documentElement;
docElement.className = docElement.className.replace(/\bjs-disabled\b/,'') + ' js-enabled';
})();

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,13 +1,19 @@
(function() {
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
(function () {
'use strict';
/*
* Listings
*/
* Listings
*/
/**
* Take filter values in querystring and propogate to select inputs
*/
*/
function propogateQueryParamsToSelects() {
var i;
var j;

Просмотреть файл

@ -1664,9 +1664,16 @@
},
{
"files": [
"js/base/dnt-helper.js"
"js/careers/base.js"
],
"name": "careers-dnt-helper"
"name": "careers-base"
},
{
"files": [
"js/careers/listings.js",
"js/careers/filters.js"
],
"name": "careers-listings"
}
]
}

Просмотреть файл

@ -93,8 +93,8 @@ const jsConfig = {
},
{
// Copy minified careers pages JS.
from: path.resolve(__dirname, 'media/js/careers/'),
to: 'js/careers/'
from: path.resolve(__dirname, 'media/js/careers/libs/'),
to: 'js/careers/libs/'
}
]
})