# HG changeset patch # User Thierry Florac # Date 1545990431 -3600 # Node ID 3707cb1270afeac7166626b5017a666bceea9e13 # Parent 0c9d115b227c5a280bc1fe16f91d664ae04e88ed Updated search results views diff -r 0c9d115b227c -r 3707cb1270af src/pyams_default_theme/features/search/portlet/__init__.py --- a/src/pyams_default_theme/features/search/portlet/__init__.py Fri Dec 28 10:45:49 2018 +0100 +++ b/src/pyams_default_theme/features/search/portlet/__init__.py Fri Dec 28 10:47:11 2018 +0100 @@ -18,9 +18,10 @@ from zope.location import ILocation from zope.schema.fieldproperty import FieldProperty +from pyams_content.features.search import ISearchFolder from pyams_content.features.search.portlet import ISearchResultsPortletSettings from pyams_content.shared.common import IWfSharedContent -from pyams_default_theme import _ +from pyams_content.shared.common.portlet.interfaces import ISharedContentHeadViewletManager from pyams_default_theme.features.search.portlet.interfaces import ISearchResultRenderer, \ ISearchResultsPortletDefaultRendererSettings from pyams_default_theme.interfaces import ISearchResultsView @@ -32,8 +33,25 @@ from pyams_utils.adapter import NullAdapter, adapter_config from pyams_utils.factory import factory_config from pyams_utils.url import canonical_url, relative_url -from pyams_viewlet.viewlet import ViewContentProvider +from pyams_viewlet.viewlet import ViewContentProvider, Viewlet, viewlet_config + +from pyams_default_theme import _ + + +# +# Search folder custom head specificities renderer +# +@viewlet_config(name='search-folder-head', context=ISearchFolder, layer=IPyAMSUserLayer, view=Interface, + manager=ISharedContentHeadViewletManager, weight=1) +@template_config(template='templates/folder-head-specificities.pt', layer=IPyAMSUserLayer) +class SearchFolderHeadViewlet(Viewlet): + """Search folder head specificities viewlet""" + + +# +# Search results portlet renderers +# @factory_config(provided=ISearchResultsPortletDefaultRendererSettings) class SearchResultsPortletDefaultRendererSettings(Persistent, Contained): diff -r 0c9d115b227c -r 3707cb1270af src/pyams_default_theme/features/search/portlet/templates/folder-head-specificities.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/features/search/portlet/templates/folder-head-specificities.pt Fri Dec 28 10:47:11 2018 +0100 @@ -0,0 +1,19 @@ +
+
+
+
+ + + + + + +
+
+
+
diff -r 0c9d115b227c -r 3707cb1270af src/pyams_default_theme/features/search/portlet/templates/search-results.pt --- a/src/pyams_default_theme/features/search/portlet/templates/search-results.pt Fri Dec 28 10:45:49 2018 +0100 +++ b/src/pyams_default_theme/features/search/portlet/templates/search-results.pt Fri Dec 28 10:47:11 2018 +0100 @@ -2,24 +2,90 @@ renderer_settings view.renderer_settings;" i18n:domain="pyams_default_theme">

${i18n:settings.title}

+
+ + + + + +
- -
- - ${count} result(s) found - - - No result found! - -
-
-
+
+ + ${count} result(s) found + + + No result found! + +
+
+ +
+
+ Page length:  + +
+
${structure:view.render_item(item)}
+
+ +