File tree Expand file tree Collapse file tree 5 files changed +62
-0
lines changed
src/plonemeeting/portal/core Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 18
18
<include file =" permissions.zcml" />
19
19
<include package =" .browser" />
20
20
<include package =" .content" />
21
+ <include package =" .faceted" />
21
22
22
23
23
24
<genericsetup : registerProfile
Original file line number Diff line number Diff line change
1
+ <configure
2
+ xmlns : faceted =" http://namespaces.zope.org/faceted"
3
+ i18n_domain =" plonemeeting.portal.core" >
4
+
5
+ <faceted : widget
6
+ factory =" .widget.RelativePathWidget"
7
+ schema =" eea.facetednavigation.widgets.interfaces.ISchema"
8
+ />
9
+
10
+ </configure >
Original file line number Diff line number Diff line change
1
+ <div class =" faceted-widget" style =" display: none"
2
+ i18n : domain =" eea" tal : define ="
3
+ error_view nocall:context/@@faceted.widget.error;
4
+ wid python:view.data.getId();
5
+ hidden python:view.hidden;
6
+ css string:faceted-widget ${view/css_class};
7
+ css python:hidden and css + ' faceted-widget-hidden' or css;
8
+ title python:view.translate(view.data.get('title', ''));
9
+ "
10
+ tal : attributes =" id string:${wid}_widget; class css;" >
11
+
12
+ <fieldset class =" widget-fieldset" >
13
+ <legend tal : content =" title" i18n : translate =" " >HTML Widget</legend >
14
+ <tal : facet on-error =" structure python:error_view(error=error, cid=wid)" >
15
+ </tal : facet >
16
+ </fieldset >
17
+ </div >
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from eea .facetednavigation .widgets import ViewPageTemplateFile
4
+ from eea .facetednavigation .widgets .interfaces import DefaultSchemata as DS
5
+ from eea .facetednavigation .widgets .interfaces import ISchema
6
+ from eea .facetednavigation .widgets .widget import Widget
7
+ from z3c .form import field
8
+
9
+ from plonemeeting .portal .core import _
10
+
11
+
12
+ class DefaultSchemata (DS ):
13
+ """ Schemata default
14
+ """
15
+
16
+ fields = field .Fields (ISchema ).select (u"title" )
17
+
18
+
19
+ class RelativePathWidget (Widget ):
20
+ """ Filter on objects from current folder
21
+ """
22
+
23
+ widget_type = "relative_path"
24
+ widget_label = _ ("Relative path widget" )
25
+ groups = (DefaultSchemata ,)
26
+
27
+ index = ViewPageTemplateFile ("widget.pt" )
28
+
29
+ def query (self , form ):
30
+ """ Returns only objects from current folder
31
+ """
32
+ current_path = "/" .join (self .context .getPhysicalPath ())
33
+ query = {"path" : {"query" : current_path }}
34
+ return query
You can’t perform that action at this time.
0 commit comments