Skip to content

Commit 94989a0

Browse files
committed
Add custom css to workshop
1 parent 558f307 commit 94989a0

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.2.23 on 2026-04-29 17:53
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("core", "0009_clientsetting_account_signup_email_enter_twice"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="clientsetting",
14+
name="custom_css",
15+
field=models.TextField(
16+
blank=True,
17+
help_text="Add custom CSS workshop backend.",
18+
null=True,
19+
verbose_name="Custom CSS",
20+
),
21+
),
22+
]

bakeup/core/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ class ClientSetting(models.Model):
133133
account_email_verification = models.CharField(
134134
max_length=12, choices=ACCOUNT_EMAIL_VERIFICATION_CHOICES, default="optional"
135135
)
136+
custom_css = models.TextField(
137+
blank=True,
138+
null=True,
139+
verbose_name="Custom CSS",
140+
help_text="Add custom CSS workshop backend.",
141+
)
136142
account_signup_email_enter_twice = models.BooleanField(default=False)
137143
is_newsletter_enabled = models.BooleanField(default=False)
138144
wagtail_reference_index_ignore = True

bakeup/templates/workshop/base.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{% extends "base.html" %}
22
{% load i18n %}
33

4+
{% block theme %}
5+
{% if request.tenant.clientsetting.custom_css %}
6+
<style>
7+
{{ request.tenant.clientsetting.custom_css|safe }}
8+
</style>
9+
{% endif %}
10+
{% endblock %}
11+
412
{% block content %}
513
<div class="container-fluid">
614
<div class="row flex-nowrap">

bakeup/templates/workshop/productionday_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="mt-4">{% trans "Summary" %}
6161

6262
<a href="{% url 'workshop:production-plans-finish' production_day=object.pk %}?next={{ object.get_absolute_url }}" class="btn{% if not has_plans_to_finish %} disabled{% endif %} btn-success btn-sm d-print-none btn-sm float-end me-2"{% if not has_plans_to_finish %} aria-disabled="true"{% endif %}>{% trans "Finish all" %}</a>
6363
<a href="{% url 'workshop:production-plans-start' production_day=object.pk %}?next={{ object.get_absolute_url }}" class="btn{% if not has_plans_to_start %} disabled{% endif %} btn-warning btn-sm d-print-none btn-sm float-end me-2"{% if not has_plans_to_start %} aria-disabled="true"{% endif %}>{% trans "Start all" %}</a>
64-
<a href="{% url 'workshop:production-day-order-max-quantities' pk=object.pk %}?next={{ object.get_absolute_url }}" class="btn{% if not has_plans_to_start %} disabled{% endif %} btn-primary btn-sm d-print-none btn-sm float-end me-2"{% if not has_plans_to_start %} aria-disabled="true"{% endif %}>{% trans "Order max. quantities" %}</a>
64+
<a href="{% url 'workshop:production-day-order-max-quantities' pk=object.pk %}?next={{ object.get_absolute_url }}" id="btn-order-max-qty" class="btn{% if not has_plans_to_start %} disabled{% endif %} btn-primary btn-sm d-print-none btn-sm float-end me-2"{% if not has_plans_to_start %} aria-disabled="true"{% endif %}>{% trans "Order max. quantities" %}</a>
6565
</h2>
6666
<table class="table table-white table-hover">
6767
<thead>

0 commit comments

Comments
 (0)