Hey guys,
I've pushed up to GitHub and Bitbucket (not to pypi) the latest branches of Mezzanine, Cartridge, and the forks of Grappelli and FileBrowser. If no new development occurs over the coming weeks, these will be released as Mezzanine 1.0 and Cartridge 1.0. I've pushed up a very large amount of changes that I've been working on over the last couple of months. I'll go over these first then talk about some outstanding things that could possibly go into the 1.0 releases.
Here are links to the all the commits pushed just now for each project:
All of this works falls under 3 main categories:
- Default front-end templates now use Twitter Bootstrap
- Gallery app added to Mezzanine
- Dropped support for Django 1.1 and 1.2
== Bootstrap ==
Not much detail to go into here. It was mostly a straight port of the templates with very little structural change. One thing that did come out of it was a new templatetag for rending form fields. Given a form object, it is: {% fields_for form %} which includes the template templates/includes/form_fields.html containing HTML for each form field. All forms use this now instead of form.as_ul etc, so you can totally customize how each form field is rendered.
== Gallery App ==
I've added the app mezzanine.galleries which is mostly just a polished version of the example in the docs. It includes support for uploading a zip file to import a gallery, and a Facebook-like jQuery overlay/slideshow on the front-end. I've used FileBrowser's FileField for this, and out of that, for the first time I've dug into the filebrowser_safe code and made a bunch of changes:
- Ripped out the "image versions" feature which didn't handle unicode well, and Mezzanine never exposed, and replaced all thumbnailing with Mezzanine's thumbnailing.
- Added a redirect after upload back to the directory browse screen - this was always a UX flaw as there's no link back to select a file after uploading it.
- Renamed all the urls and titles to "Media Library" in line with the menu item it's given in Mezzanine.
- Added automatic creation of the uploads directory when it doesn't exist.
I also changed the new feature_image field in the blog to use a FileBrowser field. The only other file upload is product images in Cartridge but that didn't work easily so I've left it for now.
== Django 1.1 and 1.2 ==
Dropping support for these has been the biggest change. It's allowed for a lot of code to be thrown out. Here's what it actually equates to:
- Thrown out most of the code for handling device templates (mobiles, tablets etc) - it's not implemented mostly with a single middleware mezzanine.core.middleware.TemplateForDeviceMiddleware which can depend on Django 1.3's TemplateResponse object, which gives you access to modifying the template list to choose from prior to rendering.
- Replaced all uses of ifequal and ifnotequal templatetags with 1.2's if operators (== and !=).
- Threw out all the 1.1/1.2 handling in mezzanine.conf.utils, which would do things like automatically change certain settings (names of middleware classes, etc) that changed across Django versions.
The final and most significant change with dropping 1.1/1.2 however is that Mezzanine, Cartridge, grappelli_safe and filebrowser_safe now fully support Django's staticfiles app and use it by default. This has led to even more cleanup:
- The concept of themes is now redundant, since mostly all this did was automate copying and serving media files for themes, so all the management commands and settings for those are gone. Just add an installed app with templates and a static directory and you've got yourself a theme.
- All the different aliases required for deploying are no longer necessary, so all the handling of Mezzanine's internal media files (referred to as content_media) and the management command for helping out with the alises are all gone.
- Tons of inline CSS and JS, mostly in admin templates, has been moved out into separate CSS and JS files.
- Hacks for hosting grappelli assets when running locally (ip:port would be used for the full url) are gone.
- django.contrib.messages is now first class, and cookie messaging is the default
== Miscellanous ==
- Added some TinyMCE features to the default setup - fullscreen button, find/replace, context menu, tab focus, inline popups (no more popup windows).
- Mezzanine and Cartridge docs now include model diagrams thanks to abstract model support landing in the graphviz layer of django-extensions.
- Featured image field on blog posts (thanks Josh Batchelor).
- pillow (
http://pypi.python.org/pypi/Pillow) is now a dependency. It's simply a pip installable version of PIL, so the checks for it being installed have been relaxed, such as thumbnail templatetag, which will now complain loudly if it can't create a thumbnail.
- PageAdmin now behaves more like Django's ModelAdmin, in that if you subclass it for your custom Page model subclass, and don't define fieldsets for your the admin class, all the extra fields added onto your custom Page model are automatically added to the admin class's fieldsets, along with the standard page fields. This removes a lot of the cases where you have to do the deepcopy(fieldsets) dance to add your custom fields to the admin.
- thumbnail templatetag now stores thumbnails in subdirectory relative to the original image, configurable via the THUMBNAILS_DIR_NAME settings which defaults to ".thumbnails".
- page_menu fixes (thanks Josh Cartmell).
- mezzanine.forms now has Number and URL type fields for admin users to choose when building forms
- Some fixes in mezzanine.forms for exporting form entries to MS Excel
- Blog posts have a bool setting BLOG_URLS_USE_DATE defaulting to False, which when True will use the format /blog/yyyy/mm/dd/slug for blog posts (thanks again Josh Batchelor).
- When running syncdb or createdb locally, the default site is given the host
127.0.0.1:8000 instead of
example.com, so admin redirects work out of the box.
I think that's everything! There weren't really any changes to Cartridge, apart from keeping it all in line with the above, so it's fully Bootstrap'd and staticfile'd as well. Check out the new demo with Bootstrap and galleries:
http://mezzanine.jupo.org/gallery/
== 1.0 Releases ==
As for Mezzanine 1.0 and Cartridge 1.0, as I mentioned if nothing else happens, the current state they're in will become the 1.0 releases. If anyone has any feedback on any of the above I'd be more than happy to consider changing things prior to the official releases. Here are some things that I think would be awesome to include, that I'm not gonna get a chance to work on myself, and aren't going to block releasing 1.0:
- Translatable content. There was some good work and discussion in this thread:
https://github.com/stephenmcd/mezzanine/issues/106 which also led to working out how to get django-modeltranslation working with Mezzanine. I don't think the work done was too far off, but the developer who did the work isn't available to continue it right now.
- Bootstrap 2.0. I don't think there would be much involved here from what I've seen. The Bootstrap port uses 1.4 and 2.0 is due out any day now.
- Project homepage design. This is the most important one for my mind, and the hardest one to do since anyone reading this is most likely not a designer. With that said, if you know of a professional designer who could spare a few hours to do a clean and elegant design for the project homepage, it would be worth more than you can imagine. I have wireframes for it already, so it just needs to be prettified. If you have anyone who'd like to help out, hit me up for the wireframe. If nothing turns up, I'm gonna try and whip something up myself, but it would be ideal if it was done by a pro!
Please try out these latest changes and help me make sure 1.0 is well tested. All feedback welcome. If you have anything you can think of that should be included in 1.0, now's the time to speak up!