Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

use description for tooltips #4

Merged
merged 2 commits into from

2 participants

Timon Tschanz Mathias Leimgruber
Timon Tschanz

@maethu could you take a look at this? it now uses the description for the title attribute in html if it is available.

Mathias Leimgruber maethu merged commit 4ad5c22 into from
Mathias Leimgruber maethu deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
10 ftw/contentpage/tests/test_contentlisting.py
View
@@ -88,7 +88,7 @@ def test_viewlet(self):
self.assertFalse(viewlet.available())
# Create more content
subpage = self.contentpage.get(
- self.contentpage.invokeFactory('ContentPage', 'subpage'))
+ self.contentpage.invokeFactory('ContentPage', 'subpage', description='SubpageDescription'))
subpage.setTitle('Subpage')
# Test with umlauts
subpage.Schema()['categories'].set(subpage, '\xc3\xa4u\xc3\xa4')
@@ -99,7 +99,7 @@ def test_viewlet(self):
subpage2.Schema()['categories'].set(subpage2, 'DEMO2')
subpage2.reindexObject()
subpage3 = self.contentpage.get(
- self.contentpage.invokeFactory('ContentPage', 'subpage3'))
+ self.contentpage.invokeFactory('ContentPage', 'subpage3', description='OtherDescription'))
subpage3.setTitle('Subpage3')
subpage3.Schema()['categories'].set(subpage3, 'DEMO2')
subpage3.reindexObject()
@@ -108,11 +108,11 @@ def test_viewlet(self):
self.assertTrue(viewlet.available())
self.assertEquals(viewlet.get_content(),
[('\xc3\xa4u\xc3\xa4', [('Subpage',
- subpage.absolute_url())]),
+ subpage.absolute_url(), 'SubpageDescription')]),
('DEMO2', [('Subpage2',
- subpage2.absolute_url()),
+ subpage2.absolute_url(), 'Subpage2'),
('Subpage3',
- subpage3.absolute_url())])])
+ subpage3.absolute_url(), 'OtherDescription')])])
transaction.commit()
self._auth()
self.browser.open(self.contentpage.absolute_url())
4 ftw/contentpage/viewlets/contentlisting.pt
View
@@ -7,7 +7,7 @@
<li tal:repeat="item python:category[1]">
<a class="subelements-listing-element"
tal:attributes="href python:item[1];
- title python:item[0]"
+ title python:item[2]"
tal:content="python:item[0]">
<!-- Title -->
</a>
@@ -16,4 +16,4 @@
</ul>
</tal:loop>
-</div>
+</div>
3  ftw/contentpage/viewlets/contentlisting.py
View
@@ -29,7 +29,8 @@ def _create_resultmap(self, contents=None):
if cat not in resultmap:
resultmap[cat] = []
resultmap[cat].append((obj.title_or_id(),
- obj.absolute_url(), ))
+ obj.absolute_url(),
+ obj.Description() or obj.title_or_id()))
for value in resultmap.values():
value.sort()
Something went wrong with that request. Please try again.