Commit e88e44d0 authored by Yann Voté's avatar Yann Voté
Browse files

Use PrimaryTab for ArchiveUnit management

Instead of SubObjectsTab.

But since each item in the tab is related to an ArchiveUnit sequence (and not
directly to an ArchiveUnit), we must override entity_call() to actually work on
the sequence.
parent bd0c14b3606a
......@@ -4016,24 +4016,12 @@ msgctxt "SEDAArchiveTransfer"
msgid "container_object"
msgstr ""
#, python-format
msgid ""
"creating SEDAAccessRule (SEDAAccessRule seda_access_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAAddressee (SEDAAddressee seda_addressee_from SEDAContent "
"%(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAAppraisalRule (SEDAAppraisalRule seda_appraisal_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAArchiveUnit (SEDAArchiveUnit seda_archive_unit "
......@@ -4052,13 +4040,6 @@ msgid ""
"SEDAArchiveTransfer %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAClassificationRule (SEDAClassificationRule "
"seda_classification_rule SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAContent (SEDAContent seda_content "
......@@ -4072,13 +4053,6 @@ msgid ""
"%(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDADisseminationRule (SEDADisseminationRule "
"seda_dissemination_rule SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr ""
#, python-format
msgid "creating SEDAEvent (SEDAEvent seda_event SEDAContent %(linkto)s)"
msgstr ""
......@@ -4104,13 +4078,6 @@ msgstr ""
msgid "creating SEDAKeyword (SEDAKeyword seda_keyword SEDAContent %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDANeedAuthorization (SEDANeedAuthorization "
"seda_need_authorization SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAPhysicalDataObject (SEDAPhysicalDataObject "
......@@ -4139,22 +4106,10 @@ msgid ""
"creating SEDARequires (SEDARequires seda_requires SEDAContent %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAReuseRule (SEDAReuseRule seda_reuse_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
#, python-format
msgid "creating SEDASpatial (SEDASpatial seda_spatial SEDAContent %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDAStorageRule (SEDAStorageRule seda_storage_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
#, python-format
msgid ""
"creating SEDATemporal (SEDATemporal seda_temporal SEDAContent %(linkto)s)"
......
......@@ -4019,27 +4019,12 @@ msgctxt "SEDAArchiveTransfer"
msgid "container_object"
msgstr ""
#, python-format
msgid ""
"creating SEDAAccessRule (SEDAAccessRule seda_access_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
"création d'une règle de communicabilité pour l'unité d'archives %(linkto)s"
#, python-format
msgid ""
"creating SEDAAddressee (SEDAAddressee seda_addressee_from SEDAContent "
"%(linkto)s)"
msgstr "création d'un destinataire pour action"
#, python-format
msgid ""
"creating SEDAAppraisalRule (SEDAAppraisalRule seda_appraisal_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
"création d'une règle de durée d'utilité administrative pour l'unité "
"d'archives %(linkto)s"
#, python-format
msgid ""
"creating SEDAArchiveUnit (SEDAArchiveUnit seda_archive_unit "
......@@ -4058,14 +4043,6 @@ msgid ""
"SEDAArchiveTransfer %(linkto)s)"
msgstr "création d'un objet-données binaire dans le profil %(linkto)s"
#, python-format
msgid ""
"creating SEDAClassificationRule (SEDAClassificationRule "
"seda_classification_rule SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr ""
"création d'une règle de classification pour l'unité d'archives %(linkto)s"
#, python-format
msgid ""
"creating SEDAContent (SEDAContent seda_content "
......@@ -4081,13 +4058,6 @@ msgstr ""
"création d'une référence à un objet-données pour l'unité d'archive "
"%(linkto)s"
#, python-format
msgid ""
"creating SEDADisseminationRule (SEDADisseminationRule "
"seda_dissemination_rule SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr "création d'une règle de diffusion pour l'unité d'archives %(linkto)s"
#, python-format
msgid "creating SEDAEvent (SEDAEvent seda_event SEDAContent %(linkto)s)"
msgstr "création d'un évènement"
......@@ -4113,13 +4083,6 @@ msgstr "création d'une juridiction administrative"
msgid "creating SEDAKeyword (SEDAKeyword seda_keyword SEDAContent %(linkto)s)"
msgstr "création d'un mot-clé"
#, python-format
msgid ""
"creating SEDANeedAuthorization (SEDANeedAuthorization "
"seda_need_authorization SEDASeqAltArchiveUnitArchiveUnitRefIdManagement "
"%(linkto)s)"
msgstr "création d'une règle d'autorisation pour l'unité d'archives %(linkto)s"
#, python-format
msgid ""
"creating SEDAPhysicalDataObject (SEDAPhysicalDataObject "
......@@ -4151,25 +4114,10 @@ msgid ""
msgstr ""
"création d'une référence vers un object requis par le contenue %(linkto)s"
#, python-format
msgid ""
"creating SEDAReuseRule (SEDAReuseRule seda_reuse_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
"création d'une règle de réutilisation pour l'unité d'archives %(linkto)s"
#, python-format
msgid "creating SEDASpatial (SEDASpatial seda_spatial SEDAContent %(linkto)s)"
msgstr "création d'une couverture spatiale"
#, python-format
msgid ""
"creating SEDAStorageRule (SEDAStorageRule seda_storage_rule "
"SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)"
msgstr ""
"création d'une règle de durée d'utilité courante pour l'unité d'archives "
"%(linkto)s"
#, python-format
msgid ""
"creating SEDATemporal (SEDATemporal seda_temporal SEDAContent %(linkto)s)"
......
......@@ -26,7 +26,8 @@ from cubicweb.web.views import uicfg, baseviews, tabs, autoform, formrenderers
from cubes.compound import views as compound
from cubes.seda.views import add_subobject_link, dropdown_button, viewlib
from cubes.seda.views import (add_subobject_link, dropdown_button, rtags_from_rtype_role_targets,
viewlib)
from cubes.seda.views.viewlib import BusinessValueLinkEntityView
_ = unicode
......@@ -160,26 +161,11 @@ class TitleBusinessValueEntityView(BusinessValueLinkEntityView):
self.wvalue(entity, self._cw._('<no title specified>'))
class ArchiveUnitManagementTab(viewlib.SubObjectsTab):
class ArchiveUnitManagementTab(tabs.PrimaryTab):
"""Display management information about an archive unit."""
__regid__ = 'seda_au_management_tab'
__select__ = EntityView.__select__ & is_instance('SEDAArchiveUnit') & ~is_archive_unit_ref()
_('creating SEDAStorageRule (SEDAStorageRule seda_storage_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDAAppraisalRule (SEDAAppraisalRule seda_appraisal_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDAAccessRule (SEDAAccessRule seda_access_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDADisseminationRule (SEDADisseminationRule seda_dissemination_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDAReuseRule (SEDAReuseRule seda_reuse_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDAClassificationRule (SEDAClassificationRule seda_classification_rule '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
_('creating SEDANeedAuthorization (SEDANeedAuthorization seda_need_authorization '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
__select__ = tabs.PrimaryTab.__select__ & is_instance('SEDAArchiveUnit')
rtype_role_targets = [
('seda_storage_rule', 'object', None),
......@@ -190,14 +176,13 @@ class ArchiveUnitManagementTab(viewlib.SubObjectsTab):
('seda_classification_rule', 'object', None),
('seda_need_authorization', 'object', None),
]
rsection, display_ctrl = rtags_from_rtype_role_targets(
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement', rtype_role_targets
)
_('creating SEDAContent (SEDAContent seda_content '
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement %(linkto)s)')
def entity_call(self, entity):
def entity_call(self, entity, **kwargs):
seq = entity.first_level_choice.content_sequence
self.display_add_button(seq)
self.display_subobjects_list(seq)
super(ArchiveUnitManagementTab, self).entity_call(seq, **kwargs)
class ArchiveUnitContentTab(viewlib.SubObjectsTab):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment