Wykres commitów

26 Commity (cd8151b2ce154c830b4d796b1bed54e3f2557a7c)

Autor SHA1 Wiadomość Data
Jaap Joris Vens cd8151b2ce Refactor models into models, fields and mixins 2021-06-30 00:48:50 +02: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 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 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 d5f5bb4296 Change default fields. This breaks existing migrations. Deal with it. 2020-02-19 22:24:01 +01:00
Jaap Joris Vens c0464a5ab6 Simplify CRUD logic
Whe needs CRUD? If a page exists, you edit it. If it doesn't, the same form
creates it. No more sections on a page? It gets automatically deleted. The
only thing the user has to remember is: nothing. Brilliant, right?
2020-02-19 16:35:23 +01:00
Jaap Joris Vens a217b1891a Fix NumberedModel bug 2020-02-08 08:31:51 +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 f9ea04662b Replace CKEditor's RichTextField with MarkdownField
Because you should not store raw HTML in database tables!
2020-01-02 23:37:26 +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 646311335b A little javascript magic shows only the fields defined on the subclassed models 2019-12-31 14:06:08 +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 4d5adcaa34 New conf parameter PAGE_URL_PATTERN 2019-12-28 21:14:06 +01:00
Jaap Joris Vens dc9744c5eb Make it easier to extend the default PageView.
First, extend BasePageView and add stuff to the context that your sections
need. Second, create a URLConf entry pointing to your new class. Third,
extend the base.html nav block and change the {% url cms:page %} to its new
name.

It seems so easy in hindsight...
2019-12-28 03:05:30 +01:00
Jaap Joris Vens 88e420f4c0 Include numberedmodel and simplesass apps
These apps are so minimal they don't warrant their own repository. I'm
hoping they will find a new home here. This move kind of obsoletes the
github.com/rtts/django-numberedmodel and github.com/rtts/django-simplesass
repositories, although I'm not planning to update their documentation unless
I make any major changes here.
2019-11-22 11:57:10 +01:00
Jaap Joris Vens 644ec5b6b4 better forms 2019-08-26 09:47:52 +02:00
Jaap Joris Vens b2fb3b1e73 proper redirects + css magic 2019-08-25 23:36:58 +02:00
Jaap Joris Vens 7997d7af0f add support for subsections 2019-08-23 17:19:40 +02:00
Jaap Joris Vens caa04922b7 fix css scroll issue 2019-07-08 14:35:29 +02:00
Jaap Joris Vens 5ad04df8fb don’t require titles and some css tweaks 2019-04-24 22:18:07 +02:00
Jaap Joris Vens d5bf5c8c06 integrate numberedmodel into this repository 2019-04-02 15:07:36 +02:00
Jaap Joris Vens d4ae47a746 first commit :) 2019-03-27 16:49:14 +01:00