Skip to content

Commit 29b8fd7

Browse files
committed
Merge branch 'develop'
2 parents e06a093 + 2b5f062 commit 29b8fd7

File tree

6 files changed

+290
-183
lines changed

6 files changed

+290
-183
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ verify_ssl = true
66
[dev-packages]
77

88
[packages]
9-
django = ">=3.0.4,<4.2"
9+
django = ">=4.2.5,<4.3"
1010
psycopg2 = ">=2.8.4,<2.9"
1111
whitenoise = ">=5.0.1,<5.1"
1212
dj-database-url = ">=0.5.0,<0.6"

Pipfile.lock

Lines changed: 163 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
/*
2-
* src: http://qaru.site/questions/3688420/trying-to-showhide-the-changelist-filter-in-django-admin
1+
/**
2+
* Add button for show and hide filters in actions menu
3+
* src: http://qaru.site/questions/3688420/trying-to-showhide-the-changelist-filter-in-django-admin
34
*/
45

5-
(function($) {
6-
$(document).ready($ => {
7-
$("tr input.action-select").actions()
8-
$('<div id="show-filters" style="float: right;"><a href="#">Show filters</a></p>').prependTo('div.actions')
9-
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">Filter &rarr;</a>')
6+
window.onload = () => {
7+
(function($) {
8+
$(`
9+
<div id="show-filters" style="float: right">
10+
<a href="#">Show filters</a>
11+
</div>
12+
`).prependTo('div.actions')
13+
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">Filters &rarr;</a>')
1014

1115
$('#show-filters').click(() => {
1216
$('#changelist-filter').show('fast')
1317
$('#changelist').addClass('filtered')
1418
$('#show-filters').hide()
1519
})
1620

17-
$('#hide-filters').click(() => {
18-
$('#changelist-filter').hide('fast')
19-
$('#show-filters').show()
20-
$('#changelist').removeClass('filtered')
21-
})
22-
23-
$('#hide-filters').click();
24-
})
25-
})($)
21+
$('#hide-filters')
22+
.click(() => {
23+
$('#changelist-filter').hide('fast')
24+
$('#show-filters').show()
25+
$('#changelist').removeClass('filtered')
26+
})
27+
.click()
28+
})(django.jQuery)
29+
}

app/templates/admin/base.html

Lines changed: 104 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,150 @@
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+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
29+
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
30+
crossorigin="anonymous" referrerpolicy="no-referrer" />
2031
</head>
2132
{% load i18n %}
2233

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

2638
<!-- Container -->
2739
<div id="container">
2840

29-
{% if not is_popup %}
41+
{% if not is_popup %}
3042
<!-- Header -->
31-
<div id="header">
43+
{% block header %}
44+
<div id="header">
3245
<div id="branding">
33-
{% block branding %}{% endblock %}
46+
{% block branding %}{% endblock %}
3447
</div>
3548
{% 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 %}
49+
{% if has_permission %}
50+
<div id="user-tools">
51+
{% block welcome-msg %}
52+
{% translate 'Welcome,' %}
53+
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
54+
{% endblock %}
55+
{% block userlinks %}
56+
{% if site_url %}
57+
<a href="{{ site_url }}">{% translate 'View site' %}</a> /
58+
{% endif %}
59+
{% if user.is_active and user.is_staff %}
60+
{% url 'django-admindocs-docroot' as docsroot %}
61+
{% if docsroot %}
62+
<a href="{{ docsroot }}">{% translate 'Documentation' %}</a> /
63+
{% endif %}
64+
{% endif %}
65+
{% if user.has_usable_password %}
66+
<a href="{% url 'admin:password_change' %}">{% translate 'Change password' %}</a> /
67+
{% endif %}
68+
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
69+
{% csrf_token %}
70+
<button type="submit">{% translate 'Log out' %}</button>
71+
</form>
72+
{% include "admin/color_theme_toggle.html" %}
73+
{% endblock %}
74+
</div>
75+
{% endif %}
5976
{% endblock %}
6077
{% block nav-global %}{% endblock %}
61-
</div>
78+
</div>
79+
{% endblock %}
6280
<!-- END Header -->
6381

6482
<!-- Navigation -->
6583
{% if user.is_authenticated %}
66-
<div class="breadcrumbs" style="background: #598ca5">
84+
<div class="breadcrumbs" style="background: #598ca5">
6785
<a href="{% url 'admin:tv_series_journal_changelist' %}">{% trans 'TV series' %}</a> |
6886
<a href="{% url 'admin:books_journal_changelist' %}">{% trans 'Books' %}</a>
6987
<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-
]
88+
[
89+
<a href="{% url 'admin:app_user_changelist' %}">{% trans 'Users' %}</a> |
90+
<a href="{% url 'admin:auth_group_changelist' %}">{% trans 'Groups' %}</a>
91+
]
7492
</div>
75-
</div>
93+
</div>
7694
{% endif %}
7795
<!-- END Navigation -->
7896

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

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>
109+
<div class="main" id="main">
110+
{% if not is_popup and is_nav_sidebar_enabled %}
111+
{% block nav-sidebar %}
112+
{% include "admin/nav_sidebar.html" %}
113+
{% endblock %}
92114
{% endif %}
93-
{% endblock messages %}
94-
95-
<!-- Content -->
96-
<div id="content" class="{% block coltype %}colM{% endblock %}">
115+
<div id="content-start" class="content" tabindex="-1">
116+
{% block messages %}
117+
{% if messages %}
118+
<ul class="messagelist">{% for message in messages %}
119+
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
120+
{% endfor %}</ul>
121+
{% endif %}
122+
{% endblock messages %}
123+
<!-- Content -->
124+
<div id="content" class="{% block coltype %}colM{% endblock %}">
97125
{% block pretitle %}{% endblock %}
98126
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
127+
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}
99128
{% block content %}
100-
{% block object-tools %}{% endblock %}
101-
{{ content }}
129+
{% block object-tools %}{% endblock %}
130+
{{ content }}
102131
{% endblock %}
103132
{% block sidebar %}{% endblock %}
104133
<br class="clear">
134+
</div>
135+
<!-- END Content -->
136+
{% block footer %}<div id="footer"></div>{% endblock %}
105137
</div>
106-
<!-- END Content -->
107-
108-
{% block footer %}<div id="footer"></div>{% endblock %}
138+
</div>
109139
</div>
110140
<!-- END Container -->
111141

142+
<!-- SVGs -->
143+
<svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
144+
<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>
145+
<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>
146+
<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>
147+
</svg>
148+
<!-- END SVGs -->
112149
</body>
113150
</html>

config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ---------------------------------------
2020
NAME = 'Tabular Notes'
2121

22-
VERSION = '1.5'
22+
VERSION = '1.6'
2323

2424
EMPTY_VALUE_DISPLAY = ''
2525
# ---------------------------------------

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
- POSTGRES_USER=${POSTGRES_USER}
2828
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
2929
ports:
30-
- 5433:5432
30+
- "5433:5432"
3131
volumes:
3232
- ./data/pgdata:/var/lib/postgresql/data
3333

0 commit comments

Comments
 (0)