Beispiel #1
0
    def _filter_info(self):
        #logger.info('Caching filter info')
        
        subjects = set()
        years = set()
        months = set()

        for brain in self.contents():
            for s in brain.Subject:
                subjects.add(s)
            if brain.publish_year:
                years.add(brain.publish_year)
            if brain.publish_month:
                months.add(brain.publish_month)
        subjects = list(subjects)
        years = list(years)
        months = list(months)

        subjects.sort()
        years.sort()
        months.sort()

        return [
            {
                'id': 'Subject:list',
                'title': _(u'select_category_option', default=u'Category'),
                'options': subjects,
                'selected': None
            },
            {
                'id': 'publish_year',
                'title': _(u'select_year_option', default=u'Year'),
                'options': years,
                'selected': None
            },
            {
                'id': 'publish_month',
                'title': _(u'select_month_option', default=u'Month'),
                'options': months,
                'selected': None
            }
        ]
Beispiel #2
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen. Here, we use the title that the user gave.
     """
     blog_title = self.target_blog and self.target_blog.title()
     return _(u"Blog Archive: ${blog}", mapping={'blog':blog_title})
Beispiel #3
0
 def title(self):
     """This property is used to give the title of the portlet in the
     "manage portlets" screen.
     """
     return _(u"Blog filter portlet")
Beispiel #4
0
 def title(self):
     return self.name or _(u'Share post')
Beispiel #5
0
 def header(self):
     return self.data.name or _(u'Share post')
Beispiel #6
0
 def header(self):
     blog_title = self.blog() and self.blog().title
     return _(u"Manage Blog: ${blog}", mapping={'blog':blog_title})