pgweb.git
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.

5 years agoRe-work moderation of submitted items
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
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.

5 years agoEnsure markdown fields cannot contain HTML or images
Magnus Hagander [Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)]
Ensure markdown fields cannot contain HTML or images

Since images can be used to drop things like tracking pixels, simply
disallow them in all submissions.

5 years agoPrefetch managers when viewing the organistion list
Magnus Hagander [Mon, 7 Sep 2020 14:02:03 +0000 (16:02 +0200)]
Prefetch managers when viewing the organistion list

This removes a few thousand SQL queries and speeds up the page "a bit"

5 years agoRemove dead links
Magnus Hagander [Tue, 1 Sep 2020 09:27:32 +0000 (11:27 +0200)]
Remove dead links

Two of our international community sites have failed to resolve or reply
for a while now, so remove the links. Should they reappear we can always
add them back.

5 years agoUpdate more links to be https instead of http
Magnus Hagander [Mon, 31 Aug 2020 09:56:33 +0000 (11:56 +0200)]
Update more links to be https instead of http

5 years agoUpdate translated docs links to be https
Magnus Hagander [Mon, 31 Aug 2020 08:40:41 +0000 (10:40 +0200)]
Update translated docs links to be https

The French docs had one link in http and one in https as noted by
Lætitia. In passing I also adjusted the japanese to link to the https
version directly as one is available. The remaining one (Chinese) does
not appear to have a responding https server, so that one is left as
http.

5 years agoEnsure "help_text" segments line up on feature matrix model
Jonathan S. Katz [Sun, 30 Aug 2020 22:00:07 +0000 (18:00 -0400)]
Ensure "help_text" segments line up on feature matrix model

There was a subtle difference between the migration and the
model itself, which was leading to a migration warning, even
though nothing about the help_text is persistent in an actual
database.

5 years agoCreate proper URL check for feature matrix entries
Jonathan S. Katz [Sun, 30 Aug 2020 20:47:12 +0000 (16:47 -0400)]
Create proper URL check for feature matrix entries

40d6891c had created a false illusion of working, which can
certainly be blamed on the patch author. That said, instead
of trying to work around what the standard Django filters
provide, it is more prudent to create a "URL checking"
function for the feature matrix descriptions. This can be
used both for the "featurelink" generation, as well as the
new check we make to get the stated goal of 40d6891c, i.e.
provide a clickable URL when that is the only content of a
feature description.

5 years agoCreate clickable links on feature details pages
Jonathan S. Katz [Sun, 30 Aug 2020 20:36:52 +0000 (16:36 -0400)]
Create clickable links on feature details pages

There are many feature matrix details pages that would have
just a plain URL that was not clickable, either due to someone
accessing a feature matrix details page directly, or due to an
old details pages with a description being converted to just a
link.

This ensures that such pages can have a clickable link to attempt
to create a better user experience. Doing so from the Django
template filters is a bit roundabout, but it does get the desired
effect.

5 years agoAdd Markdown support to feature matrix descriptions
Jonathan S. Katz [Sun, 30 Aug 2020 19:46:50 +0000 (15:46 -0400)]
Add Markdown support to feature matrix descriptions

This will make it possible to allow for links in longer
descriptions for particular features. This also adds some
help text describing how the feature matrix details field
works, as I remember I was originally caught by surprise that
one could provide a direct link to something.

5 years agoAdd v13 to feature matrix
Jonathan S. Katz [Sun, 30 Aug 2020 19:13:17 +0000 (15:13 -0400)]
Add v13 to feature matrix

This is part of the annual tradition of updating the
feature matrix.

5 years agoEnsure news and events archive doesn't generate thousands of queries
Magnus Hagander [Sun, 30 Aug 2020 15:31:57 +0000 (17:31 +0200)]
Ensure news and events archive doesn't generate thousands of queries

While there is Varnish to take the edge off it, this is just too
ineffective to leave around :)

5 years agoStrip html tags in event archive
Magnus Hagander [Sun, 30 Aug 2020 15:29:30 +0000 (17:29 +0200)]
Strip html tags in event archive

We were already doing this for news, but for some reason neglected to do
so for events, which made for some pretty messed up formatting in the
archives now and then. We should treat news and events the same...

5 years agoUpdate requirements.txt to match current production env