summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-01-17 12:56:13 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-01-17 12:58:32 (GMT)
commitbcffc11fa938bb0306be909b75aeef2cb2c1476c (patch)
treefca6fee8987c6a2ea9ed07268c5b5cd650e32aa3
parent69c713186e15e1fdc82533a1a51d78986ab6260a (diff)
downloadtabellio.webviews-bcffc11fa938bb0306be909b75aeef2cb2c1476c.zip
tabellio.webviews-bcffc11fa938bb0306be909b75aeef2cb2c1476c.tar.gz
tabellio.webviews-bcffc11fa938bb0306be909b75aeef2cb2c1476c.tar.bz2
add section for press articles
-rw-r--r--tabellio/webviews/misc.py9
-rw-r--r--tabellio/webviews/press_folder.pt15
2 files changed, 24 insertions, 0 deletions
diff --git a/tabellio/webviews/misc.py b/tabellio/webviews/misc.py
index 10050d0..ed1288c 100644
--- a/tabellio/webviews/misc.py
+++ b/tabellio/webviews/misc.py
@@ -39,6 +39,15 @@ class PressFolder(BrowserView, Cached):
sort_limit=10)[:10]
return results
+ def getRecentPresse(self):
+ catalog = getToolByName(self.context, 'portal_catalog')
+ folder_path = '/'.join(self.context.getPhysicalPath() + ('les-medias-en-parlent',))
+ results = catalog.searchResults(path={'query': folder_path, 'depth': 1},
+ portal_type=['Document', 'File'],
+ sort_on='Date', sort_order='descending',
+ sort_limit=10)[:10]
+ return results
+
class IPcfHomeFolder(Interface):
pass
diff --git a/tabellio/webviews/press_folder.pt b/tabellio/webviews/press_folder.pt
index 0b841ed..d75fc0b 100644
--- a/tabellio/webviews/press_folder.pt
+++ b/tabellio/webviews/press_folder.pt
@@ -53,6 +53,21 @@
</div> <!-- .inner -->
</div> <!-- .embossed_frame -->
+
+ <div class="embossed_frame communiques"
+ tal:condition="python:hasattr(context, 'les-medias-en-parlent')">
+ <div class="inner">
+ <h2 class="embossed_frame_header">Les médias en parlent</h2>
+ <div class="embossed_frame_content">
+ <ul>
+ <li tal:repeat="item view/getRecentPresse">
+ <a tal:attributes="href item/getURL" tal:content="item/Title">title</a>
+ </li>
+ </ul>
+ <a class="more" href="les-medias-en-parlent/">Plus d'articles de presse</a>
+ </div>
+ </div>
+ </div>
<div class="embossed_frame links">