refactor of api callbacks admin work

This commit is contained in:
chrisw
2017-12-08 10:52:38 +00:00
parent d812ff8b7c
commit 71c9618a26
8 changed files with 469 additions and 362 deletions

View File

@@ -1,49 +1,33 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/table.html" import mapping_table, row, text_field, edit_field %}
{% block service_page_title %}
Callbacks
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">Callbacks</h1>
<p>
See our <a href="{{ url_for('.callbacks') }}">documentation on the format of the callback</a>.
</p>
<form method="post">
{% if can_receive_inbound %}
{{ textbox(
form.inbound_url,
width='1-1',
hint='Valid https URL'
) }}
{{ textbox(
form.inbound_bearer_token,
width='2-3',
hint='At least 10 characters'
) }}
{% endif %}
{{ textbox(
form.outbound_url,
width='1-1',
hint='Valid https URL'
) }}
{{ textbox(
form.outbound_bearer_token,
width='2-3',
hint='At least 10 characters'
) }}
{{ page_footer(
'Save',
back_link=url_for('.api_integration', service_id=current_service.id),
back_link_text='Back to API integration'
) }}
</form>
</div>
</div>
<h1 class="heading-large">Callbacks</h1>
<div class="bottom-gutter-3-2 dashboard-table body-copy-table">
{% call mapping_table(
caption='General',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=False
) %}
{% call row() %}
{{ text_field('Delivery status callback URL') }}
{{ text_field(received_text_messages_callback) }}
{{ edit_field('Change', url_for('.delivery_status_callback', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Received text messages callback URL') }}
{{ text_field(delivery_status_callback) }}
{{ edit_field('Change', url_for('.received_text_messages_callback', service_id=current_service.id)) }}
{% endcall %}
{% endcall %}
</div>
{% endblock %}