Skip to main content

Pluggable admin bar system , works well with coop-cms

Project description

coop-bar, configurable toolbar

What is coop_bar good for?

django-coop is a set of several apps for building cooperative websites. It is based on Django.

Thses apps may need a to display an admin toolbar. For example, the CMS component may use this bar to display edit, cancel and save links.

coop_bar tries to provide a simple and configurable mechanism

Quick start

In settings.py, add ‘coop_bar’ (with an underscore) to the INSTALLED_APPS Under Django 1.3, the static folder should be found automatically, as the templates folder In urls.py add (r’^coop_bar/’, include(‘coop_bar.urls’)) to your urlpatterns

For each app needing to add links to coop_bar, create a coop_bar_cfg.py file In this file, add a load_commands function as follows

from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _

def django_admin_command(request, context):
    if request and request.user.is_staff: #request might be None
        return u'<a href="{0}">{1}</a>'.format(reverse("admin:index"), _('Admin'))

def load_commands(coop_bar):
    coop_bar.register_command(django_admin_command)

In load_commands, you can register as much callback functions as you want. A callback (django_admin_command in the previous example) is just a function with request and context as args. It returns some html code to display in the bar or None.

In your base.html, add the following template tags:

{% load coop_bar_tags %}
<html>
<head>
    ...
    {% coop_bar_headers %}
</head>
<body>
    ...
    {% coop_bar %}
</body>

License

Fugue icon set by Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 License.

coop-bar itself uses the same license as Django (BSD).

coop-bar development was funded by CREDIS, FSE (European Social Fund) and Conseil Regional d’Auvergne.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

coop-bar-0.3.7.zip (3.0 MB view details)

Uploaded Source

coop-bar-0.3.7.tar.gz (2.0 MB view details)

Uploaded Source

File details

Details for the file coop-bar-0.3.7.zip.

File metadata

  • Download URL: coop-bar-0.3.7.zip
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for coop-bar-0.3.7.zip
Algorithm Hash digest
SHA256 a297c4228b82c328085bce25a3f24e92e280106cb79ffa9a004c2e9bed426338
MD5 f70824545bd4e79c749a86a4c4776a9f
BLAKE2b-256 65377ccc836124904dba8366ee9bc908d5fa5af6f4bd3b15d10f62d9a7caf1f8

See more details on using hashes here.

File details

Details for the file coop-bar-0.3.7.tar.gz.

File metadata

  • Download URL: coop-bar-0.3.7.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for coop-bar-0.3.7.tar.gz
Algorithm Hash digest
SHA256 dce0c3fa6d75fc29cdb07a197b11d025a255840cfbdd6e1c7b76134e8b61d307
MD5 04630d04944b6a768bc81c1b3f4204ad
BLAKE2b-256 9a1ebd2c6dd482ad5012c3b0b5d52b70fe1f5547b411ad60ff2e98edd55b62e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page