Wykres commitów

32 Commity (c52be27802e10091e64cf73be0bd5b5cd18b1253)

Autor SHA1 Wiadomość Data
Jaap Joris Vens c52be27802 Make email subject user-configurable 2024-12-10 23:08:03 +01:00
Jaap Joris Vens 6781532448 Add missing docstrings 2024-12-10 23:05:36 +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 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 98de86f49d Blackify everything 2021-07-04 01:59:48 +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 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 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 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 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 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 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 b783424ff5 Improve forms 2020-02-17 11:03:31 +01:00
Jaap Joris Vens 3f900617c8 Re-introduce formsets
No more clicking individual sections to edit them. From now on, there will
only be one edit button! The biggest challenge was getting the javascript
closures to understand.
2020-02-14 17:20:41 +01:00
Jaap Joris Vens fc64b876da Move ContactForm back to cms package. Where should it live? 2020-01-06 12:51:10 +01:00
Jaap Joris Vens 2824d290f8 Cleanup source tree
The separate apps numberedmodel and simplesass have been merged into cms
2020-01-05 13:37:51 +01:00
Jaap Joris Vens 5f5f303187 A new templatetag 'includesection' now renders a section with its own
context, as provided by the polymorphic subsection's registered view.

Also, I'm trying to move all the website-related cruft from cms into the
example project, so that only the Page and Section models with their own
"admin" views will remain.
2020-01-05 03:36:23 +01:00
Jaap Joris Vens bd654f5103 Minor 2020-01-02 20:30:24 +01:00
Jaap Joris Vens e0dddeda08 New machinery for registering custom views
Each custom section can now have their own associated custom SectionView.
SectionView subclasses behave just like Django's generic views, except they
return Section objects instead of http responses. The updated PageView takes
care of compositing all rendered sections into the final response. Nice!
2020-01-02 19:32:15 +01:00
Jaap Joris Vens a69d51a0dc Automatic detection of available section types
Use the decorator @register to register your own Section child models, and
use their fields attribute to specify which fields it uses.
2020-01-02 01:56:15 +01:00
Jaap Joris Vens d166e10b05 First draft of version 2.0.0
Oh boy! This is a big one. Two new dependencies: swapper and
django-polymorphic will now allow any project that uses cms to elegantly
extend the default Section model with custom fields and custom subclasses.
This is still a work in progress.
2019-12-31 13:05:12 +01:00
Jaap Joris Vens 7997d7af0f add support for subsections 2019-08-23 17:19:40 +02:00
Jaap Joris Vens 49ced2791e improve templates 2019-04-02 14:05:14 +02:00
Jaap Joris Vens d4ae47a746 first commit :) 2019-03-27 16:49:14 +01:00