summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-06-26 09:05:05 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-06-26 09:05:05 (GMT)
commit29124955eaa5ae8599ddaf1f19f795d9149b0286 (patch)
tree58f31bfc25c594cd1cb0099684d6bf61c79e0697
parent81586a99c5a392b9b341c52fd95448e7e8b615c5 (diff)
downloadthemis.looks-29124955eaa5ae8599ddaf1f19f795d9149b0286.zip
themis.looks-29124955eaa5ae8599ddaf1f19f795d9149b0286.tar.gz
themis.looks-29124955eaa5ae8599ddaf1f19f795d9149b0286.tar.bz2
Add a new "big blocks" view for folders
http://plone.org/documentation/kb/applying-a-custom-view-to-a-specific-folder
-rw-r--r--setup.py2
-rw-r--r--themis.looks.egg-info/SOURCES.txt4
-rw-r--r--themis.looks.egg-info/requires.txt3
-rw-r--r--themis/looks/bigblocks_folder_view.pt55
-rw-r--r--themis/looks/configure.zcml26
-rw-r--r--themis/looks/interfaces.py8
-rw-r--r--themis/looks/views.py8
7 files changed, 102 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index f13a231..416a39c 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ setup(name='themis.looks',
zip_safe=False,
install_requires=[
'setuptools',
- # -*- Extra requirements: -*-
+ 'plone.app.contentmenu'
],
entry_points="""
# -*- Entry points: -*-
diff --git a/themis.looks.egg-info/SOURCES.txt b/themis.looks.egg-info/SOURCES.txt
index c358e75..c644a03 100644
--- a/themis.looks.egg-info/SOURCES.txt
+++ b/themis.looks.egg-info/SOURCES.txt
@@ -12,4 +12,6 @@ themis.looks.egg-info/paster_plugins.txt
themis.looks.egg-info/requires.txt
themis.looks.egg-info/top_level.txt
themis/looks/__init__.py
-themis/looks/tests.py \ No newline at end of file
+themis/looks/interfaces.py
+themis/looks/tests.py
+themis/looks/views.py \ No newline at end of file
diff --git a/themis.looks.egg-info/requires.txt b/themis.looks.egg-info/requires.txt
index 8b6d003..d92df66 100644
--- a/themis.looks.egg-info/requires.txt
+++ b/themis.looks.egg-info/requires.txt
@@ -1 +1,2 @@
-setuptools \ No newline at end of file
+setuptools
+plone.app.contentmenu \ No newline at end of file
diff --git a/themis/looks/bigblocks_folder_view.pt b/themis/looks/bigblocks_folder_view.pt
new file mode 100644
index 0000000..5568cd4
--- /dev/null
+++ b/themis/looks/bigblocks_folder_view.pt
@@ -0,0 +1,55 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+ lang="en"
+ metal:use-macro="context/main_template/macros/master"
+ i18n:domain="plone">
+
+<body>
+
+ <metal:content-core fill-slot="content-core">
+ <metal:block use-macro="context/folder_listing/macros/content-core">
+ <!-- we don't want the dl -->
+ <metal:entries fill-slot="entries">
+ <metal:block use-macro="context/folder_listing/macros/entries">
+ <metal:entry fill-slot="entry">
+ <div class="photoAlbumEntry photoAlbumFolder"
+ tal:define="item_object item/getObject;">
+
+ <a href="#"
+ tal:condition="exists:item_object/image_thumb"
+ tal:attributes="href python:test(item_type in use_view_action, item_url+'/view', item_url)">
+ <img src="" alt=""
+ tal:replace="structure python: path('nocall:item_object/tag')(scale='thumb', css_class='tileImage')" />
+ </a>
+
+ <h2 class="tileHeadline"
+ metal:define-macro="listitem">
+
+ <a href="#"
+ class="summary url"
+ tal:attributes="href item_url"
+ tal:content="item_title_or_id">
+ Item Title
+ </a>
+
+ </h2>
+
+ <p class="tileBody" tal:condition="item_description">
+ <span class="description" tal:content="item_description">
+ description
+ </span>
+ </p>
+
+ <div class="visualClear"><!-- --></div>
+
+ </div>
+ </metal:entry>
+ </metal:block>
+ </metal:entries>
+ </metal:block>
+ </metal:content-core>
+
+</body>
+</html>
diff --git a/themis/looks/configure.zcml b/themis/looks/configure.zcml
index 0909342..5e1f3c6 100644
--- a/themis/looks/configure.zcml
+++ b/themis/looks/configure.zcml
@@ -2,10 +2,34 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
+ xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="themis.looks">
<five:registerPackage package="." initialize=".initialize" />
<!-- -*- extra stuff goes here -*- -->
-
+ <include package="plone.app.contentmenu" />
+
+ <browser:page
+ for=".interfaces.IBigBlocksFolderView"
+ name="folder_listing"
+ class=".views.BigBlocksFolderView"
+ permission="zope2.View"
+ />
+
+ <browser:page
+ for=".interfaces.IBigBlocksFolderView"
+ name="bigblocks_folder"
+ class=".views.BigBlocksFolderView"
+ permission="zope2.View"
+ />
+
+ <browser:menuItem
+ for=".interfaces.IBigBlocksFolderView"
+ menu="plone_displayviews"
+ title="Big blocks view"
+ action="@@folder_listing"
+ description="Big blocks view"
+ />
+
</configure>
diff --git a/themis/looks/interfaces.py b/themis/looks/interfaces.py
new file mode 100644
index 0000000..76cd135
--- /dev/null
+++ b/themis/looks/interfaces.py
@@ -0,0 +1,8 @@
+from zope.interface import Interface
+from plone.theme.interfaces import IDefaultPloneLayer
+
+class IThemeSpecific(IDefaultPloneLayer):
+ """Marker interface that defines a Zope browser layer."""
+
+class IBigBlocksFolderView(Interface):
+ """Marker interface identifying Big Blocks Folder View."""
diff --git a/themis/looks/views.py b/themis/looks/views.py
new file mode 100644
index 0000000..d7b9872
--- /dev/null
+++ b/themis/looks/views.py
@@ -0,0 +1,8 @@
+from Products.Five import BrowserView
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+
+class BigBlocksFolderView(BrowserView):
+ template = ViewPageTemplateFile('bigblocks_folder_view.pt')
+
+ def __call__(self):
+ return self.template()