{% extends "_base.html" %} {% load i18n %} {% load widget_tweaks %} {% load push_notification_filters %} {% block content %}
{% csrf_token %}

{% if push_notification_form.instance.id %} {% with push_notification_form.instance as push_notification_title %} {% if push_notification_form.is_template.value %} {% blocktranslate trimmed %} Edit Template "{{ push_notification_title }}" {% endblocktranslate %} {% else %} {% blocktranslate trimmed %} Edit News "{{ push_notification_title }}" {% endblocktranslate %} {% endif %} {% endwith %} {% elif push_notification_form.is_template.value %} {% translate "Create News Template" %} {% else %} {% translate "Create News" %} {% endif %}

{% if perms.cms.change_pushnotification and not not_accessible_regions_warning %} {% endif %} {% if not push_notification_form.instance.id and push_notification_form.is_template.value %} {# hide button when creating a new template #} {% elif perms.cms.send_push_notification and not push_notification_form.instance.sent_date and not not_accessible_regions_warning %} {% endif %}
    {% for other_language in languages %}
  • {{ other_language.translated_name }} {% if other_language.secondary_country_code %} {% endif %}
  • {% endfor %}
{{ pnt_formset.management_form }} {% for push_notification_translation_form in pnt_formset %}
{% if push_notification_form.instance.sent_date and push_notification_translation_form.instance.id %} {% endif %}
{% render_field push_notification_translation_form.title|add_error_class:"border-red-500" %} {% render_field push_notification_translation_form.text|add_error_class:"border-red-500" %} {% spaceless %}

/{{ push_notification_translation_form.fields.text.max_length }}

{% endspaceless %}
{% endfor %}

{% translate "Settings" %}

{% render_field push_notification_form.channel|add_error_class:"border-red-500" %} {% render_field push_notification_form.mode|add_error_class:"border-red-500" %}
{% render_field push_notification_form.schedule_send|add_error_class:"border-red-500" %}

{% if not_accessible_regions_warning %} {{ not_accessible_regions_warning }} {% else %} {% translate "Any manager with access to only some of the selected regions can view but not edit this news message." %} {% endif %}

{% render_field push_notification_form.regions|add_error_class:"border-red-500" %} {% if push_notification_form.regions|length == 1 and not_accessible_regions_warning %}

{{ not_accessible_regions_warning }}

{% endif %}
{% if push_notification_form.instance.id and not push_notification_form.instance.is_template %}

{% translate "Status" %}

{% if push_notification_form.instance.sent_date %} {{ push_notification_form.instance.sent_date }} {% else %} {% translate "Message not sent yet" %} {% endif %}
{% endif %}
{% endblock content %}