diff options
| author | Magnus Hagander | 2013-08-17 13:55:30 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2013-08-17 13:55:30 +0000 |
| commit | 845c133d0b60f30a89332e6a49902e24298c0b1b (patch) | |
| tree | 1e9f7cab930bff1a6715101418d2641528ca958c | |
| parent | 8be717d99d3a2e29ff9fe4801bee5efd633c4600 (diff) | |
Explicitly list beta and development versions in docs as "devel"
Previously we listed both those as unsupported, which confused some users
particularly with new beta releases. While they are technically not supported
yet, it gave off the image that specific features would not be in newer
versions anymore, since they got listed as unsupported.
In passing, fix the style of the links in case they only exist in old
versions, which would put an extra | character in the version list.
| -rw-r--r-- | pgweb/docs/views.py | 8 | ||||
| -rw-r--r-- | templates/docs/docspage.html | 17 |
2 files changed, 21 insertions, 4 deletions
diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py index eea782af..c0bb86a4 100644 --- a/pgweb/docs/views.py +++ b/pgweb/docs/views.py @@ -43,7 +43,10 @@ def docpage(request, version, typ, filename): fullname = "%s.%s" % (filename, extension) page = get_object_or_404(DocPage, version=ver, file=fullname) - versions = DocPage.objects.filter(file=fullname).extra(select={'supported':"COALESCE((SELECT supported FROM core_version v WHERE v.tree=version), 'f')"}).order_by('-supported', '-version').only('version', 'file') + versions = DocPage.objects.filter(file=fullname).extra(select={ + 'supported':"COALESCE((SELECT supported FROM core_version v WHERE v.tree=version), 'f')", + 'beta':"CASE WHEN (SELECT beta FROM core_version v WHERE v.tree=version)='t' THEN true WHEN version=0 THEN true ELSE false END", + }).order_by('-supported', '-version').only('version', 'file') if typ=="interactive": comments = DocComment.objects.filter(version=ver, file=fullname, approved=True).order_by('posted_at') @@ -53,7 +56,8 @@ def docpage(request, version, typ, filename): return render_to_response('docs/docspage.html', { 'page': page, 'supported_versions': [v for v in versions if v.supported], - 'unsupported_versions': [v for v in versions if not v.supported], + 'devel_versions': [v for v in versions if not v.supported and v.beta], + 'unsupported_versions': [v for v in versions if not v.supported and not v.beta], 'title': page.title, 'doc_type': typ, 'comments': comments, diff --git a/templates/docs/docspage.html b/templates/docs/docspage.html index 0dcef107..df534d95 100644 --- a/templates/docs/docspage.html +++ b/templates/docs/docspage.html @@ -40,8 +40,8 @@ <a href="/" title="Home">Home</a> → <a href="/docs" title="Documentation">Documentation</a> → <a href="/docs/manuals" title="Manuals">Manuals</a> → <a href="/docs/{{page.display_version}}/{{doc_type}}/{{doc_index_filename}}">PostgreSQL {{page.display_version}}</a>{%if loaddate%} ({{loaddate|date:"Y-m-d H:i:s"}}){%endif%} </div> <div id="docVersions"> -{%if supported_versions%} This page in other versions: +{%if supported_versions%} {%for ver in supported_versions %} {%if not forloop.first %}/{%endif%} {%if ver.version == page.version %} @@ -51,8 +51,21 @@ This page in other versions: {%endif%} {%endfor%} {%endif%} + +{%if devel_versions%} +{%if supported_versions%} | {%endif%}Development versions: +{%for ver in devel_versions %} + {%if not forloop.first %}/{%endif%} + {%if ver.version == page.version %} + <b>{{ver.display_version}}</b> + {% else %} + <a href="/docs/{{ver.display_version}}/{{doc_type}}/{{ver.file}}" title="This page in version {{ver.display_version}}" rel="nofollow">{{ver.display_version}}</a> + {%endif%} +{%endfor%} +{%endif%} + {%if unsupported_versions%} - | Unsupported versions: +{%if supported_versions or devel_versions%} | {%endif%}Unsupported versions: {%for ver in unsupported_versions %} {%if not forloop.first %}/{%endif%} {%if ver.version == page.version %} |
