pgweb.git
4 years agoHandle empty company URLs in contributor profiles
Jonathan S. Katz [Fri, 6 Nov 2020 14:38:06 +0000 (09:38 -0500)]
Handle empty company URLs in contributor profiles

If a URL is provider, continue to provide a link, otherwise just
render the company name.

Started by Daniel Gustafsson <daniel@yesql.se>, finished by me.

4 years agoUpdate EDB logo.
Dave Page [Thu, 5 Nov 2020 09:20:21 +0000 (09:20 +0000)]
Update EDB logo.

4 years agoInclude sudo step in redhat/fedora/centos download instructions
Magnus Hagander [Tue, 3 Nov 2020 10:01:03 +0000 (11:01 +0100)]
Include sudo step in redhat/fedora/centos download instructions

We included sudo for debian/ubuntu but not for redhat, which made the
instructions inconsistent.

Discussion: https://postgr.es/m/CABUevExvb7iVNQYvoRRc1uC96adqvKqoQmDPwg2KU6zcqfDQvQ@mail.gmail.com

4 years agoUpdate CoC membership page
Jonathan S. Katz [Mon, 2 Nov 2020 19:19:15 +0000 (14:19 -0500)]
Update CoC membership page

This includes the latest membership changes.

4 years agoUpdate the number of core team members on core team page
Jonathan S. Katz [Mon, 2 Nov 2020 19:17:16 +0000 (14:17 -0500)]
Update the number of core team members on core team page

This number is now seven, instead of five.

4 years agoStagger outgoing news emails
Magnus Hagander [Thu, 29 Oct 2020 14:28:06 +0000 (15:28 +0100)]
Stagger outgoing news emails

Set to a maximum of one outgoing email per 30 minutes

4 years agoAdd support for staggering outgoing emails
Magnus Hagander [Thu, 29 Oct 2020 14:27:56 +0000 (15:27 +0100)]
Add support for staggering outgoing emails

Sent email can be assigned a "stagger type", for which he system will
maintain a "last sent" information. When the email is sent, it will be
delayed to be at least "stagger" time after the last one sent of the
same type. If no email of this type has been sent before, the email is
of course sent immediately.

4 years agoRemove unused function
Magnus Hagander [Thu, 29 Oct 2020 10:55:58 +0000 (11:55 +0100)]
Remove unused function

4 years agoAutomatically populate list of coc reports and languages
Magnus Hagander [Tue, 27 Oct 2020 11:10:32 +0000 (12:10 +0100)]
Automatically populate list of coc reports and languages

Use the new filter to list templates and auto-generate the set of links.

4 years agoAdd a filter for getting language name from code
Magnus Hagander [Tue, 27 Oct 2020 12:22:09 +0000 (13:22 +0100)]
Add a filter for getting language name from code

This adds a requirement on the Babel module in python.

4 years agoAdd filter to list all templates in a directory
Magnus Hagander [Tue, 27 Oct 2020 11:09:55 +0000 (12:09 +0100)]
Add filter to list all templates in a directory

4 years agoRestructure coc templates
Magnus Hagander [Tue, 27 Oct 2020 09:49:47 +0000 (10:49 +0100)]
Restructure coc templates

This creates a base templatefor the coc pages that will include the coc
itself and translations, the committee and the annual reports.

This removes the include files with _ in the name in the coc section,
which would previously both be directly accessible as pages and
part of the sitemap. The pages/ directory in the templates should really
only contain directly accessible pages.

4 years agoRemove unused variable
Magnus Hagander [Tue, 27 Oct 2020 09:34:45 +0000 (10:34 +0100)]
Remove unused variable

4 years agoFix sitemap generation for static pages
Magnus Hagander [Mon, 26 Oct 2020 20:53:31 +0000 (21:53 +0100)]
Fix sitemap generation for static pages

In commit 7f8a0a56dd1fb5dedb5c04a872ce940ae7c891b4 we replaced the way
the "core" app is loaded, and this broke the generation of sitemap
entries for it. Oops.

4 years agoRevert "Temporarily remove links to EDB interactive installers"
Jonathan S. Katz [Fri, 23 Oct 2020 21:50:49 +0000 (17:50 -0400)]
Revert "Temporarily remove links to EDB interactive installers"

4 years agoTemporarily remove links to EDB interactive installers
Jonathan S. Katz [Fri, 23 Oct 2020 20:38:55 +0000 (16:38 -0400)]
Temporarily remove links to EDB interactive installers

This is due to an expired certificate. Once the certificate
is updated, the links will be reintroduced.

4 years agoAdd static og: tag to the index page
Magnus Hagander [Thu, 22 Oct 2020 12:30:10 +0000 (14:30 +0200)]
Add static og: tag to the index page

4 years agoAdd opengraph tags to some pages
Magnus Hagander [Thu, 22 Oct 2020 12:08:29 +0000 (14:08 +0200)]
Add opengraph tags to some pages

Add template support for opengraph tags (which will enable things like
icons and preview on posts to twitter and facebook and other places) to
both base pages and documentation pages. Use this to actually add the
tags to docs pages (only v10+ will get text previews, but all should get
the titles and image) and news (only news from the project will get an
image, all get both title and text)

4 years agoReduce number of queries to render a docs page
Magnus Hagander [Wed, 21 Oct 2020 18:57:47 +0000 (20:57 +0200)]
Reduce number of queries to render a docs page

One query for each version, supported or unsupported, now replaced with
a single query to get all of them.

4 years agoFix a stray typo
Jonathan S. Katz [Mon, 19 Oct 2020 14:58:31 +0000 (10:58 -0400)]
Fix a stray typo

Somehow, even after reading through the patch three times,
the committer still missed it.

4 years agoAdd "Learn PostgreSQL" to books
Jonathan S. Katz [Mon, 19 Oct 2020 14:56:01 +0000 (10:56 -0400)]
Add "Learn PostgreSQL" to books

4 years agoAllow for direct URLs to abbreviated legacy PostgreSQL releases
Jonathan S. Katz [Mon, 12 Oct 2020 18:00:09 +0000 (14:00 -0400)]
Allow for direct URLs to abbreviated legacy PostgreSQL releases

For example, while a link to "/docs/release/9.1.0/" would work,
going to "/docs/release/9.1/" would not; in this case, it would
show the release details for "9.0.1". While the probability of
someone modifying the links to see the different release notes
is low, we would still need to take action on what is an
incorrect link.

Instead of returning a 404, this transposes the major/minor
version to point at the canonical version number and render the
expected page. This is set up to work for the 6, 7, 8, 9 series.

Reported by: Nikolay Samokhvalov <samokhvalov@gmail.com>

4 years agoAdd additional updates to CoCC bios
Jonathan S. Katz [Thu, 8 Oct 2020 11:54:19 +0000 (07:54 -0400)]
Add additional updates to CoCC bios

In this case, I had forgotten to update this bio in the first
pass. I'll ponder that perhaps we should put something in the
database to manage this in the future.

4 years agoFix regression that prevented accessing new organisation page
Jonathan S. Katz [Wed, 7 Oct 2020 21:59:22 +0000 (17:59 -0400)]
Fix regression that prevented accessing new organisation page

The addition of the fieldsets did not account for the fields
themselves from being removed from the new organisation form.
The OrganisationForm now removes the appropriate fieldset when
the fields are not available in this form.

4 years agoUpdate to a bio on the CoC committee page
Jonathan S. Katz [Wed, 7 Oct 2020 21:47:09 +0000 (17:47 -0400)]
Update to a bio on the CoC committee page

4 years agoAdd fieldsets to the organisation form
Magnus Hagander [Wed, 7 Oct 2020 15:45:11 +0000 (17:45 +0200)]
Add fieldsets to the organisation form

4 years agoAdd support for fieldsets to forms
Magnus Hagander [Wed, 7 Oct 2020 15:44:44 +0000 (17:44 +0200)]
Add support for fieldsets to forms

This makes it possible to define a fieldset which has a legend and a
description, to split up a large form into multiple visual components.

4 years agoMove form field details into a separate include file
Magnus Hagander [Wed, 7 Oct 2020 15:08:58 +0000 (17:08 +0200)]
Move form field details into a separate include file

4 years agoUpdate the CoCC page change date
Jonathan S. Katz [Wed, 7 Oct 2020 16:35:27 +0000 (12:35 -0400)]
Update the CoCC page change date

The previous commit forgot to do this. Also changed italicized
text to use "<em>" instead of "<i>", as "<i>" is deprecated
for italics.

4 years agoUpdate Code of Conduct Commmittee Page
Jonathan S. Katz [Wed, 7 Oct 2020 16:33:15 +0000 (12:33 -0400)]
Update Code of Conduct Commmittee Page

This is changed to reflect the committee for the 2020-2021 term.

This also changes the "Past Members" structure to list out
names and which terms they served.

4 years agoMake the add manager field more clear in the organisation form
Magnus Hagander [Wed, 7 Oct 2020 10:23:50 +0000 (12:23 +0200)]
Make the add manager field more clear in the organisation form

Make it clear that one should enter the email address, not username, to
add a manager, and that it should be an existing account.

4 years agoAdditional date translations for the PG13 presskits
Jonathan S. Katz [Sat, 3 Oct 2020 01:10:15 +0000 (21:10 -0400)]
Additional date translations for the PG13 presskits

These include:

- French
- Portuguese
- Polish
- Spanish

4 years agoAdd release date to the Japanese press release for PG13
Jonathan S. Katz [Fri, 2 Oct 2020 02:39:59 +0000 (22:39 -0400)]
Add release date to the Japanese press release for PG13

4 years agoFix silly copy/paste mistake
Magnus Hagander [Tue, 29 Sep 2020 16:49:23 +0000 (18:49 +0200)]
Fix silly copy/paste mistake

4 years agoSlugify event URLs
Magnus Hagander [Mon, 28 Sep 2020 15:47:08 +0000 (17:47 +0200)]
Slugify event URLs

4 years agoUpdate event archive footer links
Magnus Hagander [Mon, 28 Sep 2020 15:54:43 +0000 (17:54 +0200)]
Update event archive footer links

* Turn main links into buttons
* Have a link from the archive back to the upcoming events, not just in
  one direction.
* Write a paragraph about submitting events, similar to what was
  recently done for news.

4 years agoFix silly typo
Magnus Hagander [Mon, 28 Sep 2020 15:54:28 +0000 (17:54 +0200)]
Fix silly typo

4 years agoRemove template reference to eventblocks
Magnus Hagander [Mon, 28 Sep 2020 15:47:37 +0000 (17:47 +0200)]
Remove template reference to eventblocks

This hasn't been used for a long time but was left over in a template.
It would render a link with a space in the title and missing the word
"events"...

4 years agoFix typo in comment
Magnus Hagander [Mon, 28 Sep 2020 15:31:49 +0000 (17:31 +0200)]
Fix typo in comment

4 years agoPrevent creating new accounts with email registered as secondary
Magnus Hagander [Sat, 26 Sep 2020 20:08:44 +0000 (22:08 +0200)]
Prevent creating new accounts with email registered as secondary

If an email is already added as a secondary address to one account,
don't allow creating a new account using that email, unless it's
removed. Otherwise we end up with the same email address attached to
multiple different accounts, which can cause big problems downstream.

This should never have been allowed of course, but was missed when
support for secondary emails was added.

4 years agoFix password type identifications
Magnus Hagander [Sat, 26 Sep 2020 15:50:44 +0000 (17:50 +0200)]
Fix password type identifications

Sha1's start with sha1$, not sha1_ (and this is not a SQL LIKE match).
And fix parameters when calling re.match in the unmatched case.

4 years agoFix merging of organisations
Magnus Hagander [Sat, 26 Sep 2020 14:59:23 +0000 (16:59 +0200)]
Fix merging of organisations

This has been broken since the OneToOne change in 2016 and since the
addition of pugs in 2013. Clearly not much used functionality.

4 years agoAdd direct links to news/events/services policy from submission forms
Magnus Hagander [Sat, 26 Sep 2020 14:08:20 +0000 (16:08 +0200)]
Add direct links to news/events/services policy from submission forms

No link for Products because we don't currently have a policy for them.

4 years agoUse a dash instead of empty string to indicate all tags
Magnus Hagander [Sat, 26 Sep 2020 13:54:25 +0000 (15:54 +0200)]
Use a dash instead of empty string to indicate all tags

Seems there is somethign in the stack used in production that does not
like the use of an empty string between two slashes...

4 years agoRemove hardcoded number, when we have a variable
Magnus Hagander [Sat, 26 Sep 2020 13:54:07 +0000 (15:54 +0200)]
Remove hardcoded number, when we have a variable

4 years agoImprove display of news tags
Magnus Hagander [Sat, 26 Sep 2020 13:42:36 +0000 (15:42 +0200)]
Improve display of news tags

* Add a fa icon for tags to the buttons that are clicked for news tags,
  to make it more clear what they are.
* Show a badge with the tag on each item when browsing the list.
* Change the buttons to be badges when viewing an individual item, and
  move them to the top of the page instead of the bottom for consistency
  with the listing.

In passing, add some spacing between the header and the text when
viewing a news item, because it looks a lot better.

4 years agoImplement pagination for news archive
Magnus Hagander [Sat, 26 Sep 2020 13:13:55 +0000 (15:13 +0200)]
Implement pagination for news archive

For now we do 10 items per page, but that's easy to adjust.

Paginate based on the date (so create an index on the date field to
simplify this), making page rendering and load a *lot* faster.

4 years agoUpdate existing static news URLs to be slugified
Magnus Hagander [Fri, 25 Sep 2020 11:51:35 +0000 (13:51 +0200)]
Update existing static news URLs to be slugified

4 years agoSlugify URLs to news articles
Magnus Hagander [Fri, 25 Sep 2020 11:46:25 +0000 (13:46 +0200)]
Slugify URLs to news articles

4 years agoAdd a github action to validate syntax post-commit
Magnus Hagander [Fri, 25 Sep 2020 11:04:39 +0000 (13:04 +0200)]
Add a github action to validate syntax post-commit

While we don't use the github workflow for our development, it doesn't
hurt to get a post-commit notification when somebody forgot to validate
things pre-commit (using the hook we have). This hook also runs with
exactly the version of python/pycodestyle that we are using in
production, which might help someone.

4 years agoUpdate package information on Windows / macOS pages
Jonathan S. Katz [Thu, 24 Sep 2020 17:20:45 +0000 (13:20 -0400)]
Update package information on Windows / macOS pages

This now indicates the support for PostgreSQL 13.

4 years agoUpdates to the PostgreSQL 13 Russian press release translation
Jonathan S. Katz [Thu, 24 Sep 2020 17:13:11 +0000 (13:13 -0400)]
Updates to the PostgreSQL 13 Russian press release translation

This fixes a few typos.

4 years agoFix release notes browser for 9.6 and earlier
Magnus Hagander [Thu, 24 Sep 2020 13:27:40 +0000 (15:27 +0200)]
Fix release notes browser for 9.6 and earlier

At some point the code to drop down parts of the list broke for version
numbers that had a dot in it, meaning all versions prior to 10.
Unrelated to the release today. Fix is to just render 96 instead of
9.6..

Bug spotted by Stephen Frost

4 years agoFix a date on the relesae roadmap
Jonathan S. Katz [Thu, 24 Sep 2020 13:04:12 +0000 (09:04 -0400)]
Fix a date on the relesae roadmap

Someone put 2020 instead of 2021.

4 years agoPostgreSQL 13 release announcement
Jonathan S. Katz [Wed, 23 Sep 2020 19:47:18 +0000 (15:47 -0400)]
PostgreSQL 13 release announcement

Yay!

4 years agoContent updaes for PostgreSQL 13 release
Jonathan S. Katz [Wed, 23 Sep 2020 01:49:46 +0000 (21:49 -0400)]
Content updaes for PostgreSQL 13 release

An annual review of general content on the website, including adding
in new tidibts of information based on the new PostgreSQL release,
in this case for PostgreSQL 13.

4 years agoPostgreSQL 13 Press Kit
Jonathan S. Katz [Sat, 19 Sep 2020 14:48:42 +0000 (10:48 -0400)]
PostgreSQL 13 Press Kit

Includes the press kit, translations of the press release, and
retires the PostgreSQL 12 press kit.

4 years agoUpdate the FAQ
Jonathan S. Katz [Sat, 19 Sep 2020 14:58:30 +0000 (10:58 -0400)]
Update the FAQ

Amend, emend, and remove questions and answers to help keep up
with the modern times.

4 years agoFix language in unsupported documentation blurb
Jonathan S. Katz [Wed, 23 Sep 2020 16:09:34 +0000 (12:09 -0400)]
Fix language in unsupported documentation blurb

This removes any ambiguity that the blurb is making a reference
to other supported documentation.

Author: Daniel Gustafsson <daniel@yesql.se>

4 years agoFix typo on NetBSD page
Jonathan S. Katz [Wed, 23 Sep 2020 16:07:39 +0000 (12:07 -0400)]
Fix typo on NetBSD page

Somehow, this was missed by the person who is typing out this
sentence.

4 years agoAdd NetBSD OS to list of downloadable packages
Jonathan S. Katz [Wed, 23 Sep 2020 15:10:38 +0000 (11:10 -0400)]
Add NetBSD OS to list of downloadable packages

This also includes a change in the descruption of the BSD
family of packages to use the term "operating system", which
is the preferred language for describing the different BSD
options.

Author: Daniel Gustafsson <daniel@yesql.se>

4 years agoAdd rel="noopener" to all _blank target urls
Magnus Hagander [Wed, 23 Sep 2020 12:53:34 +0000 (14:53 +0200)]
Add rel="noopener" to all _blank target urls

4 years agoRemove the cross-platform Linux installer
Jonathan S. Katz [Tue, 22 Sep 2020 18:39:00 +0000 (14:39 -0400)]
Remove the cross-platform Linux installer

This installer is only supported up to PostgreSQL 10 and based on
the overall outbound traffic numbers to the installer, it makes
sense to remove it instead of carrying the overall maintenance
burden.

4 years agoUpdate macOS downloads page
Jonathan S. Katz [Tue, 22 Sep 2020 18:34:09 +0000 (14:34 -0400)]
Update macOS downloads page

This provides a much more concise and accurate description of
what is on this page, as well as an ordering of the installers
based on the measured popularity of them.

4 years agoRemove Debian backports from downloads page
Jonathan S. Katz [Tue, 22 Sep 2020 18:31:05 +0000 (14:31 -0400)]
Remove Debian backports from downloads page

There was little outbound traffic going to these URLs.

4 years agoRemove references to BigSQL packages
Jonathan S. Katz [Tue, 22 Sep 2020 18:10:51 +0000 (14:10 -0400)]
Remove references to BigSQL packages

The BigSQL packages are no longer publicly available, and
various parts of the BigSQL packages in the website had already
been commented out.

4 years agoRemove "Build from Source" section on Linux package pages
Jonathan S. Katz [Tue, 22 Sep 2020 18:13:13 +0000 (14:13 -0400)]
Remove "Build from Source" section on Linux package pages

The measured traffic patterns indicated that people wanting to
build from source were not getting to the source tarballs from
the Linux package pages, rather a) people on the package pages
wanted the pre-built packages and b) people who wanted source
code went directly to the source code from the main downloads
page.

4 years agoImprove moderation messages somewhat
Magnus Hagander [Fri, 18 Sep 2020 09:13:36 +0000 (11:13 +0200)]
Improve moderation messages somewhat

Change the subject to use the title of the object instead of the id, and
include a link to the moderation page. There's surely more to be done,
but this is a decent start.

4 years agoAdd admin function to initiate user password reset
Magnus Hagander [Fri, 18 Sep 2020 07:10:51 +0000 (09:10 +0200)]
Add admin function to initiate user password reset

This will trigger the same reset-your-password email as a user initiated
one, but it'll cut out one step and be a bit more user friendly...

Also, if this is done with an OAuth connected account, it will be
converted into a regular one (something we don't allow the end user to
do, for support reasons)

This also adds an entry to the user editor in the admin view that shows
if the user *is* an oauth user or not, or if they might have an old
"unmigrated" password.

4 years agoPostgreSQL 13 Beta 1 updates
Jonathan S. Katz [Thu, 17 Sep 2020 02:35:00 +0000 (22:35 -0400)]
PostgreSQL 13 Beta 1 updates

4 years agoProperly verify owner of organisation in all forms
Magnus Hagander [Thu, 17 Sep 2020 12:37:58 +0000 (14:37 +0200)]
Properly verify owner of organisation in all forms

4 years agoRemove form that no longer does anyting non-default
Magnus Hagander [Wed, 16 Sep 2020 17:58:30 +0000 (19:58 +0200)]
Remove form that no longer does anyting non-default

4 years agoAdd an inline to view and edit organisation emalis
Magnus Hagander [Wed, 16 Sep 2020 17:56:07 +0000 (19:56 +0200)]
Add an inline to view and edit organisation emalis

The ability to do this was lost when we moved to multiple emails per
organisation since it's no longer in the main table, so add it back as
an inline.

4 years agoRemove unused import
Magnus Hagander [Wed, 16 Sep 2020 17:55:08 +0000 (19:55 +0200)]
Remove unused import

4 years agoAdd easy way to do xkey based purging of a template
Magnus Hagander [Wed, 16 Sep 2020 17:48:51 +0000 (19:48 +0200)]
Add easy way to do xkey based purging of a template

Since we can purge based on the md5 hash of a template name, expose this
in the purge dialog so one doesn't have to manually calculate the hash
to use it.

4 years agoFix reject message subject on two-moderator items
Magnus Hagander [Wed, 16 Sep 2020 08:45:35 +0000 (10:45 +0200)]
Fix reject message subject on two-moderator items

Two-moderator items require only one moderator to be rejected or to be
sent back for more editing. In that case, don't log None as the other
moderator.

4 years agoDon't send link to edit deleted submissions
Magnus Hagander [Wed, 16 Sep 2020 08:45:03 +0000 (10:45 +0200)]
Don't send link to edit deleted submissions

Once a submission, like a news article, has been deleted, that link
would just become a 404 anyway.

5 years agoExclude the pgAdmin repos from the FTP crawl.
Dave Page [Wed, 16 Sep 2020 10:44:31 +0000 (11:44 +0100)]
Exclude the pgAdmin repos from the FTP crawl.

5 years agoUpdate jquery dependency to 3.4.1
Magnus Hagander [Sat, 12 Sep 2020 10:47:08 +0000 (12:47 +0200)]
Update jquery dependency to 3.4.1

5 years agoUpgrade bootstrap and popper dependencies
Magnus Hagander [Sat, 12 Sep 2020 10:45:03 +0000 (12:45 +0200)]
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.

5 years agoRemove unused dependency on jquery.matchHeight
Magnus Hagander [Sat, 12 Sep 2020 10:43:38 +0000 (12:43 +0200)]
Remove unused dependency on jquery.matchHeight

5 years agoRemove dynamic "docs" stylesheet
Magnus Hagander [Sat, 12 Sep 2020 10:31:18 +0000 (12:31 +0200)]
Remove dynamic "docs" stylesheet

This was never used. And it was probably good that it wasn't, because if
it had it would've included both two copies of bootstrap in the page,
and also the bootstrap css map (as part of the css, and not as the map).

The docs pages these days use the same base stylesheet as the rest of
the site.

5 years agoRemove CSS files from the previous generation of the site
Magnus Hagander [Sat, 12 Sep 2020 10:28:15 +0000 (12:28 +0200)]
Remove CSS files from the previous generation of the site

5 years agoRemove unused parts of bootstrap
Magnus Hagander [Sat, 12 Sep 2020 10:27:54 +0000 (12:27 +0200)]
Remove unused parts of bootstrap

5 years agoRemove unused javascript
Magnus Hagander [Sat, 12 Sep 2020 10:21:12 +0000 (12:21 +0200)]
Remove unused javascript

This is from the old version of the website, and hasn't been used for
quite some time.

5 years agoRemove dependency on unversioned jquery-ui
Magnus Hagander [Sat, 12 Sep 2020 10:19:54 +0000 (12:19 +0200)]
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.

5 years agoEnsure cache-buster URLs are used for all css and javascript
Magnus Hagander [Sat, 12 Sep 2020 10:00:40 +0000 (12:00 +0200)]
Ensure cache-buster URLs are used for all css and javascript

Most of this is in the admin section where it's less important, but it's
not all, and even there it's not zero importance.

5 years agoDon't send notifications for new objects that are tri-state moderation
Magnus Hagander [Thu, 10 Sep 2020 18:47:19 +0000 (20:47 +0200)]
Don't send notifications for new objects that are tri-state moderation

These will get a notification when they are explicitly submitted for
moderation, so there is no point in having a separate notice sent when
they're created, since there is nothing for the moderators to do at that
point.

5 years agoFix moderation preview of organisatoin managers
Magnus Hagander [Thu, 10 Sep 2020 18:27:05 +0000 (20:27 +0200)]
Fix moderation preview of organisatoin managers

5 years agoFix invalid field name
Magnus Hagander [Thu, 10 Sep 2020 18:11:09 +0000 (20:11 +0200)]
Fix invalid field name

Missed in a previous rename round.

5 years agoTurn off usergenerated flags for email from our own addresses
Magnus Hagander [Thu, 10 Sep 2020 17:55:57 +0000 (19:55 +0200)]
Turn off usergenerated flags for email from our own addresses

News, docs and bugs are all sending from our own noreply addresses these
days, so they should not be flagged as usergenerated (flagging as
usergenerated will revent dkim signing, amongst other things)

5 years agoDon't create duplicate headers in outgoing email
Magnus Hagander [Thu, 10 Sep 2020 14:45:38 +0000 (16:45 +0200)]
Don't create duplicate headers in outgoing email

The python libraries will *append* a header if it's just added again,
which would cause the news to go out with two date headers. Oops. So
instead check if each header is present and in that case replace it
rather than appending.

5 years agoTrack multiple email addresses for an organisation
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Track multiple email addresses for an organisation

This allows organisation managers to add more than one email address to
an organisation, and use this for sending news from. Sending news is the
only thing that the email field is used for at this point. Adding an
email will trigger a validation email sent to the address with a token
to confirm it, so that we can actually trust the emails.

Remove the previous registered emails on organisations. These addresses
were never validated and thus cannot really be trusted, so it's better
to remove them cleanly than to migrate them into the new system and be
uncertain.

Finally, in passing, remove the phone field on organisations. We've
never used that for anything and there's not really any point in
collecting the data.

5 years agoSend moderation notices to organisation admins
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Send moderation notices to organisation admins

Instead of tracking one single (non-verified!) email address for
organisations only to send notificationsn to, send the notifications to
all managers. This is relevant because all managers are in a position to
act upon them (and for example fix a posting).

5 years agoAdd support for sending out news as HTML email
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
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).

5 years agoTeach send_simple_mail about sending HTML email
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Teach send_simple_mail about sending HTML email

If a HTML body is specified, the plaintext and html bodies will be sent
as a multipart/alternative MIME object.

Also teach it to add attachments with Content-ID and overriding the
Content-Disposition, to make it possible to reference images attached
using cid: type URLs.

5 years agoStore project root directory in settings
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Store project root directory in settings

This makes it possible to reference for example templates in relation to
the root directory.

5 years agoAdd templatefilter joinandor
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Add templatefilter joinandor

This filter takes a list of a,b,c,d and turns it into "a, b, c and d"
or "a, b, c or d" depending on parameter given.

5 years agoSimplify admin preview of emails
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Simplify admin preview of emails

Use the python3 function to get the plaintext body of the email, instead
of our own very limited one we had before.

5 years agoRemove references to website migration
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Remove references to website migration

This migration happened 10 years ago, so if someone hasn't updated their
records by now, they're not going to.

We still allow and special-case the migrated data in the database in
order not to delete history, but this removes the direct texts about it
which take up unnecessary space and confuse some people.