{% 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 %} {% if push_notification_form.is_template.value %} {# BUTTONS FOR NEWS TEMPLATES #} {% else %} {# BUTTONS FOR NEWS #} {% if push_notification_form.instance.sent_date %} {% elif perms.cms.send_push_notification %}
{% endif %} {% endif %} {% 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 %} {% if push_notification_form.is_template.value %} {% translate "Any manager with access to only some of the selected regions can view but not edit this news template." %} {% else %} {% translate "Any manager with access to only some of the selected regions can view but not edit this news." %} {% endif %} {% 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 %} {% if push_notification_form.instance.draft %} {% blocktranslate trimmed with sent_date=push_notification_form.instance.sent_date %} News was sent on {{ sent_date }}, but is now in draft state, which means it is no longer shown in the news section of the app. {% endblocktranslate %} {% else %} {% translate "News sent on:" %}
{{ push_notification_form.instance.sent_date }} {% endif %}
{% elif push_notification_form.instance.scheduled_send_date %} {% if push_notification_form.instance.draft %} {% translate "News is scheduled, but in draft and will not be sent automatically." %} {% else %} {% translate "News will be sent automatically on:" %}
{{ push_notification_form.instance.scheduled_send_date }} {% endif %} {% else %} {% translate "News not sent yet" %} {% endif %}
{% endif %}
{% endblock content %}