summaryrefslogtreecommitdiff
path: root/postgresqleu/util/widgets.py
AgeCommit message (Collapse)Author
2024-11-05Don't crash when both removing and uploading PDF at the same timeMagnus Hagander
Noted by Karen Jex
2024-08-21Add a widget to show a simple treeviewMagnus Hagander
2024-08-21Add a form control for previewing HTMLMagnus Hagander
This uses (partially) the pgweb code for loading previewable HTML into an iframe sandbox.
2024-01-30Fix reference to conference urlname in speaker lookupMagnus Hagander
This got botched when the javascript was moved, and hidden by caching in testing.
2024-01-29Remove jquery, selectize and bootstrap js from conference frontendMagnus Hagander
This was used for the call for papers form handling of multiple speakers at this point, and caused issues with skins that didn't realize this and thus didn't include them. Replace it with a native js version, which instead of doing autocomplete just adds a button for "Add speaker" to add secondary speakers. This shows a browser popup asking for the email address of an existing profile. In practice I think this actually makes it more clear to the user what's going on than the previous autocomplete version, just not as pretty. It was also used for tags, which being a much shorter list, could just be replaced with a set of checkboxes. Tags was also something most conferences didn't use, and it only showed up if explicitly enabled on the conference (non-default).
2022-11-06Stop using hard wrapping for email text areasMagnus Hagander
This is buggy in both chrome and safari, and most likely other browsers based on the same heritage as well, in one way (which could lead to a lot of random blank lines eerywhere in emails). . And has been partially buggy in Firefox in the past as well. Bottom line is that it does not appear to be a good thing to rely on, so fall back to juat handling it manually (until we have managed to add support for html mails).
2022-06-26Support higher resolution speaker photosMagnus Hagander
This adds a new field to the speaker model supporting 512x512 sized speaker photos. It also changes the speaker form (as well as the backend form) to accept any size image and resize it into the bounding box of 512x512. There is no reason to force the speaker to do that manually, computers are good at such things. The rezied image will be padded as necessary to the full 512x512 with transparent background, which also means the storage format of the new photos will be PNG in order to support that transparency. Whenever the photo is updated, a downscaled copy will automatically be generated that's 128x128 for backwards compatibilty as well as thumbnailing. There is no interface to independently edit this lower resolution photo. Fixes #15
2020-05-18Complete overhaul of social media integrationsMagnus Hagander
* Remove the hard-coded twitter implementation and replace it with an infrastructure for pluggable implementations. * Separate out "social media broadcasting" (public twitter posts) from "private notifications" (DMs) and invent "private broadcasting" (notifications sent only to attendees of a conference) and "organisation notifications" (sent to organisers). * Add the concept of a Messaging Provider that's configured on a Conference Series, which maps to a twitter account (or similar in other providers). Replace "incoming twitter active" flag on a conference with a setting on this messaging provider for "route messages to conference". This way the messaging doesn't have to be reconfigured for each new conference in a series, and we also automatically avoid the risk of having two conferences getting the same input. * For each conference in a series, the individual Messaging Providers can be enabled or disabled for the different functionality, and individual channels be configured when applicable. * Add implementations of Twitter (updated, social broadcasting and private messaging support), Mastodon (social broadcasting and private messaging) and Telegram (attendee boadcasts, private notifications, and organisation broadcasts) * Add webhook support for Twitter and Telegram, making for much faster reactions to incoming messages. * Hardcoded news twitter post accounts, and replaced with MessagingProviders per above that are not attached to a conference. * Add a daemon that listens to PostgreSQL notifications and sends out broadcasts and notifications for quicker action (if not enabled, a scheduled task will send them out every 10 minutes like before) * In making broadcast posts, add support for the fact that different providers have different max length of posts (e.g. Twitter currently has 280 and Mastodon 500), and also roughly account for the effects of URL shorterners on posts. * Add a button to registration dashboards to send DMs to attendees that have configured notification. * Send "private broadcasts" ahead of any talks to keep people posted of talks. For now this is always enabled if a channel is set up for private broadcasts, we may want to consider making it more configurable in the future. There are still a lot of tables and files referring Twitter in the tree, and some of those will be renamed in a future commit to make tracking of changes easier. Fixes #29 Fixes #13
2020-05-11Add field and widget to support a custom submit button in backend formsMagnus Hagander
This form will not do a regular save, and instead call a callback function defined on the field.
2020-05-11Add backend widget that can set a field value from a dropdownMagnus Hagander
A regular choice field can be configured to update a different (text) field with a value based on data in the options. On a per-value basis this can be configured to also turn that field into a read-only field.
2020-04-01Always decode base64encoded values to stringsMagnus Hagander
2020-02-20Make json widget handle null values and nested dictsMagnus Hagander
2020-01-09Fix image field to handle files large enough to spool to temp filesMagnus Hagander
Above a certain size, Django spools the uploaded file to a temp file, which caused an exception when trying to read it. Now identify the uploaded file based on the baseclass instead of explicitly on the in memory version.
2019-10-29Move speaker photos into main model with byteaMagnus Hagander
Instead of having a separate table with just the photos, move into the main table. And instead of storing it base64 encoded, store it as a proper bytea field. Also rename the field from photofile to photo, to be more logical. Note that this can BREAK templates overriding this field. The old name is preserved on the model so that old templates for showing the page should work, but not the form in the speaker profile.
2019-10-29Add a widget for inline PDF uploading and storingMagnus Hagander
Similar to the existing one for JPEG images
2019-08-23Add tracking of pre-defined hashtags for a conferenceMagnus Hagander
These are then made available for easy addition to a tweet. That makes it more likely that one remains consistent.
2019-08-21Add a field+widgets for uploading images into a bytea columnMagnus Hagander
Bypasses the annoying django handling and also doesn't require a special table. PostgreSQL has no problem storing small things inline and toast makes it transparent...
2019-07-11Make the speaker photo use a proper widget and validatorMagnus Hagander
Instead of a bunch of things hardcoded in the template and in the view, make the photo upload widget reusable, and move the validation of the field into a proper validator. This makes it a lot easier to re-use the field elsewhere.
2019-07-09Make email forms use monospace font and fixed widthMagnus Hagander
To make it easier to write plaintext emails, make sure the font used for the email body is monospace, and do hard auto-wrapping at 72 characters. In passing also make a couple of other fields like PEM keys for Trustly use a monospace font (but of course not hard wrapping).
2019-03-27Add the concept of test/validate to invoice payment formsMagnus Hagander
This adds a button which can be clicked to validate the current settings, at which point it will do an ajax pingback to get data and then replace itself with that.
2019-02-16Generalize frontend side formsMagnus Hagander
Reomve a lot of duplicates, and also make the frontend forms actually use the bootstrap 4 templates that we have for everything else, instead of using old hardcoded tables. We already had generalized forms for the backend, but they include a number of tings that are very backend-specific, so create a simplified version for the frontend.
2019-01-19Include static fields show notification instructionsMagnus Hagander
For Adyen and Paypal (so far), show exactly which URLs to enter into which fields to configure the integration.
2019-01-10Generic changes for python3 from 2to3Magnus Hagander
2018-12-14Fix blankline related warningsMagnus Hagander
2018-12-14Replace tabs with spacesMagnus Hagander
In an effort to close up with PEP8, we should use spaces for indent rather than tabs... Time to update your editor config!
2018-07-06Move HTML 5 date input widget to utilsMagnus Hagander
So it can be used in other places than the backend editors. While at it make it also handle the case where a DateTime is sent to the field even though it's only supposed to edit the date part.
2018-06-27Add widgets for pretty-printing jsonMagnus Hagander
2018-06-20Add a more user friendly file upload widgetMagnus Hagander