Exemplo n.º 1
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'), getter=getHealth),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('User'),
                        getter=getUserName,
                        cell_formatter=fsearch_user_formatter),
        IctGetterColumn(title=_('Room'),
                        getter=lambda i, f: i.room,
                        cell_formatter=link('details.html')),
        DateGetterColumn(title=_('Modified'),
                         getter=getModifiedDate,
                         subsort=True,
                         cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4, 5]
Exemplo n.º 2
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IpGetterColumn(title=_('IP'),
                       getter=getIpAddr,
                       cell_formatter=link('overview.html')),
        IpGetterColumn(title=_('hostname'),
                       getter=getHostname,
                       cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('User'),
                        getter=getUserName,
                        cell_formatter=fsearch_user_formatter),
        DateGetterColumn(title=_('Modified'),
                         getter=getModifiedDate,
                         subsort=True,
                         cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
Exemplo n.º 3
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('Contract type')),
#                        getter=lambda i,f: i.type,
#                        cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('expiration date'),
                        getter=lambda i,f: i.expirationDate,
                        cell_formatter=link('details.html')),
        IctGetterColumn(title=_('annual charges'),
                        getter=lambda i,f: i.annualCharges,
                        cell_formatter=link('details.html')),
        DateGetterColumn(title=_('Modified'),
                        getter=getModifiedDate,
                        subsort=True,
                        cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
        )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4, 5]
Exemplo n.º 4
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'),
                     getter=getHealth),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('Members'),
                        getter=getMembers,
                        cell_formatter=raw_cell_formatter),
        DateGetterColumn(title=_('Modified'),
                        getter=getModifiedDate,
                        subsort=True,
                        cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
        )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
Exemplo n.º 5
0
class FSearchForm(Overview):
    """ Search Form """
    #    form.extends(form.Form)
    label = _(u"Search for what?")
    fsearchText = None
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'), getter=getHealth),
        #TitleGetterColumn(title=_('Title'),
        #getter=getTitle),
        GetterColumn(title=_('Type'),
                     getter=getTypeName,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        GetterColumn(title=_('Modified'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
    status = None
    firstSortOn = _('Title')

    def objs(self):
        """List of Content objects"""
        retList = []
        if self.fsearchText is not None and \
            len(self.fsearchText) > 0:
            my_catalog = zapi.getUtility(ICatalog)
            try:
                res = my_catalog.searchResults(
                    all_fulltext_index=self.fsearchText)
                for obj in res:
                    retList.append(obj)
            except ParseError, errText:
                self.status = u"Error: '%s'" % errText
        return retList