Git Product home page Git Product logo

django-client-admin's Introduction

Concentric Sky

Client Admin for Django

Client Admin is an open source project developed by Concentric Sky that enhances Django Admin by providing organization tools and features that make the interface more appropriate for clients. Some of the code started as Admin Tools, although the theming engine has been removed and many features have been added.

Table of Contents

Version History

  • v1.0.11 Various bug fixes and style changes
  • v1.0.0 Public codebase was released

Documentation

Detailed documentation is available on Read The Docs.

Installation

pip install git+https://github.com/concentricsky/django-client-admin.git

Include Client Admin in your settings.py. It should be listed before the django.contrib.admin module so that client_admin can override the default Django admin templates.

INSTALLED_APPS = [
    'client_admin',

    ...

]

Include Client Admin urls in your urls.py at the same path as normal contrib.admin

urlpatterns = patterns('',

    ...

    url(r'^admin/', include('client_admin.urls')),
    url(r'^admin/', include('admin.site.urls')),

    ...

)

Client Admin depends on Jingo to process Jinja2 templates. Please follow the installation instructions according to that library (available at https://jingo.readthedocs.org/en/latest/), and be sure to include contrib.admin in the excluded apps setting:

JINGO_EXCLUDE_APPS = ( 'admin',)

Getting Started

Import and inherit from ClientModelAdmin and Inline classes.

from client_admin.admin import ClientModelAdmin, GroupedInline, TabularInline, StackedInline


class BindingInline(GroupedInline):
    model = Binding


class RetailerInline(TabularInline):
    model = Retailer


class AuthorInline(StackedInline):
    model = Author


class BookAdmin(ClientModelAdmin):
    inlines = [PhoneNumberInline, RetailerInline, MailingAddressInline]

...

Default Features

  • Provides a new style for the Django Admin interface.
  • Provides a dashboard with draggable widgets.
  • Creates a menu persistent on all admin pages.
  • Provides a system of admin bookmarks that allow users to quickly star favorite pages and have them available from the menu.
  • Provides a ClientModelAdmin class to inherit from that improves default widgets and settings.
  • Provides an additional inline type, Grouped, that acts much like a Stacked inline but floats each field group instead of clearing them.
  • Allows admin templates to extend Jinja2 templates. Assuming certain blocks are present in your template, this means the admin interface could inherit a header and footer from the front-end templates.

Additional Features

  • Provides nested inline formsets for ModelAdmin classes.
  • Adds an advanced search form to change list views.
  • Provides an improved generic-foreignkey widget.
  • Provides an improved Raw ID foreignkey widget that displays unicode instead of the object's pk.
  • Includes revision history and deleted object recovery via django-reversion

License

This project is licensed under the Apache License, Version 2.0. Details can be found in the LICENSE.md file.

About Concentric Sky

For nearly a decade, Concentric Sky has been building technology solutions that impact people everywhere. We work in the mobile, enterprise and web application spaces. Our team, based in Eugene Oregon, loves to solve complex problems. Concentric Sky believes in contributing back to our community and one of the ways we do that is by open sourcing our code on GitHub. Contact Concentric Sky at [email protected].

django-client-admin's People

Contributors

blanchardjeremy avatar coffindragger avatar hamms avatar iankpconcentricsky avatar krimkus avatar lbyers avatar minism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-client-admin's Issues

jQuery "top" error on changelist view

Error: http://d.pr/i/YpJ2

"Uncaught TypeError: Cannot read property 'top' of undefined "

The second line below is the line in question. Seems to be something that's only applicable to the detail view, perhaps?

$('body.change-form header').followTo($submitrow.offset().top-$submitrow.height()-2);
$('div.submit-row').followAt($submitrow.offset().top);

This issue might be showing up elsewhere also.

All views need permission check

get_obj, generic_lookup, and get-generic_rel_list can all be called by an anonymous user since there are no permission checks on them. This is a security hole that could be exploited sometime in the future if they knew what URL to request.

Nested inlines not displaying

I've just installed django-client-admin per the README instructions. It works on a basic level -- it's taken over rendering my admin pages, with proper styling and everything. However, it won't display nested inline menus at all.

Not only can I not see the nested inline, but I can't submit the admin form without getting a ValidationError ([u'ManagementForm data is missing or has been tampered with']). Some excerpts from the stacktrace:

/Users/cbrink/.virtualenvs/cci/lib/python2.6/site-packages/client_admin/admin.py in change_view
                self.add_recursive_inline_formsets(request, inline, formset, obj) ...

/Users/cbrink/.virtualenvs/cci/lib/python2.6/site-packages/client_admin/admin.py in add_recursive_inline_formsets
                        self.add_recursive_inline_formsets(request, recursive_inline, recursive_formset) ...

/Users/cbrink/.virtualenvs/cci/lib/python2.6/site-packages/client_admin/admin.py in add_recursive_inline_formsets
    for form in formset.forms: ...

Has anyone else run into similar behavior?

Here's my settings.INSTALLED_APPS:

INSTALLED_APPS = ( 'django.contrib.auth'
                 , 'django.contrib.contenttypes'
                 , 'django.contrib.sessions'
                 , 'django.contrib.sites'
                 , 'django.contrib.messages'
                 , 'django.contrib.staticfiles'
                 , 'client_admin'
                 , 'django.contrib.admin'
                 , 'django.contrib.admindocs'
                 , 'south'
                 , 'myapp'
                 )

The relevant slice of urls.urlpatterns:

url(r'^admin/', include('client_admin.urls')),
url(r'^admin/', include(admin.site.urls)),

The relevant bits of myapp.admin:

from client_admin.admin import ClientModelAdmin \
                             , GroupedInline    \
                             , TabularInline    \
                             , StackedInline

class MySecondLevelInline(TabularInline):
    model = MySecondLevelModel

class MyFirstLevelInline(StackedInline):
    model = MyFirstLevelModel
    inlines = [MySecondLevelInline]

class MyAdmin(ClientModelAdmin):
    inlines = [MyFirstLevelInline]

I've tried all combinations of StackedInline and TabularInline; all fail the same way.

I've tried manually creating an instance of the nested inline's model, hoping that would force it to render the nested formset -- I could more easily start debugging this if I could see it work properly in one scenario. But no luck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.