]> git.parisson.com Git - telemeta.git/commitdiff
add auto_period_access to collection, fix resource edit rights
authoryomguy <yomguy@parisson.com>
Thu, 14 Mar 2013 14:47:38 +0000 (15:47 +0100)
committeryomguy <yomguy@parisson.com>
Thu, 14 Mar 2013 14:47:38 +0000 (15:47 +0100)
telemeta/models/media.py
telemeta/templates/telemeta/resource_detail.html

index 3a6c62a782c2b7411d8ec4c304a2631e4a50e474..a5fd6cd2a4e55d2cb6ffd585e370e8a9ca2f10c5 100644 (file)
@@ -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',
index 286994b3ca6bb78e7c344c08ecc37beac31cbf63..62dcdf3f0cc7848dc6e40e84d5f25392a820a317 100644 (file)
@@ -39,10 +39,12 @@ jQuery(document).ready(function(){
 
 {% block title_buttons %}
   <div class="fixedWidthAsPlayer">
-    {% if perms.telemeta.add_mediacorpus or perms.telemeta.add_mediafonds %}
+    {% if perms.telemeta.change_mediacorpus or perms.telemeta.change_mediafonds %}
       <a href="{% url telemeta-resource-edit type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+    {% endif %}
+    {% if perms.telemeta.add_mediacorpus or perms.telemeta.add_mediafonds %}
       <a href="{% url telemeta-resource-copy type resource.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
-     {% endif %}
+    {% endif %}
     {% if user.is_authenticated %}
     <a href="#" id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
     {% endif %}