Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_legends(self):
def img(spec):
return HTML.img(
src=svg.data_url(svg.icon(spec)), height='20', width='20', style='margin-left: 0.5em;')
def desc(text):
return HTML.span(text, style='margin-left: 0.5em; margin-right: 0.5em;')
values = [desc('Most extensive description is a ...')]
for sdt in get_parameter('med').domain:
icon = self.de_to_icon['med'][sdt.id.split('-')[1]]
values.append(
HTML.label(
HTML.input(
type='checkbox',
checked='checked',
id='marker-toggle-sdt-' + str(sdt.number),
onclick='GLOTTOLOG3.LangdocStatus.toggleMarkers()'),
img(icon.shape + 'ffffff' if self.focus == 'ed' else 'c' + icon.color),
desc(sdt.name)))
values.append(desc('Language is ...'))
for ed in get_parameter('aes').domain:
icon = self.de_to_icon['aes'][ed.id.split('-')[1]]
values.append((
HTML.label(
HTML.input(
type='checkbox',
checked='checked',
id='marker-toggle-ed-' + str(ed.number),
onclick='GLOTTOLOG3.LangdocStatus.toggleMarkers()'),
def __init__(self, dt, name, **kw):
ma = DBSession.query(Parameter).filter(Parameter.id == 'macroarea').one()
kw['choices'] = [de.name for de in ma.domain]
kw['bSortable'] = False
kw['sDescription'] = HTML.span(
'see ',
HTML.a('glossary',
href=dt.req.route_url('home.glossary', _anchor='macroarea')))
super(MacroareaCol, self).__init__(dt, name, **kw)
def td(icon):
return HTML.td(
marker_img(icon.url(req)),
onclick='CLLD.reload({"%s": "%s"})' % (param, icon.name))
rows = [
def format(self, item):
return button(
self.button_text,
href=self.dt.req.resource_url(self.get_obj(item), ext='snippet.html'),
title="show details",
class_="btn-info details",
tag=HTML.button)
def doc(self):
items = []
for col in self.ctx.cols:
dsc = col.js_args.get('sDescription')
if dsc:
items.extend([HTML.dt(col.js_args['sTitle']), HTML.dd(dsc)])
return HTML.dl(
HTML.p(
'Columns containing numeric data may be filtered giving upper or lower '
'bounds in the form "<5" or ranges in the form "-2..20".'),
self.ctx.options.get('sDescription', ''),
*items)
def doc(self):
items = []
for col in self.ctx.cols:
dsc = col.js_args.get('sDescription')
if dsc:
items.extend([HTML.dt(col.js_args['sTitle']), HTML.dd(dsc)])
return HTML.dl(
HTML.p(
'Columns containing numeric data may be filtered giving upper or lower '
'bounds in the form "<5" or ranges in the form "-2..20".'),
self.ctx.options.get('sDescription', ''),
*items)
def coins(self, req):
return HTML.span(
' ',
**coins.ContextObject.from_bibtex(
req.dataset.name, self.bibtex()).span_attrs()
)