[PATCH seda] [views] Ensure archive unit's creation/edition form is consistent with its main tab

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Apr 11 15:13:41 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1491838891 -7200
#      Mon Apr 10 17:41:31 2017 +0200
# Node ID a36decbdc2cc6070aa58ca712cc5a3abe87dd34e
# Parent  1c2fedd574684c1cd7bc7c029b5e0c6e6d253671
[views] Ensure archive unit's creation/edition form is consistent with its main tab

in case of simplified profile. This requires adding afs rules and adding/updating
some translations.

Closes extranet #16385548

diff --git a/cubicweb_seda/i18n/fr.po b/cubicweb_seda/i18n/fr.po
--- a/cubicweb_seda/i18n/fr.po
+++ b/cubicweb_seda/i18n/fr.po
@@ -3259,11 +3259,11 @@ msgstr ""
 
 msgid "add a SEDAEncodingCodeListVersion"
 msgstr ""
 
 msgid "add a SEDAEndDate"
-msgstr ""
+msgstr "date de fin"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_end_date.object"
 msgid "add a SEDAEndDate"
 msgstr ""
@@ -3372,11 +3372,11 @@ msgstr "ajouter un type"
 msgctxt "inlined:SEDAKeyword.seda_keyword_type_from.object"
 msgid "add a SEDAKeywordType"
 msgstr ""
 
 msgid "add a SEDALanguage"
-msgstr "langue"
+msgstr "langue du contenu"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_language_from."
 "object"
 msgid "add a SEDALanguage"
@@ -3413,11 +3413,11 @@ msgstr ""
 
 msgid "add a SEDANumberOfPage"
 msgstr ""
 
 msgid "add a SEDAOriginatingAgency"
-msgstr ""
+msgstr "service producteur"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement."
 "seda_originating_agency_from.object"
 msgid "add a SEDAOriginatingAgency"
@@ -3711,11 +3711,11 @@ msgstr ""
 
 msgid "add a SEDASpatial"
 msgstr "ajouter une couverture spatiale"
 
 msgid "add a SEDAStartDate"
-msgstr "date de départ"
+msgstr "date de début"
 
 msgctxt "inlined:SEDASeqAccessRuleRule.seda_start_date.object"
 msgid "add a SEDAStartDate"
 msgstr ""
 
@@ -3770,11 +3770,11 @@ msgstr ""
 
 msgid "add a SEDASubmissionAgencyIdentifier"
 msgstr ""
 
 msgid "add a SEDASystemId"
-msgstr ""
+msgstr "identifiant pour le SAE"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_system_id.object"
 msgid "add a SEDASystemId"
 msgstr ""
@@ -3812,11 +3812,11 @@ msgstr ""
 
 msgid "add a SEDATransferRequestReplyIdentifier"
 msgstr "identifiant de réponse à une demande de transfert"
 
 msgid "add a SEDATransferringAgencyArchiveUnitIdentifier"
-msgstr ""
+msgstr "identifiant pour le service versant"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement."
 "seda_transferring_agency_archive_unit_identifier.object"
 msgid "add a SEDATransferringAgencyArchiveUnitIdentifier"
diff --git a/cubicweb_seda/views/archiveunit.py b/cubicweb_seda/views/archiveunit.py
--- a/cubicweb_seda/views/archiveunit.py
+++ b/cubicweb_seda/views/archiveunit.py
@@ -860,11 +860,16 @@ def _display_attributes(self, entity):
 
 
 content_ordered_fields = [
     ('seda_description_level', 'subject'),
     ('seda_title', 'object'),
+    ('seda_start_date', 'object'),
+    ('seda_end_date', 'object'),
     ('seda_description', 'object'),
+    ('seda_originating_agency_from', 'object'),
+    ('seda_transferring_agency_archive_unit_identifier', 'object'),
+    ('seda_system_id', 'object'),
     ('seda_version', 'object'),
     ('seda_type_from', 'object'),
     ('seda_document_type', 'object'),
     ('seda_status', 'object'),
     ('seda_language_from', 'object'),
diff --git a/cubicweb_seda/views/simplified.py b/cubicweb_seda/views/simplified.py
--- a/cubicweb_seda/views/simplified.py
+++ b/cubicweb_seda/views/simplified.py
@@ -166,10 +166,19 @@ for rtype, role in archivetransfer.at_or
         else:
             simplified_section = 'hidden'
         simplified_pvs.tag_object_of(('*', rtype, 'SEDAArchiveTransfer'), simplified_section)
 
 
+# SEDAArchiveUnit
+simplified_au_rtypes = set(
+    rtype for rtype, role, targets in archiveunit.SimplifiedContentMainView.rtype_role_targets)
+for rtype, role in archiveunit.content_ordered_fields:
+    if role == 'object':
+        section = 'inlined' if rtype in simplified_au_rtypes else 'hidden'
+        simplified_afs.tag_object_of(('*', rtype, CONTENT_ETYPE), 'main', section)
+
+
 # SEDABinaryDataObject/SEDAPhysicalDataObject customization
 simplified_afs.tag_object_of(
     ('SEDADataObjectReference', 'seda_data_object_reference_id', '*'),
     'main', 'inlined')
 simplified_afs.tag_object_of(


More information about the saem-devel mailing list