merge from upstream
commit 150ccbe7a70d443c83ff68f81abd78e1d491a228
2 parents f3d5c16 + ac3ae03
@Máirín Duffy Máirín Duffy authored on 5 Oct 2013
Showing 10 changed files
View
227
src/postorius/forms.py
from django import forms
from django.core.validators import validate_email
from django.utils.translation import gettext as _
from fieldset_forms import FieldsetForm
from django.forms.models import modelformset_factory
 
 
class DomainNew(FieldsetForm):
 
"""
Form field to add a new domain
"""
mail_host = forms.CharField(
raise forms.ValidationError(_("Please enter a valid Web Host"))
return web_host
 
class Meta:
 
"""
Class to handle the automatic insertion of fieldsets and divs.
 
To use it: add a list for each wished fieldset. The first item in
"description"]]
 
 
class NewOwnerForm(forms.Form):
 
"""Add a list owner."""
owner_email = forms.EmailField(
label=_('Email Address'),
error_messages={
'invalid': _('Please enter a valid email adddress.')})
 
 
class NewModeratorForm(forms.Form):
 
"""Add a list moderator."""
moderator_email = forms.EmailField(
label=_('Email Address'),
error_messages={
'invalid': _('Please enter a valid email adddress.')})
 
 
class ListNew(FieldsetForm):
 
"""
Form fields to add a new list. Languages are hard coded which should
be replaced by a REST lookup of available languages.
"""
choices=domain_choices,
error_messages={'required': _("Choose an existing Domain."),
'invalid': "ERROR-todo_forms.py"})
if len(domain_choices) < 2:
self.fields["mail_host"].help_text=_(
self.fields["mail_host"].help_text = _(
"Site admin has not created any domains")
#if len(choices) < 2:
# if len(choices) < 2:
# help_text=_("No domains available: " +
# "The site admin must create new domains " +
# "before you will be able to create a list")
 
def clean_listname(self):
try:
validate_email(self.cleaned_data['listname'] + '@example.net')
raise forms.ValidationError(_("Please enter a valid listname"))
return self.cleaned_data['listname']
 
class Meta:
 
"""
Class to handle the automatic insertion of fieldsets and divs.
 
To use it: add a list for each wished fieldset. The first item in
"advertised"], ]
 
 
class ListSubscribe(FieldsetForm):
 
"""Form fields to join an existing list.
"""
email = forms.EmailField(
label=_('Your email address'),
required=False)
 
 
class ListUnsubscribe(FieldsetForm):
 
"""Form fields to leave an existing list.
"""
email = forms.EmailField(
label=_('Your email address'),
'invalid': _('Please enter a valid email address.')})
 
 
class ListSettings(FieldsetForm):
 
"""Form fields dealing with the list settings.
"""
choices = ((True, _('Yes')), (False, _('No')))
#list_name = forms.CharField(
# list_name = forms.CharField(
# label=_('List Name'),
# required=False)
host_name = forms.CharField(
label=_('Domain host name'),
required=False)
# informational, not configurable
#fqdn_listname = forms.CharField(
# fqdn_listname = forms.CharField(
# label=_('Fqdn listname'),
# required=False)
include_rfc2369_headers = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
label= _('Include RFC2369 headers'),
help_text=_('Yes is highly recommended. RFC 2369 defines a set of List-* headers that are normally added to every message sent to the list membership. These greatly aid end-users who are using standards compliant mail readers. They should normally always be enabled.However, not all mail readers are standards compliant yet, and if you have a large number of members who are using non-compliant mail readers, they may be annoyed at these headers. You should first try to educate your members as to why these headers exist, and how to hide them in their mail clients. As a last resort you can disable these headers, but this is not recommended (and in fact, your ability to disable these headers may eventually go away).'))
help_text=_('Yes is highly recommended. RFC 2369 defines a set of List-* headers that are normally added to every message sent to the list membership. These greatly aid end-users who are using standards compliant mail readers. They should normally always be enabled.However, not all mail readers are standards compliant yet, and if you have a large number of members who are using non-compliant mail readers, they may be annoyed at these headers. You should first try to educate your members as to why these headers exist, and how to hide them in their mail clients. As a last resort you can disable these headers, but this is not recommended (and in fact, your ability to disable these headers may eventually go away).'))
allow_list_posts = forms.TypedChoiceField(
choices=choices,
widget=forms.RadioSelect,
label=_("Include the list post header"),
help_text=_("This can be set to no for announce lists that do not wish to include the List-Post header because posting to the list is discouraged."),
help_text=_(
"This can be set to no for announce lists that do not wish to include the List-Post header because posting to the list is discouraged."),
)
archive_policy_choices = (
("public", _("Public Archives")),
("public", _("Public Archives")),
("private", _("Private Archives")),
("never", _("Do not archive this list")),
)
archive_policy = forms.ChoiceField(
autorespond_owner = forms.ChoiceField(
choices=autorespond_choices,
widget=forms.RadioSelect,
label=_('Autorespond to list owner'),
help_text=('Should Mailman send an auto-response to emails sent to the -owner address?'))
help_text=('Should Mailman send an auto-response to emails sent to the -owner address?'))
autoresponse_owner_text = forms.CharField(
label=_('Autoresponse owner text'),
widget=forms.Textarea(),
required=False,
help_text=('Auto-response text to send to -owner emails.'))
help_text=('Auto-response text to send to -owner emails.'))
autorespond_postings = forms.ChoiceField(
choices=autorespond_choices,
widget=forms.RadioSelect,
label=_('Autorespond postings'),
autoresponse_grace_period = forms.CharField(
label=_('Autoresponse grace period'),
help_text=('Number of days between auto-responses to either the mailing list or -request/-owner address from the same poster. Set to zero (or negative) for no grace period (i.e. auto-respond to every message).'))
# This doesn't make sense as a configurable, so we're leaving it out
#bounces_address = forms.EmailField(
# bounces_address = forms.EmailField(
# label=_('Bounces Address'),
# required=False)
advertised = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
label=_('Filter content'),
help_text=('Should Mailman filter the content of list traffic according to the settings below?'))
help_text=('Should Mailman filter the content of list traffic according to the settings below?'))
collapse_alternatives = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
label=_('Collapse alternatives'),
help_text=('Should Mailman collapse multipart/alternative to its first part content?'))
help_text=('Should Mailman collapse multipart/alternative to its first part content?'))
convert_html_to_plaintext = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
label=_('Convert html to plaintext'),
help_text=('Should Mailman convert text/html parts to plain text? This conversion happens after MIME attachments have been stripped.'))
help_text=('Should Mailman convert text/html parts to plain text? This conversion happens after MIME attachments have been stripped.'))
action_choices = (
("hold", _("Hold for moderator")),
("reject", _("Reject (with notification)")),
("discard", _("Discard (no notification)")),
error_messages={
'required': _("Please choose a default member action.")},
required=True,
choices=action_choices,
help_text=('Default action to take when a member posts to the list.Hold -- This holds the message for approval by the list moderators. Reject -- this automatically rejects the message by sending a bounce notice to the post\'s author. The text of the bounce notice can be configured by you. Discard -- this simply discards the message, with no notice sent to the post\'s author. Accept --accepts any postings to the list by default. Defer -- Defers any postings to the list by default. '))
help_text=('Default action to take when a member posts to the list.Hold -- This holds the message for approval by the list moderators. Reject -- this automatically rejects the message by sending a bounce notice to the post\'s author. The text of the bounce notice can be configured by you. Discard -- this simply discards the message, with no notice sent to the post\'s author. Accept --accepts any postings to the list by default. Defer -- Defers any postings to the list by default. '))
default_nonmember_action = forms.ChoiceField(
widget=forms.RadioSelect(),
label=_('Default action to take when a non-member posts to the'
'list: '),
error_messages={
'required': _("Please choose a default non-member action.")},
required=True,
choices=action_choices,
help_text=('When a post from a non-member is received, the message\'s sender is matched against the list of explicitly accepted, held, rejected (bounced), and discarded addresses. If no match is found, then this action is taken.'))
help_text=('When a post from a non-member is received, the message\'s sender is matched against the list of explicitly accepted, held, rejected (bounced), and discarded addresses. If no match is found, then this action is taken.'))
description = forms.CharField(
label=_('Description'),
help_text=('This description is used when the mailing list is listed with other mailing lists, or in headers, and so forth. It should be as succinct as you can get it, while still identifying what the list is.'),
help_text=(
'This description is used when the mailing list is listed with other mailing lists, or in headers, and so forth. It should be as succinct as you can get it, while still identifying what the list is.'),
widget=forms.Textarea())
digest_size_threshold = forms.DecimalField(
label=_('Digest size threshold'),
help_text=('How big in Kb should a digest be before it gets sent out?')
)
# Informational
#digest_last_sent_at = forms.IntegerField(
# digest_last_sent_at = forms.IntegerField(
# label=_('Digest last sent at'),
# error_messages={
# 'invalid': _('Please provide an integer.')},
# required=False)
first_strip_reply_to = forms.TypedChoiceField(
first_strip_reply_to = forms.TypedChoiceField(
coerce=lambda x: x == 'False',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
help_text=_('Should any existing Reply-To: header found in the original message be stripped? If so, this will be done regardless of whether an explict Reply-To: header is added by Mailman or not.')
help_text=_(
'Should any existing Reply-To: header found in the original message be stripped? If so, this will be done regardless of whether an explict Reply-To: header is added by Mailman or not.')
)
generic_nonmember_action = forms.IntegerField(
label=_('Generic nonmember action'),
error_messages={
'invalid': _('Please enter a valid domain name.')},
required=True,
help_text="The \"host_name\" is the preferred name for email to mailman-related addresses on this host, and generally should be the mail host's exchanger address, if any. This setting can be useful for selecting among alternative names of a host that has multiple addresses.")
# informational, not editable
#next_digest_number = forms.IntegerField(
# next_digest_number = forms.IntegerField(
# label=_('Next digest number'),
# error_messages={
# 'invalid': _('Please provide an integer.'),
# },
# required=False,
#)
#no_reply_address = forms.EmailField(
# no_reply_address = forms.EmailField(
# label=_('No reply address'),
# required=False,
#)
posting_pipeline = forms.CharField(
label=_('Pipeline'),
help_text=('Type of pipeline you want to use for this mailing list')
)
#post_id = forms.IntegerField(
help_text=(
'Type of pipeline you want to use for this mailing list')
)
# post_id = forms.IntegerField(
# label=_('Post ID'),
# error_messages={
# 'invalid': _('Please provide an integer.'),
# },
# required=False,
#)
display_name = forms.CharField(
label=_('Display name'),
help_text= ('Display name is the name shown in the web interface.')
help_text=('Display name is the name shown in the web interface.')
)
subject_prefix = forms.CharField(
label=_('Subject prefix'),
)
choices=(
("no_munging", _("No Munging")),
("point_to_list", _("Reply goes to list")),
("explicit_header", _("Explicit Reply-to header set"))),
help_text=('Where are replies to list messages directed? No Munging is strongly recommended for most mailing lists. \nThis option controls what Mailman does to the Reply-To: header in messages flowing through this mailing list. When set to No Munging, no Reply-To: header is added by Mailman, although if one is present in the original message, it is not stripped. Setting this value to either Reply to List or Explicit Reply causes Mailman to insert a specific Reply-To: header in all messages, overriding the header in the original message if necessary (Explicit Reply inserts the value of reply_to_address).There are many reasons not to introduce or override the Reply-To: header. One is that some posters depend on their own Reply-To: settings to convey their valid return address. Another is that modifying Reply-To: makes it much more difficult to send private replies. See `Reply-To\' Munging Considered Harmful for a general discussion of this issue. See Reply-To Munging Considered Useful for a dissenting opinion.Some mailing lists have restricted posting privileges, with a parallel list devoted to discussions. Examples are `patches\' or `checkin\' lists, where software changes are posted by a revision control system, but discussion about the changes occurs on a developers mailing list. To support these types of mailing lists, select Explicit Reply and set the Reply-To: address option to point to the parallel list. '))
reply_to_address = forms.CharField(
label= _('Explicit reply-to address'),
required=False,
help_text=_('This option allows admins to set an explicit Reply-to address. It is only used if the reply-to is set to use an explicitly set header'),
help_text=('Where are replies to list messages directed? No Munging is strongly recommended for most mailing lists. \nThis option controls what Mailman does to the Reply-To: header in messages flowing through this mailing list. When set to No Munging, no Reply-To: header is added by Mailman, although if one is present in the original message, it is not stripped. Setting this value to either Reply to List or Explicit Reply causes Mailman to insert a specific Reply-To: header in all messages, overriding the header in the original message if necessary (Explicit Reply inserts the value of reply_to_address).There are many reasons not to introduce or override the Reply-To: header. One is that some posters depend on their own Reply-To: settings to convey their valid return address. Another is that modifying Reply-To: makes it much more difficult to send private replies. See `Reply-To\' Munging Considered Harmful for a general discussion of this issue. See Reply-To Munging Considered Useful for a dissenting opinion.Some mailing lists have restricted posting privileges, with a parallel list devoted to discussions. Examples are `patches\' or `checkin\' lists, where software changes are posted by a revision control system, but discussion about the changes occurs on a developers mailing list. To support these types of mailing lists, select Explicit Reply and set the Reply-To: address option to point to the parallel list. '))
reply_to_address = forms.CharField(
label=_('Explicit reply-to address'),
required=False,
help_text=_(
'This option allows admins to set an explicit Reply-to address. It is only used if the reply-to is set to use an explicitly set header'),
)
# informational, not editable
#request_address = forms.EmailField(
# request_address = forms.EmailField(
# label=_('Request address'),
# required=False)
send_welcome_message = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
required=False,
label=_('Send welcome message'),
help_text=('Send welcome message to newly subscribed members?Turn this off only if you plan on subscribing people manually and don\'t want them to know that you did so. This option is most useful for transparently migrating lists from some other mailing list manager to Mailman.'))
welcome_message_uri = forms.CharField(
label = _('URI for the welcome message'),
help_text = _('If a welcome message is to be sent to subscribers, you can specify a URI that gives the text of this message.'),
label=_('URI for the welcome message'),
help_text=_(
'If a welcome message is to be sent to subscribers, you can specify a URI that gives the text of this message.'),
)
# tko - look this up
# scheme = forms.CharField(
# label=_('Scheme'),
acceptable_aliases = forms.CharField(
widget=forms.Textarea(),
label=_("Acceptable aliases"),
required=False,
help_text=('Alias names which qualify as explicit to or cc destination names for this list.Alternate addresses that are acceptable when `require_explicit_destination\' is enabled. This option takes a list of regular expressions, one per line, which is matched against every recipient address in the message. The matching is performed with Python\'s re.match() function, meaning they are anchored to the start of the string.'))
help_text=('Alias names which qualify as explicit to or cc destination names for this list.Alternate addresses that are acceptable when `require_explicit_destination\' is enabled. This option takes a list of regular expressions, one per line, which is matched against every recipient address in the message. The matching is performed with Python\'s re.match() function, meaning they are anchored to the start of the string.'))
admin_immed_notify = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Admin immed notify'),
administrivia = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Administrivia'),
help_text=('Administrivia tests will check postings to see whether it\'s really meant as an administrative request (like subscribe, unsubscribe, etc), and will add it to the the administrative requests queue, notifying the administrator of the new request, in the process.'))
help_text=('Administrivia tests will check postings to see whether it\'s really meant as an administrative request (like subscribe, unsubscribe, etc), and will add it to the the administrative requests queue, notifying the administrator of the new request, in the process.'))
anonymous_list = forms.TypedChoiceField(
coerce=lambda x: x == 'True',
choices=((True, _('Yes')), (False, _('No'))),
widget=forms.RadioSelect,
required=False,
label=_('Anonymous list'),
help_text=('Hide the sender of a message, replacing it with the list address (Removes From, Sender and Reply-To fields)'))
help_text=('Hide the sender of a message, replacing it with the list address (Removes From, Sender and Reply-To fields)'))
# Informational field, not needed.
#created_at = forms.IntegerField(
# created_at = forms.IntegerField(
# label=_('Created at'),
# widget=forms.HiddenInput(),
# required=False)
#join_address = forms.EmailField(
# join_address = forms.EmailField(
# label=_('Join address'),
# required=False)
#last_post_at = forms.IntegerField(
# last_post_at = forms.IntegerField(
# label=_('Last post at'),
# required=False)
#leave_address = forms.EmailField(
# leave_address = forms.EmailField(
# label=_('Leave address'),
# required=False)
#owner_address = forms.EmailField(
# owner_address = forms.EmailField(
# label=_('Owner Address'),
# required=False)
#posting_address = forms.EmailField(
# posting_address = forms.EmailField(
# label=_('Posting Address'),
# required=False)
 
 
#Descriptions used in the Settings Overview Page
# Descriptions used in the Settings Overview Page
section_descriptions = {
"List Identity": _("Basic identity settings for the list"),
"Automatic Responses": _("All options for Autoreply"),
"Alter Messages": _("Settings that modify member messages"),
 
def __init__(self, visible_section, visible_option, *args, **kwargs):
super(ListSettings, self).__init__(*args, **kwargs)
# if settings:
# raise Exception(settings) # debug
# raise Exception(settings) # debug
if visible_option:
options = []
for option in self.layout:
options += option[1:]
if not(key in used_options):
del self.fields[key]
 
class Meta:
 
"""Class to handle the automatic insertion of fieldsets and divs.
 
To use it: add a list for each wished fieldset. The first item in
the list should be the wished name of the fieldset, the following
"""
# just a really temporary layout to see that it works. -- Anna
layout = [
["List Identity", "display_name", "mail_host", "description",
"advertised", "subject_prefix"],
"advertised", "subject_prefix"],
["Automatic Responses", "autorespond_owner",
"autoresponse_owner_text", "autorespond_postings",
"autoresponse_postings_text", "autorespond_requests",
"autoresponse_request_text", "autoresponse_grace_period",
"send_welcome_message",
"send_welcome_message",
"welcome_message_uri",
"admin_immed_notify",
"admin_notify_mchanges"],
["Alter Messages", "filter_content", "collapse_alternatives",
"convert_html_to_plaintext", "anonymous_list",
"include_rfc2369_headers",
"include_rfc2369_headers",
"allow_list_posts",
"reply_goes_to_list",
"reply_to_address",
"first_strip_reply_to",
"posting_pipeline"],
"reply_to_address",
"first_strip_reply_to",
"posting_pipeline"],
["Digest", "digest_size_threshold"],
["Message Acceptance", "acceptable_aliases", "administrivia",
"default_nonmember_action", "default_member_action"],
["Archives", "archive_policy"],
]
]
 
 
class Login(FieldsetForm):
 
"""Form fields to let the user log in.
"""
user = forms.EmailField(
label=_('Email address'),
'invalid': _('Please enter a valid password.')},
required=True)
 
class Meta:
 
"""
Class to define the name of the fieldsets and what should be
included in each.
"""
layout = [["Login", "user", "password"]]
 
 
class ListMassSubscription(FieldsetForm):
 
"""Form fields to masssubscribe users to a list.
"""
emails = forms.CharField(
label=_('Emails to mass subscribe'),
 
verify_with_email = forms.BooleanField(required=False)
 
class Meta:
 
"""
Class to define the name of the fieldsets and what should be
included in each.
"""
layout = [["Mass subscription", "emails"]]
 
 
class MembershipSettings(FieldsetForm):
"""Form handling the membership settings.
class UserPreferences(FieldsetForm):
 
"""
Form handling the user's global, address and subscription based preferences.
"""
choices = ((True, _('Yes')), (False, _('No')))
 
delivery_mode_choices = (("regular", _('Regular')),
("plaintext_digests", _('Plain Text Digests')),
("mime_digests", _('Mime Digests')),
("summary_digests", _('Summary Digests')))
delivery_status_choices = (
("enabled", _('Enabled')), ("by_user", _('Disabled')))
delivery_status = forms.ChoiceField(
widget=forms.RadioSelect,
choices=delivery_status_choices,
required=False,
label=_('Delivery status'),
help_text=_('Set this option to Enabled to receive messages posted to this mailing list. Set it to Disabled if you want to stay subscribed, but don\'t want mail delivered to you for a while (e.g. you\'re going on vacation). If you disable mail delivery, don\'t forget to re-enable it when you come back; it will not be automatically re-enabled.'))
delivery_mode = forms.ChoiceField(
widget=forms.Select(),
choices=delivery_mode_choices,
required=False,
label=_('Delivery mode'),
help_text=_('If you select summary digests , you\'ll get posts bundled together (usually one per day but possibly more on busy lists), instead of singly when they\'re sent. Your mail reader may or may not support MIME digests. In general MIME digests are preferred, but if you have a problem reading them, select plain text digests.'))
receive_own_postings = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Receive own postings'),
help_text=_('Ordinarily, you will get a copy of every message you post to the list. If you don\'t want to receive this copy, set this option to No'))
acknowledge_posts = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Acknowledge posts'))
label=_('Acknowledge posts'),
help_text=_('Receive acknowledgement mail when you send mail to the list?'))
hide_address = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Hide address'))
label=_('Hide address'),
help_text=_('When someone views the list membership, your email address is normally shown (in an obscured fashion to thwart spam harvesters). If you do not want your email address to show up on this membership roster at all, select Yes for this option.'))
receive_list_copy = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Receive list copy'))
receive_own_postings = forms.BooleanField(
widget=forms.RadioSelect(choices=choices),
required=False,
label=_('Receive own postings'))
delivery_mode = forms.ChoiceField(
widget=forms.Select(),
error_messages={
'required': _("Please choose a mode.")},
required=False,
choices=(
("", _("Please choose")),
("delivery_mode", "some mode...")),
label=_('Delivery mode'))
delivery_status = forms.ChoiceField(
widget=forms.Select(),
error_messages={
'required': _("Please choose a status.")},
required=False,
choices=(
("", _("Please choose")),
("delivery_status", "some status...")),
label=_('Delivery status'))
label=_('Receive list copy'),
help_text=_('When you are listed explicitly in the To: or Cc: headers of a list message, you can opt to not receive another copy from the mailing list. Select Yes to avoid receiving copies from the mailing list; select No to receive copies. '))
 
class Meta:
 
"""
Class to define the name of the fieldsets and what should be
included in each.
"""
layout = [["Membership Settings", "acknowledge_posts", "hide_address",
layout = [["User Preferences", "acknowledge_posts", "hide_address",
"receive_list_copy", "receive_own_postings",
"delivery_mode", "delivery_status"]]
 
 
class UserNew(FieldsetForm):
 
"""
Form field to add a new user
"""
display_name = forms.CharField(
error_messages={'required': _('Please repeat the password.')},
widget=forms.PasswordInput(render_value=False))
 
def clean(self):
cleaned_data = self.cleaned_data
cleaned_data = self.cleaned_data
password = cleaned_data.get("password")
password_repeat = cleaned_data.get("password_repeat")
if password != password_repeat:
raise forms.ValidationError("Passwords must be identical.")
return cleaned_data
 
 
class UserSettings(FieldsetForm):
 
"""Form handling the user settings.
"""
 
def __init__(self, address_choices, *args, **kwargs):
"""
Initialize the user settings with a field 'address' where
the values are set dynamically in the view.
error_messages={'required': _('Please enter your password.'),
'invalid': _('Please enter a valid password.')})
 
class Meta:
 
"""
Class to define the name of the fieldsets and what should be
included in each.
"""
View
129
src/postorius/templates/postorius/user_address_preferences.html 0 → 100644
{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% block main %}
{% include 'postorius/menu/user_nav.html' %}
<ul class="nav nav-tabs">
<li><a href="{% url 'user_mailmansettings' %}">{% trans "Global Mailman Preferences" %}</a></li>
<li class="active"><a href="#">{% trans "Address Based Preferences" %}</a></li>
<li><a href="{% url 'user_subscription_preferences' %}">{% trans "Subscription Based Preferences" %}</a></li>
</ul>
<br>
<h2> Per-Email-Address Based Preferences Overview </h2>
<p> Table to view the preferences(for testing only)</p>
<!-- Table displaying the user's address-based Mailman preferences, for testing/viewing purposes only, may be removed-->
<table class="table table-bordered table-striped mm_userData">
<tbody>
<tbody>
<tr>
<th>{% trans 'Email Address' %}</th>
<th>{% trans 'Delivery Status' %}</th>
<th>{% trans 'Delivery Mode' %}</th>
<th>{% trans 'Receive Own Postings' %}</th>
<th>{% trans 'Acknowledge Posts' %}</th>
<th>{% trans 'Hide Address' %}</th>
<th>{% trans 'Receive List Copy' %}</th>
</tr>
{%for a in addresses%}
<tr>
<th>{{ a }}</th>
<td>{{ a.preferences.delivery_status }}</td>
<td>{{ a.preferences.delivery_mode }}</td>
<td>{{ a.preferences.receive_own_postings }}</td>
<td>{{ a.preferences.acknowledge_posts }}</td>
<td>{{ a.preferences.hide_address }}</td>
<td>{{ a.preferences.receive_list_copy }}</td>
</tr>
{%endfor%}
</tbody>
</table>
<br>
<h2>Address Based Preferences Form </h2>
<!-- Form to modify the user's address based preferences. The form is displayed as a table showing initial values
previously set by the user, if any -->
<form action = "{% url 'user_address_preferences' %}" method = "post" class = "well" id ="address_formset">
{% csrf_token %}
{{formset.management_form}}
{{formset.non_form_errors.as_ul}}
<table class="table table-bordered table-striped" border = "2">
<thead>
<tr>
<th> Preferences </th>
{% for form,address in zipped_data %}
<th> {{address}} </th>
{% endfor %}
</tr >
</thead >
<tr>
<td>
<p>Mail Delivery: </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.delivery_status.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.delivery_status }}</td>
{% endfor %}
</tr>
<tr>
<td>
<p> Select a Mode of Delivery: </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.delivery_mode.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.delivery_mode }} </td>
{% endfor %}
</tr>
<tr>
<td>
<p> Receive your own posts to the list? </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.receive_own_postings.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.receive_own_postings }} </td>
{% endfor %}
</tr>
<tr>
<td>
<p> Receive acknowledgement mails? </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.acknowledge_posts.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.acknowledge_posts }} </td>
{% endfor %}
</tr>
<tr>
<td>
<p> Conceal yourself from the subscriber list? </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.hide_address.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.hide_address }} </td>
{% endfor %}
</tr>
<tr>
<td>
<p> Avoid duplicate copies of messages? </p>
<p>[<span class="more_info"><a href="#" target="_blank">More info</a><span>{{ helperform.receive_list_copy.help_text }}
</span></span>]
</p>
</td>
{% for form,address in zipped_data %}
<td> {{form.receive_list_copy }} </td>
{% endfor %}
</tr>
</table>
<center><button class="btn btn-success" type="submit">{% trans "Save" %}</button></center>
</form>
{% endblock main %}
 
 
View
src/postorius/templates/postorius/user_mailmansettings.html
View
src/postorius/templates/postorius/user_subscription_preferences.html 0 → 100644
View
src/postorius/templates/postorius/user_subscriptions.html
View
src/postorius/urls.py
View
src/postorius/views/generic.py
View
src/postorius/views/list.py
View
src/postorius/views/settings.py
View
src/postorius/views/user.py