mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Include docs load timestamp in developer docs
This makes it possible to figure out when the docs were actually loaded, since developer docs don't carry a version number. This is actually going to be the docs *load* timestamp, and not build timestamp, but they should be close enough together that it shouldn't matter. Fixes #108
This commit is contained in:
@ -15,6 +15,7 @@ from models import DocPage, DocComment
|
||||
from forms import DocCommentForm
|
||||
|
||||
def docpage(request, version, typ, filename):
|
||||
loaddate = None
|
||||
# Get the current version both to map the /current/ url, and to later
|
||||
# determine if we allow comments on this page.
|
||||
currver = Version.objects.filter(current=True)[0].tree
|
||||
@ -24,6 +25,7 @@ def docpage(request, version, typ, filename):
|
||||
if not typ == 'static':
|
||||
raise Http404("Only static version of developer docs available")
|
||||
ver = Decimal(0)
|
||||
loaddate = Version.objects.get(tree=Decimal(0)).docsloaded
|
||||
else:
|
||||
ver = Decimal(version)
|
||||
|
||||
@ -54,6 +56,7 @@ def docpage(request, version, typ, filename):
|
||||
'comments': comments,
|
||||
'can_comment': (typ=="interactive" and ver==currver),
|
||||
'doc_index_filename': indexname,
|
||||
'loaddate': loaddate,
|
||||
})
|
||||
|
||||
def docsrootpage(request, version, typ):
|
||||
|
Reference in New Issue
Block a user