197 lines
10 KiB
HTML
197 lines
10 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}{% if role %}{{ role.title or "Role" }}{% else %}Roles{% endif %} — roledesk{% endblock %}
|
||
|
||
{# newsdesk's feed and reader (news/newsdesk/web/templates/index.html), as
|
||
three panes: the rail of filters, the feed of roles, and the reader, which
|
||
opens as a third column beside the feed and replaces it below 60rem.
|
||
`static/roles.js` fills all three and drives every action. The server
|
||
renders only the select options, from `app.models` and
|
||
`plugins.ats.FUNCTIONS`, so they cannot drift from what the store accepts.
|
||
|
||
The rail opens on Viewing as: which search agent the feed is seen as.
|
||
An agent is a persona (a candidate, a hiring manager watching the market)
|
||
with its own scores, votes and hidden companies, so the order, the stance
|
||
on each row and every vote cast belong to the agent picked here. Order is
|
||
its own section below, the same three choices whichever agent is picked.
|
||
|
||
`/roles/{uid}` renders this same page with `role` set: the reader starts
|
||
open, so a phone lands on the role rather than on the list for as long as
|
||
the script takes. No `data-rail` on `<body>` until the script sets one:
|
||
the stylesheet shows the rail beside the feed and keeps the overlay shut,
|
||
which is right at either width before anything has been chosen. #}
|
||
|
||
{% block body_attrs %}{% if role %} data-reader="open"{% endif %}{% endblock %}
|
||
|
||
{% block header_tools %}
|
||
{# The rail's only opener, labelled with the number of filters on when there
|
||
are any, since with the rail shut nothing else says the list is narrowed. #}
|
||
<button type="button" id="rail-toggle" title="Menu (f)" aria-label="Menu"
|
||
aria-controls="rail"><span class="burger" aria-hidden="true"></span><span
|
||
class="rail-toggle-label">Menu</span></button>
|
||
<input type="search" id="search" placeholder="Search" aria-label="Search titles and companies"
|
||
autocomplete="off">
|
||
{% endblock %}
|
||
|
||
{% block page %}
|
||
{# Only ever visible under the rail overlay, which only exists narrow.
|
||
Tapping it is how the rail is put away. #}
|
||
<div id="scrim"></div>
|
||
|
||
<div class="shell">
|
||
<aside id="rail" aria-label="Filters">
|
||
<section class="rail-viewing" aria-labelledby="viewing-as">
|
||
{# A select of the enabled agents, also when there is one, so the place
|
||
to switch agent is always the same; none is a sentence with the way
|
||
to make one. The script shows whichever applies. #}
|
||
<h3 id="viewing-as">Viewing as <a class="linky" href="/settings/agents">agents</a></h3>
|
||
<select id="agent" class="rail-select agent-pick" aria-labelledby="viewing-as" hidden></select>
|
||
<p id="agent-none" class="rail-note" hidden></p>
|
||
{# Every order keeps to the agent's fetch gate (docs/architecture.md,
|
||
"5 Feed"), so the filters below only narrow what it passed. #}
|
||
<p id="agent-gate" class="rail-note" hidden></p>
|
||
</section>
|
||
{# The agent's saved filters (`/api/agents/{id}/filters`), newsdesk's
|
||
`#active` pills: a click applies one, × deletes it. Save names the
|
||
filters on screen in a field of its own; there is no editing, a change
|
||
is saved as a new one. Hidden with no agent. #}
|
||
<section id="saved" aria-labelledby="saved-title" hidden>
|
||
<h3 id="saved-title">Saved filters <button type="button" class="linky" id="save-open"
|
||
aria-controls="save-form" aria-expanded="false">save</button></h3>
|
||
<div id="saved-list" class="saved-list"></div>
|
||
<form id="save-form" class="save-form" hidden>
|
||
<input type="text" id="save-name" maxlength="80" autocomplete="off"
|
||
placeholder="Name" aria-label="Name of the saved filter">
|
||
<button type="submit">Save</button>
|
||
<button type="button" class="linky" id="save-cancel">cancel</button>
|
||
</form>
|
||
<p class="rail-note" id="saved-note" role="status" hidden></p>
|
||
</section>
|
||
<section>
|
||
<h3>Filters</h3>
|
||
<button type="button" class="rail-row" id="show-read" aria-pressed="true"
|
||
title="Include the roles you have already opened"><span>Show read</span><span
|
||
class="count" aria-hidden="true">👁</span></button>
|
||
</section>
|
||
<section>
|
||
<h3>Order</h3>
|
||
{# Agent match is the viewing agent's final score, Newest is first
|
||
seen, CV match the agent's `judge` total against its CV; all carry
|
||
that agent's votes and keep to its fetch gate. #}
|
||
<div class="seg" id="sort" role="group" aria-label="Order"></div>
|
||
<label class="rail-field" for="period">First seen</label>
|
||
<select id="period" class="rail-select"></select>
|
||
</section>
|
||
<section>
|
||
<h3>Tags <button type="button" class="linky" id="clear-tags" hidden>clear</button></h3>
|
||
<div id="tags"></div>
|
||
<p class="rail-note" id="tag-note" hidden></p>
|
||
</section>
|
||
<section>
|
||
<details id="f-more" class="rail-more">
|
||
<summary>More filters<span id="f-active" class="filter-active"></span></summary>
|
||
<div class="rail-fields">
|
||
{# Company and Place are chip inputs (static/chips.js), each pick a
|
||
company key or a place token from the suggest routes. The chips
|
||
of `?company=` and `?place=`, the substrings other pages link
|
||
with, sit under them to be taken off; nothing types a new one. #}
|
||
<div id="f-company"></div>
|
||
<div id="f-company-text" class="rail-legacy" hidden></div>
|
||
<div id="f-place"></div>
|
||
<div id="f-place-text" class="rail-legacy" hidden></div>
|
||
{# From and to are the rungs of `app.models.RUNGS`, drawn by roles.js
|
||
from `ROLEDESK_LADDER` with counts from
|
||
/api/roles/facets; the track says which side of the ladder
|
||
counts. "No level" is a question only once a bound or a track is
|
||
set. #}
|
||
<div class="rail-facet" role="group" aria-labelledby="f-seniority-label">
|
||
<span class="rail-field" id="f-seniority-label">Seniority</span>
|
||
<label class="rail-field" for="f-level-from">From</label>
|
||
<select id="f-level-from"></select>
|
||
<label class="rail-field" for="f-level-to">To</label>
|
||
<select id="f-level-to"></select>
|
||
<div class="seg" id="f-track" role="group" aria-label="Track"></div>
|
||
<label class="check" id="f-seniority-unknown-row" hidden>
|
||
<input type="checkbox" id="f-seniority-unknown"> <span>and roles with no level<span
|
||
class="count" id="f-seniority-unknown-count"></span></span>
|
||
</label>
|
||
</div>
|
||
<select id="f-function" aria-label="Function">
|
||
<option value="">Any function</option>
|
||
{% for value, label in functions %}
|
||
<option value="{{ value }}">{{ label }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<select id="f-remote" aria-label="Remote">
|
||
<option value="">Any remote</option>
|
||
{% for value, label in remote_options %}
|
||
<option value="{{ value }}">{{ label }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<div class="rail-facet">
|
||
<select id="f-pay" aria-label="Pay">
|
||
<option value="" data-label="Any pay">Any pay</option>
|
||
{% for value, label in pay_options %}
|
||
<option value="{{ value }}" data-label="{{ label }}">{{ label }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<label class="check" id="f-pay-unknown-row" hidden>
|
||
<input type="checkbox" id="f-pay-unknown"> <span>and roles that state no pay<span
|
||
class="count" id="f-pay-unknown-count"></span></span>
|
||
</label>
|
||
</div>
|
||
<select id="f-judged" aria-label="Judged">
|
||
<option value="">Any vote</option>
|
||
<option value="liked">Liked</option>
|
||
<option value="unjudged">Unjudged</option>
|
||
<option value="passed">Passed</option>
|
||
</select>
|
||
{# The deadline today or in the next four days (`closing=1`). #}
|
||
<label class="check">
|
||
<input type="checkbox" id="f-closing"> Closing soon
|
||
</label>
|
||
{# The roles the agent's fetch gate rejects, each with the reason,
|
||
in any order; offered only with an agent. #}
|
||
<label class="check" id="show-gated" hidden
|
||
title="Also list the roles this agent's fetch gate rejects, with the reason">
|
||
<input type="checkbox" id="f-gated"> Show gated
|
||
</label>
|
||
</div>
|
||
</details>
|
||
</section>
|
||
<p class="rail-stats" id="rail-stats" role="status"></p>
|
||
<p class="rail-keys"><kbd>j</kbd><kbd>k</kbd> move · <kbd>u</kbd><kbd>n</kbd><kbd>d</kbd> vote ·
|
||
<kbd>S</kbd> save · <kbd>enter</kbd> read · <kbd>o</kbd> posting · <kbd>/</kbd> search ·
|
||
<kbd>f</kbd> menu · <kbd>c</kbd> clear</p>
|
||
</aside>
|
||
|
||
<main id="list">
|
||
{# The company filtered to, when there is exactly one: its name, its
|
||
roles, its careers page and its star (`renderStrip`). #}
|
||
<section id="company-strip" class="company-strip" aria-label="Company" hidden></section>
|
||
<div id="roles-list" class="feed"></div>
|
||
<div id="feed-empty" class="empty" hidden></div>
|
||
<div id="feed-end" class="feed-end" role="status"></div>
|
||
</main>
|
||
|
||
<article id="reader" aria-label="Role"{% if not role %} hidden{% endif %}>
|
||
{%- if role %}<div class="reader-body"><p class="reader-note">Loading…</p></div>{% endif -%}
|
||
</article>
|
||
</div>
|
||
{% endblock %}
|
||
|
||
{% block scripts %}
|
||
<script>
|
||
// The seniority ladder, `RUNGS` and `LADDER` of app/models.py, so the
|
||
// rail's From, To and Track never hold a copy of the words; see
|
||
// app/web/pages.py.
|
||
window.ROLEDESK_LADDER = {{ ladder | tojson }};
|
||
</script>
|
||
{# base.html has no block in its head; a stylesheet linked from the body
|
||
applies all the same, and chips.css only adds to app.css. #}
|
||
<link rel="stylesheet" href="{{ asset('chips.css') }}">
|
||
<script src="{{ asset('chips.js') }}"></script>
|
||
<script src="{{ asset('remote.js') }}"></script>
|
||
<script src="{{ asset('judge.js') }}"></script>
|
||
<script src="{{ asset('roles.js') }}"></script>
|
||
{% endblock %}
|