{ "info": { "author": "Luc Jean", "author_email": "ljean@apidev.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Natural Language :: French", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": "coop-bar, configurable toolbar\n===============================================\n\n* `What is coop_bar good for?`_\n* `Quick start`_\n\n.. _What is coop_bar good for?: #good-for\n.. _Quick start?: #quick-start\n\n.. _good-for:\n\n.. figure:: https://raw.github.com/quinode/coop-bar/master/docs/coop_bar.png\n :align: left\n\nWhat is coop_bar good for?\n------------------------------------\ndjango-coop is a set of several apps for building cooperative websites. It is based on Django.\n\nThses apps may need a to display an admin toolbar. For example, the CMS component may use this bar\nto display edit, cancel and save links.\n\ncoop_bar tries to provide a simple and configurable mechanism\n\n.. _quick-start:\n\nQuick start\n------------------------------------\nIn settings.py, add 'coop_bar' (with an underscore) to the INSTALLED_APPS\nUnder Django 1.3, the static folder should be found automatically, as the templates folder\nIn urls.py add (r'^coop_bar/', include('coop_bar.urls')) to your urlpatterns\n\nFor each app needing to add links to coop_bar, create a coop_bar_cfg.py file\nIn this file, add a load_commands function as follows ::\n\n from django.core.urlresolvers import reverse\n from django.utils.translation import ugettext as _\n\n def django_admin_command(request, context):\n if request and request.user.is_staff: #request might be None\n return u'{1}'.format(reverse(\"admin:index\"), _('Admin'))\n\n def load_commands(coop_bar):\n coop_bar.register_command(django_admin_command)\n\n\nIn load_commands, you can register as much callback functions as you want. A callback (django_admin_command in the previous example)\nis just a function with request and context as args. It returns some html code to display in the bar or None.\n\nIn your base.html, add the following template tags::\n\n {% load coop_bar_tags %}\n \n
\n ...\n {% coop_bar_headers %}\n \n \n {% coop_bar %}\n ...\n your page\n ...\n {% coop_bar_footer %}\n \n\n\nHumanized Messages\n------------------------------------\n\n.. figure:: https://raw.github.com/quinode/coop-bar/master/docs/humanmsg.png\n :align: center\n\nCoop-bar takes also care of providing a nice display of django session messages.\nIt's based on the `Humanized Message idea