Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template different to main site #47

Closed
stretch4x4 opened this issue Feb 5, 2016 · 5 comments
Closed

Template different to main site #47

stretch4x4 opened this issue Feb 5, 2016 · 5 comments

Comments

@stretch4x4
Copy link
Contributor

We have noticed a few differences between the adminplus template and the standard django admin.

On all our custom views we loose our logout links, have tried to have a look in the templates but can't figure out what is causing them to disappear..

We also had to pass through our customised titles and headings, it would be excellent if the template picked up on the original values so each view didn't have to respecify them

@athre0z
Copy link

athre0z commented Mar 11, 2016

I'll assume you extend your templates from admin/base_site.html or adminplus/base.html. When using those templates, make sure to include a correct context in your render call.

from django.shortcuts import render

@admin.site.register_view('meow')
def test_view(request):
    return render(
        request,
        'core/admin/blah.html',
        context=admin.site.each_context(request)
    )

See: https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#django.contrib.admin.AdminSite.each_context

That might be something worth noting in the documentation of this library.

@stretch4x4
Copy link
Contributor Author

Cheers will take a look at that on Tuesday!

@jsocol
Copy link
Owner

jsocol commented May 28, 2016

@stretch4x4 did @athre0z's comment solve the issue?

@stretch4x4
Copy link
Contributor Author

Sorry to not respond earlier, yes for memory I think it did, if not something very similar.

Cheers


From: James Socolmailto:notifications@github.com
Sent: ‎29/‎05/‎2016 1:55 AM
To: jsocol/django-adminplusmailto:django-adminplus@noreply.github.com
Cc: stretch4x4mailto:desert-cruiser@hotmail.com; Mentionmailto:mention@noreply.github.com
Subject: Re: [jsocol/django-adminplus] Template different to main site (#47)

@stretch4x4 did @athre0z's comment solve the issue?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#47 (comment)

@jsocol
Copy link
Owner

jsocol commented May 30, 2016

OK, thanks! If anyone is still running into this, please reopen!

@jsocol jsocol closed this as completed May 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants