Beispiel #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')
Beispiel #2
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')
Beispiel #3
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')
Beispiel #4
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')
Beispiel #5
0
 def format(self, item):
     return HTML.ul(
         *[HTML.li(o.name + ',') for o in getattr(item, self.__rel_name__)],
         class_="unstyled")
Beispiel #6
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')
Beispiel #7
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")
Beispiel #8
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")
Beispiel #9
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')
Beispiel #10
0
 def format(self, item):
     return HTML.ul(
         *[HTML.li(o.name + ',') for o in getattr(item, self.__rel_name__)],
         class_="unstyled")