Tweaked the changelog presentation to work irrespective of current directory, and give a sensible 404 if the changelog can't be found.

- Legacy-Id: 4972
This commit is contained in:
Henrik Levkowetz 2012-10-30 22:13:37 +00:00
parent 781403ae9c
commit 7e84ccc606
3 changed files with 8 additions and 2 deletions

View file

@ -3,12 +3,17 @@ import os
from django.template import RequestContext from django.template import RequestContext
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.conf import settings
from django.http import Http404
import changelog import changelog
def release(request, version=None): def release(request, version=None):
entries = {} entries = {}
log_entries = changelog.parse("changelog") if os.path.exists(settings.CHANGELOG_PATH):
log_entries = changelog.parse(settings.CHANGELOG_PATH)
else:
raise Http404()
next = None next = None
for entry in log_entries: for entry in log_entries:
if next: if next:

View file

@ -302,6 +302,7 @@ BIBXML_BASE_PATH = '/a/www/ietf-ftp/xml2rfc'
# Timezone files for iCalendar # Timezone files for iCalendar
TZDATA_ICS_PATH = '/www/ietf-datatracker/tz/ics/' TZDATA_ICS_PATH = '/www/ietf-datatracker/tz/ics/'
CHANGELOG_PATH = '/www/ietf-datatracker/web/changelog'
# Put SECRET_KEY in here, or any other sensitive or site-specific # Put SECRET_KEY in here, or any other sensitive or site-specific
# changes. DO NOT commit settings_local.py to svn. # changes. DO NOT commit settings_local.py to svn.

View file

@ -77,7 +77,7 @@ IETF.user_groups = {{ user|user_roles_json }};
</div> </div>
<div style="width: 100%; text-align: center; padding-top:4px;font-size:69%;"> <div style="width: 100%; text-align: center; padding-top:4px;font-size:69%;">
{% if version_num %} {% if version_num %}
<a href="/release/">Version {{ version_num }}, {{revision_date}}</a> <a href="/release/{{version_num}}/">Version {{ version_num }}, {{revision_date}}</a>
<br/> <br/>
{% endif %} {% endif %}
<a href="http://tools.ietf.org/tools/ietfdb/newticket">Report a bug</a> <a href="http://tools.ietf.org/tools/ietfdb/newticket">Report a bug</a>