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

django admin: custom index template #227

Merged

Conversation

domdinicola
Copy link
Contributor

This PR introduces a custom index template:

  • highlighting with a different color the tenant apps
  • disable the tenant apps when in the public schema (avoiding exceptions)

@domdinicola domdinicola force-pushed the feature/admin_color_tenant_apps branch from 2de43e7 to 77fb4ff Compare January 18, 2019 21:15
@tomturner
Copy link
Member

Thanks for this What w good idea. I will give this a look later and merge in

@domdinicola domdinicola force-pushed the feature/admin_color_tenant_apps branch 2 times, most recently from 7243a8e to ffa56ed Compare January 21, 2019 19:15
{% is_tenant_app app as is_tenant_app %}
<div class="app-{{ app.app_label }} module">
<table id="change-history">
{% if is_tenant_app_and_public %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide the models when in public schema and the app is a tenant app

<table id="change-history">
{% if is_tenant_app_and_public %}
<div class="module">
<caption {% if is_tenant_app %}style="background-color:#f7d904"{% endif %}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change color of the app if it's a tenant app

</caption>
</div>
{% else %}
<caption {% if is_tenant_app %}style="background-color:#f7d904"{% endif %} >
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change color of the app if it's a tenant app

@domdinicola domdinicola force-pushed the feature/admin_color_tenant_apps branch from ffa56ed to 9349cdd Compare January 23, 2019 23:12
{% is_tenant_app app as is_tenant_app %}
<div class="app-{{ app.app_label }} module">
<table id="change-history">
{% if is_tenant_app and is_public_schema %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if the app is tenant and we're in the public schema

@tomturner tomturner merged commit 9349cdd into django-tenants:master Jan 24, 2019
tomturner added a commit that referenced this pull request Jan 24, 2019
@domdinicola domdinicola deleted the feature/admin_color_tenant_apps branch January 24, 2019 23:17
@tomturner
Copy link
Member

@domdinicola thanks mereged now

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

Successfully merging this pull request may close these issues.

2 participants