[views] Ensure archive unit's creation/edition form is consistent with its main tab
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 10 Apr 2017 17:41:31 +0200
changeset 2617 76bb0064f236
parent 2616 45cae2f412d1
child 2619 7769b2787347
[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
cubicweb_seda/i18n/fr.po
cubicweb_seda/views/archiveunit.py
cubicweb_seda/views/simplified.py
--- a/cubicweb_seda/i18n/fr.po	Mon Apr 10 16:16:10 2017 +0200
+++ b/cubicweb_seda/i18n/fr.po	Mon Apr 10 17:41:31 2017 +0200
@@ -3261,7 +3261,7 @@
 msgstr ""
 
 msgid "add a SEDAEndDate"
-msgstr ""
+msgstr "date de fin"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_end_date.object"
@@ -3374,7 +3374,7 @@
 msgstr ""
 
 msgid "add a SEDALanguage"
-msgstr "langue"
+msgstr "langue du contenu"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_language_from."
@@ -3415,7 +3415,7 @@
 msgstr ""
 
 msgid "add a SEDAOriginatingAgency"
-msgstr ""
+msgstr "service producteur"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement."
@@ -3713,7 +3713,7 @@
 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"
@@ -3772,7 +3772,7 @@
 msgstr ""
 
 msgid "add a SEDASystemId"
-msgstr ""
+msgstr "identifiant pour le SAE"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_system_id.object"
@@ -3814,7 +3814,7 @@
 msgstr "identifiant de réponse à une demande de transfert"
 
 msgid "add a SEDATransferringAgencyArchiveUnitIdentifier"
-msgstr ""
+msgstr "identifiant pour le service versant"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement."
--- a/cubicweb_seda/views/archiveunit.py	Mon Apr 10 16:16:10 2017 +0200
+++ b/cubicweb_seda/views/archiveunit.py	Mon Apr 10 17:41:31 2017 +0200
@@ -862,7 +862,12 @@
 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'),
--- a/cubicweb_seda/views/simplified.py	Mon Apr 10 16:16:10 2017 +0200
+++ b/cubicweb_seda/views/simplified.py	Mon Apr 10 17:41:31 2017 +0200
@@ -168,6 +168,15 @@
         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', '*'),