From: yomguy Date: Thu, 14 Mar 2013 14:47:38 +0000 (+0100) Subject: add auto_period_access to collection, fix resource edit rights X-Git-Tag: 1.4.5~2^2~4^2~2^2~30 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=62372d1da66a9fdd1994ead6e5b0a93be70f1a60;p=telemeta.git add auto_period_access to collection, fix resource edit rights --- diff --git a/telemeta/models/media.py b/telemeta/models/media.py index 3a6c62a7..a5fd6cd2 100644 --- a/telemeta/models/media.py +++ b/telemeta/models/media.py @@ -214,8 +214,9 @@ class MediaCollection(MediaResource): booklet_author = CharField(_('author of published notice')) external_references = TextField(_('bibliographic references')) doctype_code = IntegerField(_('document type')) - public_access = CharField(_('public access'), choices=PUBLIC_ACCESS_CHOICES, + public_access = CharField(_('access status'), choices=PUBLIC_ACCESS_CHOICES, max_length=16, default="metadata") + auto_period_access = BooleanField(_('automatic access after a rolling period'), default=True) legal_rights = WeakForeignKey('LegalRight', related_name="collections", verbose_name=_('legal rights')) @@ -369,10 +370,11 @@ class MediaItem(MediaResource): # Legal mentions organization = WeakForeignKey('Organization', verbose_name=_('organization')) - public_access = CharField(_('public access'), choices=PUBLIC_ACCESS_CHOICES, + public_access = CharField(_('access status'), choices=PUBLIC_ACCESS_CHOICES, max_length=16, default="metadata") depositor = CharField(_('depositor')) rights = WeakForeignKey('Rights', verbose_name=_('rights')) + auto_period_access = BooleanField(_('automatic access after a rolling period'), default=True) # Archiving data code = CharField(_('code'), unique=True, blank=True) @@ -390,7 +392,6 @@ class MediaItem(MediaResource): copied_from_item = WeakForeignKey('self', related_name="copies", verbose_name=_('copy of')) mimetype = CharField(_('mime type'), max_length=255, blank=True) - auto_period_access = BooleanField(_('automatic access after a rolling period'), default=True) # Media file = FileField(_('file'), upload_to='items/%Y/%m/%d', diff --git a/telemeta/templates/telemeta/resource_detail.html b/telemeta/templates/telemeta/resource_detail.html index 286994b3..62dcdf3f 100644 --- a/telemeta/templates/telemeta/resource_detail.html +++ b/telemeta/templates/telemeta/resource_detail.html @@ -39,10 +39,12 @@ jQuery(document).ready(function(){ {% block title_buttons %}
- {% if perms.telemeta.add_mediacorpus or perms.telemeta.add_mediafonds %} + {% if perms.telemeta.change_mediacorpus or perms.telemeta.change_mediafonds %} {% trans "Edit" %} + {% endif %} + {% if perms.telemeta.add_mediacorpus or perms.telemeta.add_mediafonds %} {% trans "Copy" %} - {% endif %} + {% endif %} {% if user.is_authenticated %} {% trans "Add to playlist" %} {% endif %}