From 24a48d2037c66e45d33a0b88f128189097b03413 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 23 Nov 2020 17:05:11 +0100 Subject: [PATCH] Update layout of documentation navigation pages * Move links to current manuals to /docs/, decommission /docs/manuals/ * Add link to /docs/current/ with a large button * Add links to /docs/devel/ at the bottom of the version table * Remove translated manuals from left nav menu, since they are in the right one * Remove redundant wording around "comprehensive manual" * Clean up some incorrect template tags Discussion: https://www.postgresql.org/message-id/CABUevEymaWDL4JywHxBDBATUUPPrAf4_tGwin4CtGFdQ5tx5Hg@mail.gmail.com --- media/css/main.css | 4 ++ pgweb/docs/views.py | 8 ++-- pgweb/util/contexts.py | 6 +-- templates/docs/archive.html | 13 ++++--- templates/docs/index.html | 73 ++++++++++++++++++++++++------------- templates/docs/manuals.html | 34 ----------------- 6 files changed, 64 insertions(+), 74 deletions(-) delete mode 100644 templates/docs/manuals.html diff --git a/media/css/main.css b/media/css/main.css index 08f794a3..69936559 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -1161,6 +1161,10 @@ hr.eventseparator { margin: 1em auto; } +.btn-double-width { + width: 28em; +} + .btn-center { text-align: center; display: block; diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py index df6e6b0e..54393f74 100644 --- a/pgweb/docs/views.py +++ b/pgweb/docs/views.py @@ -182,7 +182,7 @@ def redirect_root(request, version): def root(request): versions = Version.objects.filter(Q(supported=True) | Q(testing__gt=0, tree__gt=0)).order_by('-tree') return render_pgweb(request, 'docs', 'docs/index.html', { - 'versions': versions, + 'versions': [_VersionPdfWrapper(v) for v in versions], }) @@ -216,10 +216,8 @@ class _VersionPdfWrapper(object): def manuals(request): - versions = Version.objects.filter(Q(supported=True) | Q(testing__gt=0, tree__gt=0)).order_by('-tree') - return render_pgweb(request, 'docs', 'docs/manuals.html', { - 'versions': [_VersionPdfWrapper(v) for v in versions], - }) + # Legacy URL for manuals, redirect to the main docs page + return HttpResponsePermanentRedirect('/docs/') def manualarchive(request): diff --git a/pgweb/util/contexts.py b/pgweb/util/contexts.py index 88e3c4aa..f17374c9 100644 --- a/pgweb/util/contexts.py +++ b/pgweb/util/contexts.py @@ -30,12 +30,8 @@ sitenav = { ], 'docs': [ {'title': 'Documentation', 'link': '/docs/'}, - {'title': 'Manuals', 'link': '/docs/manuals/', 'submenu': [ + {'title': 'Manuals', 'link': '/docs/', 'submenu': [ {'title': 'Archive', 'link': '/docs/manuals/archive/'}, - {'title': 'Chinese', 'link': 'http://www.postgres.cn/docs'}, - {'title': 'French', 'link': 'https://docs.postgresql.fr/'}, - {'title': 'Japanese', 'link': 'https://www.postgresql.jp/document/'}, - {'title': 'Russian', 'link': 'https://postgrespro.ru/docs/postgresql'}, ]}, {'title': 'Release Notes', 'link': '/docs/release/'}, {'title': 'Books', 'link': '/docs/books/'}, diff --git a/templates/docs/archive.html b/templates/docs/archive.html index 6cff6317..b88cbb91 100644 --- a/templates/docs/archive.html +++ b/templates/docs/archive.html @@ -10,20 +10,23 @@ If you are still using any of these releases, you are strongly advised to upgrad - + {%for v in versions%} - + {%endfor%} diff --git a/templates/docs/index.html b/templates/docs/index.html index 22bceba7..cfcc2f8f 100644 --- a/templates/docs/index.html +++ b/templates/docs/index.html @@ -7,35 +7,58 @@

Documentation

-

This section contains current - and archived manuals for PostgreSQL users. You can read the release notes, and view a listing of books - written about PostgreSQL.

+

+ View the manual +

+ +

Manuals

+

+ You can view the manual for an older version or download a PDF of a manual from the below table. +

+
Online VersionOnline Version PDF Version
{{v.treestring}} - {%if v.a4pdf%}Comprehensive Manual: A4 PDF ({{v.a4pdf|filesizeformat}}){%endif%} - {%if v.uspdf%}Comprehensive Manual: US PDF ({{v.uspdf|filesizeformat}}){%endif%} - {%if not v.a4pdf and not v4.uspdf%}PDF version not available{%endif%} + {%if v.a4pdf or v.uspdf%} + {%if v.a4pdf%}A4 PDF ({{v.a4pdf|filesizeformat}}){%endif%} + {%if v.a4pdf and v.uspdf%} • {%endif%} + {%if v.uspdf%}US PDF ({{v.uspdf|filesizeformat}}){%endif%} + {%else%}PDF version not available + {%endif%}
+ + + + + + + + {%for v in versions%} + + + + {%endfor%} + + + + + +
Online VersionPDF Version
+ {{v.treestring}} + + {%if v.a4pdf or v.uspdf%} + {%if v.a4pdf%}A4 PDF ({{v.a4pdf|filesizeformat}}){%endif%} + {%if v.a4pdf and v.uspdf%}•{%endif%} + {%if v.uspdf%}US PDF ({{v.uspdf|filesizeformat}}){%endif%} + {%else%}PDF version not available + {%endif%} +
Development snapshotPDF version not available
+ +

+ Looking for documentation for an older, unsupported, version? Check the + archive of older manuals. +

-

Online Manuals

+

Translated Manuals

-
-
- -
-
Translated Manuals
-
- -
-

More manuals
-
+
diff --git a/templates/docs/manuals.html b/templates/docs/manuals.html deleted file mode 100644 index 0db40811..00000000 --- a/templates/docs/manuals.html +++ /dev/null @@ -1,34 +0,0 @@ -{%extends "base/page.html"%} -{%block title%}Manuals{%endblock%} -{%block contents%} - -

Manuals

- - - - - - - - - - {%for v in versions%} - - - - {%endfor%} - -
Online VersionPDF Version
- {{v.treestring}} - - {%if v.a4pdf or v.uspdf%} - {%if v.a4pdf%}Comprehensive Manual: A4 PDF ({{v.a4pdf|filesizeformat}}){%endif%} - {%if v.uspdf%}Comprehensive Manual: US PDF ({{v.uspdf|filesizeformat}}){%endif%} - {%if not v.a4pdf and not v4.uspdf%}PDF version not available{%endif%} - {%endif%} -
- -

Please see the manual archive for documentation for older releases. -The DocBook SGML source for the manuals is available as part of the PostgreSQL source download available in -the FTP area.

-{%endblock%} -- 2.39.5