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

Break dependency on the admin #228

Open
1 task done
alvra opened this issue Oct 11, 2019 · 3 comments
Open
1 task done

Break dependency on the admin #228

alvra opened this issue Oct 11, 2019 · 3 comments

Comments

@alvra
Copy link
Contributor

alvra commented Oct 11, 2019

  • Which version of Django are you using?: 2.2.6
  • Which version of django-rosetta are you using?: 0.9.3
  • Have you looked trough recent issues and checked this isn't a duplicate?

This isn't really clear to me from the documentation, but it seems Rosetta requires the Django admin to be enabled for a few css files. The pages work ok, but lacks all styling.

Is it possible for Rosetta to provide a (minimal) version of these css files in case the admin is not enabled. Placing Rosetta lower than the admin in the INSTALLED_APPS will not override the admin css if it is enabled, or is there a way to avoid this?

As far as I can tell, only the following files are needed:

  • /admin/css/base.css
  • /admin/css/forms.css
  • /admin/css/changelists.css
@jayvdb
Copy link

jayvdb commented Jul 9, 2020

This would be useful for frameworks which include rosetta as part of a distinct admin-like dashboard, such as https://github.com/scaryclam/django-oscar-rosetta

@bittner
Copy link

bittner commented Jul 15, 2020

I'd suggest to generalize this topic and call it "Separate Rosetta cleanly from Django Admin".

Why? – Because currently, Rosetta is not even cleanly integrated with the Admin:

  • From the user interface, it's not possible to navigate back to the admin (although it seems to be visually integrated)
  • Rosetta's templates don't inherit from Django's admin/base.html, which makes it tedious to customize its look and feel

If there were a clean separation it should be easy to allow for a Django setting to use either an integrated Django admin user experience, or a completely independent, stand-alone app appearance and behavior.

That would then potentially obsolete or replace settings like ROSETTA_SHOW_AT_ADMIN_PANEL.

@balazs-endresz
Copy link
Contributor

Since the latest django admin comes with a dark theme I thought I try extending admin/base.html from rosetta/base.html and it was fairly straightforward to get it working and styled properly:

Screenshot of localhost_8000_rosetta_files_project_fr_0_ (1)

@mbi Would you accept a PR for that, or rather go in the opposite direction and have this completely decoupled from the django admin?

Btw, if someone doesn't want django admin in INSTALLED_APPS, then I guess they can also copy those three css files to their project's own static files.

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

4 participants