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/
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.
"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.
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!
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.
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?
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.
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.
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.
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!
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.