From e367a6d4f5cf17c023947230f99abcd5bfe267d7 Mon Sep 17 00:00:00 2001 From: Manuel Reinhardt Date: Thu, 25 Apr 2024 14:41:48 +0200 Subject: [PATCH] Custom ddcSubject vocabulary Fixes syslabcom/scrum#2194 --- recensio/altertum/browser/configure.zcml | 8 ++++++++ recensio/altertum/browser/views.py | 6 ++++++ recensio/altertum/configure.zcml | 7 +++++++ recensio/altertum/vocabularies/configure.zcml | 8 ++++++++ .../altertum/vocabularies/vdex}/ddc_sach.vdex | 2 +- 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 recensio/altertum/vocabularies/configure.zcml rename {vocabularies => recensio/altertum/vocabularies/vdex}/ddc_sach.vdex (96%) diff --git a/recensio/altertum/browser/configure.zcml b/recensio/altertum/browser/configure.zcml index ef18544..4f354ae 100644 --- a/recensio/altertum/browser/configure.zcml +++ b/recensio/altertum/browser/configure.zcml @@ -46,4 +46,12 @@ layer="recensio.altertum.interfaces.IAltertumLayer" /> + + diff --git a/recensio/altertum/browser/views.py b/recensio/altertum/browser/views.py index 20b0808..e34b8ca 100644 --- a/recensio/altertum/browser/views.py +++ b/recensio/altertum/browser/views.py @@ -1,3 +1,4 @@ +from recensio.plone.browser.helper import VocabularyHelper from recensio.plone.browser.homepage import HomepageView from recensio.plone.browser.pdfgen import GeneratePdfRecension @@ -12,3 +13,8 @@ class AltertumHomepageView(HomepageView): resource_directory = "++resource++recensio.altertum.images" review_languages = [""] + +class AltertumVocabularyHelper(VocabularyHelper): + @property + def ddcSubject(self): + return self.get_named_vocabulary("recensio.altertum.vocabularies.topic_values") diff --git a/recensio/altertum/configure.zcml b/recensio/altertum/configure.zcml index 0c98d1e..7c82356 100644 --- a/recensio/altertum/configure.zcml +++ b/recensio/altertum/configure.zcml @@ -4,7 +4,14 @@ i18n_domain="recensio.altertum" > + + + + " diff --git a/recensio/altertum/vocabularies/configure.zcml b/recensio/altertum/vocabularies/configure.zcml new file mode 100644 index 0000000..e5a1338 --- /dev/null +++ b/recensio/altertum/vocabularies/configure.zcml @@ -0,0 +1,8 @@ + + + + + diff --git a/vocabularies/ddc_sach.vdex b/recensio/altertum/vocabularies/vdex/ddc_sach.vdex similarity index 96% rename from vocabularies/ddc_sach.vdex rename to recensio/altertum/vocabularies/vdex/ddc_sach.vdex index 5bac02c..387caa7 100644 --- a/vocabularies/ddc_sach.vdex +++ b/recensio/altertum/vocabularies/vdex/ddc_sach.vdex @@ -11,7 +11,7 @@ International Standard Classification of Occupations, ISCO-88 - ISCO88 + recensio.altertum.vocabularies.topic_values 1001