Commit 7ab67acd authored by Vladimir Popescu's avatar Vladimir Popescu
Browse files

[views] Enable CSS customization on outofcontext views (closes #4142552).

parent 93802d8a790e
......@@ -24,6 +24,7 @@ class BrainomicsAbstractOutOfContextView(EntityView):
__abstract__ = True
icon = None
local_image = None
css_class = None
def add_icon(self):
if self.icon:
......@@ -40,7 +41,11 @@ class BrainomicsAbstractOutOfContextView(EntityView):
def cell_call(self, row, col):
w = self.w
entity = self.cw_rset.get_entity(row, col)
w(u'<div class="ooview"><div class="well"><div class="row">')
klass = [u'ooview']
if self.css_class is not None:
klass.append(self.css_class)
klass = ' '.join(klass)
w(u'<div class="%s"><div class="well"><div class="row">' % klass)
self.add_icon()
w(u'<div class="col-md-10"><h4>%s</h4></div>' % entity.view('incontext'))
w(u'</div>')
......@@ -147,7 +152,6 @@ class DrugContextView(BrainomicsAbstractOutOfContextView):
__select__ = BrainomicsAbstractOutOfContextView.__select__ & is_instance('Drug')
icon = 'tint'
class DrugTakeContextView(BrainomicsAbstractOutOfContextView):
__select__ = BrainomicsAbstractOutOfContextView.__select__ & is_instance('DrugTake')
icon = 'calendar'
......
Supports Markdown
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