flows: allow uploading of custom flow backgrounds, update default flow background

This commit is contained in:
Jens Langhammer
2020-12-02 14:24:24 +01:00
parent 821458373d
commit cc5a0c23aa
12 changed files with 97 additions and 25 deletions

View File

@ -92,11 +92,27 @@ class Flow(SerializerModel, PolicyBindingModel):
flow_uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4)
name = models.TextField()
slug = models.SlugField(unique=True)
slug = models.SlugField(unique=True, help_text=_("Visible in the URL."))
title = models.TextField()
title = models.TextField(help_text=_("Shown as the Title in Flow pages."))
designation = models.CharField(max_length=100, choices=FlowDesignation.choices)
designation = models.CharField(
max_length=100,
choices=FlowDesignation.choices,
help_text=_(
(
"Decides what this Flow is used for. For example, the Authentication flow "
"is redirect to when an un-authenticated user visits passbook."
)
),
)
background = models.FileField(
upload_to="flow-backgrounds/",
default="../static/dist/assets/images/flow_background.jpg",
blank=True,
help_text=_("Background shown during execution"),
)
stages = models.ManyToManyField(Stage, through="FlowStageBinding", blank=True)