Skip to content

Commit 4b4eb29

Browse files
committed
Merged [5425] from ietf@augustcellars.com:
Modify atom change feed so that 1. It returns the last 14 days of changes rather than the last 20 2. Change the atom template so that it has correct time offsets rather than saying that PST and UTC are the same 3. Change the atom template so that it uses content rather than summary and return HTML content with line breaks as needed. - Legacy-Id: 5459 Note: SVN reference [5425] has been migrated to Git commit cb1593d
2 parents 420098c + cb1593d commit 4b4eb29

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

ietf/community/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import uuid
33
import datetime
44
import hashlib
5+
from datetime import timedelta
56

67
from django.conf import settings
78
from django.contrib.auth import REDIRECT_FIELD_NAME
@@ -137,7 +138,9 @@ def view_group_list(request, acronym):
137138

138139
def _atom_view(request, clist, significant=False):
139140
documents = [i['pk'] for i in clist.get_documents().values('pk')]
140-
notifications = DocEvent.objects.filter(doc__pk__in=documents)\
141+
startDate = datetime.datetime.now() - datetime.timedelta(days=14)
142+
143+
notifications = DocEvent.objects.filter(doc__pk__in=documents, time__gte=startDate)\
141144
.distinct()\
142145
.order_by('-time', '-id')
143146
if significant:
@@ -154,7 +157,7 @@ def _atom_view(request, clist, significant=False):
154157

155158
return render_to_response('community/public/atom.xml',
156159
{'cl': clist,
157-
'entries': notifications[:20],
160+
'entries': notifications,
158161
'title': title,
159162
'subtitle': subtitle,
160163
'id': feed_id.get_urn(),

ietf/templates/community/public/atom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<title type="text">{{ title }}</title>
44
<subtitle type="text">{{ subtitle }}</subtitle>
55
<id>{{ id }}</id>
6-
<updated>{{ updated|date:"Y-m-d\TH:i:s" }}Z</updated>
6+
<updated>{{ updated|date:"Y-m-d\TH:i:sO" }}</updated>
77
<link rel="alternate" type="text/html" hreflang="en" href="http://{{ request.get_host }}/"/>
88
<link rel="self" type="application/atom+xml" href="http://{{ request.get_host }}{{ request.get_full_path }}"/>
99

@@ -15,16 +15,16 @@
1515

1616
<id>{{ entry.id }}</id>
1717

18-
<updated>{{ entry.time|date:"Y-m-d\TH:i:s" }}Z</updated>
18+
<updated>{{ entry.time|date:"Y-m-d\TH:i:sO" }}</updated>
1919

20-
<published>{{ entry.time|date:"Y-m-d\TH:i:s" }}</published>
20+
<published>{{ entry.time|date:"Y-m-d\TH:i:sO" }}</published>
2121

2222
<author>
2323
<name>{{ entry.by }}</name>
2424
</author>
25-
26-
<summary>{{ entry.desc|striptags }}</summary>
27-
25+
{%autoescape off %}
26+
<content type="html">{{ entry.desc|linebreaksbr|force_escape }}</content>
27+
{%endautoescape %}
2828
</entry>
2929
{% endfor %}
3030

0 commit comments

Comments
 (0)