################################# Django cradmin 2.0.0 releasenotes ################################# ************ What is new? ************ - New theme. No longer based on bootstrap, and using SASS instead of LESS. - ``django_cradmin.viewhelpers`` can be imported as ``from django_cradmin import viewhelpers``. After this import, you can use ``viewhelpers.create.CreateView``, ``viewhelpers.update.UpdateView``, ... - Views using any of the base templates for cradmin must inherit from one of the views in ``django_cradmin.viewhelpers`` or mix in one of the subclasses of :class:`django_cradmin.javascriptregistry.viewmixin.MinimalViewMixin`. - New menu system. Much more flexible, with a much simpler core based on ``django_cradmin.viewhelpers.listbuilder``. *************** New menu system *************** Menus are structurally changed, and they are defined in a different manner. Read :doc:`crmenu` for details. Migrating from the old menu system ================================== From a simple cases updating your menu for 2.x is fairly easy: 1. Add menu items in :meth:`django_cradmin.crinstance.BaseCrAdminInstance.get_menu_item_renderables` instead of in the ``build_menu``-method of your Menu. Since the attributes of :class:`django_cradmin.crmenu.LinkItemRenderable` is the same as for the old ``add_menuitem()``-method, this is easy. Just make sure to change the ``active`` attribute to ``is_active``. 2. Remove your old ``django_cradmin.crmenu.Menu`` subclass. 3. Remove the ``menuclass``-attribute from your BaseCrAdminInstance subclass. If your old menu was defined like this:: from django_cradmin import crinstance, crmenu class Menu(crmenu.Menu): def build_menu(self): self.add_menuitem( label=_('Dashboard'), url=self.appindex_url('dashboard'), active=self.request.cradmin_app.appname == 'dashboard') class CrInstance(crinstance.BaseCrAdminInstance): # ... other required BaseCrAdminInstance attributes and methods ... menuclass = Menu It will look like this in cradmin 2.x:: class CrInstance(crinstance.BaseCrAdminInstance): # ... other required BaseCrAdminInstance attributes and methods ... def get_menu_item_renderables(self): return [ crmenu.LinkItemRenderable( label=_('Dashboard'), url=self.appindex_url('dashboard'), is_active=self.request.cradmin_app.appname == 'dashboard'), ] **************************** Django base template changes **************************** standalone-base-internal.django.html ==================================== - The div with id ``django_cradmin_bodycontentwrapper`` no longer exists, and this also means that the ``outside-bodycontentwrapper`` template block no longer exists. - We no longer load any javascript by default. django_cradmin/base-internal.django.html ======================================== - We use the new template blocks from ``standalone-base-internal.django.html`` (see the section above). - The ``pageheader`` and ``pageheader-inner`` blocks no longer exist. Use: - ``page-cover`` instead of ``pageheader``. - ``page-cover-content`` instead of ``pageheader-inner``, or use ``page-cover-title`` to just set the content of the H1 tag. You can use the following regex in PyCharm to searh and all replace ``page-header-content`` blocks that only contain a H1 tag with the new ``page-cover-title`` block: Text to find:: \{\% block pageheader\-inner \%\}\s*\