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
This commit is contained in:
parent
d9deb613cd
commit
0ed0d375ee
|
@ -1,4 +1,4 @@
|
|||
__version__ = "0.98"
|
||||
__version__ = "0.98-dev"
|
||||
|
||||
__date__ = "$Date$"
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
from django.conf import settings
|
||||
from ietf import __date__, __rev__, __version__, __id__
|
||||
from ietf.utils import log
|
||||
|
||||
def server_mode(request):
|
||||
return {'server_mode': settings.SERVER_MODE}
|
||||
|
||||
print "*** In context_processors.py"
|
||||
def revision_info(request):
|
||||
return {'revision_time': __date__[7:32], 'revision_date': __date__[34:-3], 'revision_num': __rev__[6:-2], "revision_id": __id__[5:-2], "version_num": __version__ }
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import re
|
||||
import django.utils.html
|
||||
from django.shortcuts import render_to_response as render
|
||||
from django.template import RequestContext
|
||||
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
|
||||
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
|
||||
from ietf.ipr.related import related_docs
|
||||
|
@ -16,19 +17,10 @@ def mark_last_doc(iprs):
|
|||
|
||||
def mark_related_doc(iprs):
|
||||
for item in iprs:
|
||||
print "*** Item:", item
|
||||
for entry in item.drafts.all():
|
||||
print " ** Entry:", entry
|
||||
print " * Doc:", entry.document
|
||||
related_docs(entry.document, [])
|
||||
print " Doc relation:", entry.document.relation
|
||||
print " Doc related :", entry.document.related
|
||||
for entry in item.rfcs.all():
|
||||
print " ** Entry:", entry
|
||||
print " * Doc:", entry.document
|
||||
related_docs(entry.document, [])
|
||||
print " Doc relation:", entry.document.relation
|
||||
print " Doc related :", entry.document.related
|
||||
|
||||
def unique_iprs(iprs):
|
||||
ids = []
|
||||
|
@ -85,9 +77,11 @@ def search(request, type="", q="", id=""):
|
|||
docs = related_docs(first, [])
|
||||
#docs = get_doclist.get_doclist(first)
|
||||
iprs = iprs_from_docs(docs)
|
||||
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs})
|
||||
return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs},
|
||||
context_instance=RequestContext(request) )
|
||||
elif start.count():
|
||||
return render("ipr/search_doc_list.html", {"q": q, "docs": start })
|
||||
return render("ipr/search_doc_list.html", {"q": q, "docs": start },
|
||||
context_instance=RequestContext(request) )
|
||||
else:
|
||||
raise ValueError("Missing or malformed search parameters, or internal error")
|
||||
|
||||
|
@ -99,7 +93,8 @@ def search(request, type="", q="", id=""):
|
|||
# Some extra information, to help us render 'and' between the
|
||||
# last two documents in a sequence
|
||||
mark_last_doc(iprs)
|
||||
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count } )
|
||||
return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count },
|
||||
context_instance=RequestContext(request) )
|
||||
|
||||
# Search by content of email or pagent_info field
|
||||
elif type == "patent_info_search":
|
||||
|
@ -118,7 +113,8 @@ def search(request, type="", q="", id=""):
|
|||
iprs = iprs_from_docs(docs)
|
||||
count = len(iprs)
|
||||
#mark_last_doc(iprs)
|
||||
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "iprs": iprs, "count": count } )
|
||||
return render("ipr/search_wg_result.html", {"q": q, "docs": docs, "iprs": iprs, "count": count },
|
||||
context_instance=RequestContext(request) )
|
||||
|
||||
# Search by rfc and id title
|
||||
elif type == "title_search":
|
||||
|
@ -130,4 +126,4 @@ def search(request, type="", q="", id=""):
|
|||
else:
|
||||
raise ValueError("Unexpected search type in IPR query: %s" % type)
|
||||
return django.http.HttpResponseRedirect(request.path)
|
||||
return render("ipr/search.html", {"wgs": wgs})
|
||||
return render("ipr/search.html", {"wgs": wgs}, context_instance=RequestContext(request))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import django.utils.html
|
||||
from django.shortcuts import render_to_response as render
|
||||
from django.template import RequestContext
|
||||
from django.utils.html import escape
|
||||
from ietf.idtracker.models import IETFWG
|
||||
from ietf.ipr.models import IprDetail, SELECT_CHOICES, LICENSE_CHOICES
|
||||
|
@ -14,7 +15,7 @@ def linebreaks(value):
|
|||
|
||||
def default(request):
|
||||
"""Default page, with links to sub-pages"""
|
||||
return render("ipr/disclosure.html", {})
|
||||
return render("ipr/disclosure.html", {}, context_instance=RequestContext(request))
|
||||
|
||||
def showlist(request):
|
||||
"""Display a list of existing disclosures"""
|
||||
|
@ -36,7 +37,7 @@ def list_all(request, template):
|
|||
'generic_disclosures' : generic_disclosures.order_by(* ['-submitted_date', ] ),
|
||||
'specific_disclosures': specific_disclosures.order_by(* ['-submitted_date', ] ),
|
||||
'thirdpty_disclosures': thirdpty_disclosures.order_by(* ['-submitted_date', ] ),
|
||||
} )
|
||||
}, context_instance=RequestContext(request) )
|
||||
|
||||
# Details views
|
||||
|
||||
|
@ -74,7 +75,8 @@ def show(request, ipr_id=None):
|
|||
ipr.is_pending = dict(SELECT_CHOICES)[ipr.is_pending]
|
||||
if ipr.applies_to_all:
|
||||
ipr.applies_to_all = dict(SELECT_CHOICES)[ipr.applies_to_all]
|
||||
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list})
|
||||
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
def update(request, ipr_id=None):
|
||||
"""Update a specific IPR disclosure"""
|
||||
|
@ -86,7 +88,7 @@ def update(request, ipr_id=None):
|
|||
def form(request):
|
||||
wgs = IETFWG.objects.filter(group_type__group_type_id=1).exclude(group_acronym__acronym='2000').select_related().order_by('acronym.acronym')
|
||||
log("Search form")
|
||||
return render("ipr/search.html", {"wgs": wgs})
|
||||
return render("ipr/search.html", {"wgs": wgs}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||
'django.core.context_processors.debug',
|
||||
'django.core.context_processors.i18n',
|
||||
'ietf.context_processors.server_mode',
|
||||
'ietf.context_processors.revision_info',
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
|
|
|
@ -4,7 +4,9 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
{% endblock %}
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
|
||||
<head><title>{% block title %}IETF Data{% endblock %}{% ifnotequal server_mode "production" %} - {{ server_mode|upper }} MODE{% endifnotequal %}</title>
|
||||
<head>
|
||||
<!-- Project Revision {{ revision_num }}, {{ revision_time }} -->
|
||||
<title>{% block title %}IETF Data{% endblock %}{% ifnotequal server_mode "production" %} - {{ server_mode|upper }} MODE{% endifnotequal %}</title>
|
||||
{% ifnotequal server_mode "production" %}
|
||||
<link rel="icon" href="/images/ietf-dev-icon.bmp" />
|
||||
{% else %}
|
||||
|
@ -46,7 +48,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|||
{% block content %}{% endblock %}
|
||||
{% block main_content %}{% endblock %}
|
||||
</div>
|
||||
<hr/>
|
||||
<hr/>
|
||||
<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>
|
||||
<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>
|
||||
{% include "debug.html" %}
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue