Permalink
Browse files

updated

  • Loading branch information...
1 parent b273b2a commit 92bd16d0456d3adcc9ee7b3b1f437a1cdbb5d06c @zopyx committed Apr 12, 2012
Showing with 21 additions and 10 deletions.
  1. +10 −8 vs/jquerybookmarks/browser/viewlet.pt
  2. +6 −2 vs/jquerybookmarks/browser/viewlets.py
  3. +5 −0 vs/jquerybookmarks/header.txt
View
18 vs/jquerybookmarks/browser/viewlet.pt
@@ -1,10 +1,12 @@
-<div id="jquery-bookmark">
- hello world
-</div>
+<tal:if condition="view/available">
+ <div id="jquery-bookmark">
+ <!-- placeholder for bookmarks -->
+ </div>
-<script type="text/javascript">
- $(document).ready(function() {
- $('#jquery-bookmark').bookmark();
- });
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('#jquery-bookmark').bookmark();
+ });
-</script>
+ </script>
+</tal:if>
View
8 vs/jquerybookmarks/browser/viewlets.py
@@ -1,8 +1,12 @@
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.viewlets.common import ViewletBase
+from Products.CMFCore.utils import getToolByName
class MyViewlet(ViewletBase):
render = ViewPageTemplateFile('viewlet.pt')
- def update(self):
- self.computed_value = 'any output'
+ def available(self):
+ qi = getToolByName(self.context, 'portal_quickinstaller')
+ ids = [p['id'] for p in qi.listInstalledProducts()]
+ return 'jquery.booksmarks' in ids
+
View
5 vs/jquerybookmarks/header.txt
@@ -0,0 +1,5 @@
+################################################################
+# vs.jquerybookmarks
+# (C) 2012 Veit Schiele Communications GmbH, ZOPYX Ltd.
+################################################################
+

0 comments on commit 92bd16d

Please sign in to comment.