summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 0c22b8e7f..e749580f4 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -67,7 +67,7 @@ from simple_history.signals import (
from ishtar_common.data_importer import post_importer_action, ImporterError
from ishtar_common.model_managers import TypeManager
from ishtar_common.model_merging import merge_model_objects
-from ishtar_common.models_imports import Import
+from ishtar_common.models_imports import Import, MediaExporter
from ishtar_common.templatetags.link_to_window import simple_link_to_window
from ishtar_common.utils import (
cached_label_changed,
@@ -854,7 +854,19 @@ class TemplateItem:
for template in q.all():
urlname = "generate-document"
templates.append(
- (template.name, reverse(urlname, args=[template.slug, self.pk]))
+ (template.name, reverse(urlname, args=[template.slug, self.pk]),
+ template.get_icon())
+ )
+ templates += self.get_media_exporters(request)
+ return templates
+
+ def get_media_exporters(self, request):
+ templates = []
+ for media_exporter in MediaExporter.get_available(self.__class__, request):
+ templates.append(
+ (media_exporter.name,
+ reverse("export-media", args=[media_exporter.slug, self.pk]),
+ "fa fa-file-archive-o")
)
return templates