Skip to main content

Pluggable admin bar system , works well with coop_cms

Project description

apidev-coop_bar, configurable toolbar

What is coop_bar good for?

coop_bar is a django app which provides an menu bar with external auto-registred menu items.

Quick start

In settings.py, add ‘coop_bar’ (with an underscore) to the INSTALLED_APPS 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

apidev-coop_bar in a fork of credis/coop-bar (see https://github.com/credis/coop-bar).

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

apidev-coop_bar itself uses the BSD license: see license.txt

credis/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 Distribution

apidev-coop_bar-1.6.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apidev_coop_bar-1.6.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file apidev-coop_bar-1.6.0.tar.gz.

File metadata

  • Download URL: apidev-coop_bar-1.6.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for apidev-coop_bar-1.6.0.tar.gz
Algorithm Hash digest
SHA256 5535711bd93c13c6fe5e282af9eb5de6dc008f2f5eb98b79ab27d352ff9e55e8
MD5 21b207c56649800c4183c8749a43671e
BLAKE2b-256 41b37f821f64c514a5fe689fd68a1e4d4bb1952971b6ea43908565d65f8abb00

See more details on using hashes here.

File details

Details for the file apidev_coop_bar-1.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apidev_coop_bar-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98d9e5d8c0ec7132ec1a6136431687e22d9f3641bd32b4d6a53b42363e7b9623
MD5 0b0f8aa3f56a12894108ba6a4f7956d2
BLAKE2b-256 9dc261c1f701ffa677ee97cec104fadfeb10cb4d7e3209ea10bb65f2fc86a292

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