diff --git a/compound/book/browser.py b/compound/book/browser.py index fff8064..cb4b44e 100644 --- a/compound/book/browser.py +++ b/compound/book/browser.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# Copyright (c) 2017 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ from loops.browser.concept import ConceptRelationView as \ BaseConceptRelationView from loops.browser.resource import ResourceView as BaseResourceView from loops.common import adapted, baseObject +from loops.util import _ standard_template = standard.standard_template @@ -54,42 +55,6 @@ class Base(object): def sectionType(self): return self.conceptManager['section'] - @Lazy - def isPartOfPredicate(self): - return self.conceptManager['ispartof'] - - @Lazy - def showNavigation(self): - return self.typeOptions.show_navigation - - @Lazy - def breadcrumbsParent(self): - for p in self.context.getParents([self.isPartOfPredicate]): - return self.nodeView.getViewForTarget(p) - - @Lazy - def neighbours(self): - pred = succ = None - parent = self.breadcrumbsParent - if parent is not None: - myself = None - children = list(parent.context.getChildren([self.isPartOfPredicate])) - for idx, c in enumerate(children): - if c == self.context: - if idx > 0: - pred = self.nodeView.getViewForTarget(children[idx-1]) - if idx < len(children) - 1: - succ = self.nodeView.getViewForTarget(children[idx+1]) - return pred, succ - - @Lazy - def predecessor(self): - return self.neighbours[0] - - @Lazy - def successor(self): - return self.neighbours[1] - @Lazy def tabview(self): if self.editable: @@ -181,10 +146,46 @@ class SectionView(Base, ConceptView): def macro(self): return book_template.macros['section'] + @Lazy + def isPartOfPredicate(self): + return self.conceptManager['ispartof'] + + @Lazy + def breadcrumbsParent(self): + for p in self.context.getParents([self.isPartOfPredicate]): + return self.nodeView.getViewForTarget(p) + + @Lazy + def showNavigation(self): + return self.typeOptions.show_navigation + + @Lazy + def neighbours(self): + pred = succ = None + parent = self.breadcrumbsParent + if parent is not None: + myself = None + children = list(parent.context.getChildren([self.isPartOfPredicate])) + for idx, c in enumerate(children): + if c == self.context: + if idx > 0: + pred = self.nodeView.getViewForTarget(children[idx-1]) + if idx < len(children) - 1: + succ = self.nodeView.getViewForTarget(children[idx+1]) + return pred, succ + + @Lazy + def predecessor(self): + return self.neighbours[0] + + @Lazy + def successor(self): + return self.neighbours[1] + class TopicView(Base, ConceptView): - breadcrumbsParent = ConceptView.breadcrumbsParent + tabTitle = _(u'title_bookTopicView') @Lazy def macro(self): diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index 1e54dfb..7c9d512 100644 Binary files a/locales/de/LC_MESSAGES/loops.mo and b/locales/de/LC_MESSAGES/loops.mo differ diff --git a/locales/de/LC_MESSAGES/loops.po b/locales/de/LC_MESSAGES/loops.po index c475e64..fed1354 100644 --- a/locales/de/LC_MESSAGES/loops.po +++ b/locales/de/LC_MESSAGES/loops.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: 0.13.1\n" "POT-Creation-Date: 2007-05-22 12:00 CET\n" -"PO-Revision-Date: 2015-10-25 12:00 CET\n" +"PO-Revision-Date: 2017-12-08 12:00 CET\n" "Last-Translator: Helmut Merz \n" "Language-Team: loops developers \n" "MIME-Version: 1.0\n" @@ -1002,6 +1002,9 @@ msgstr "Objekte löschen" msgid "confirm('Do you really want to delete the selected objects?')" msgstr "confirm('Wollen Sie die ausgewählten Objekte wirklich löschen?')" +msgid "title_bookTopicView" +msgstr "Übersicht" + # management interface msgid "label_type"