Skip to content

Commit faf885a

Browse files
committed
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
1 parent 8628844 commit faf885a

7 files changed

Lines changed: 33 additions & 16 deletions

File tree

ietf/mailinglists/models.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class MailingList(models.Model):
4545
(2, 'Non-WG Mailing List'),
4646
(3, 'Close Non-WG Mailing List'),
4747
)
48+
POSTWHO_CHOICES = (
49+
(1, 'List members only'),
50+
(2, 'Open'),
51+
)
4852
mailing_list_id = models.CharField('Unique ID', primary_key=True, maxlength=25, editable=False)
4953
request_date = models.DateField(default=datetime.now, editable=False)
5054
requestor = models.CharField("Requestor's full name", maxlength=250)
@@ -58,7 +62,7 @@ class MailingList(models.Model):
5862
welcome_message = models.TextField('Provide a welcome message for initial subscriber(s)(optional)', blank=True)
5963
welcome_new = models.TextField('Provide a welcome message for new subscriber(s)(optional)', blank=True)
6064
subscription = models.IntegerField('What steps are required for subscription?', choices=SUBSCRIPTION_CHOICES)
61-
post_who = models.BooleanField('Only members can post')
65+
post_who = models.IntegerField('Messages to this list can be posted by', choices=POSTWHO_CHOICES)
6266
post_admin = models.BooleanField('Do postings need to be approved by an administrator?')
6367
archive_private = models.BooleanField('Are the archives private?')
6468
archive_remote = models.TextField('Provide specific information about how to access and move the existing archive (optional)', blank=True)
@@ -82,6 +86,10 @@ def save(self, *args, **kwargs):
8286
except MailingList.DoesNotExist:
8387
generate = False
8488
super(MailingList, self).save(*args, **kwargs)
89+
def domain(self):
90+
if self.domain_name:
91+
return self.domain_name
92+
return 'ietf.org'
8593
class Meta:
8694
db_table = 'mailing_list'
8795
class Admin:
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{% extends "mailinglists/list_approval_base.html" %}
22

33
{% block innercontent %}
4-
<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>
4+
<font color="#022d66"> Your note denying the request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %} has been sent to the
5+
{% if list.add_comment %}
6+
requestor with your comments.
7+
{% else %}
8+
requestor.
9+
{% endif %}
10+
<br>
511
{% endblock %}

ietf/templates/mailinglists/list_summary.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr><td colspan="2">Request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %}</td></tr>
22
<tr><td> Requestor: </td><td>{{ list.requestor|escape }}</td></tr>
33
<tr><td> Requestor's email address: </td><td>{{ list.requestor_email|urlize }}</td></tr>
4-
<tr><td> Email list name: </td><td>{{ list.mlist_name }}@{{ list.domain_name }}</td></tr>
4+
<tr><td> Email list name: </td><td>{{ list.mlist_name }}@{{ list.domain }}</td></tr>
55
{% ifequal req "delete" %}
66
<tr><td> Reason for closing list: </td><td>{{ list.reason_to_delete|escape|linebreaksbr }}</td></tr>
77
{% else %}
@@ -12,7 +12,7 @@
1212
<tr><td> Welcome message for initial subscriber(s) (optional): </td><td>{{ list.welcome_message|linebreaksbr }}</td></tr>
1313
<tr><td> Welcome message for new subscriber(s) (optional): </td><td>{{ list.welcome_new|linebreaksbr }}</td></tr>
1414
<tr><td> Required steps for subscription: </td><td>{{ list.get_subscription_display }}</td></tr>
15-
<tr><td> Messages to this list can be posted by:</td><td>{{ list.post_who|yesno:"List members only,Open" }}</td></tr>
15+
<tr><td> Messages to this list can be posted by:</td><td>{{ list.get_post_who_display }}</td></tr>
1616
<tr><td> Administrator approval required for posts: </td><td>{{ list.post_admin|yesno:"YES,NO" }}</td></tr>
1717
<tr><td> Private Archive: </td><td>{{ list.archive_private|yesno:"YES,NO" }}</td></tr>
1818
<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>

ietf/templates/mailinglists/list_summary.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ Requestor: {{ list.requestor }}
22

33
Requestor's email address: {{ list.requestor_email }}
44

5-
Email list name: {{ list.mlist_name }}@{{ list.domain_name }}
5+
Email list name: {{ list.mlist_name }}@{{ list.domain }}
66

77
{% ifequal req "delete" %}
88
Reason for closing list: {{ list.reason_to_delete }}
99
{% else %}
10-
Short description of the email list: {{ list.short_desc }}
10+
Short description of the email list:
11+
{{ list.short_desc }}
1112

12-
Long description of the email list: {{ list.long_desc }}
13+
Long description of the email list:
14+
{{ list.long_desc }}
1315

14-
Administrator(s): {{ list.admins }}{# formatting? #}
16+
Administrator(s):
17+
{{ list.admins }}
1518

1619
Email address(es) of the initial subscriber(s) (optional):
1720
{{ list.initial }}
@@ -24,7 +27,7 @@ Welcome message for new subscriber(s) (optional):
2427

2528
Required steps for subscription: {{ list.get_subscription_display }}
2629

27-
Messages to this list can be posted by: {{ list.post_who|yesno:"List members only,Open" }}
30+
Messages to this list can be posted by: {{ list.get_post_who_display }}
2831

2932
Administrator approval required for posts: {{ list.post_admin|yesno:"YES,NO" }}
3033

ietf/templates/mailinglists/list_toapprove.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22

3-
{% block title %}Confirmation of Request to {{ list.get_mail_type_display }}{% endblock %}
3+
{% block title %}Confirmation of request to {% filter escape %}{% include "mailinglists/list_type_message2.txt" %}{% endfilter %}{% endblock %}
44

55
{% block css %}
66
table {

ietf/templates/mailinglists/list_type_message.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Creation of the WG email list <{{ list.mlist_name }}@ietf.org>
55
Movement of the WG email list for {{ list.mlist_name }} to ietf.org
66
{% else %}
77
{% ifequal list.mail_type 3 %}
8-
Movement of the non-WG email list {{ list.mlist_name }} to {{ list.domain_name }}
8+
Movement of the non-WG email list {{ list.mlist_name }} to {{ list.domain }}
99
{% else %}
1010
{% ifequal list.mail_type 4 %}
11-
Creation of the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}>
11+
Creation of the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}>
1212
{% else %}
1313
{% ifequal list.mail_type 5 %}
1414
Closing the WG email list <{{ list.mlist_name }}@ietf.org>
1515
{% else %}
1616
{% ifequal list.mail_type 6 %}
17-
Closing the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}>
17+
Closing the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}>
1818
{% else %}
1919
** programming error **
2020
{% endifequal %}

ietf/templates/mailinglists/list_type_message2.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ create the WG email list <{{ list.mlist_name }}@ietf.org>
55
move the WG email list for {{ list.mlist_name }} to ietf.org
66
{% else %}
77
{% ifequal list.mail_type 3 %}
8-
move the non-WG email list {{ list.mlist_name }} to {{ list.domain_name }}
8+
move the non-WG email list {{ list.mlist_name }} to {{ list.domain }}
99
{% else %}
1010
{% ifequal list.mail_type 4 %}
11-
create the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}>
11+
create the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}>
1212
{% else %}
1313
{% ifequal list.mail_type 5 %}
1414
close the WG email list <{{ list.mlist_name }}@ietf.org>
1515
{% else %}
1616
{% ifequal list.mail_type 6 %}
17-
close the non-WG email list <{{ list.mlist_name }}@{{ list.domain_name }}>
17+
close the non-WG email list <{{ list.mlist_name }}@{{ list.domain }}>
1818
{% else %}
1919
** programming error **
2020
{% endifequal %}

0 commit comments

Comments
 (0)