Skip to content

Commit 0ed0d37

Browse files
committed
Adding a footer line with version info and webmaster link, and a context processor to transfer information to it and variables in ietf/__init__.py to hold the information.
- Legacy-Id: 652
1 parent d9deb61 commit 0ed0d37

6 files changed

Lines changed: 29 additions & 21 deletions

File tree

ietf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.98"
1+
__version__ = "0.98-dev"
22

33
__date__ = "$Date$"
44

ietf/context_processors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from django.conf import settings
2+
from ietf import __date__, __rev__, __version__, __id__
3+
from ietf.utils import log
24

35
def server_mode(request):
46
return {'server_mode': settings.SERVER_MODE}
57

8+
print "*** In context_processors.py"
9+
def revision_info(request):
10+
return {'revision_time': __date__[7:32], 'revision_date': __date__[34:-3], 'revision_num': __rev__[6:-2], "revision_id": __id__[5:-2], "version_num": __version__ }
11+

ietf/ipr/search.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
import django.utils.html
33
from django.shortcuts import render_to_response as render
4+
from django.template import RequestContext
45
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
56
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
67
from ietf.ipr.related import related_docs
@@ -16,19 +17,10 @@ def mark_last_doc(iprs):
1617

1718
def mark_related_doc(iprs):
1819
for item in iprs:
19-
print "*** Item:", item
2020
for entry in item.drafts.all():
21-
print " ** Entry:", entry
22-
print " * Doc:", entry.document
2321
related_docs(entry.document, [])
24-
print " Doc relation:", entry.document.relation
25-
print " Doc related :", entry.document.related
2622
for entry in item.rfcs.all():
27-
print " ** Entry:", entry
28-
print " * Doc:", entry.document
2923
related_docs(entry.document, [])
30-
print " Doc relation:", entry.document.relation
31-
print " Doc related :", entry.document.related
3224

3325
def unique_iprs(iprs):
3426
ids = []
@@ -85,9 +77,11 @@ def search(request, type="", q="", id=""):
8577
docs = related_docs(first, [])
8678
#docs = get_doclist.get_doclist(first)
8779
iprs = iprs_from_docs(docs)
88-
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs})
80+
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs},
81+
context_instance=RequestContext(request) )
8982
elif start.count():
90-
return render("ipr/search_doc_list.html", {"q": q, "docs": start })
83+
return render("ipr/search_doc_list.html", {"q": q, "docs": start },
84+
context_instance=RequestContext(request) )
9185
else:
9286
raise ValueError("Missing or malformed search parameters, or internal error")
9387

@@ -99,7 +93,8 @@ def search(request, type="", q="", id=""):
9993
# Some extra information, to help us render 'and' between the
10094
# last two documents in a sequence
10195
mark_last_doc(iprs)
102-
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count } )
96+
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count },
97+
context_instance=RequestContext(request) )
10398

10499
# Search by content of email or pagent_info field
105100
elif type == "patent_info_search":
@@ -118,7 +113,8 @@ def search(request, type="", q="", id=""):
118113
iprs = iprs_from_docs(docs)
119114
count = len(iprs)
120115
#mark_last_doc(iprs)
121-
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "iprs": iprs, "count": count } )
116+
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "iprs": iprs, "count": count },
117+
context_instance=RequestContext(request) )
122118

123119
# Search by rfc and id title
124120
elif type == "title_search":
@@ -130,4 +126,4 @@ def search(request, type="", q="", id=""):
130126
else:
131127
raise ValueError("Unexpected search type in IPR query: %s" % type)
132128
return django.http.HttpResponseRedirect(request.path)
133-
return render("ipr/search.html", {"wgs": wgs})
129+
return render("ipr/search.html", {"wgs": wgs}, context_instance=RequestContext(request))

ietf/ipr/views.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import django.utils.html
22
from django.shortcuts import render_to_response as render
3+
from django.template import RequestContext
34
from django.utils.html import escape
45
from ietf.idtracker.models import IETFWG
56
from ietf.ipr.models import IprDetail, SELECT_CHOICES, LICENSE_CHOICES
@@ -14,7 +15,7 @@ def linebreaks(value):
1415

1516
def default(request):
1617
"""Default page, with links to sub-pages"""
17-
return render("ipr/disclosure.html", {})
18+
return render("ipr/disclosure.html", {}, context_instance=RequestContext(request))
1819

1920
def showlist(request):
2021
"""Display a list of existing disclosures"""
@@ -36,7 +37,7 @@ def list_all(request, template):
3637
'generic_disclosures' : generic_disclosures.order_by(* ['-submitted_date', ] ),
3738
'specific_disclosures': specific_disclosures.order_by(* ['-submitted_date', ] ),
3839
'thirdpty_disclosures': thirdpty_disclosures.order_by(* ['-submitted_date', ] ),
39-
} )
40+
}, context_instance=RequestContext(request) )
4041

4142
# Details views
4243

@@ -74,7 +75,8 @@ def show(request, ipr_id=None):
7475
ipr.is_pending = dict(SELECT_CHOICES)[ipr.is_pending]
7576
if ipr.applies_to_all:
7677
ipr.applies_to_all = dict(SELECT_CHOICES)[ipr.applies_to_all]
77-
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list})
78+
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list},
79+
context_instance=RequestContext(request))
7880

7981
def update(request, ipr_id=None):
8082
"""Update a specific IPR disclosure"""
@@ -86,7 +88,7 @@ def update(request, ipr_id=None):
8688
def form(request):
8789
wgs = IETFWG.objects.filter(group_type__group_type_id=1).exclude(group_acronym__acronym='2000').select_related().order_by('acronym.acronym')
8890
log("Search form")
89-
return render("ipr/search.html", {"wgs": wgs})
91+
return render("ipr/search.html", {"wgs": wgs}, context_instance=RequestContext(request))
9092

9193

9294

ietf/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
'django.core.context_processors.debug',
106106
'django.core.context_processors.i18n',
107107
'ietf.context_processors.server_mode',
108+
'ietf.context_processors.revision_info',
108109
)
109110

110111
INSTALLED_APPS = (

ietf/templates/base.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
55
{% endblock %}
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
7-
<head><title>{% block title %}IETF Data{% endblock %}{% ifnotequal server_mode "production" %} - {{ server_mode|upper }} MODE{% endifnotequal %}</title>
7+
<head>
8+
<!-- Project Revision {{ revision_num }}, {{ revision_time }} -->
9+
<title>{% block title %}IETF Data{% endblock %}{% ifnotequal server_mode "production" %} - {{ server_mode|upper }} MODE{% endifnotequal %}</title>
810
{% ifnotequal server_mode "production" %}
911
<link rel="icon" href="/images/ietf-dev-icon.bmp" />
1012
{% else %}
@@ -46,7 +48,8 @@
4648
{% block content %}{% endblock %}
4749
{% block main_content %}{% endblock %}
4850
</div>
49-
<hr/>
51+
<hr/>
52+
<div style="width: 100%; height: 1em; font-size: 9pt; font-style: italic;"><span style="float: left;">Made with <a href="http://www.djangoproject.com/">django</a></span><span style="float: right;">v{{ version_num }}, {{ revision_date }} - <a href="mailto:webmaster@ietf.org">webmaster@ietf.org</a></span></div>
5053
<a href="http://www.djangoproject.com/"><img src="http://media.djangoproject.com/img/badges/djangomade124x25.gif" border="0" alt="Made with Django." title="Made with Django." /></a>
5154
{% include "debug.html" %}
5255
</body>

0 commit comments

Comments
 (0)