{% from "macros/form_inputs.html" import input_text, input_checkbox, input_textarea, input_csrf_token with context %} {% from "macros/general.html" import display_filter_by_first_char, display_list_access_policies with context %} {% macro display_maillist_basic_profile(profile=None, access_policy=None, mail=None) -%} {% if not profile %} {% set profile = {} %} {% endif %} {{ input_text(label=_('Prefix text to mail subject'), input_name='subject_prefix', value=profile.get('subject_prefix', '')) }} {% set max_mail_size_in_bytes = profile.get('max_message_size', '0') | int %} {% if max_mail_size_in_bytes == 0 %} {% set max_mail_size_in_form = 0 %} {% set max_mail_size_unit = 'MB' %} {% elif (max_mail_size_in_bytes % 1024) == 0 and max_mail_size_in_bytes >= (1024*1024) %} {# MB #} {% set max_mail_size_in_form = (max_mail_size_in_bytes / (1024*1024)) | int %} {% set max_mail_size_unit = 'MB' %} {% else %} {# KB #} {% set max_mail_size_in_form = (max_mail_size_in_bytes / 1024) |int %} {% set max_mail_size_unit = 'KB' %} {% endif %}

{{ _('Max message size') }}

MB KB
{{ input_textarea(label=_('Footer text (plain text format)'), input_name='footer_text', value=profile.get('footer_text', ''), rows=3, cols='60%') }} {{ input_textarea(label=_('Footer text (HTML format)'), input_name='footer_html', value=profile.get('footer_html', ''), rows=3, cols='60%') }}
{{ display_list_access_policies(policy=access_policy, enable_members_and_moderators_only=false) }}
{{ input_checkbox(label=_('Archive'), input_name='disable_archive', checked=profile.get('disable_archive'), comment=_('Do not archive received emails'), comment_as_tooltip=false, add_hidden_input=true) }}
{{ input_checkbox(label=_('Mail posting'), input_name='disable_send_copy_to_sender', checked=profile.get('disable_send_copy_to_sender'), comment=_('Do not send a copy to sender'), comment_as_tooltip=false, add_hidden_input=true) }}
{{ input_checkbox(label=_('Subscription control'), input_name='close_list', checked=profile.get('close_list'), comment=_('Disable subscription and unsubscription via email (existing subscribers are still able to send to list)'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='disable_subscription', checked=profile.get('disable_subscription'), comment=_('Disable subscription but allow unsubscription via email'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='disable_subscription_confirm', checked=profile.get('disable_subscription_confirm'), comment=_('Disable subscription confirm'), comment_as_tooltip=false, add_hidden_input=true) }}
{{ input_checkbox(label=_('Access control'), input_name='moderated', checked=profile.get('moderated'), comment=_('Moderate all posts (Moderators are required)'), comment_as_tooltip=false, add_hidden_input=true) }}
{{ input_checkbox(label=_('Notifications'), input_name='disable_notify_when_subscriber_only', checked=profile.get('disable_notify_when_subscriber_only'), comment=_('Do not notify sender when posting to a subscriber-only mailing list was denied'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='disable_notify_when_moderator_only', checked=profile.get('disable_notify_when_moderator_only'), comment=_('Do not notify sender when posting to a moderator-only mailing list was denied'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='disable_notify_subscription_moderated', checked=profile.get('disable_notify_subscription_moderated'), comment=_('Do not notify subscription requestor when subscription is under moderated'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='disable_notify_when_exceeding_max_mail_size', checked=profile.get('disable_notify_when_exceeding_max_mail_size'), comment=_('Do not notify sender when posting was denied due to exceed max message size'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='notify_sender_when_moderated', checked=profile.get('notify_sender_when_moderated'), comment=_('Notify sender if email is under moderated'), comment_as_tooltip=false, add_hidden_input=true) }} {{ input_checkbox(label='', input_name='notify_owner_when_sub_unsub', checked=profile.get('notify_owner_when_sub_unsub'), comment=_('Notify owner(s) when someone subscribe to or unsubscribe from the mailing list'), comment_as_tooltip=false, add_hidden_input=true) }} {%- endmacro %} {% macro display_maillist_owners(mail, addresses=None) %} {% if not addresses %} {% set addresses = [] %} {% endif %} {% set (listname, domain) = mail.split('@', 1) %}

{{ _('Owners') }}

{{ _('One mail address per line. Invalid address will be discarded.') }}
{# .col2-3 #}
  • {{ _('Email addresses of the mailing list owners which need to be contacted via email %s, either by the system or by end users.') | format(listname + '+owner@' + domain) }}
{# .columns #} {% endmacro %} {% macro display_maillist_moderators(mail, addresses=None) %} {% if not addresses %} {% set addresses = [] %} {% endif %}

{{ _('Moderators') }}

{{ _('One mail address per line. Invalid address will be discarded.') }}
{# .col2-3 #}
  • {{ _('Email addresses of the mailing list moderators which need to be contacted when there is some email under moderated. If empty, mailing list owners will be used instead.') }}
{# .columns #} {% endmacro %} {% macro display_maillist_subscription_moderators(mail, profile, addresses=None) %} {% if not addresses %} {% set addresses = [] %} {% endif %}
{{ input_checkbox(label=_('Moderate subscriptions'), input_name='moderate_subscription', checked=profile.get('moderate_subscription'), add_hidden_input=true) }}

{{ _('Subscription Moderators') }}

{{ _('One mail address per line. Invalid address will be discarded.') }}
{# .col2-3 #}
  • {{ _('Email addresses of the mailing list moderators which need to be contacted when there is someone subscribing to the list and under moderated. If empty, mailing list moderators will be used instead.') }}
{# .columns #} {% endmacro %} {% macro display_modal_add_subscribers(form_post_url) %} {% endmacro %} {% macro display_maillist_subscribers(mail, subscribers=None, account_is_enabled=true) -%}
{{ _('Filter:') }} {% if account_is_enabled %} {{ _('Add new members') }} {% else %} {{ _('To add new members, please enable mailing list account first.') }} {% endif %}
{% if subscribers %} {% for i in subscribers |sort(attribute='mail') %} {% set _mail = i.mail |e %} {% set _subscription = i.subscription | e %} {% set _domain = _mail.split('@', 1)[-1] %} {% endfor %} {% else %} {% endif %}
{{ _('Email') }} {{ _('Domain') }} {{ _('Mail Delivery') }}
{{ _mail }} {{ _domain }} {%- if _subscription == 'normal' -%} {{ _('All emails') }} {%- elif _subscription == 'digest' -%} {{ _('Digest') }} {%- elif _subscription == 'nomail' -%} {{ _('No email') }} {%- else %} {{ _subscription }} {%- endif -%}
{{ _('No members.') }}
{% if subscribers %} {% endif %} {% endmacro %} {% macro display_modal_newsletter_html_code(mlid) %} {% endmacro %} {% macro display_maillist_newsletter_profile(is_newsletter=False, description=None) -%} {% if not description %} {% set description = '' %} {% endif %}
{{ input_checkbox(label=_('Enable newsletter-style mailing list'), input_name='is_newsletter', comment=_('Enable subscription and unsubscription from website'), checked=is_newsletter) }} {{ input_textarea(label=_('Text to introduce this newsletter on subscription page'), input_name='description', value=description) }}
{%- endmacro %}