50 Commits

Author SHA1 Message Date
7a271485c8 download/debian,ubuntu: Support 2nd "copy script" button 2024-04-16 14:04:11 +02:00
9f22b31ec7 Increase dark mode contrast and add a manual toggle.
Per discussion on psql-www. This time, CSP compatible!

Reviewed by Jonathan Katz and Magnus Hagander.
2023-01-06 16:14:05 +00:00
1ac963e766 Revert "Increase dark mode contrast and add a manual toggle."
This reverts commit 92b55bad91.
2023-01-05 15:30:28 +00:00
92b55bad91 Increase dark mode contrast and add a manual toggle.
Per discussion on psql-www.

Reviewed by Jonathan Katz and Magnus Hagander.
2023-01-05 15:27:50 +00:00
11725a28c4 Allow deletion of draft news articles
When somebody posts a news article, make it possible to delete it before
it's submitted to moderation (or after it's been withdrawn or bounced),
instead of forcing the user to leave it around ForEver (TM).

Do this by adding some generic functionality for confirmation popups,
that can also be used for other things in the future.
2022-12-15 17:25:42 +01:00
5389adf8f5 Dark mode for the website.
This patch also changes the stylesheets to use CSS vars for all
the colour definitions. Dark mode is enabled automatically if the
users browser prefers it.

Patch by me, with improvements from Jonathan Katz.
Review by Jonathan Katz, Vik Fearing, and Hubert Depesz Lubaczewski.
2022-10-20 11:49:25 +01:00
78cf5fa770 Fix bug in markdown preview of new objects
Whens submitting a new object, the instructions for how to do markdown
didn't show up until after the object had been saved once.

This turns out to be because the performance optimization to take an
empty string markdown and turn it into an empty string html wrote the
(empty) result to the wrong field, thereby overwriting the instructions.
2021-03-16 18:27:01 +01:00
f9abdbfd77 Create instruction page for markdown fields
Instead of directly linking to the spec, include some basic info and a
list of our limitations.
2020-11-12 18:53:16 +01:00
ea9becd746 Re-do markdown handling for better user experience and security
* Get rid of the django_markwhat dependency, and implement our own
  classes to get more control. In passing also remove django-markdown,
  because we never used that.
* Instead of trying to clean markdown with regexps, use the bleach
  library (NEW DEPENDENCY) with special whitelisting of allowed tags
  based off standard markdown. This means that one can input links or
  formatting in HTML if one prefers, as long as it renders to the same
  subset of tags that markdown allows.
* Replace javascript based client side preview with an actual call to a
  preview URL that renders the exact result using the same function,
  since the use of showdown on the client was increasingly starting to
  differ from the server, and since that cannot be kept secure the same
  way. Rewrite the client side javascript to work better with the now
  longer interval between updates of the preview.

Long in planning, but never got around to it.

Suggestion to use bleach for escaping from David Fetter.
2020-11-12 18:52:04 +01:00
b0e7f5ce76 Add rel="noopener" to all _blank target urls 2020-09-23 16:20:48 +02:00
230b672d34 Update jquery dependency to 3.4.1 2020-09-12 14:19:34 +02:00
2217408d0d Upgrade bootstrap and popper dependencies
Up to bootstrap 4.4.1 containing a lot of fixes.

While at it, put the version in the filenames, so we don't have to
cache-bust them every time we modify something unrelated, since they do
have well defined versions.
2020-09-12 14:18:39 +02:00
ddc11b5002 Remove unused dependency on jquery.matchHeight 2020-09-12 12:48:58 +02:00
c40cc5e223 Remove unused javascript
This is from the old version of the website, and hasn't been used for
quite some time.
2020-09-12 12:48:45 +02:00
087be8458b Remove dependency on unversioned jquery-ui
We apparently had some old /admin/ code that used an old version of
jquery-ui, but AFAICT we don't have that anymore. So remove teh loading
of them and also the files, so we have just one version of jquery
around.
2020-09-12 12:48:45 +02:00
e4453cdda9 Add support for sending out news as HTML email
When a news article is approved, it gets delivered as an email to the
pgsql-announce mailinglist. It will render the markdown of the news
article into a HTML part of the email, and include the markdown raw as
the text part (for those unable or unwilling to read html mail).

For each organisation, a mail template can be specified. Initially only
two templates are supported, one "default" and one "pgproject" which is
for official project news. The intention is *not* to provide generic
templates, but we may want to extend this to certain related projects in
the future *maybe* (such as regional NPOs).

These templates are stored in templates/news/mail/*.html, and for each
template *all* images found in templates/news/mail/img.<template>/ will
be attached to the email. "Conditional image inclusion" currently not
supported.

To do CSS inlining on top of the markdown output, module pynliner is now
required (available in the python3-pynliner package on Debian).

A testing script is added as news_send_email.py in order to easier test
out templates. This is *not* intended for production sending, so it will
for example send unmoderated news. By sending, it adds it to the
outgoing mailqueue in the system, so unless the cronjob is set up to
send, nothing will happen until that is run manually.

Support is included for tagged delivery using pglister, by directly
mapping NewsTags to pglister tags.

While at it, update the moderation preview forms to preview news items
using the HTML template for the email (while leaving other types of
items previewing without a particular stylesheet).
2020-09-10 14:52:41 +02:00
5ffe6c389c Re-work moderation of submitted items
This includes a number of new features:

* Move some moderation functionality into shared places, so we don't
  keep re-inventing the wheel.
* Implement three-state moderation, where the submitter can edit their
  item and then explicitly say "i'm done, please moderate this now".
  This is currently only implemented for News, but done in a reusable
  way.
* Move moderation workflow to it's own set of URLs instead of
  overloading it on the general admin interface. Admin interface remains
  for editing things, but these are now separated out into separate
  things.
* Do proper stylesheet clearing for moderation of markdown fields, using
  a dynamic sandboxed iframe, so it's not ruined by the /admin/ css.
* Move moderation email notification into dedicated moderation code,
  thereby simplifying the admin subclassing we did which was in some
  places quite fragile.
* Reset date of news postings to the date of their approval, when
  approved. This avoids some annoying ordering issues.
2020-09-10 14:52:41 +02:00
b2ffced2b0 Update more links to be https instead of http 2020-08-31 11:56:47 +02:00
6464c68d6a Clean up javascript indentation
Remove tabs from indentation, which was in about half the files, and
make everything 4-space indentation, which is what most of the rest
used.
2020-07-12 14:09:25 +02:00
6b61af92f7 Move all the non-Yum event handler setup into one shared script, per discussion. 2020-07-09 12:03:28 +01:00
b0c19acf47 Download pages overhaul:
- Don't use inline event handlers
- Simplify some of the wording
- Replace the package download list with nice buttons

Design by me & Jonathan, code by me, review by Jonathan and others.
2020-07-07 16:52:25 +01:00
0f4ae761e3 Remove the source mapping URL for popper.min.js to prevent cluttering dev tools with warnings that it can't be found. 2020-07-07 11:09:45 +01:00
fee3746ea0 Make described checkboxes a lot more clear
Instead of a weirdly located "hover over the checkbox to get a
description" message, put the actual description underneath the
checkboxes. This removes the need for javascript for it, and make the
description a lot more readily available.

This applies only to news tags for now, since that's the only use of
described checkboxes, but hopefully it will make those more clear to
people submitting.

In passing, fix how help_text for multi-checkbox field is shown -- it
was previously shown almost as part of the field name itself, making it
very hard to make out. Now make it look like all other form field help
texts.
2020-07-04 14:54:06 +02:00
36277b95a7 Use Google Tag Manager for integration with Google Analytics and honour DNT.
Per discussion and review on pgsql-www.
2020-07-02 15:03:19 +01:00
1dc0f560a9 Overhaul the Redhat, Ubuntu and Debian installation instructions.
* Merge all commands into a single text area for ease of copy/paste.
* Add a Copy Script button to each text area to copy the script (without comments and blanks) to the clipboard.
* Centralise the copy/paste code so it can be used elsewhere.
* Always install the database server.

Based on reviews/discussion with Magnus, Jonathan, Daniel and Sehrope.
2020-06-10 14:08:04 +01:00
289f9bc409 Fixed code formatting error in featurematrix.js 2019-05-15 08:18:49 -04:00
53d041d968 Pin the navigation bar to the top of the page.
From user feedback, the scrolling navigation bar would cause problems with
readability, especially in larger font views. This keeps the navigation bar
pinned to the top, until we can find a way to more easily handle this.
2019-02-03 09:33:00 -05:00
1d78793add Remove inline script from debian/ubuntu download page 2019-01-05 13:15:58 +01:00
25860344de Remove inline styles from feature matrix generator.
This moves the HTML code generated for the filters into the Django
template, instead of the JavaScript portion.
2018-12-22 11:35:31 -05:00
b5e5c2970a Move google analytics and scrolling code into main.js
This moves the remaining inline javascript out of the base templates
2018-12-21 14:14:03 +01:00
436fcf837a Move scripts from admin changeform to their own JS file
Could be made more efficient by combining some files, but tihs is just
the /admin/ interface so not used very often.
2018-12-20 17:18:11 +01:00
c622ecd02a Move javascript for forms into separate JS file
In passing also clean up a few things that can be passed directly in the
template instead, and simplify things now that we have jquery all the
time.
2018-12-20 17:18:11 +01:00
a33bc4630b Move debian/ubuntu downloads javascript into main.js 2018-12-20 17:18:11 +01:00
6ee5d9c58d Move featurematrix javascript into a separate script file 2018-12-20 17:18:11 +01:00
1e84557d40 Refactor the navigation bar for desktop, tablet, and mobile.
Specifically, the navigation bar now shrinks in height on scroll
and when on devices smaller than 768px. Additionally, the search
box disappears at the 1280px break point to avoid text wrapping.
A JavaScript file was added (main.js) to apply the "compressed"
class when scrolling, which is what provides the menu shrinking.
2018-04-25 14:01:04 -07:00
9256e2f00d New base HTML for PostgreSQL.org
The base HTML structure enables the responsiveness for the
website. In addition to the primary base template, the generic
page and form templates are also modernized.

Authors: Sarah Conway <sarah.conway@crunchydata.com> and me
2018-04-17 13:43:04 -04:00
c72d7cefd1 New CSS base for the PostgreSQL website.
This also adds Bootstrap, Font Awesome to the codebase with license info.

Bootstrap and Font Awesome are CSS and font frameworks respectively
that ease modern web development.

The new CSS allows the PostgreSQL.org website to be responsive
based on browser window size as well as provide a modern look
and feel.

The redesign is built on top off the Bootstrap and Font Awesome
CSS and font frameworks respectively.

Authors: Sarah Conway <sarah.conway@crunchydata.com> and me
2018-04-16 15:06:42 -04:00
fb8ab1c4c5 Remove duplicate closing of </style>
Noted by Peter Eisentraut
2017-04-14 21:37:50 +02:00
d7957a214d Fix font adjustment for double-code embedding
Add additional CSS injection to prevent code tag embedded in code tag
from having its font size adjusted twice.

Discussion: https://postgr.es/m/20170408015201.GA18573@momjian.us
2017-04-14 20:45:12 +02:00
41e1b3b1b2 Import jquery and jquery-ui
We need these for autocomplete in the admin interface, to come shortly.
2016-06-23 17:59:45 +02:00
e495cae03c Replace locally-hosted jQuery with CDN-hosted version. 2014-03-15 14:35:59 +00:00
92d2b72c15 Add filters to feature matrix.
As the feature matrix is useful for seeing how far PostgreSQL has come, we
still want to keep older versions on display.  However, this is causing
problems displaying the newer versions on smaller screens.

This change adds a filter which only shows supported versions by default,
and allows folk to choose which versions they wish to compare.  This will
have no effect on browsers with Javascript disabled.
2014-03-13 15:26:19 +00:00
78c698c180 Remove links to smaller/normal text size
This functionality is already implemented in browsers, there is no need
for us to have our own implementation.
2014-02-09 13:58:34 +01:00
6f96c14452 Override some CSS classes from django-admin in the markdown previews
We don't want to use django style headlines and margins in the preview,
we want something that looks a bit more like the main site. It's not
going to be exact (e.g. the colors will still be wrong), but it will
be a lot closer than without this.
2013-02-12 17:57:34 +01:00
e897b7a6a4 Detect HTML in markdown submission forms
This will do simple html detection based on trivial regexps. If HTML is found,
it will replace it with HTML_REMOVED and also show a warning (in red color,
no less) that this is not permitted.

The actual filtering is still done server-side later, so the fact that these
regexps are trickable if you really want to doesn't matter...

Fixes #164
2012-06-05 11:36:43 +02:00
bb30e59c56 Link to markdown specification for markdown fields 2011-08-17 20:02:10 +02:00
ac612423f5 Synchronize documentation stylesheet changes to the new layout
Thom Brown
2011-06-15 12:27:14 +02:00
6ab39b4eb7 Add markdown previews for generic forms in the site as well, not
just the admin site.
2009-09-18 15:40:20 +02:00
e808d4cdb3 Add (working) previewing of markdown fields in the admin interface. 2009-09-18 10:18:41 +02:00
90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00