web/views/baseviews.py
changeset 8900 010a59e12d89
parent 8745 00c5ea2a064a
child 8995 a90a98800578
equal deleted inserted replaced
8899:c7a95ebcc093 8900:010a59e12d89
   591     def index_link(self, basepath, key, items):
   591     def index_link(self, basepath, key, items):
   592         """represent a single month entry"""
   592         """represent a single month entry"""
   593         year, month = key
   593         year, month = key
   594         label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[int(month)-1]),
   594         label = u'%s %s [%s]' % (self._cw._(calendar.MONTHNAMES[int(month)-1]),
   595                                  year, len(items))
   595                                  year, len(items))
   596         etypes = set(entity.__regid__ for entity in items)
   596         etypes = set(entity.cw_etype for entity in items)
   597         vtitle = '%s %s' % (', '.join(display_name(self._cw, etype, 'plural')
   597         vtitle = '%s %s' % (', '.join(display_name(self._cw, etype, 'plural')
   598                                       for etype in etypes),
   598                                       for etype in etypes),
   599                             label)
   599                             label)
   600         title = self._cw._('archive for %(month)s/%(year)s') % {
   600         title = self._cw._('archive for %(month)s/%(year)s') % {
   601             'month': month, 'year': year}
   601             'month': month, 'year': year}
   618 
   618 
   619     def index_link(self, basepath, key, items):
   619     def index_link(self, basepath, key, items):
   620         if key[0] is None:
   620         if key[0] is None:
   621             return
   621             return
   622         label = u'%s [%s]' % (key[0], len(items))
   622         label = u'%s [%s]' % (key[0], len(items))
   623         etypes = set(entity.__regid__ for entity in items)
   623         etypes = set(entity.cw_etype for entity in items)
   624         vtitle = self._cw._('%(etype)s by %(author)s') % {
   624         vtitle = self._cw._('%(etype)s by %(author)s') % {
   625             'etype': ', '.join(display_name(self._cw, etype, 'plural')
   625             'etype': ', '.join(display_name(self._cw, etype, 'plural')
   626                                for etype in etypes),
   626                                for etype in etypes),
   627             'author': label}
   627             'author': label}
   628         url = self.index_url(basepath, key[1], vtitle=vtitle)
   628         url = self.index_url(basepath, key[1], vtitle=vtitle)