Пример #1
0
 def content(self, items):
     return HTML.ul(*[
         HTML.li(
             HTML.a(eid, href=self.dt.req.route_url('ecoregion', id=eid)))
         for eid in items
     ],
                    class_='unstyled')
Пример #2
0
 def format(self, item):
     taxon = self.get_obj(item)
     thumbnail = taxon.image_url('thumbnail', tag='thumbnail1') \
         or taxon.image_url('thumbnail', index=0)
     if thumbnail:
         return HTML.img(src=thumbnail)
     return ''
Пример #3
0
 def format(self, item):
     taxon = self.get_obj(item)
     thumbnail = taxon.image_url('thumbnail', tag='thumbnail1') \
         or taxon.image_url('thumbnail', index=0)
     if thumbnail:
         return HTML.img(src=thumbnail)
     return ''
Пример #4
0
 def format(self, item):
     lis = []
     if item.source:
         s = item.source
         if s.startswith('http://'):
             label = s
             for t in 'wikimedia wikipedia plantzafrica'.split():
                 if t in s:
                     label = t
                     break
             lis.append(external_link(s, label))
     lis.append(linked_references(self.dt.req, item))
     return HTML.ul(*lis, class_='unstyled')
Пример #5
0
 def format(self, item):
     lis = []
     if item.source:
         s = item.source
         if s.startswith('http://'):
             label = s
             for t in 'wikimedia wikipedia plantzafrica'.split():
                 if t in s:
                     label = t
                     break
             lis.append(external_link(s, label))
     lis.append(linked_references(self.dt.req, item))
     return HTML.ul(*lis, class_='unstyled')
Пример #6
0
 def format(self, item):
     if hasattr(item, 'valueset'):
         item = item.valueset.language
     return HTML.span(map_marker_img(self.dt.req, item), item.lineage.name)
Пример #7
0
 def format(self, item):
     res = NameCol.format(self, item)
     if item.editor:
         return HTML.span(res, HTML.span(' [ed.]'))
     return res
Пример #8
0
 def format(self, item):
     return HTML.ul(
         *[HTML.li(o.name + ',') for o in getattr(item, self.__rel_name__)],
         class_="unstyled")
Пример #9
0
 def content(self, items):
     return HTML.ul(*[
         HTML.li(HTML.a(eid, href=self.dt.req.route_url('ecoregion', id=eid)))
         for eid in items],
         class_='unstyled')
Пример #10
0
 def format(self, item):
     if hasattr(item, 'valueset'):
         item = item.valueset.language
     return HTML.span(map_marker_img(self.dt.req, item), item.lineage.name)
Пример #11
0
 def format(self, item):
     return HTML.ul(
         *[HTML.li(HTML.span(t, class_="label label-info"))
                   for t in split_ids(item.name)],
         class_='unstyled')
Пример #12
0
 def format(self, item):
     names = [
         o.name for o in item.valueset.parameter.categories
         if o.language_pk == item.valueset.language_pk]
     return HTML.ul(*[HTML.li(name) for name in names], class_="unstyled")
Пример #13
0
 def format(self, item):
     return HTML.ul(*[
         HTML.li(HTML.span(t, class_="label label-info"))
         for t in split_ids(item.name)
     ],
                    class_='unstyled')
Пример #14
0
 def format(self, item):
     return HTML.img(src=item.jsondata['thumbnail'])
Пример #15
0
 def format(self, item):
     return HTML.span(LinkCol.format(self, item),
                      style="font-family: monospace;")
Пример #16
0
 def format(self, item):
     res = NameCol.format(self, item)
     if item.editor:
         return HTML.span(res, HTML.span(' [ed.]'))
     return res
Пример #17
0
 def format(self, item):
     return HTML.span(LinkCol.format(self, item), style="font-family: monospace;")
Пример #18
0
 def format(self, item):
     return HTML.img(src=item.jsondata['thumbnail'])
Пример #19
0
 def format(self, item):
     obj = self.get_obj(item)
     names = [
         self._cat(o) for o in obj.categories if o.language_pk in self.lang_dict]
     return HTML.ul(*[HTML.li(name) for name in names], class_="unstyled")
Пример #20
0
 def format(self, item):
     item = self.get_obj(item)
     if item.thumbnail:
         return HTML.img(src=self.dt.req.file_url(item.thumbnail))
     return ''
Пример #21
0
 def format(self, item):
     return HTML.ul(
         *[HTML.li(o.name + ',') for o in getattr(item, self.__rel_name__)],
         class_="unstyled")