Skip to content

Commit cca760b

Browse files
committed
Added /doc/all/ page
- Legacy-Id: 1999
1 parent bb232fc commit cca760b

4 files changed

Lines changed: 94 additions & 4 deletions

File tree

ietf/idrfc/testurl.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
200 /
22
200 /doc/
3+
200,heavy /doc/all/
34
200 /doc/test/
45

56
# draft that's now RFC

ietf/idrfc/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
(r'^test/$', views.test),
3838
(r'^/?$', views_search.search_main),
3939
(r'^search/$', views_search.search_results),
40+
(r'^all/$', views_search.all),
4041
(r'^(?P<name>[^/]+)/$', views_doc.document_main),
4142
(r'^(?P<name>[^/]+)/_debug.data$', views_doc.document_debug),
4243
(r'^(?P<name>[^/]+)/_ballot.data$', views_doc.document_ballot),

ietf/idrfc/views_search.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from django.shortcuts import render_to_response
3636
from django.db.models import Q
3737
from django.template import RequestContext
38-
38+
from django.views.decorators.cache import cache_page
3939
from ietf.idtracker.models import IDState, IESGLogin, IDSubState, Area, InternetDraft, Rfc, IDInternal
4040
from ietf.idrfc.models import RfcIndex
4141
from django.http import Http404, HttpResponse
@@ -249,7 +249,12 @@ def by_ad(request, name):
249249
results.sort(key=lambda obj: obj.view_sort_key_byad())
250250
return render_to_response('idrfc/by_ad.html', {'form':form, 'docs':results,'meta':meta, 'ad_name':ad_name}, context_instance=RequestContext(request))
251251

252+
@cache_page(15*60) # 15 minutes
253+
def all(request):
254+
active = InternetDraft.objects.all().filter(status=1).order_by("filename").values('filename')
255+
rfc1 = InternetDraft.objects.all().filter(status=3).order_by("filename").values('filename','rfc_number')
256+
rfc_numbers1 = InternetDraft.objects.all().filter(status=3).values_list('rfc_number', flat=True)
257+
rfc2 = RfcIndex.objects.all().exclude(rfc_number__in=rfc_numbers1).order_by('rfc_number').values('rfc_number','draft')
258+
dead = InternetDraft.objects.all().exclude(status__in=[1,3]).order_by("filename").select_related('status__status')
259+
return render_to_response('idrfc/all.html', {'active':active, 'rfc1':rfc1, 'rfc2':rfc2, 'dead':dead}, context_instance=RequestContext(request))
252260

253-
254-
# changes done by convert-096.py:changed newforms to forms
255-
# cleaned_data

ietf/templates/idrfc/all.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{% comment %}
2+
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3+
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions
7+
are met:
8+
9+
* Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following
14+
disclaimer in the documentation and/or other materials provided
15+
with the distribution.
16+
17+
* Neither the name of the Nokia Corporation and/or its
18+
subsidiary(-ies) nor the names of its contributors may be used
19+
to endorse or promote products derived from this software
20+
without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #}
33+
{% endcomment %}
34+
<html>
35+
<head>
36+
<title>All Internet-Drafts and RFCs</title>
37+
</head>
38+
<body>
39+
40+
<h1>All Internet-Drafts and RFCs</h1>
41+
42+
<p>This page lists all Internet-Drafts and RFCs, grouped by
43+
status. The main purpose of this page is to ensure all pages can be
44+
found by search engines. For normal use, it is recommended to use
45+
the <a href="/doc/">search page</a> instead.</p>
46+
47+
<p>The following files are also available for download:</p>
48+
<ul>
49+
<li><a href="http://www.ietf.org/id/1id-index.txt">Active Internet-Drafts (text)</a></li>
50+
<li><a href="http://www.ietf.org/id/all_id.txt">All Internet-Drafts (tab-separated)</a></li>
51+
<li><a href="http://www.rfc-editor.org/rfc/rfc-index.txt">All RFCs (text)</a></li>
52+
<li><a href="http://www.rfc-editor.org/rfc/rfc-index.xml">All RFCs (XML)</a></li>
53+
</ul>
54+
55+
56+
<h1>Active Internet-Drafts</h1>
57+
<p>
58+
{% for doc in active %}<a href="/doc/{{ doc.filename }}/">{{ doc.filename }}</a><br/>
59+
{% endfor %}
60+
</p>
61+
62+
<h1>Internet-Drafts Published as RFCs</h1>
63+
64+
<p>
65+
{% for doc in rfc1 %}<a href="/doc/{{ doc.filename }}/">{{ doc.filename }}</a> (<a href="/doc/rfc{{doc.rfc_number}}/">RFC {{ doc.rfc_number }}</a>)<br/>
66+
{% endfor %}
67+
</p>
68+
69+
<h1>RFCs Without Internet-Draft Information</h1>
70+
71+
<p>
72+
{% for doc in rfc2 %}<a href="/doc/rfc{{ doc.rfc_number }}/">RFC {{ doc.rfc_number }}</a>{% if doc.draft %} ({{ doc.draft }}?){% endif %}<br/>
73+
{% endfor %}
74+
</p>
75+
76+
<h1>Expired/Withdrawn/Replaced Internet-Drafts</h1>
77+
78+
<p>
79+
{% for doc in dead %}<a href="/doc/{{ doc.filename }}/">{{ doc.filename }}</a> ({{ doc.status.status}})<br/>
80+
{% endfor %}
81+
</p>
82+
83+
</body>

0 commit comments

Comments
 (0)