From de0ac9533871d28ea4b7d3dfe9247a4802841a1c Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Mon, 20 Jan 2025 11:39:16 +0100 Subject: [PATCH] WCM-614: Add search filter for video type --- core/src/zeit/find/browser/README.txt | 3 ++- core/src/zeit/find/browser/find.py | 9 +++++++++ .../src/zeit/find/browser/resources/search_form.jsont | 9 +++++++++ core/src/zeit/find/browser/tests/test_selenium.py | 11 +++++++++++ core/src/zeit/find/search.py | 1 + 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/src/zeit/find/browser/README.txt b/core/src/zeit/find/browser/README.txt index f0e491e58b..3a4d86584f 100644 --- a/core/src/zeit/find/browser/README.txt +++ b/core/src/zeit/find/browser/README.txt @@ -74,7 +74,8 @@ Content-Type: text/json... 'ressorts': [{'ressort': 'Deutschland', 'ressort_name': 'Deutschland'},... 'series': [{'serie': '-', 'serie_title': '-'},... 'template_url': 'http://localhost/++skin++vivi/fanstatic/zeit.find/search_form.jsont', - 'types': [{'title': 'Image Group', 'type': 'image-group'}]} + 'types': [{'title': 'Image Group', 'type': 'image-group'}], + 'video_type': [{'key': 'brightcove', 'value': 'Brightcove'},...]} Favorites diff --git a/core/src/zeit/find/browser/find.py b/core/src/zeit/find/browser/find.py index 802b6b9936..458f9bb774 100644 --- a/core/src/zeit/find/browser/find.py +++ b/core/src/zeit/find/browser/find.py @@ -14,6 +14,7 @@ import zeit.cms.content.interfaces import zeit.cms.interfaces import zeit.content.audio.interfaces +import zeit.content.video.interfaces import zeit.find.interfaces import zeit.find.search @@ -44,6 +45,7 @@ def json(self): 'series': self.series, 'audio_type': self.audio_types, 'podcasts': self.podcasts, + 'video_type': self.video_types, 'types': self.types, } @@ -88,6 +90,11 @@ def audio_types(self): types = zeit.content.audio.interfaces.AudioTypeSource().factory.values return [{'key': key, 'value': value} for key, value in types.items()] + @property + def video_types(self): + types = zeit.content.video.interfaces.VideoTypeSource().factory.values + return [{'key': key, 'value': value} for key, value in types.items()] + CONTENT_TYPES = [ 'advertisement', 'animation', @@ -424,6 +431,7 @@ def g(name, default=None): serie = g('serie', None) audio_type = g('audio_type', None) podcast = g('podcast', None) + video_type = g('video_type', None) # four states: published, not-published, published-with-changes, # don't care (None) published = g('published', None) @@ -448,6 +456,7 @@ def g(name, default=None): 'topic': topic, 'types': types, 'until': until, + 'video_type': video_type, 'volume': volume, 'year': year, } diff --git a/core/src/zeit/find/browser/resources/search_form.jsont b/core/src/zeit/find/browser/resources/search_form.jsont index c7a9732c40..93b22a866c 100644 --- a/core/src/zeit/find/browser/resources/search_form.jsont +++ b/core/src/zeit/find/browser/resources/search_form.jsont @@ -102,6 +102,15 @@ {.end} +
+ + +