11 # |
11 # |
12 |
12 |
13 __docformat__ = 'restructuredtext' |
13 __docformat__ = 'restructuredtext' |
14 |
14 |
15 from zope.interface import Interface |
15 from zope.interface import Interface |
16 from zope.schema import Bool, Int |
16 from zope.schema import Bool, Int, Choice |
|
17 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm |
17 |
18 |
18 from pyams_default_theme import _ |
19 from pyams_default_theme import _ |
|
20 |
|
21 |
|
22 VIEW_ITEMS_THUMBNAILS = ( |
|
23 {'id': 'portrait', 'title': _("Portrait selection")}, |
|
24 {'id': 'pano', 'title': _("Panoramic selection")}, |
|
25 {'id': 'square', 'title': _("Square selection")} |
|
26 ) |
|
27 |
|
28 VIEW_ITEMS_THUMBNAILS_VOCABULARY = SimpleVocabulary([SimpleTerm(item['id'], title=item['title']) |
|
29 for item in VIEW_ITEMS_THUMBNAILS]) |
19 |
30 |
20 |
31 |
21 class IViewItemsPortletVerticalRendererSettings(Interface): |
32 class IViewItemsPortletVerticalRendererSettings(Interface): |
22 """View items portlet vertical renderer settings interface""" |
33 """View items portlet vertical renderer settings interface""" |
23 |
34 |
24 display_illustrations = Bool(title=_("Display illustrations?"), |
35 display_illustrations = Bool(title=_("Display illustrations?"), |
25 description=_("If 'no', view contents will not display illustrations"), |
36 description=_("If 'no', view contents will not display illustrations"), |
26 required=True, |
37 required=True, |
27 default=True) |
38 default=True) |
28 |
39 |
|
40 thumbnails_selection = Choice(title=_("Thumbnails selection"), |
|
41 description=_("Selection used to display images thumbnails"), |
|
42 vocabulary=VIEW_ITEMS_THUMBNAILS_VOCABULARY, |
|
43 required=True, |
|
44 default='pano') |
|
45 |
|
46 display_breadcrumbs = Bool(title=_("Display breadcrumbs?"), |
|
47 description=_("If 'no', view items breadcrumbs will not be displayed"), |
|
48 required=True, |
|
49 default=True) |
|
50 |
|
51 display_tags = Bool(title=_("Display tags?"), |
|
52 description=_("If 'no', view items tags will not be displayed"), |
|
53 required=True, |
|
54 default=True) |
|
55 |
29 paginate = Bool(title=_("Paginate?"), |
56 paginate = Bool(title=_("Paginate?"), |
30 description=_("If 'no', results pagination will be disabled"), |
57 description=_("If 'no', results pagination will be disabled"), |
31 required=True, |
58 required=True, |
32 default=True) |
59 default=True) |
33 |
60 |
34 page_size = Int(title=_("Page size"), |
61 page_size = Int(title=_("Page size"), |
35 description=_("Number of items per page, if pagination is enabled"), |
62 description=_("Number of items per page, if pagination is enabled"), |
36 required=False, |
63 required=False, |
37 default=10) |
64 default=10) |
|
65 |
|
66 |
|
67 class IViewItemsPortletHorizontalRendererSettings(Interface): |
|
68 """View items portlet horizontal renderer settings interface""" |
|
69 |
|
70 thumbnails_selection = Choice(title=_("Thumbnails selection"), |
|
71 description=_("Selection used to display images thumbnails"), |
|
72 vocabulary=VIEW_ITEMS_THUMBNAILS_VOCABULARY, |
|
73 required=True, |
|
74 default='portrait') |