Giter Site home page Giter Site logo

Comments (4)

nordbit avatar nordbit commented on August 21, 2024

Less coffee, more sleep. And fresh air. Jogging? Nuts are good to for brain work.
BTW can You reformat css for "Recent action"? For now "Recent actions" take plenty of admin area and leaving big empty spaces. CSS "display: inline" or "inline-block"?
Action are marked by color, it is neccessary place one kind on left, another kind on right centralized column?

from django-admin-bootstrap.

michaelkuty avatar michaelkuty commented on August 21, 2024

see https://github.com/django-admin-bootstrap/django-admin-bootstrap-demo/blob/master/example_app/site.py#L13
maybe it's not a bug

from django-admin-bootstrap.

douglasmiranda avatar douglasmiranda commented on August 21, 2024

Thanks @michaelkuty I will look into it this week =]

from django-admin-bootstrap.

elton2048 avatar elton2048 commented on August 21, 2024

I don't know if anyone cares about this issue and still I would like to post a solution which is not perfect because it needs to modify the module code.

The issue is due to the file bootstrap_admin_template_tags.py in templatetages folder only import the default site from django.contrib.admin, if there is any custom AdminSite is created it cannot use the new class as reference. As a result any new model register to the new custom AdminSite cannot be referenced on the sidebar.

To tackle the issue the custom AdminSite needs to be import to the bootstrap_admin_template_tags.py manually.
For example, if the custom AdminSite is created in admin.py in your app.

class MyAdminSite(AdminSite):
    site_header = 'New Header'
    site_title = 'New Title'
    index_title = 'Admin Panel'

admin_site = MyAdminSite(name='myadmin')
admin_site.register(YourModel)

Then in bootstrap_admin_template_tags.py add the following two lines after the other modules import

from media.admin import admin_site
site = admin_site

In this way the site in the bootsrtap_admin_template_tags.py file is overrided by the custom AdminSite.

from django-admin-bootstrap.

Related Issues (20)

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.