Skip to content

Commit aad0627

Browse files
committed
#424 Updated base.html
1 parent 60e6b1e commit aad0627

File tree

1 file changed

+102
-67
lines changed

1 file changed

+102
-67
lines changed

app/templates/admin/base.html

Lines changed: 102 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,148 @@
11
{% load i18n static %}<!DOCTYPE html>
22
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
3-
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
3+
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}">
44
<head>
5-
<title>{% block title %}{% endblock %}</title>
6-
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}">
7-
{% block extrastyle %}{% endblock %}
8-
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
9-
{% block extrahead %}{% endblock %}
10-
{% block responsive %}
5+
<title>{% block title %}{% endblock %}</title>
6+
<link rel="stylesheet" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}">
7+
{% block dark-mode-vars %}
8+
<link rel="stylesheet" href="{% static "admin/css/dark_mode.css" %}">
9+
<script src="{% static "admin/js/theme.js" %}" defer></script>
10+
{% endblock %}
11+
{% if not is_popup and is_nav_sidebar_enabled %}
12+
<link rel="stylesheet" href="{% static "admin/css/nav_sidebar.css" %}">
13+
<script src="{% static 'admin/js/nav_sidebar.js' %}" defer></script>
14+
{% endif %}
15+
{% block extrastyle %}{% endblock %}
16+
{% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
17+
{% block extrahead %}{% endblock %}
18+
{% block responsive %}
1119
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
12-
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}">
13-
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
14-
{% endblock %}
15-
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
20+
<link rel="stylesheet" href="{% static "admin/css/responsive.css" %}">
21+
{% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
22+
{% endblock %}
23+
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
24+
25+
{% comment %}Custom syltes and scripts{% endcomment %}
1626

17-
{% comment %}Custom syltes and scripts{% endcomment %}
18-
<link rel="stylesheet" type="text/css" href="{% static "admin/css/custom.css" %}">
19-
<script src="https://kit.fontawesome.com/f077be8756.js" crossorigin="anonymous"></script>
27+
<link rel="stylesheet" type="text/css" href="{% static "admin/css/custom.css" %}">
28+
<script src="https://kit.fontawesome.com/f077be8756.js" crossorigin="anonymous"></script>
2029
</head>
2130
{% load i18n %}
2231

2332
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
2433
data-admin-utc-offset="{% now "Z" %}">
34+
<a href="#content-start" class="skip-to-content-link">{% translate 'Skip to main content' %}</a>
2535

2636
<!-- Container -->
2737
<div id="container">
2838

29-
{% if not is_popup %}
39+
{% if not is_popup %}
3040
<!-- Header -->
31-
<div id="header">
41+
{% block header %}
42+
<div id="header">
3243
<div id="branding">
33-
{% block branding %}{% endblock %}
44+
{% block branding %}{% endblock %}
3445
</div>
3546
{% block usertools %}
36-
{% if has_permission %}
37-
<div id="user-tools">
38-
{% block welcome-msg %}
39-
{% trans 'Welcome,' %}
40-
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
41-
{% endblock %}
42-
{% block userlinks %}
43-
{% if site_url %}
44-
<a href="{{ site_url }}">{% trans 'View site' %}</a> /
45-
{% endif %}
46-
{% if user.is_active and user.is_staff %}
47-
{% url 'django-admindocs-docroot' as docsroot %}
48-
{% if docsroot %}
49-
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
50-
{% endif %}
51-
{% endif %}
52-
{% if user.has_usable_password %}
53-
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
54-
{% endif %}
55-
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
56-
{% endblock %}
57-
</div>
58-
{% endif %}
47+
{% if has_permission %}
48+
<div id="user-tools">
49+
{% block welcome-msg %}
50+
{% translate 'Welcome,' %}
51+
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
52+
{% endblock %}
53+
{% block userlinks %}
54+
{% if site_url %}
55+
<a href="{{ site_url }}">{% translate 'View site' %}</a> /
56+
{% endif %}
57+
{% if user.is_active and user.is_staff %}
58+
{% url 'django-admindocs-docroot' as docsroot %}
59+
{% if docsroot %}
60+
<a href="{{ docsroot }}">{% translate 'Documentation' %}</a> /
61+
{% endif %}
62+
{% endif %}
63+
{% if user.has_usable_password %}
64+
<a href="{% url 'admin:password_change' %}">{% translate 'Change password' %}</a> /
65+
{% endif %}
66+
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
67+
{% csrf_token %}
68+
<button type="submit">{% translate 'Log out' %}</button>
69+
</form>
70+
{% include "admin/color_theme_toggle.html" %}
71+
{% endblock %}
72+
</div>
73+
{% endif %}
5974
{% endblock %}
6075
{% block nav-global %}{% endblock %}
61-
</div>
76+
</div>
77+
{% endblock %}
6278
<!-- END Header -->
6379

6480
<!-- Navigation -->
6581
{% if user.is_authenticated %}
66-
<div class="breadcrumbs" style="background: #598ca5">
82+
<div class="breadcrumbs" style="background: #598ca5">
6783
<a href="{% url 'admin:tv_series_journal_changelist' %}">{% trans 'TV series' %}</a> |
6884
<a href="{% url 'admin:books_journal_changelist' %}">{% trans 'Books' %}</a>
6985
<div style="float: right;">
70-
[
71-
<a href="{% url 'admin:app_user_changelist' %}">{% trans 'Users' %}</a> |
72-
<a href="{% url 'admin:auth_group_changelist' %}">{% trans 'Groups' %}</a>
73-
]
86+
[
87+
<a href="{% url 'admin:app_user_changelist' %}">{% trans 'Users' %}</a> |
88+
<a href="{% url 'admin:auth_group_changelist' %}">{% trans 'Groups' %}</a>
89+
]
7490
</div>
75-
</div>
91+
</div>
7692
{% endif %}
7793
<!-- END Navigation -->
7894

79-
{% block breadcrumbs %}
80-
<div class="breadcrumbs">
81-
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
82-
{% if title %} &rsaquo; {{ title }}{% endif %}
83-
</div>
95+
{% block nav-breadcrumbs %}
96+
<nav aria-label="{% translate 'Breadcrumbs' %}">
97+
{% block breadcrumbs %}
98+
<div class="breadcrumbs">
99+
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
100+
{% if title %} &rsaquo; {{ title }}{% endif %}
101+
</div>
102+
{% endblock %}
103+
</nav>
84104
{% endblock %}
85-
{% endif %}
105+
{% endif %}
86106

87-
{% block messages %}
88-
{% if messages %}
89-
<ul class="messagelist">{% for message in messages %}
90-
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
91-
{% endfor %}</ul>
107+
<div class="main" id="main">
108+
{% if not is_popup and is_nav_sidebar_enabled %}
109+
{% block nav-sidebar %}
110+
{% include "admin/nav_sidebar.html" %}
111+
{% endblock %}
92112
{% endif %}
93-
{% endblock messages %}
94-
95-
<!-- Content -->
96-
<div id="content" class="{% block coltype %}colM{% endblock %}">
113+
<div id="content-start" class="content" tabindex="-1">
114+
{% block messages %}
115+
{% if messages %}
116+
<ul class="messagelist">{% for message in messages %}
117+
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
118+
{% endfor %}</ul>
119+
{% endif %}
120+
{% endblock messages %}
121+
<!-- Content -->
122+
<div id="content" class="{% block coltype %}colM{% endblock %}">
97123
{% block pretitle %}{% endblock %}
98124
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
125+
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}
99126
{% block content %}
100-
{% block object-tools %}{% endblock %}
101-
{{ content }}
127+
{% block object-tools %}{% endblock %}
128+
{{ content }}
102129
{% endblock %}
103130
{% block sidebar %}{% endblock %}
104131
<br class="clear">
132+
</div>
133+
<!-- END Content -->
134+
{% block footer %}<div id="footer"></div>{% endblock %}
105135
</div>
106-
<!-- END Content -->
107-
108-
{% block footer %}<div id="footer"></div>{% endblock %}
136+
</div>
109137
</div>
110138
<!-- END Container -->
111139

140+
<!-- SVGs -->
141+
<svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
142+
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-auto"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2V4a8 8 0 1 0 0 16z"/></symbol>
143+
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-moon"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol>
144+
<symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-sun"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol>
145+
</svg>
146+
<!-- END SVGs -->
112147
</body>
113148
</html>

0 commit comments

Comments
 (0)