Wykres commitów

57 Commity (main)

Autor SHA1 Wiadomość Data
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 4a8c804452 Better form handling 2020-03-29 01:54:56 +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 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 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 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 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 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 bf312ed647 Translations 2020-02-20 22:48:35 +01:00
Jaap Joris Vens 241e5af2d3 Form logic: only save if valid, delete pages when the last sections is deleted 2020-02-20 10:49:11 +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 25770feb57 I can't believe it actually works! 2020-02-19 20:13:43 +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 b783424ff5 Improve forms 2020-02-17 11:03:31 +01:00
Jaap Joris Vens a7a640a721 Fix non-cms forms 2020-02-14 22:03:25 +01:00
Jaap Joris Vens 3d66484afe New feature: auto-resizing textarea's
You didn't know you needed this but now you can't live without it!
2020-02-14 21:40:00 +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 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 6e1a6ac220 Fix small insignificant bug 2019-12-28 23:26:34 +01:00
Jaap Joris Vens 15b44b7d44 Somewhat better default styling 2019-12-28 23:22:51 +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 eeb121795e add class 2019-08-28 17:04:42 +02:00
Jaap Joris Vens b550e25bbd move edit page button 2019-08-27 14:25:55 +02:00
Jaap Joris Vens b4256226c1 css tweaks 2019-08-26 23:38:44 +02:00
Jaap Joris Vens 5290199bd8 be more verbose with pages and sections 2019-08-26 17:31:46 +02:00
Jaap Joris Vens 98b10502e5 auto create empty homepage 2019-08-26 12:30:47 +02: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