forked from darklow/django-suit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow overriding suit config by request for demos. Layout switch for …
…demo
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,47 @@ | ||
{% extends 'admin/base_site.html' %} | ||
{# This is how you can extend admin by custom CSS or JS files #} | ||
{% load suit_tags %} | ||
|
||
{# Following is an example how to extend admin by custom CSS or JS files #} | ||
{# Add extra CSS for admin #} | ||
{#{% block extrastyle %}#} | ||
{# {{ block.super }}#} | ||
{# <link rel="stylesheet" href="{% static 'css/admin.css' %}">#} | ||
{#{% endblock %}#} | ||
|
||
{#{% block foot %}#} | ||
{# {{ block.super }}#} | ||
{# <script type="text/javascript"></script>#} | ||
{#{% endblock %}#} | ||
|
||
|
||
|
||
{# Switch for demonstration purposes, not indended for production use #} | ||
{% block usertools %} | ||
{% with suit_layout='layout'|suit_conf:request %} | ||
{% if suit_layout == 'horizontal' %} | ||
<a href="{% url 'admin:index' %}?__suit_layout=vertical" class="demo-layout-switch"> | ||
Switch to vertical | ||
</a> | ||
{% else %} | ||
<a href="{% url 'admin:index' %}?__suit_layout=horizontal" class="demo-layout-switch"> | ||
Switch to horizontal | ||
</a> | ||
{% endif %} | ||
|
||
{{ block.super }} | ||
|
||
{% endwith %} | ||
|
||
<style type="text/css"> | ||
body #header a.demo-layout-switch { | ||
color: #687086; | ||
} | ||
|
||
body.suit_layout_vertical .demo-layout-switch { | ||
background-color: #383D4B; | ||
order: 10; | ||
text-align: center; | ||
padding: .5rem 0; | ||
} | ||
</style> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters