Commit Graph

23 Commits

Author SHA1 Message Date
ba9138f36b 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.
2020-07-13 14:58:08 +02:00
60f75e498e Implement permissions on news tags
This makes it possible to limit which organisations can use specific
tags in news, and verify those as news is submitted. Administrators can,
as always, override.

In passing also add a sortkey field to newstags to make them, well,
sortable.
2020-07-13 14:57:17 +02:00
e4872d9aee 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-07-13 14:57:17 +02: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
46606e5284 Set on_delete=models.CASCADE on all ForeignKey fields
This is the bardware compatible value that will be needed once we
upgrade django later.
2020-03-31 22:34:51 +02:00
a156829375 Generic unicode updates 2019-01-26 16:19:26 +01:00
0883ac6423 Fix whitespace and indentation, per pep8 2019-01-17 20:47:43 +01:00
87237f6536 Tabs, meet your new overlords: spaces
In a quest to reach pep8, use spaces to indent rather than tabs.
2019-01-17 15:35:39 +01:00
dc3fae85f0 Add "mailto" anchors to help text for News & Event submissions. 2018-04-15 13:25:35 -04:00
ab36183fda Predictable ordering for newstags 2017-12-13 21:21:05 +01:00
9bd151082e Add tag support for news items
This lets us separate things like project news from other OSS and from
commercial postings, for example, allowing for people to subscribe to
different feeds with just the parts they are interested in.
2017-12-13 20:55:07 +01:00
06a48b477c Implement automatic tweeting of news
Once a twitter account has been registered (using the twitter_register
management command), the twitter_post command wills start posting all
new news to twitter, once they are approved. It will only post news from
the past 7 days to avoid accidentally flooding with old news.
2017-12-09 16:46:38 +01:00
2f52c4f7c4 Clean up whitespace in primary Python / HTML files
Clean up the whitespace in the primary Python / HTML files in
order to make it easier to apply changes going forward.
2017-11-29 08:21:35 -05:00
d28d3f3bfc Consistently use standard date formats for news entries
This appears to have become dependent on a django setting that we no
longer set -- and it's best to have a predictable format regardless.

Most things on the frontpage used the standard format, but not news,
leading to an annoyingly inconsistent view.
2016-04-13 15:17:09 +02:00
8058accee0 Get rid of PgModel, replacing it with simple signals
We were already using signals for everything except delete, and even
in our old version of django the delete signal exists (it didn't exist
when this code was first written).

Django doesn't really like models to be OOP like this, so keeping PgModel
would cause issues with upcoming changes in django 1.8. Using simple functions
is easier, and the actual functionality is replicated straight off.
2016-03-07 21:41:45 +01:00
af69d6ad22 Set verbose name on more organisation fields 2012-06-29 14:14:43 +02:00
3af6029727 Add help texts refering to the organisation list on forms that take an organisation field
For those who don't read the introduction page under my account, per request
from Dave.
2012-01-20 15:15:08 +01:00
79ba71a4f9 Purges need to be anchored in / - fix news and events rss feeds 2011-12-05 15:25:15 +01:00
f92709d2a6 Implement basic varnish purging
This allows all models inherited from PgModel to specify which
URLs to purge by either setting a field or defining a function
called purge_urls, at which point they will be purged whenever
the save signal is fired.

Also implements a form under /admin/purge/ that allows for manual
purging. This should probably be extended in the future to show
the status of the pgq slaves, but that will come later.

Includes a SQL function that posts the expires to a pgq queue. For
a local deployment, this can be replaced with a simple void function
to turn off varnish purging.
2011-06-14 19:48:48 +02:00
388d8b170c Indicate if a news article has been migrated, the same way we do for
events.
2010-06-11 14:22:49 +02:00
7b3bb5d09b Make organisations support multiple "managers" and not just one
"submitter", thus making it possible for a single person to manage
multiple organisations, as well as for a single organisation to have
multiple different manages.

Re-hook events and news items to use organisation of the submitter
instead of the user who did the submission. (product listings already
did this)
2010-02-26 12:34:19 +01: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