Grok extension to configure browser menus
Python
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/megrok Update tests, restore missing files. Jan 13, 2016
.gitignore Add .gitignore. Jan 13, 2016
.travis.yml Update CHANGES.txt, .travis.yml and MANIFEST.in. Feb 15, 2016
CHANGES.txt Back to development: 0.4.2 Feb 16, 2016
COPYRIGHT.txt
LICENSE.txt
MANIFEST.in Update CHANGES.txt, .travis.yml and MANIFEST.in. Feb 15, 2016
README.txt
bootstrap.py
buildout.cfg Update tests, restore missing files. Jan 13, 2016
setup.py Back to development: 0.4.2 Feb 16, 2016

README.txt

This package allows you to register browser menus and menu items for
browser views in Grok.

A menu is easily registered by creating a subclass of ``megrok.menu.Menu``::

  import megrok.menu.Menu

  class Tabs(megrok.menu.Menu):
      grok.name('tabs')
      grok.title('Tabs')
      grok.description('')

A view can then placed on a menu with the ``menuitem`` directive::

  class Edit(grok.View):
      grok.title('Edit')
      grok.description("Change this object's data.")
      megrok.menu.menuitem('tabs')

      ...

The ``title`` and ``description`` directives used here specifie the
menu item's label and description.  The ``menuitem`` directive takes
at least one argument, the menu that the item is registered to be for.
This can either be an identifier string or the menu class
itself. Other optional parameters include ``icon``, ``filter``, ``order``
and ``extra``.

For more use cases and examples, take a look to tests/test_functional.py