Files
jobboard/app/templates/roles.html
T
WolfandClaude Fable 5.1 09c5dde113 Roles as a feed, a read page, votes that move the rank, unstar
The Roles tab is news's feed row: the title opens /roles/{uid}, company,
place and age under it, the badges, a one-line excerpt (summary, else the
description's opening), and ▲ ● ▼ ★ on the right, under the text at 640px.
The company affinity control leaves the row. A passed role and a hidden
company's are dimmed and stay. The filter bar is one row: order, search and
a Filters <details> holding the rest, with a judged select and "Show hidden
companies". The list loads 60 and appends on an IntersectionObserver
sentinel; back from a read page restores the filters, rows and scroll.

GET /api/roles takes offset, defaults to 60 and answers {items, total}.
judged= is a WHERE on roles.vote. Under a ranking the served score and the
order are the stored score moved by the vote (x0.5 pass, x1.2 like, capped
at 1), so a vote shows at once without a rescore. POST and DELETE
/api/roles/{uid}/vote set and clear it; pressing the pressed stance clears.

★ saves; pressed again it calls DELETE /api/applications/{id}, which drops
the application while it is still saved and answers 409 after. save_role no
longer writes the placeholder next step.

The read page (role.html, role.js) is news's reader: a bar with back,
▲ ● ▼ ★ and ↗, the company with its affinity control, place, badges, salary,
summary, the text (fetched posting, else description) and the link out.
It offers Fetch the posting for a teaser and Summarise without a summary,
against the /text and /summarise routes B4 adds. The vote and star buttons
are judge.js, shared by the feed and the reader.

Applications: titles open the read page, the Next column is gone, a Saved
column instead, and the lede says what the page is for.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-25 21:51:48 +02:00

90 lines
3.3 KiB
HTML

{% extends "base.html" %}
{% block title %}Roles — roledesk{% endblock %}
{# An empty shell: `static/roles.js` fills it 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 bar is one row at any width: the order, the search box, and a Filters
toggle. The toggle is a `<details>` whose summary is lifted into that row
by the stylesheet, so the panel it opens is in the flow under the row and
pushes the list down rather than covering it. #}
{% block content %}
<form id="filters" class="filters roles-filters" autocomplete="off">
<div class="filter-line">
<select id="f-agent" aria-label="Order">
<option value="">Newest</option>
</select>
<input type="search" id="f-q" placeholder="Search titles" aria-label="Search titles">
</div>
<details id="f-more" class="filter-more">
<summary>Filters<span id="f-active" class="filter-active"></span></summary>
<div class="filter-panel">
<input type="text" id="f-company" placeholder="Company" aria-label="Company">
<input type="text" id="f-place" placeholder="Place" aria-label="Place">
<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>
<select id="f-days" aria-label="New in">
<option value="">Any time</option>
<option value="1">New in 1 day</option>
<option value="3">New in 3 days</option>
<option value="7">New in 7 days</option>
<option value="30">New in 30 days</option>
</select>
<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>
<label class="check">
<input type="checkbox" id="f-show-muted"> Show hidden companies
</label>
<label class="check" id="show-gated" hidden>
<input type="checkbox" id="f-gated"> Show gated
</label>
</div>
</details>
</form>
<p id="roles-count" class="count" role="status"></p>
<ul id="roles-list" class="roles"></ul>
<div id="roles-end" class="roles-end" aria-hidden="true"></div>
<template id="role-row">
<li class="role">
<div class="role-body">
<a class="role-title"></a>
<div class="role-meta">
<b class="role-company"></b>
<span class="role-place"></span>
<span class="role-age"></span>
</div>
<div class="role-badges">
<span class="role-remote badge"></span>
<span class="role-function badge"></span>
<span class="role-score badge"></span>
<span class="role-gated"></span>
</div>
<p class="role-excerpt"></p>
</div>
<div class="role-actions judge"></div>
</li>
</template>
{% endblock %}
{% block scripts %}
<script src="{{ asset('judge.js') }}"></script>
<script src="{{ asset('roles.js') }}"></script>
{% endblock %}