major styling additions & refinements; offloaded navbar from base.html into its own partial, core/_partials/_navbar.html, alongside new _footer.html; 0006 dash migrations fix 0003 & 0005 theme-switcher handling and rename more fluidly to palette; added remaining realm-swatches to palette applet choices & updated test_views accordingly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -4,7 +4,7 @@ from django.db import migrations
|
||||
def seed_applets(apps, schema_editor):
|
||||
Applet = apps.get_model("dashboard", "Applet")
|
||||
Applet.objects.get_or_create(slug="username", defaults={"name": "Username"})
|
||||
Applet.objects.get_or_create(slug="palette", defaults={"name": "Palette"})
|
||||
Applet.objects.get_or_create(slug="theme-switcher", defaults={"name": "Theme Switcher"})
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -3,7 +3,7 @@ from django.db import migrations
|
||||
|
||||
def set_grid_defaults(apps, schema_editor):
|
||||
Applet = apps.get_model("dashboard", "Applet")
|
||||
Applet.objects.filter(slug__in=["username", "palette"]).update(grid_cols=6, grid_rows=3)
|
||||
Applet.objects.filter(slug__in=["username", "theme-switcher"]).update(grid_cols=6, grid_rows=3)
|
||||
Applet.objects.get_or_create(slug="new-list", defaults={"name": "New List", "grid_cols": 9, "grid_rows": 3})
|
||||
Applet.objects.get_or_create(slug="my-lists", defaults={"name": "My Lists", "grid_cols": 3, "grid_rows": 3})
|
||||
|
||||
|
||||
18
src/apps/dashboard/migrations/0006_rename_theme_switcher.py
Normal file
18
src/apps/dashboard/migrations/0006_rename_theme_switcher.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename_theme_switcher(apps, schema_editor):
|
||||
Applet = apps.get_model("dashboard", "Applet")
|
||||
Applet.objects.filter(slug="theme-switcher").update(
|
||||
slug="palette", name="Palette", grid_cols=6, grid_rows=3
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("dashboard", "0005_set_applet_grid_defaults"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(rename_theme_switcher, migrations.RunPython.noop),
|
||||
]
|
||||
@@ -2,8 +2,29 @@
|
||||
const initialize = (inputSelector) => {
|
||||
// console.log("initialize called!");
|
||||
const textInput = document.querySelector(inputSelector);
|
||||
if (!textInput) return;
|
||||
textInput.oninput = () => {
|
||||
// console.log("oninput triggered");
|
||||
textInput.classList.remove("is-invalid");
|
||||
};
|
||||
};
|
||||
|
||||
const initGearMenu = () => {
|
||||
const gear = document.getElementById('id_dash_gear');
|
||||
if (!gear) return;
|
||||
|
||||
gear.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
const menu = document.getElementById('id_applet_menu');
|
||||
if (!menu) return;
|
||||
menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
|
||||
});
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
const menu = document.getElementById('id_applet_menu');
|
||||
if (!menu || menu.style.display === 'none') return;
|
||||
if (e.target.closest('#id_applet_menu_cancel') || !menu.contains(e.target)) {
|
||||
menu.style.display = 'none';
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -313,7 +313,8 @@ class SetPaletteTest(TestCase):
|
||||
response = self.client.get(self.url)
|
||||
parsed = lxml.html.fromstring(response.content)
|
||||
locked = parsed.cssselect(".swatch.locked")
|
||||
self.assertEqual(len(locked), 2)
|
||||
expected_locked = [p for p in response.context["palettes"] if p["locked"]]
|
||||
self.assertEqual(len(locked), len(expected_locked))
|
||||
# they mustn't be button els
|
||||
for swatch in locked:
|
||||
self.assertNotEqual(swatch.tag, "button")
|
||||
|
||||
@@ -15,6 +15,9 @@ PALETTES = [
|
||||
{"name": "palette-default", "label": "Earthman", "locked": False},
|
||||
{"name": "palette-nirvana", "label": "Nirvana", "locked": True},
|
||||
{"name": "palette-sheol", "label": "Sheol", "locked": True},
|
||||
{"name": "palette-inferno", "label": "Inferno", "locked": True},
|
||||
{"name": "palette-terrestre", "label": "Terrestre", "locked": True},
|
||||
{"name": "palette-celestia", "label": "Celestia", "locked": True},
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user