Commit 16f50325 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Display archive unit as parent in breadcrumbs for data object in simplified profiles

parent eea6033bc0cf
......@@ -21,7 +21,7 @@ from logilab.mtconverter import xml_escape
from cubicweb import tags, view, _
from cubicweb.predicates import match_form_params, is_instance
from cubicweb.web.views import uicfg, tabs
from cubicweb.web.views import uicfg, tabs, ibreadcrumbs
from cubes.relationwidget import views as rwdg
from cubes.skos.views import widgets as skos
......@@ -315,3 +315,13 @@ class UnitBusinessValueEntityView(viewlib.BusinessValueEntityView):
unit = self._cw._('<no unit specified>')
self.w(u' (%s)' % xml_escape(unit))
class IBreadCrumbsAdapter(ibreadcrumbs.IBreadCrumbsAdapter):
"""Override adapter from compound when BDO is within a simplified profile to display the archive
unit as parent.
__select__ = is_instance('SEDABinaryDataObject') & simplified_profile()
def parent_entity(self):
return self.entity.cw_adapt_to('ITreeBase').parent()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment