Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgres/pgweb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: postgres/pgweb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: beta
Choose a head ref
  • 9 commits
  • 52 files changed
  • 1 contributor

Commits on Jul 13, 2020

  1. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    8fbc977 View commit details
    Browse the repository at this point in the history
  2. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    e4872d9 View commit details
    Browse the repository at this point in the history
  3. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    7b96690 View commit details
    Browse the repository at this point in the history
  4. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    60f75e4 View commit details
    Browse the repository at this point in the history
  5. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    74d9a03 View commit details
    Browse the repository at this point in the history
  6. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    5ea4c37 View commit details
    Browse the repository at this point in the history
  7. Store project root directory in settings

    This makes it possible to reference for example templates in relation to
    the root directory.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    4e71d1a View commit details
    Browse the repository at this point in the history
  8. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    afe3676 View commit details
    Browse the repository at this point in the history
  9. 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.
    mhagander committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    ba9138f View commit details
    Browse the repository at this point in the history
Loading