From d3c0947fa5f82b85c19cdd5a4996ad85c125a852 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Mon, 14 Apr 2025 18:49:21 -0400 Subject: [PATCH] feat: implement a design system for UI consistency --- umap/templates/umap/design_system.html | 140 +++++++++++++++++++++++++ umap/urls.py | 1 + umap/views.py | 7 ++ 3 files changed, 148 insertions(+) create mode 100644 umap/templates/umap/design_system.html diff --git a/umap/templates/umap/design_system.html b/umap/templates/umap/design_system.html new file mode 100644 index 00000000..0d580dce --- /dev/null +++ b/umap/templates/umap/design_system.html @@ -0,0 +1,140 @@ +{% extends "umap/content.html" %} + +{% load umap_tags i18n %} + +{% block messages %} + {# We don't want to display errors (yet?). #} +{% endblock messages %} + +{% block extra_head %} + {{ block.super }} + +{% endblock extra_head %} + +{% block maincontent %} +
+

uMap Design System

+
+

Forms

+

Copiable link

+
+ +
+

Toggle

+
+ +
+

Multiple choice

+
+ +
+ + + +
+
+

Select

+
+ + +
+

You want it darker…

+
+

Titre avec icône

+ +
+ Options d'interface +
+
+
+ + +
+
+ +
+ + + +
+
+
+ + +
+
+
+
+
+ Actions avancées +
+
+ + + + + +
+
+
+
+

Colors

+
+
+
+{% endblock maincontent %} +{% block bottom_js %} + {{ block.super }} + +{% endblock bottom_js %} diff --git a/umap/urls.py b/umap/urls.py index 5287d9c9..46ed4b5f 100644 --- a/umap/urls.py +++ b/umap/urls.py @@ -205,6 +205,7 @@ urlpatterns += i18n_patterns( ) urlpatterns += ( path("stats/", cache_page(60 * 60)(views.stats), name="stats"), + path("design_system/", views.design_system, name="design_system"), path( "favicon.ico", cache_control(max_age=60 * 60 * 24, immutable=True, public=True)( diff --git a/umap/views.py b/umap/views.py index e9f9163d..d2b08e63 100644 --- a/umap/views.py +++ b/umap/views.py @@ -1410,6 +1410,13 @@ def stats(request): ) +class DesignSystem(TemplateView): + template_name = "umap/design_system.html" + + +design_system = DesignSystem.as_view() + + @require_GET @cache_control(max_age=60 * 60 * 24, immutable=True, public=True) # One day. def webmanifest(request):