diff options
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index ddee0f6cc..1e8876e66 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -26,6 +26,7 @@ from django.contrib.postgres.indexes import GinIndex from django.core.cache import cache from django.db.models import Q, Count, Sum from django.db.models.signals import post_save, m2m_changed, post_delete +from django.core.urlresolvers import reverse from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy from ishtar_common.utils import cached_label_changed, get_cache, \ @@ -706,6 +707,17 @@ class File(ClosedItem, DocumentItem, BaseHistorizedItem, CompleteIdentifierItem, self.general_contractor.save() return True + def get_extra_actions(self, request): + # url, base_text, icon, extra_text, extra css class, is a quick action + actions = super(File, self).get_extra_actions(request) + if self.can_do(request, 'add_administrativeact'): + actions += [ + (reverse('file-add-adminact', args=[self.pk]), + _("Add associated administrative act"), "fa fa-plus", + _("admin. act"), "", False), + ] + return actions + def save(self, *args, **kwargs): returned = super(File, self).save(*args, **kwargs) if not getattr(self, '_no_new_add', None) and self.main_town and \ |