[gen] Added the possibility to define dict someClass.styles (with, currently, a single entry 'title'), allowing to specify alternative CSS classes for class-related elements (here, 'title' allows to define an alternative CSS class for the link allowing to click on some instance of the class on a query or ref).

This commit is contained in:
Gaetan Delannay 2013-04-27 02:15:44 +02:00
parent ca16f8989c
commit 1c3555fd28
8 changed files with 61 additions and 42 deletions

View file

@ -810,6 +810,15 @@ class BaseMixin:
res['css'] = css
res['js'] = js
def getCssFor(self, elem):
'''Gets the name of the CSS class to use for styling some p_elem. If
self's class does not define a dict "styles", the defaut CSS class
to use will be named p_elem.'''
klass = self.getClass()
if hasattr(klass, 'styles') and (elem in klass.styles):
return klass.styles[elem]
return elem
def getColumnsSpecifiers(self, columnLayouts, dir):
'''Extracts and returns, from a list of p_columnLayouts, the information
that is necessary for displaying a column in a result screen or for