mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Add an ‘edit’ field type
Like the link field, but right aligns so that it sits nicely in the last column of a table.
This commit is contained in:
@@ -85,6 +85,12 @@
|
|||||||
{% endcall %}
|
{% endcall %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro edit_field(text, link) -%}
|
||||||
|
{% call field(align='right') %}
|
||||||
|
<a href="{{ link }}">{{ text }}</a>
|
||||||
|
{% endcall %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro boolean_field(yes) -%}
|
{% macro boolean_field(yes) -%}
|
||||||
{% call field(status='yes' if yes else 'no') %}
|
{% call field(status='yes' if yes else 'no') %}
|
||||||
{{ "Yes" if yes else "No" }}
|
{{ "Yes" if yes else "No" }}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% extends "withnav_template.html" %}
|
{% extends "withnav_template.html" %}
|
||||||
{% from "components/browse-list.html" import browse_list %}
|
{% from "components/browse-list.html" import browse_list %}
|
||||||
{% from "components/table.html" import mapping_table, row, text_field, link_field %}
|
{% from "components/table.html" import mapping_table, row, text_field, edit_field %}
|
||||||
|
|
||||||
{% block page_title %}
|
{% block page_title %}
|
||||||
Settings – GOV.UK Notify
|
Settings – GOV.UK Notify
|
||||||
@@ -19,32 +19,32 @@
|
|||||||
{% call row() %}
|
{% call row() %}
|
||||||
{{ text_field('Service name' )}}
|
{{ text_field('Service name' )}}
|
||||||
{{ text_field(current_service.name) }}
|
{{ text_field(current_service.name) }}
|
||||||
{{ link_field('Change', url_for('.service_name_change', service_id=current_service.id)) }}
|
{{ edit_field('Change', url_for('.service_name_change', service_id=current_service.id)) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call row() %}
|
{% call row() %}
|
||||||
{{ text_field('Email reply to address')}}
|
{{ text_field('Email reply to address')}}
|
||||||
{{ text_field(current_service.reply_to_email_address or '{}@notifications.service.gov.uk'.format(current_service.email_from)) }}
|
{{ text_field(current_service.reply_to_email_address) }}
|
||||||
{{ link_field('Change', url_for('.service_set_reply_to_email', service_id=current_service.id)) }}
|
{{ edit_field('Change', url_for('.service_set_reply_to_email', service_id=current_service.id)) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call row() %}
|
{% call row() %}
|
||||||
{{ text_field('Text message sender')}}
|
{{ text_field('Text message sender')}}
|
||||||
{{ text_field(current_service.sms_sender or '40604') }}
|
{{ text_field(current_service.sms_sender or '40604') }}
|
||||||
{{ link_field('Change', url_for('.service_set_sms_sender', service_id=current_service.id)) }}
|
{{ edit_field('Change', url_for('.service_set_sms_sender', service_id=current_service.id)) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call row() %}
|
{% call row() %}
|
||||||
{{ text_field('Mode')}}
|
{{ text_field('Mode')}}
|
||||||
{% if current_service.restricted %}
|
{% if current_service.restricted %}
|
||||||
{{ text_field('Trial') }}
|
{{ text_field('Trial') }}
|
||||||
{{ link_field('Go live', url_for('.service_request_to_go_live', service_id=current_service.id)) }}
|
{{ edit_field('Go live', url_for('.service_request_to_go_live', service_id=current_service.id)) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ text_field('Live') }}
|
{{ text_field('Live') }}
|
||||||
{{ link_field() }}
|
{{ edit_field() }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call row() %}
|
{% call row() %}
|
||||||
{{ text_field('Active')}}
|
{{ text_field('Active')}}
|
||||||
{{ text_field(current_service.active) }}
|
{{ text_field(current_service.active) }}
|
||||||
{{ link_field('Suspend', url_for('.service_status_change', service_id=current_service.id)) }}
|
{{ edit_field('Suspend', url_for('.service_status_change', service_id=current_service.id)) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user