mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add /tu/{proposal_id} (get, post) routes
This commit ports the `/tu/?id={proposal_id}` PHP routes to FastAPI into two individual GET and POST routes. With this port of the single proposal view and POST logic, several things have changed. - The only parameter used is now `decision`, which must contain `Yes`, `No`, or `Abstain` as a string. When an invalid value is given, a BAD_REQUEST response is returned in plaintext: Invalid 'decision' value. - The `doVote` parameter has been removed. - The details section has been rearranged into a set of divs with specific classes that can be used for testing. CSS has been added to persist the layout with the element changes. - Several errors that can be discovered in the POST path now trigger their own non-200 HTTPStatus codes. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
83c038a42a
commit
85ba4a33a8
7 changed files with 571 additions and 2 deletions
20
templates/tu/show.html
Normal file
20
templates/tu/show.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends "partials/layout.html" %}
|
||||
|
||||
{% block pageContent %}
|
||||
<div class="box">
|
||||
{% include "partials/tu/proposal/details.html" %}
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
{% include "partials/tu/proposal/voters.html" %}
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
{% if error %}
|
||||
<span class="status">{{ error | tr }}</span>
|
||||
{% else %}
|
||||
{% include "partials/tu/proposal/form.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue