Skip to content

Commit

Permalink
[#2093] Upgrade django-admin-index to 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma committed Feb 20, 2024
1 parent b050470 commit e29731f
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 61 deletions.
17 changes: 13 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ cryptography==41.0.7
# mozilla-django-oidc
# pyopenssl
css-inline==0.13.0
# via -r requirements/base.in
# via
# -r requirements/base.in
# mail-editor
cssselect2==0.4.1
# via
# svglib
Expand All @@ -77,6 +79,7 @@ diff-match-patch==20200713
django==3.2.23
# via
# -r requirements/base.in
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -120,7 +123,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via -r requirements/base.in
django-appconf==1.0.5
# via
Expand Down Expand Up @@ -298,7 +301,9 @@ face==20.1.1
fontawesomefree==6.4.2
# via -r requirements/base.in
fonttools[woff]==4.29.1
# via weasyprint
# via
# fonttools
# weasyprint
furl==2.1.3
# via
# -r requirements/base.in
Expand Down Expand Up @@ -341,6 +346,7 @@ lockfile==0.12.2
lxml==4.9.1
# via
# django-digid-eherkenning
# mail-editor
# maykin-python3-saml
# svglib
# xmlsec
Expand Down Expand Up @@ -453,6 +459,7 @@ requests==2.31.0
# django-open-forms-client
# django-rosetta
# gemma-zds-client
# mail-editor
# maykin-python3-saml
# messagebird
# mozilla-django-oidc
Expand Down Expand Up @@ -481,7 +488,9 @@ sqlparse==0.4.4
svglib==1.5.1
# via easy-thumbnails
tablib[html,ods,xls,xlsx,yaml]==3.1.0
# via django-import-export
# via
# django-import-export
# tablib
tinycss2==1.1.1
# via
# -r requirements/base.in
Expand Down
9 changes: 8 additions & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ css-inline==0.13.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
# mail-editor
cssselect==1.1.0
# via pyquery
cssselect2==0.4.1
Expand All @@ -148,6 +149,7 @@ django==3.2.23
# via
# -c requirements/base.txt
# -r requirements/base.txt
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -191,7 +193,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -472,6 +474,7 @@ easy-thumbnails[svg]==2.8.5
# -r requirements/base.txt
# django-filer
# djangocms-picture
# easy-thumbnails
ecs-logging==2.1.0
# via
# -c requirements/base.txt
Expand Down Expand Up @@ -515,6 +518,7 @@ fonttools[woff]==4.29.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# fonttools
# weasyprint
freezegun==1.1.0
# via -r requirements/test-tools.in
Expand Down Expand Up @@ -605,6 +609,7 @@ lxml==4.9.1
# -c requirements/base.txt
# -r requirements/base.txt
# django-digid-eherkenning
# mail-editor
# maykin-python3-saml
# pyquery
# svglib
Expand Down Expand Up @@ -834,6 +839,7 @@ requests==2.31.0
# django-open-forms-client
# django-rosetta
# gemma-zds-client
# mail-editor
# maykin-python3-saml
# messagebird
# mozilla-django-oidc
Expand Down Expand Up @@ -886,6 +892,7 @@ tablib[html,ods,xls,xlsx,yaml]==3.1.0
# -c requirements/base.txt
# -r requirements/base.txt
# django-import-export
# tablib
tblib==1.7.0
# via -r requirements/test-tools.in
text-unidecode==1.3
Expand Down
9 changes: 8 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ css-inline==0.13.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# mail-editor
cssselect==1.1.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -182,6 +183,7 @@ django==3.2.23
# -c requirements/ci.txt
# -r requirements/ci.txt
# ddt-api-calls
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -228,7 +230,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -521,6 +523,7 @@ easy-thumbnails[svg]==2.8.5
# -r requirements/ci.txt
# django-filer
# djangocms-picture
# easy-thumbnails
ecs-logging==2.1.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -580,6 +583,7 @@ fonttools[woff]==4.29.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# fonttools
# weasyprint
freezegun==1.1.0
# via
Expand Down Expand Up @@ -699,6 +703,7 @@ lxml==4.9.1
# -c requirements/ci.txt
# -r requirements/ci.txt
# django-digid-eherkenning
# mail-editor
# maykin-python3-saml
# pyquery
# svglib
Expand Down Expand Up @@ -974,6 +979,7 @@ requests==2.31.0
# django-rosetta
# gemma-zds-client
# locust
# mail-editor
# maykin-python3-saml
# messagebird
# mozilla-django-oidc
Expand Down Expand Up @@ -1059,6 +1065,7 @@ tablib[html,ods,xls,xlsx,yaml]==3.1.0
# -c requirements/ci.txt
# -r requirements/ci.txt
# django-import-export
# tablib
tblib==1.7.0
# via
# -c requirements/ci.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.23 on 2024-02-08 15:13

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("configurations", "0058_siteconfiguration_recipients_email_digest"),
]

operations = [
migrations.AlterModelOptions(
name="siteconfigurationpage",
options={
"ordering": ("order",),
"verbose_name": "Flatpage in the footer",
"verbose_name_plural": "Flatpages in the footer",
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 3.2.23 on 2024-02-15 14:01

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("configurations", "0059_alter_siteconfigurationpage_options"),
("configurations", "0061_merge_20240214_1308"),
]

operations = []
4 changes: 3 additions & 1 deletion src/open_inwoner/js/components/anchor-menu/scroll_to_top.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const mybutton = document.getElementById('scroll-anchor')
document.addEventListener(
'scroll',
(e) => {
if (
if (!mybutton) {
return
} else if (
document.body.scrollTop > 80 ||
document.documentElement.scrollTop > 80
) {
Expand Down
9 changes: 6 additions & 3 deletions src/open_inwoner/scss/admin/_admin_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ div.breadcrumbs {
color: $color_primary;
position: sticky;
top: 60px;
z-index: 100000;

a {
color: $color_dark;
Expand Down Expand Up @@ -101,9 +100,13 @@ div.breadcrumbs {
#content {
/* adjusting for django-cms page */
#changelist:not([class~='cms-pagetree-root']) {
display: grid;
grid-template-columns: 1fr 360px;
display: block;
grid-template-columns: 1fr 260px;
gap: 16px;

@media (min-width: 768px) {
display: grid;
}
}

#toolbar,
Expand Down
87 changes: 36 additions & 51 deletions src/open_inwoner/scss/admin/_app_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,57 @@
/**
* DJANGO ADMIN INDEX
*/

.dropdown-menu,
div#container .dropdown-menu {
/* Override for Environment banner */
top: 48px;
/* Added to attach body */
border-bottom: 8px solid $color_secondary;
body {
--djai-tab-bg: #{$color-primary}; // no fallback to default admin vars
--djai-tab-bg--active: #{$color-secondary};
--djai-tab-bg--hover: #{$color-primary-dark};
--djai-tab-fg--active: #{$color-primary};
--djai-dropdown-bg--active: var(--color-primary);
--djai-dropdown-bg--hover: #{$color-primary};
}

.breadcrumbs {
top: 48px !important;
}
$djai-padding: 40px;
$djai-padding--mobile: 15px;
$djai-padding--tablet: 30px;
$djai-border-width: 8px;

/* Integration into color scheme */
.dropdown-menu {
background-color: $color_primary;
.djai-dropdown-menu {
// use full width on mobile & tablet
width: 100%;

.dropdown-menu__item,
.dropdown-menu__item:link,
.dropdown-menu__item:visited {
color: $color_lightest;
& &__drop {
min-width: 250px !important;
}

&.dropdown-menu__item--active {
background-color: $color_secondary;
text-decoration: none;
color: $color_primary;
// remove the header padding on mobile and tablet
@at-root #header {
padding-bottom: 0 !important;

&:hover {
color: $color_lightest;
}
// remove the border height from the breadcrumbs padding
& + .breadcrumbs {
padding-top: 10px - $djai-border-width; // 10px is original django value
}

&:hover {
background-color: $color_primary_dark;
// overwrite admin '#header a:link' rule which is otherwise more specific
.djai-dropdown-menu .djai-dropdown-menu__item--active:link,
.djai-dropdown-menu .djai-dropdown-menu__item--active:visited {
color: var(--djai-tab-fg--active);

&:hover {
color: var(--djai-tab-fg--hover);
}
}
}

.dropdown-menu__drop {
background-color: $color_primary;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
/* Override for wider filer dropzone Taiga #359 */
.js-filer-dropzone {
min-width: 600px !important;
}

.dropdown-menu__link,
.dropdown-menu__link:link,
.dropdown-menu__link:visited {
color: $color_lightest;

&:hover {
background-color: $color_primary_dark;
}

&.dropdown-menu__link--active {
background-color: $color_primary_dark;
text-decoration: none;
}
@at-root body.login #header {
padding-bottom: 15px !important;
}
}
/* Override for wider dropdown */
.dropdown-menu .dropdown-menu__drop {
min-width: 250px;
}

/* Override for wider filer dropzone Taiga #359 */
.js-filer-dropzone {
min-width: 600px !important;
}

/**
* DJANGO-BETTER-ADMIN-ARRAYFIELD
Expand Down
1 change: 1 addition & 0 deletions src/open_inwoner/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from open_inwoner.pdc.views import FAQView

handler500 = "open_inwoner.utils.views.server_error"
admin.site.enable_nav_sidebar = False
admin.site.site_header = "Open Inwoner beheeromgeving"
admin.site.site_title = "Open Inwoner beheeromgeving"
admin.site.index_title = "Welkom op de OpenInwoner beheeromgeving"
Expand Down

0 comments on commit e29731f

Please sign in to comment.