Ejemplo n.º 1
0
    def columns(self):
        columns = (
            {'column': 'getContentType',
             'column_title': _(u'column_type', default=u'Type'),
             'sort_index': 'getContentType',
             'transform': file_link(icon=True, icon_only=True)},

            {'column': 'Title',
             'column_title': _(u'column_title', default=u'Title'),
             'sort_index': 'sortable_title',
             'transform': file_link(icon=False)},

            {'column': 'modified',
             'column_title': _(u'column_modified', default=u'modified'),
             'sort_index': 'modified',
             'transform': helper.readable_date,
             },

            {'column': 'Creator',
             'column_title': _(u'column_creater', default=u'creater'),
             'transform': helper.readable_author,
             },

            {'column': 'getObjSize',
             'column_title': _(u'column_size', default=u'size'),
             },

            {'column': 'review_state',
             'column_title': _(u'review_state', default=u'Review State'),
             'transform': helper.translated_string(),
             },

            {'column': 'id',
             'column_title': _(u'ID', default=u'ID'),
             'sort_index': 'id',
             },
            )

        if HAS_FILE:
            columns += (
                {'column': 'documentDate',
                 'column_title': _(u'column_documen_date',
                                   default=u'Document date'),
                 'sort_index': 'documentDate',
                 'transform': helper.readable_date},)

        return columns
Ejemplo n.º 2
0
class TaskTab(listing.CatalogListingView):
    """Lists all tasks within this context in a tabbedview listing tab.
    """

    types = ('Task', )

    sort_on = 'sortable_title'

    show_selects = False
    show_menu = False

    columns = (
        {
            'column': 'Title',
            'sort_index': 'sortable_title',
            'column_title': _(u'label_taskstab_title', default=u'Title'),
            'transform': helper.linked
        },
        {
            'column': 'end',
            'column_title': _(u'label_taskstab_end_date', default=u'End'),
            'transform': helper.readable_date_time_text,
            'width': 90
        },
        {
            'column':
            'getResponsibility',
            'column_title':
            _(u'label_taskstab_responsibility', default=u'Responsibility'),
            'transform':
            readable_responsible
        },
        {
            'column': 'review_state',
            'column_title': _(u'label_taskstab_review_state',
                              default=u'State'),
            'transform': helper.translated_string(),  # default is plone domain
            'width': 70
        },
        {
            'column': 'Creator',
            'column_title': _(u'label_taskstab_creator', default=u'Creator'),
            'transform': helper.readable_author
        },
    )
Ejemplo n.º 3
0
 def test_translate_unicode_string_returns_unicode(self):
     result = translated_string('ftw.table')(object, u'sortAscText')
     self.assertEquals(u'Ascending', result)
     self.assertEquals(unicode, type(result))
Ejemplo n.º 4
0
 def test_translate_none_returns_none_string(self):
     result = translated_string('ftw.table')(object, None)
     self.assertEquals(u'None', result)
     self.assertEquals(unicode, type(result))
 def test_translate_unicode_string_returns_unicode(self):
     result = translated_string("ftw.table")(object, u"sortAscText")
     self.assertEquals(u"Ascending", result)
     self.assertEquals(unicode, type(result))
 def test_translate_none_returns_none_string(self):
     result = translated_string("ftw.table")(object, None)
     self.assertEquals(u"None", result)
     self.assertEquals(unicode, type(result))