mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Move parameters out of the …_message components
This commit refactors the `email_message` and `sms_message` UI components to take fewer parameters. `name`, `edit_link` and anything to do with versions are identical for both text and email messages so I’ve moved them to the pages where you choose a template or see the versions. This commit also tidies up the wording and styling of the template history stuff.
This commit is contained in:
@@ -1,32 +1,13 @@
|
||||
{% macro email_message(
|
||||
subject,
|
||||
body,
|
||||
name=None,
|
||||
edit_link=None,
|
||||
from_name=None,
|
||||
from_address=None,
|
||||
recipient=None,
|
||||
id=None,
|
||||
updated_at=None,
|
||||
versions_url=None,
|
||||
version=1,
|
||||
show_placeholder_for_recipient=False,
|
||||
show_id=False
|
||||
) %}
|
||||
{% if name %}
|
||||
<h3 class="email-message-name">
|
||||
{% if edit_link %}
|
||||
<a href="{{ edit_link }}">{{ name }}</a>
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
{% if version > 1 %}
|
||||
{% if updated_at %}
|
||||
<p class="email-message-updated-at">Last updated on {{ updated_at|format_date_normal }} <a href="{{ versions_url }}">see earlier versions</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="email-message">
|
||||
{% if from_name or subject %}
|
||||
<table class="email-message-meta">
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{% macro sms_message(
|
||||
body,
|
||||
recipient=None,
|
||||
name=None,
|
||||
id=None,
|
||||
edit_link=None,
|
||||
from=None,
|
||||
version=1,
|
||||
updated_at=None,
|
||||
@@ -11,20 +9,6 @@
|
||||
show_placeholder_for_recipient=False,
|
||||
show_id=False
|
||||
) %}
|
||||
{% if name %}
|
||||
<h3 class="sms-message-name">
|
||||
{% if edit_link %}
|
||||
<a name="{{ name|linkable_name }}" href="{{ edit_link }}">{{ name }}</a>
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
{% if version > 1 %}
|
||||
{% if updated_at %}
|
||||
<p class="sms-message-updated-at">Last updated on {{ updated_at|format_date_normal }} <a href="{{ versions_url }}">see earlier versions</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if recipient is not none %}
|
||||
<p class="sms-message-recipient">
|
||||
To:
|
||||
|
||||
Reference in New Issue
Block a user