From faf885aabdd36f23fab6ca2122e442911f34f53f Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Fri, 1 Jun 2007 20:40:21 +0000 Subject: [PATCH] MailingList model updates: - Add domain helper function to default domain name to ietf.org - Use correct values for post_who Template updates: - Use the domain helper function - Use the post_who_display helper function - Move some of the items that could wrap to the next line - Legacy-Id: 212 --- ietf/mailinglists/models.py | 10 +++++++++- ietf/templates/mailinglists/list_denied.html | 8 +++++++- ietf/templates/mailinglists/list_summary.html | 4 ++-- ietf/templates/mailinglists/list_summary.txt | 13 ++++++++----- ietf/templates/mailinglists/list_toapprove.html | 2 +- ietf/templates/mailinglists/list_type_message.txt | 6 +++--- ietf/templates/mailinglists/list_type_message2.txt | 6 +++--- 7 files changed, 33 insertions(+), 16 deletions(-) diff --git a/ietf/mailinglists/models.py b/ietf/mailinglists/models.py index bd67b2459..01fdba791 100644 --- a/ietf/mailinglists/models.py +++ b/ietf/mailinglists/models.py @@ -45,6 +45,10 @@ class MailingList(models.Model): (2, 'Non-WG Mailing List'), (3, 'Close Non-WG Mailing List'), ) + POSTWHO_CHOICES = ( + (1, 'List members only'), + (2, 'Open'), + ) mailing_list_id = models.CharField('Unique ID', primary_key=True, maxlength=25, editable=False) request_date = models.DateField(default=datetime.now, editable=False) requestor = models.CharField("Requestor's full name", maxlength=250) @@ -58,7 +62,7 @@ class MailingList(models.Model): welcome_message = models.TextField('Provide a welcome message for initial subscriber(s)(optional)', blank=True) welcome_new = models.TextField('Provide a welcome message for new subscriber(s)(optional)', blank=True) subscription = models.IntegerField('What steps are required for subscription?', choices=SUBSCRIPTION_CHOICES) - post_who = models.BooleanField('Only members can post') + post_who = models.IntegerField('Messages to this list can be posted by', choices=POSTWHO_CHOICES) post_admin = models.BooleanField('Do postings need to be approved by an administrator?') archive_private = models.BooleanField('Are the archives private?') archive_remote = models.TextField('Provide specific information about how to access and move the existing archive (optional)', blank=True) @@ -82,6 +86,10 @@ class MailingList(models.Model): except MailingList.DoesNotExist: generate = False super(MailingList, self).save(*args, **kwargs) + def domain(self): + if self.domain_name: + return self.domain_name + return 'ietf.org' class Meta: db_table = 'mailing_list' class Admin: diff --git a/ietf/templates/mailinglists/list_denied.html b/ietf/templates/mailinglists/list_denied.html index 041337a78..c3b31a56a 100644 --- a/ietf/templates/mailinglists/list_denied.html +++ b/ietf/templates/mailinglists/list_denied.html @@ -1,5 +1,11 @@ {% extends "mailinglists/list_approval_base.html" %} {% block innercontent %} - Your note denying the request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %} has been sent to the requestor with your comments (if any).
+ Your note denying the request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %} has been sent to the +{% if list.add_comment %} +requestor with your comments. +{% else %} +requestor. +{% endif %} +
{% endblock %} diff --git a/ietf/templates/mailinglists/list_summary.html b/ietf/templates/mailinglists/list_summary.html index eacff1391..0d6cc69cb 100644 --- a/ietf/templates/mailinglists/list_summary.html +++ b/ietf/templates/mailinglists/list_summary.html @@ -1,7 +1,7 @@ Request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %} Requestor: {{ list.requestor|escape }} Requestor's email address: {{ list.requestor_email|urlize }} - Email list name: {{ list.mlist_name }}@{{ list.domain_name }} + Email list name: {{ list.mlist_name }}@{{ list.domain }} {% ifequal req "delete" %} Reason for closing list: {{ list.reason_to_delete|escape|linebreaksbr }} {% else %} @@ -12,7 +12,7 @@ Welcome message for initial subscriber(s) (optional): {{ list.welcome_message|linebreaksbr }} Welcome message for new subscriber(s) (optional): {{ list.welcome_new|linebreaksbr }} Required steps for subscription: {{ list.get_subscription_display }} - Messages to this list can be posted by:{{ list.post_who|yesno:"List members only,Open" }} + Messages to this list can be posted by:{{ list.get_post_who_display }} Administrator approval required for posts: {{ list.post_admin|yesno:"YES,NO" }} Private Archive: {{ list.archive_private|yesno:"YES,NO" }} Specific information about how to access and move the exiting archive from a remote location (optional): {{ list.archive_remote }} diff --git a/ietf/templates/mailinglists/list_summary.txt b/ietf/templates/mailinglists/list_summary.txt index 48358c490..fd73a3a37 100644 --- a/ietf/templates/mailinglists/list_summary.txt +++ b/ietf/templates/mailinglists/list_summary.txt @@ -2,16 +2,19 @@ Requestor: {{ list.requestor }} Requestor's email address: {{ list.requestor_email }} -Email list name: {{ list.mlist_name }}@{{ list.domain_name }} +Email list name: {{ list.mlist_name }}@{{ list.domain }} {% ifequal req "delete" %} Reason for closing list: {{ list.reason_to_delete }} {% else %} -Short description of the email list: {{ list.short_desc }} +Short description of the email list: +{{ list.short_desc }} -Long description of the email list: {{ list.long_desc }} +Long description of the email list: +{{ list.long_desc }} -Administrator(s): {{ list.admins }}{# formatting? #} +Administrator(s): +{{ list.admins }} Email address(es) of the initial subscriber(s) (optional): {{ list.initial }} @@ -24,7 +27,7 @@ Welcome message for new subscriber(s) (optional): Required steps for subscription: {{ list.get_subscription_display }} -Messages to this list can be posted by: {{ list.post_who|yesno:"List members only,Open" }} +Messages to this list can be posted by: {{ list.get_post_who_display }} Administrator approval required for posts: {{ list.post_admin|yesno:"YES,NO" }} diff --git a/ietf/templates/mailinglists/list_toapprove.html b/ietf/templates/mailinglists/list_toapprove.html index 57dfdad8a..50773d647 100644 --- a/ietf/templates/mailinglists/list_toapprove.html +++ b/ietf/templates/mailinglists/list_toapprove.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Confirmation of Request to {{ list.get_mail_type_display }}{% endblock %} +{% block title %}Confirmation of request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %}{% endblock %} {% block css %} table { diff --git a/ietf/templates/mailinglists/list_type_message.txt b/ietf/templates/mailinglists/list_type_message.txt index 612e1715a..48310a7de 100644 --- a/ietf/templates/mailinglists/list_type_message.txt +++ b/ietf/templates/mailinglists/list_type_message.txt @@ -5,16 +5,16 @@ Creation of the WG email list <{{ list.mlist_name }}@ietf.org> Movement of the WG email list for {{ list.mlist_name }} to ietf.org {% else %} {% ifequal list.mail_type 3 %} -Movement of the non-WG email list {{ list.mlist_name }} to {{ list.domain_name }} +Movement of the non-WG email list {{ list.mlist_name }} to {{ list.domain }} {% else %} {% ifequal list.mail_type 4 %} -Creation of the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}> +Creation of the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}> {% else %} {% ifequal list.mail_type 5 %} Closing the WG email list <{{ list.mlist_name }}@ietf.org> {% else %} {% ifequal list.mail_type 6 %} -Closing the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}> +Closing the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}> {% else %} ** programming error ** {% endifequal %} diff --git a/ietf/templates/mailinglists/list_type_message2.txt b/ietf/templates/mailinglists/list_type_message2.txt index cc24c6548..67712926c 100644 --- a/ietf/templates/mailinglists/list_type_message2.txt +++ b/ietf/templates/mailinglists/list_type_message2.txt @@ -5,16 +5,16 @@ create the WG email list <{{ list.mlist_name }}@ietf.org> move the WG email list for {{ list.mlist_name }} to ietf.org {% else %} {% ifequal list.mail_type 3 %} -move the non-WG email list {{ list.mlist_name }} to {{ list.domain_name }} +move the non-WG email list {{ list.mlist_name }} to {{ list.domain }} {% else %} {% ifequal list.mail_type 4 %} -create the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}> +create the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}> {% else %} {% ifequal list.mail_type 5 %} close the WG email list <{{ list.mlist_name }}@ietf.org> {% else %} {% ifequal list.mail_type 6 %} -close the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}> +close the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}> {% else %} ** programming error ** {% endifequal %}