Wykres commitów

103 Commity (main)

Autor SHA1 Wiadomość Data
Jaap Joris Vens 20edda4936 Upgrade pre-commit hooks and reformat code 2023-02-21 00:21:13 +01:00
Jaap Joris Vens 94af72cca8 Merry 1.1.1
This release fine-tunes the translations and offers a ready-to-use,
spam resistant contact form. Submitting the form will open the user's
mail app with an email addressed to the `href` field of the section.

This method, although unconventional, has been tested by my mother on
several of her devices, which proofs anyone can use it. It couldn't be
easier and, best of all, no more spam! \o/
2022-12-25 22:02:50 +01:00
Jaap Joris Vens 9588d7ac72 Bump version number 2022-12-25 01:16:09 +01:00
Jaap Joris Vens 1fda2f40c1 Spam-resistant contact form
Submitting the form now returns a 302 mailto: redirect, which should
open the user's email client with a pre-composed email. In case it
doesn't work, the example form view now renders text content where
{{ section.href }} should be mentioned as an alternative.

Of course, publishing an email address on the internet will still lead
to spam, but at least Django won't be the one sending it.
2022-12-25 01:10:41 +01:00
Jaap Joris Vens 80133f8aa1 Add missing translations 2022-01-29 13:36:59 +01:00
Jaap Joris Vens 74c896b86e Properly sort out pre-commit hook handling
What this means is that the source code of SimpleCMS now passes all the the
pre-commit hooks, and that the code generated by `simplecms` _also_ passes
all the pre-commit hooks.
2022-01-29 12:56:45 +01:00
Jaap Joris Vens 98de86f49d Blackify everything 2021-07-04 01:59:48 +02:00
Jaap Joris Vens cd8151b2ce Refactor models into models, fields and mixins 2021-06-30 00:48:50 +02:00
Jaap Joris Vens 8dcf61c766 Let's rock! 2021-01-23 10:29:24 +01:00
Jaap Joris Vens e228763052 The `simplecms` command is now a proper entrypoint 2021-01-23 00:15:44 +01:00
Jaap Joris Vens 3c8d5f6afe Reduce indentation 2020-09-13 23:16:38 +02:00
Jaap Joris Vens 43c4cd281c Custom cache middleware that doesn't serve cached pages to logged-in users.
The hard problem of detecting whether a user is logged in is simply
sidestepped by assuming that any user that sends the `sessionid` cookie
is logged in. This is true as long as you don't save session variables
on anonymous users (i.e. if you don't spy on them ;)
2020-09-12 15:13:02 +02:00
Jaap Joris Vens b3e2132762 Don't show 404s to logged-in users, but the new page form 2020-05-20 19:03:14 +02:00
Jaap Joris Vens 4a5259d831 Do what I want 2020-05-20 18:29:22 +02:00
Jaap Joris Vens 125f643cec Same, but for views.py 2020-05-20 18:15:23 +02:00
Jaap Joris Vens 11fa5ba39b Changed has_perms() to has_perm(), because the former always returns False... 2020-05-20 18:03:53 +02:00
Jaap Joris Vens 257a51cb57 Allow multiple email recipients 2020-04-29 23:32:13 +02:00
Jaap Joris Vens 4a8c804452 Better form handling 2020-03-29 01:54:56 +01:00
Jaap Joris Vens e9fddf8a2e Fix invalid form bug (in an ugly way...) 2020-03-25 16:52:16 +01:00
Jaap Joris Vens 96ce4c4ac3 Scale edit interface to 100% width 2020-03-24 18:16:33 +01:00
Jaap Joris Vens c552f52e46 Various small improvements 2020-03-24 15:32:12 +01:00
Jaap Joris Vens b092c12c99 [ no commit message supplied ] 2020-03-24 01:55:49 +01:00
Jaap Joris Vens ab9dc1621f Updated example project with cache settings. Also, deleted frontend
templates from cms app.
2020-03-24 01:15:17 +01:00
Jaap Joris Vens a9b4d5dfb3 [ no commit message supplied ] 2020-03-22 22:05:11 +01:00
Jaap Joris Vens 1e503349d6 Minor tweaks 2020-03-22 21:19:12 +01:00
Jaap Joris Vens 2382fd47f0 Tidying up! 2020-03-22 19:57:48 +01:00
Jaap Joris Vens 0e221ccf33 The dependency on swapper has been replaced with an incredibly simply
"registry". Client projects register their models and views during import
time with a decorator. The cms views use the registered classes to generate
pages and forms.

Furthermore, the example application now combines the app and the project in
one, inspired by this line in the Django documentation:

    There’s no restriction that a project package can’t also be considered
    an application and have models, etc.
2020-03-22 12:46:10 +01:00
Jaap Joris Vens 98b1a61af1 New template tag: {% edit %} which generates a simple edit link for the
current section
2020-03-21 20:24:07 +01:00
Jaap Joris Vens 3cc1f9ec08 New version! Modelled after Django's admin application, simplecms now allows
you to define everything related to it in the file 'cms.py'. No more
inherited proxy models and no more migrations every time you add/remove a
section type! In fact, the dependency on django-polymorphic has completely
been removed!

The example project has been updated and should get you started.
Documentation will be coming soon!
2020-03-21 18:49:41 +01:00
Jaap Joris Vens 09f03b6866 Even better permissions. Seems that they get swapped automatically! 2020-03-20 14:32:53 +01:00
Jaap Joris Vens d5bbfb67cf Not sure if this accounts for swapped models... 2020-03-20 14:19:01 +01:00
Jaap Joris Vens 89600bad98 Allow form sections to return http responses 2020-03-20 13:45:49 +01:00
Jaap Joris Vens 2b9c9d9a14 email 2020-03-19 21:48:03 +01:00
Jaap Joris Vens 2332740cf9 css tweaks 2020-03-19 21:12:41 +01:00
Jaap Joris Vens 9a8822f68b This was one of those bugs where you search for hours, endlessly, only to
arrive at a simple, senseful and elegant solution that costs only 3 lines to
implement.

I know I should be happy about that, but it really makes me feel like a
total dumbass.
2020-03-19 18:59:29 +01:00
Jaap Joris Vens 764f135785 More sensible default email addresses 2020-03-18 23:57:37 +01:00
Jaap Joris Vens bd2d622db9 Warning! Backwards-incompatible change: custom views should now be placed in
cms.py (instead of views.py)
2020-03-17 18:15:58 +01:00
Jaap Joris Vens 045b05a337 Give each section it's own id for use in urls
(e.g., http://localhost/#give-me-snacks)
2020-03-16 19:32:39 +01:00
Jaap Joris Vens 774e9e7379 Remove SectionFormSetView. If you need formsets, just add them to your custom form! 2020-03-14 12:35:15 +01:00
Jaap Joris Vens d8d54ea4c4 Refactor forms.py: quite elegant and reusable Page _and_ Section forms. Both
work with the same edit.html template. Finally you can edit sections
individually!
2020-03-13 23:08:21 +01:00
Jaap Joris Vens 1989615e60 Pixel peeping + javascript robustness 2020-03-13 09:39:27 +01:00
Jaap Joris Vens 712b542610 Default form styling 2020-03-11 22:59:44 +01:00
Jaap Joris Vens b56bbec534 Ready for the first deployment! 2020-03-11 11:48:37 +01:00
Jaap Joris Vens 2ef844044d Make forms save and look pretty
TODO: handle bug in show_relevant_fields()
2020-03-10 23:55:46 +01:00
Jaap Joris Vens e47d35a578 Alright, this is much better! Client side javascript much cleaner, plus the
templates are now truly recursive! Moving on to implementing the server side
code.
2020-03-10 15:17:46 +01:00
Jaap Joris Vens 3cabdda617 Got a perfect _server side_ solution for accepting forms with nested
formsets, automatically generated from a reusable app foreign key relations
to their section model. Georgeous!

However, the client side javascript is, even after a complete refactoring,
still an utter mess. After the template generates the HTML tree it's a chore
to use javascript to show, hide and duplicate nodes based on user
interaction.

Maybe I should look into client-side templating?
2020-03-09 18:24:39 +01:00
Jaap Joris Vens da6cff19f6 New experimental feature branch: subsections.
Despite the name, the idea is to allow reusable apps to add any kind of
formset to the edit page. The first test case is to allow madebyjane to
upload multiple images to a section.

Work in progress.
2020-03-08 22:19:39 +01:00
Jaap Joris Vens 8bd8bdde47 Beautiful hand-drawn edit icon by MadeByJane 2020-03-07 22:52:14 +01:00
Jaap Joris Vens f715a472d7 Pure javascript for dynamically adding forms to formsets. Works, but id
attributes are not properly incremented and will cause unknown trouble in
the future. Strangely enough, it works for now!
2020-03-06 14:37:25 +01:00
Jaap Joris Vens e4950e8d47 Big downstream changes, little upstream tweaks 2020-03-02 19:13:01 +01:00