From 67fe55056f228a949be3bb060edd1993f49df89a Mon Sep 17 00:00:00 2001
From: Helmut Merz
Date: Fri, 17 Apr 2015 11:17:37 +0200
Subject: [PATCH] show resources (other than text) in book_topic_view
---
compound/book/browser.py | 5 ++++-
compound/book/view_macros.pt | 13 ++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/compound/book/browser.py b/compound/book/browser.py
index fb6fcf6..fb43ab2 100644
--- a/compound/book/browser.py
+++ b/compound/book/browser.py
@@ -107,6 +107,7 @@ class Base(object):
@Lazy
def textResources(self):
self.images = [[]]
+ self.otherResources = []
result = []
idx = 0
for rv in self.getResources():
@@ -115,7 +116,7 @@ class Base(object):
idx += 1
result.append(rv)
self.images.append([])
- else:
+ elif rv.context.contentType.startswith('image/'):
self.registerDojoLightbox()
url = self.nodeView.getUrlForTarget(rv.context)
src = '%s/mediaasset.html?v=small' % url
@@ -123,6 +124,8 @@ class Base(object):
img = dict(src=src, fullImageUrl=fullSrc, title=rv.title,
description=rv.description, url=url, object=rv)
self.images[idx].append(img)
+ else:
+ self.otherResources.append(rv)
return result
def getDocumentTypeForResource(self, r):
diff --git a/compound/book/view_macros.pt b/compound/book/view_macros.pt
index c85a69c..1fcf7b1 100644
--- a/compound/book/view_macros.pt
+++ b/compound/book/view_macros.pt
@@ -130,7 +130,8 @@
+ textResources textResources|item/textResources;
+ resources item/otherResources">
Children
@@ -151,8 +152,18 @@
more...
+
+
+ ![]()
+
+