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 %} + + + + + + + + + + + {% block title %}{% endblock %} + - La Chariotte + {% block css %} + + + {% block extra_css %} + {% endblock extra_css %} + {% endblock css %} + + + +
+ + + +
+
+
+ {% block content %}{% endblock %} +
+
+
+
+ + + + diff --git a/la_chariotte/themes/light/templates/dashboard.html b/la_chariotte/themes/light/templates/dashboard.html new file mode 100644 index 0000000..b74303d --- /dev/null +++ b/la_chariotte/themes/light/templates/dashboard.html @@ -0,0 +1,60 @@ +{% extends 'base.html' %} + +{% block title %}Tableau de bord{% endblock %} +{% block content_column_class%}is-10{% endblock %} + +{% block content %} +{% load static %} + +

+ {% block content_title %}{% endblock %} +

+{% if user.is_authenticated %} +
+ + Mes commandes groupées + +
+{% else %} +
+
+
+

La Chariotte, gestion de commandes groupées

+ +
+
+
+{% endif %} +
+
+
+

Rejoindre une commande groupée

+
+ {% csrf_token %} + {% for error in form.code.errors %} +

{{ error }}

+ {% endfor %} +
+
+ +
+
+ +
+
+
+
+
+
+{% endblock %} + diff --git a/la_chariotte/themes/light/templates/help/about_chariotte.html b/la_chariotte/themes/light/templates/help/about_chariotte.html new file mode 120000 index 0000000..9af646e --- /dev/null +++ b/la_chariotte/themes/light/templates/help/about_chariotte.html @@ -0,0 +1 @@ +../../../default/templates/help/about_chariotte.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/help/faq.html b/la_chariotte/themes/light/templates/help/faq.html new file mode 120000 index 0000000..cf7929e --- /dev/null +++ b/la_chariotte/themes/light/templates/help/faq.html @@ -0,0 +1 @@ +../../../default/templates/help/faq.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/help/legal_notice.html b/la_chariotte/themes/light/templates/help/legal_notice.html new file mode 120000 index 0000000..fa44b2c --- /dev/null +++ b/la_chariotte/themes/light/templates/help/legal_notice.html @@ -0,0 +1 @@ +../../../default/templates/help/legal_notice.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/help/notice.html b/la_chariotte/themes/light/templates/help/notice.html new file mode 120000 index 0000000..1c3c4af --- /dev/null +++ b/la_chariotte/themes/light/templates/help/notice.html @@ -0,0 +1 @@ +../../../default/templates/help/notice.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/mail b/la_chariotte/themes/light/templates/mail new file mode 120000 index 0000000..88efcbf --- /dev/null +++ b/la_chariotte/themes/light/templates/mail @@ -0,0 +1 @@ +../../default/templates/mail \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_add_items.html b/la_chariotte/themes/light/templates/order/grouped_order_add_items.html new file mode 120000 index 0000000..8086f5c --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_add_items.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_add_items.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_confirm_delete.html b/la_chariotte/themes/light/templates/order/grouped_order_confirm_delete.html new file mode 120000 index 0000000..1499f2e --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_confirm_delete.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_confirm_delete.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_create.html b/la_chariotte/themes/light/templates/order/grouped_order_create.html new file mode 120000 index 0000000..aa25035 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_create.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_create.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_detail.html b/la_chariotte/themes/light/templates/order/grouped_order_detail.html new file mode 120000 index 0000000..1099983 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_detail.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_detail.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_overview.html b/la_chariotte/themes/light/templates/order/grouped_order_overview.html new file mode 100644 index 0000000..4a4352e --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_overview.html @@ -0,0 +1,421 @@ +{% extends 'base.html' %} +{% load crispy_forms_tags %} + +{% block title %}{{ grouped_order }} - Gestion{% endblock %} + +{% block content %} +

+ {% block content_title %}{{ grouped_order }} : gestion de la commande{% endblock %} +

+
+ + Retour à la page de commande + + + Mes commandes + +
+
+
+
+

{{ grouped_order }}

+ {% if grouped_order.description %}

{{ grouped_order.description }}

{% endif %} +
+
+ {% if grouped_order.place %} +

{{ grouped_order.place }}

+ {% endif %} +

+ Commandes avant le {{ grouped_order.deadline|date:'d M Y' }} à {{ grouped_order.deadline|date:'H:i' }} +

+

+ Livraison le {{ grouped_order.delivery_date }}{% if grouped_order.delivery_slot %}, {{ grouped_order.delivery_slot }}{% endif %} +

+
+
+ {% if not grouped_order.is_to_be_delivered %} +

+ Cette commande groupée est terminée, la livraison a eu lieu le {{ grouped_order.deadline }}. +

+ {% elif not grouped_order.is_open %} +

+ La période de commande est terminée depuis le {{ grouped_order.deadline }}. + Vous pouvez préparer la livraison, qui aura lieu le {{ grouped_order.delivery_date }} ! +

+ {% else %} +

Code de la commande : {{ grouped_order.code }}

+ {% endif %} +
+ {% if grouped_order.is_to_be_delivered and grouped_order.is_open %} + + + {% endif %} + + Supprimer la commande + +
+
+ +
+ +
+ +
+

Paramètres de la commande groupée

+
+
{% csrf_token %} + {{ grouped_order_form | crispy }} +
+ Annuler + +
+
+
+
+ +
+

Ajouter un produit

+ + + + + + + + + + + + + {% csrf_token %} + + + + + + + +
NomPrixQuantité (optionnel)Action
+

Produits commandés

+ {% if grouped_order.item_set.all %} + + + + + + + + + + + + + {% for item in grouped_order.item_set.all %} + + + + + + + + + + {% endfor %} + + + + + + + +
ProduitPrix unitaireCommandéDisponibleTotalAction
{{ item.name }}{{ item.price }} €{{ item.ordered_nb }}{{ item.max_limit }}{{ item.get_total_price }} € + +
Total{{ total_ordered_items }}{{ grouped_order.total_price }} € +
+ {% else %} +

Vous n'avez pas ajouté de produits à cette commande groupée. Ajoutez-en ici

+ {% endif %} +
+ +
+

Export des contacts

+
+ + Emails en CSV + + + + Copier les emails + +
+

Export des commandes

+
+ + Commandes en PDF + + + Commandes en CSV + +
+

Détail des commandes

+ {% if grouped_order.order_set.all %} + + + + + + + + + + + {% for order in grouped_order.order_set.all %} + + + + + + + + + + + + + {% endfor %} + + + + + + + + +
Participant·eMontantContactAction
{{ order.author }}{{ order.price }} €{{ order.author.email }}{% if order.author.phone %} / {{ order.author.phone }}{% endif %} + + {% if order.note %} + + {% else %} + + {% endif %} + +
Total{{ grouped_order.total_price }} €
+ {% else %} +

Personne n'a encore commandé. Partagez l'info à votre entourage !

+ {% endif %} +
+ {% endblock %} + + diff --git a/la_chariotte/themes/light/templates/order/grouped_order_sheet.html b/la_chariotte/themes/light/templates/order/grouped_order_sheet.html new file mode 120000 index 0000000..2b1a047 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_sheet.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_sheet.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/grouped_order_update.html b/la_chariotte/themes/light/templates/order/grouped_order_update.html new file mode 120000 index 0000000..bfb9da5 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/grouped_order_update.html @@ -0,0 +1 @@ +../../../default/templates/order/grouped_order_update.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/index.html b/la_chariotte/themes/light/templates/order/index.html new file mode 120000 index 0000000..a40b603 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/index.html @@ -0,0 +1 @@ +../../../default/templates/order/index.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/order/order_detail.html b/la_chariotte/themes/light/templates/order/order_detail.html new file mode 120000 index 0000000..d03eeb9 --- /dev/null +++ b/la_chariotte/themes/light/templates/order/order_detail.html @@ -0,0 +1 @@ +../../../default/templates/order/order_detail.html \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/registration b/la_chariotte/themes/light/templates/registration new file mode 120000 index 0000000..2e96b64 --- /dev/null +++ b/la_chariotte/themes/light/templates/registration @@ -0,0 +1 @@ +../../default/templates/registration \ No newline at end of file diff --git a/la_chariotte/themes/light/templates/warning_grouped_order_creation.html b/la_chariotte/themes/light/templates/warning_grouped_order_creation.html new file mode 120000 index 0000000..51801b0 --- /dev/null +++ b/la_chariotte/themes/light/templates/warning_grouped_order_creation.html @@ -0,0 +1 @@ +../../default/templates/warning_grouped_order_creation.html \ No newline at end of file