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
This commit is contained in:
Bill Fenner 2007-06-01 20:40:21 +00:00
parent 8628844700
commit faf885aabd
7 changed files with 33 additions and 16 deletions

View file

@ -45,6 +45,10 @@ class MailingList(models.Model):
(2, 'Non-WG Mailing List'), (2, 'Non-WG Mailing List'),
(3, 'Close 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) mailing_list_id = models.CharField('Unique ID', primary_key=True, maxlength=25, editable=False)
request_date = models.DateField(default=datetime.now, editable=False) request_date = models.DateField(default=datetime.now, editable=False)
requestor = models.CharField("Requestor's full name", maxlength=250) 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_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) 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) 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?') post_admin = models.BooleanField('Do postings need to be approved by an administrator?')
archive_private = models.BooleanField('Are the archives private?') 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) 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: except MailingList.DoesNotExist:
generate = False generate = False
super(MailingList, self).save(*args, **kwargs) super(MailingList, self).save(*args, **kwargs)
def domain(self):
if self.domain_name:
return self.domain_name
return 'ietf.org'
class Meta: class Meta:
db_table = 'mailing_list' db_table = 'mailing_list'
class Admin: class Admin:

View file

@ -1,5 +1,11 @@
{% extends "mailinglists/list_approval_base.html" %} {% extends "mailinglists/list_approval_base.html" %}
{% block innercontent %} {% block innercontent %}
<font color="#022d66"> 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).<br> <font color="#022d66"> 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 %}
<br>
{% endblock %} {% endblock %}

View file

@ -1,7 +1,7 @@
<tr><td colspan="2">Request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %}</td></tr> <tr><td colspan="2">Request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %}</td></tr>
<tr><td> Requestor: </td><td>{{ list.requestor|escape }}</td></tr> <tr><td> Requestor: </td><td>{{ list.requestor|escape }}</td></tr>
<tr><td> Requestor's email address: </td><td>{{ list.requestor_email|urlize }}</td></tr> <tr><td> Requestor's email address: </td><td>{{ list.requestor_email|urlize }}</td></tr>
<tr><td> Email list name: </td><td>{{ list.mlist_name }}@{{ list.domain_name }}</td></tr> <tr><td> Email list name: </td><td>{{ list.mlist_name }}@{{ list.domain }}</td></tr>
{% ifequal req "delete" %} {% ifequal req "delete" %}
<tr><td> Reason for closing list: </td><td>{{ list.reason_to_delete|escape|linebreaksbr }}</td></tr> <tr><td> Reason for closing list: </td><td>{{ list.reason_to_delete|escape|linebreaksbr }}</td></tr>
{% else %} {% else %}
@ -12,7 +12,7 @@
<tr><td> Welcome message for initial subscriber(s) (optional): </td><td>{{ list.welcome_message|linebreaksbr }}</td></tr> <tr><td> Welcome message for initial subscriber(s) (optional): </td><td>{{ list.welcome_message|linebreaksbr }}</td></tr>
<tr><td> Welcome message for new subscriber(s) (optional): </td><td>{{ list.welcome_new|linebreaksbr }}</td></tr> <tr><td> Welcome message for new subscriber(s) (optional): </td><td>{{ list.welcome_new|linebreaksbr }}</td></tr>
<tr><td> Required steps for subscription: </td><td>{{ list.get_subscription_display }}</td></tr> <tr><td> Required steps for subscription: </td><td>{{ list.get_subscription_display }}</td></tr>
<tr><td> Messages to this list can be posted by:</td><td>{{ list.post_who|yesno:"List members only,Open" }}</td></tr> <tr><td> Messages to this list can be posted by:</td><td>{{ list.get_post_who_display }}</td></tr>
<tr><td> Administrator approval required for posts: </td><td>{{ list.post_admin|yesno:"YES,NO" }}</td></tr> <tr><td> Administrator approval required for posts: </td><td>{{ list.post_admin|yesno:"YES,NO" }}</td></tr>
<tr><td> Private Archive: </td><td>{{ list.archive_private|yesno:"YES,NO" }}</td></tr> <tr><td> Private Archive: </td><td>{{ list.archive_private|yesno:"YES,NO" }}</td></tr>
<tr><td> Specific information about how to access and move the exiting archive from a remote location (optional): </td><td>{{ list.archive_remote }}</td></tr> <tr><td> Specific information about how to access and move the exiting archive from a remote location (optional): </td><td>{{ list.archive_remote }}</td></tr>

View file

@ -2,16 +2,19 @@ Requestor: {{ list.requestor }}
Requestor's email address: {{ list.requestor_email }} 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" %} {% ifequal req "delete" %}
Reason for closing list: {{ list.reason_to_delete }} Reason for closing list: {{ list.reason_to_delete }}
{% else %} {% 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): Email address(es) of the initial subscriber(s) (optional):
{{ list.initial }} {{ list.initial }}
@ -24,7 +27,7 @@ Welcome message for new subscriber(s) (optional):
Required steps for subscription: {{ list.get_subscription_display }} 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" }} Administrator approval required for posts: {{ list.post_admin|yesno:"YES,NO" }}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% 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 %} {% block css %}
table { table {

View file

@ -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 Movement of the WG email list for {{ list.mlist_name }} to ietf.org
{% else %} {% else %}
{% ifequal list.mail_type 3 %} {% 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 %} {% else %}
{% ifequal list.mail_type 4 %} {% 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 %} {% else %}
{% ifequal list.mail_type 5 %} {% ifequal list.mail_type 5 %}
Closing the WG email list <{{ list.mlist_name }}@ietf.org> Closing the WG email list <{{ list.mlist_name }}@ietf.org>
{% else %} {% else %}
{% ifequal list.mail_type 6 %} {% 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 %} {% else %}
** programming error ** ** programming error **
{% endifequal %} {% endifequal %}

View file

@ -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 move the WG email list for {{ list.mlist_name }} to ietf.org
{% else %} {% else %}
{% ifequal list.mail_type 3 %} {% 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 %} {% else %}
{% ifequal list.mail_type 4 %} {% 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 %} {% else %}
{% ifequal list.mail_type 5 %} {% ifequal list.mail_type 5 %}
close the WG email list <{{ list.mlist_name }}@ietf.org> close the WG email list <{{ list.mlist_name }}@ietf.org>
{% else %} {% else %}
{% ifequal list.mail_type 6 %} {% 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 %} {% else %}
** programming error ** ** programming error **
{% endifequal %} {% endifequal %}