mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-20 08:03:51 -04:00
Most of the existing platform admin buttons on the service settings page used to issue GET requests to switch service settings. This means they weren't protected by CSRF. On top of that as our number of service permissions increases over time a lot of buttons on the page made it hard to work with. To fix these issues we replace most of the buttons with rows in the platform admin settings table. Each setting has a 'Change' link that leads to a page with an On/Off switch form. This removes "research mode" switch completely since we're planning to deprecate it in the future and we don't expect to switch any new services into research mode at the moment. Most service permissions are now handled by a shared endpoint that is parameterized with the permission name. Some permissions that require some additional logic before they can be toggled (like document upload, which requires setting a contact address) have separate initial endpoints that redirect to `set_service_permission`. "Archive", "Suspend" and "Resume" actions are kept as buttons since they display a confirmation banner (which is a CSRF-protected form) and they're not easily represented as an On/Off switch.
27 lines
729 B
HTML
27 lines
729 B
HTML
{% extends "withnav_template.html" %}
|
|
{% from "components/radios.html" import radios %}
|
|
{% from "components/page-footer.html" import page_footer %}
|
|
{% from "components/form.html" import form_wrapper %}
|
|
|
|
{% block service_page_title %}
|
|
Send letters
|
|
{% endblock %}
|
|
|
|
{% block maincolumn_content %}
|
|
|
|
<div class="grid-row">
|
|
<div class="column-five-sixths">
|
|
<h1 class="heading-large">{{ title }}</h1>
|
|
{% call form_wrapper() %}
|
|
{{ radios(form.enabled, hide_legend=True) }}
|
|
{{ page_footer(
|
|
'Save',
|
|
back_link=url_for('.service_settings', service_id=current_service.id),
|
|
back_link_text='Back to settings'
|
|
) }}
|
|
{% endcall %}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|