summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index d4ea72dea..420670ca1 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -38,6 +38,7 @@ import time
from io import BytesIO
from subprocess import Popen, PIPE
from PIL import Image
+from markdown import markdown
from ooopy.OOoPy import OOoPy
from ooopy.Transformer import Transformer as OOTransformer
import ooopy.Transforms as OOTransforms
@@ -1036,6 +1037,8 @@ class IshtarSiteProfile(models.Model, Cached):
description = models.TextField(_("Description"), blank=True, default="")
warning_name = models.TextField(_("Warning name"), blank=True, default="")
warning_message = models.TextField(_("Warning message"), blank=True, default="")
+ footer = models.TextField(_("Footer text"), default="", blank=True,
+ help_text=_("You can use markdown syntax."))
delete_image_zip_on_archive = models.BooleanField(
_("Import - Delete image/document zip on archive"), default=False
)
@@ -1563,6 +1566,12 @@ class IshtarSiteProfile(models.Model, Cached):
return str(dict(SITE_LABELS)[self.archaeological_site_label])
return str(TRANSLATED_SITE_LABELS[self.archaeological_site_label][key])
+ @property
+ def rendered_footer(self):
+ if not self.footer:
+ return ""
+ return markdown(self.footer)
+
def save(self, *args, **kwargs):
raw = False
if "raw" in kwargs:
@@ -1628,6 +1637,8 @@ class CustomForm(models.Model):
"fields may lead to database errors."
),
)
+ header = models.TextField(_("Header text"), default="", blank=True,
+ help_text=_("You can use markdown syntax."))
apply_to_all = models.BooleanField(
_("Apply to all"),
default=False,