diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-06-17 18:06:46 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-06-17 18:06:46 +0200 |
commit | fc0e811f9f5042fe72b91db4548142f5f2d4e1df (patch) | |
tree | 30adfd1fabc9b9aec7003b71d723a800606b0dfa /ishtar_common/models.py | |
parent | fb1046c52552461a2d8dd9db5f73747eb3da51e6 (diff) | |
download | Ishtar-fc0e811f9f5042fe72b91db4548142f5f2d4e1df.tar.bz2 Ishtar-fc0e811f9f5042fe72b91db4548142f5f2d4e1df.zip |
✨ Media exporter: export action
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 579c3c644..11ac75876 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2132,6 +2132,13 @@ if settings.USE_LIBREOFFICE: ("xlsx", _("XLSX")), ] +EXPORT_FORMATS_ICONS = { + "docx": "fa fa-file-word-o", + "html": "fa fa-code", + "pdf": "fa fa-file-pdf-o", + "xlsx": "fa fa-file-excel-o", +} + EXPORT_FORMATS_DICT = dict(EXPORT_FORMATS) @@ -2187,6 +2194,11 @@ class DocumentTemplate(models.Model): def __str__(self): return self.name + def get_icon(self): + if not self.export_format or self.export_format not in EXPORT_FORMATS_ICONS: + return "fa fa-file-text-o" + return EXPORT_FORMATS_ICONS[self.export_format] + def natural_key(self): return (self.slug,) |