diff --git a/docs/install.md b/docs/install.md index 32bf2dd..57977bc 100644 --- a/docs/install.md +++ b/docs/install.md @@ -94,6 +94,8 @@ DATABASES = { Everything should now be ready to start the server: ```shell +python manage.py compilescss +python manage.py collectstatic python manage.py migrate --settings=local_settings python manage.py runserver --settings=local_settings ``` @@ -112,3 +114,14 @@ pip install sendria sendria --db mails.sqlite $NAVIGATOR http://127.0.0.1:1080 ``` + +## Using a custom theme + +Themes are provided in the `la_chariotte/themes` folder. The `default` theme is enabled by default, but the `CHARIOTTE_THEME` setting and environment variable allows you to change that. Another `light` theme is provided in the repository for you to try, but you can make your own. + +After changing the setting or environment variable: + +- delete the `static` folder at the repository root +- run `python manage.py compilescss` +- run `python manage.py collectstatic` +- restart the server diff --git a/la_chariotte/themes/light/__init__.py b/la_chariotte/themes/light/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/la_chariotte/themes/light/settings.py b/la_chariotte/themes/light/settings.py new file mode 100644 index 0000000..d1c7341 --- /dev/null +++ b/la_chariotte/themes/light/settings.py @@ -0,0 +1,31 @@ +# The theme may want to specify which URL a successful form should redirect to +def success_url(view): + from django.urls import reverse + + from la_chariotte.order import views + + if type(view) == views.grouped_order.GroupedOrderOverview: + return reverse( + "order:grouped_order_overview", kwargs={"code": view.object.code} + ) + elif type(view) == views.grouped_order.GroupedOrderCreateView: + return reverse( + "order:grouped_order_overview", kwargs={"code": view.object.code} + ) + elif type(view) == views.grouped_order.GroupedOrderUpdateView: + return reverse( + "order:grouped_order_overview", kwargs={"code": view.object.code} + ) + elif type(view) == views.item.ItemCreateView: + return reverse( + "order:grouped_order_overview", + kwargs={"code": view.object.grouped_order.code}, + ) + elif type(view) == views.item.ItemDeleteView: + return reverse( + "order:grouped_order_overview", + kwargs={"code": view.object.grouped_order.code}, + ) + + # No more form success URLs to overwrite + return None diff --git a/la_chariotte/themes/light/static/fork-awesome b/la_chariotte/themes/light/static/fork-awesome new file mode 120000 index 0000000..428f0fe --- /dev/null +++ b/la_chariotte/themes/light/static/fork-awesome @@ -0,0 +1 @@ +../../default/static/fork-awesome \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/contributeureuses.png b/la_chariotte/themes/light/static/img/contributeureuses.png new file mode 120000 index 0000000..62da298 --- /dev/null +++ b/la_chariotte/themes/light/static/img/contributeureuses.png @@ -0,0 +1 @@ +../../../default/static/img/contributeureuses.png \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/icons b/la_chariotte/themes/light/static/img/icons new file mode 120000 index 0000000..e1420ae --- /dev/null +++ b/la_chariotte/themes/light/static/img/icons @@ -0,0 +1 @@ +../../../default/static/img/icons \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.png b/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.png new file mode 100644 index 0000000..2b1b0a4 Binary files /dev/null and b/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.png differ diff --git a/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.svg b/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.svg new file mode 100644 index 0000000..341c452 --- /dev/null +++ b/la_chariotte/themes/light/static/img/logos/logo_chariotte_horizontal.svg @@ -0,0 +1,49 @@ + + + + diff --git a/la_chariotte/themes/light/static/img/logos/logo_hashbang.png b/la_chariotte/themes/light/static/img/logos/logo_hashbang.png new file mode 120000 index 0000000..ef67c5b --- /dev/null +++ b/la_chariotte/themes/light/static/img/logos/logo_hashbang.png @@ -0,0 +1 @@ +../../../../default/static/img/logos/logo_hashbang.png \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/logos/logo_la_chariotte.png b/la_chariotte/themes/light/static/img/logos/logo_la_chariotte.png new file mode 120000 index 0000000..865bb19 --- /dev/null +++ b/la_chariotte/themes/light/static/img/logos/logo_la_chariotte.png @@ -0,0 +1 @@ +../../../../default/static/img/logos/logo_la_chariotte.png \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/notice b/la_chariotte/themes/light/static/img/notice new file mode 120000 index 0000000..83a6ba4 --- /dev/null +++ b/la_chariotte/themes/light/static/img/notice @@ -0,0 +1 @@ +../../../default/static/img/notice \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/notice_1.jpg b/la_chariotte/themes/light/static/img/notice_1.jpg new file mode 120000 index 0000000..2ae3683 --- /dev/null +++ b/la_chariotte/themes/light/static/img/notice_1.jpg @@ -0,0 +1 @@ +../../../default/static/img/notice_1.jpg \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/notice_2.jpg b/la_chariotte/themes/light/static/img/notice_2.jpg new file mode 120000 index 0000000..d6da911 --- /dev/null +++ b/la_chariotte/themes/light/static/img/notice_2.jpg @@ -0,0 +1 @@ +../../../default/static/img/notice_2.jpg \ No newline at end of file diff --git a/la_chariotte/themes/light/static/img/notice_3.jpg b/la_chariotte/themes/light/static/img/notice_3.jpg new file mode 120000 index 0000000..e8ee20d --- /dev/null +++ b/la_chariotte/themes/light/static/img/notice_3.jpg @@ -0,0 +1 @@ +../../../default/static/img/notice_3.jpg \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_accordion.sass b/la_chariotte/themes/light/static/sass/base/_accordion.sass new file mode 120000 index 0000000..1572441 --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_accordion.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_accordion.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_content.sass b/la_chariotte/themes/light/static/sass/base/_content.sass new file mode 100644 index 0000000..2c9aea2 --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_content.sass @@ -0,0 +1,14 @@ +@media screen and (min-width: $min-desktop) + .content + margin: $base + +@media screen and (max-width: $max-tablet) + .content + margin: $small + +.formatted-text + white-space: pre-wrap + +img.notice-img + border: $info 3px solid + margin-bottom: 1em diff --git a/la_chariotte/themes/light/static/sass/base/_footer.sass b/la_chariotte/themes/light/static/sass/base/_footer.sass new file mode 120000 index 0000000..3510c2d --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_footer.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_footer.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_form.sass b/la_chariotte/themes/light/static/sass/base/_form.sass new file mode 120000 index 0000000..846686b --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_form.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_form.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_global.sass b/la_chariotte/themes/light/static/sass/base/_global.sass new file mode 120000 index 0000000..6c83551 --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_global.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_global.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_navbar.sass b/la_chariotte/themes/light/static/sass/base/_navbar.sass new file mode 100644 index 0000000..e8b93fa --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_navbar.sass @@ -0,0 +1,40 @@ +// Desktop +@media screen and (min-width: $min-desktop) + .navbar.side-nav + right: inherit + height: 100vh + width: $side-nav-width + padding: 20px 10px + + .side-nav + &.navbar, .navbar-brand, .navbar-menu, .navbar-start + flex-direction: column + overflow-y: auto + + .navbar-brand .navbar-item + padding: 0 3px 15px 3px + img + max-height: 150px + + .navbar.top-nav + border-bottom: $beige 1px solid + + .desktop-hidden + display: none + +// Mobile +@media screen and (max-width: $max-tablet) + .navbar.side-nav + .navbar-brand .navbar-item + padding-top: 3px + padding-bottom: 3px + img + max-height: 46px + .navbar-menu.is-active + padding: 10px 10px + +// Global +a.navbar-item:hover + color: $bright-black + background-color: $beige + border-radius: $border-radius diff --git a/la_chariotte/themes/light/static/sass/base/_table.sass b/la_chariotte/themes/light/static/sass/base/_table.sass new file mode 120000 index 0000000..5b903fc --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_table.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_table.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_tabs.sass b/la_chariotte/themes/light/static/sass/base/_tabs.sass new file mode 120000 index 0000000..568177c --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_tabs.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_tabs.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_titles.sass b/la_chariotte/themes/light/static/sass/base/_titles.sass new file mode 120000 index 0000000..e846aa3 --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_titles.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_titles.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/base/_variables.sass b/la_chariotte/themes/light/static/sass/base/_variables.sass new file mode 120000 index 0000000..651c2de --- /dev/null +++ b/la_chariotte/themes/light/static/sass/base/_variables.sass @@ -0,0 +1 @@ +../../../../default/static/sass/base/./_variables.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/static/sass/style.sass b/la_chariotte/themes/light/static/sass/style.sass new file mode 120000 index 0000000..ea20aa0 --- /dev/null +++ b/la_chariotte/themes/light/static/sass/style.sass @@ -0,0 +1 @@ +../../../default/static/sass/style.sass \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/base.html b/la_chariotte/themes/light/templates/base.html new file mode 100644 index 0000000..15a57cd --- /dev/null +++ b/la_chariotte/themes/light/templates/base.html @@ -0,0 +1,176 @@ +{% load static %} +{% load settings %} +{% load sass_tags %} + + +
+ + + + + + +