File tree 2 files changed +18
-14
lines changed
src/recensio/plone/browser
2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 11
11
from ZTUtils import make_query
12
12
13
13
14
- class RecensioFacetedQueryHandler (FacetedQueryHandler ):
15
- """Add recensio capabilities"""
16
-
17
- def punctuated_title_and_subtitle (self , obj ):
18
- return punctuated_title_and_subtitle (obj )
19
-
20
-
21
14
class ResultsListing (BrowserView ):
22
15
"""Lists search results."""
23
16
@@ -35,6 +28,14 @@ class ListingBase(BrowserView):
35
28
def punctuated_title_and_subtitle (self , obj ):
36
29
return punctuated_title_and_subtitle (obj )
37
30
31
+ def publication_reference (self , item ):
32
+ obj = item .getObject ()
33
+ view = api .content .get_view (
34
+ context = obj , request = self .request , name = "breadcrumbs_view"
35
+ )
36
+ breadcrumbs = list (view .breadcrumbs ())[2 :- 1 ]
37
+ return ", " .join ([crumb ["Title" ] for crumb in breadcrumbs ])
38
+
38
39
@property
39
40
def rss_url (self ):
40
41
portal_url = api .portal .get ().absolute_url ()
@@ -56,6 +57,10 @@ def translate(self, msgid):
56
57
)
57
58
58
59
60
+ class RecensioFacetedQueryHandler (FacetedQueryHandler , ListingBase ):
61
+ """Add recensio capabilities"""
62
+
63
+
59
64
class ReviewSectionsListing (ListingBase ):
60
65
@property
61
66
def title (self ):
Original file line number Diff line number Diff line change 171
171
</span >
172
172
173
173
<span class =" review-author"
174
+ tal : define ="
175
+ publication_reference python: view.publication_reference(result);
176
+ "
174
177
tal : condition =" python:is_review and review_authors"
175
178
>
176
179
<br />
183
186
/
184
187
</tal : c ></tal : repeatblock ></tal : nameblock ></tal : author ><tal : block tal : condition =" result/get_publication_title | nothing" >,
185
188
</tal : block >
186
- <tal : block tal : condition =" result/get_publication_title | nothing" >
187
- <tal : journal tal : condition =" result/get_publication_title | nothing"
188
- i18n : translate =" source_journal"
189
- >in:
190
- <tal : block i18n : name =" publication_volume_issue" ><tal : publication tal : replace =" result/get_publication_title" />,
191
- <tal : block replace =" result/get_volume_title" /><tal : comma tal : condition =" result/get_issue_title|nothing" >,
192
- </tal : comma ><tal : block replace =" result/get_issue_title" /></tal : block >
189
+ <tal : block tal : condition =" publication_reference" >
190
+ <tal : journal i18n : translate =" source_journal" >in:
191
+ <tal : block i18n : name =" publication_volume_issue" ><tal : publication tal : replace =" publication_reference" /></tal : block >
193
192
</tal : journal ><tal : pages tal : condition =" result_obj/page_start_end_in_print|nothing" >,
194
193
<tal : block i18n : translate =" text_pages" >p.</tal : block >
195
194
<tal : block tal : replace =" result_obj/page_start_end_in_print" /></tal : pages >
You can’t perform that action at this time.
0 commit comments