Example #1
0
class Persons(PersonListingTab):
    sort_on = 'lastname'

    show_selects = False
    filterlist_name = 'person_state_filter'
    filterlist_available = True
    filterlist = FilterList(
        Filter('filter_all', tmf('all')),
        ActiveOnlyFilter('filter_active', tmf('Active'), default=True))

    enabled_actions = []
    major_actions = []
Example #2
0
class Organizations(OrganizationListingTab):
    sort_on = 'name'

    show_selects = False
    filterlist_name = 'organization_state_filter'
    filterlist_available = True
    filterlist = FilterList(
        Filter('filter_all', tmf('label_tabbedview_filter_all')),
        ActiveOnlyFilter('filter_active', tmf('Active'), default=True))

    enabled_actions = []
    major_actions = []
Example #3
0
class Committees(grok.View, GeverTabMixin):
    grok.name('tabbedview_view-committees')
    grok.context(ICommitteeContainer)
    grok.require('zope2.View')
    grok.template('committee')

    filterlist_name = 'committee_state_filter'
    filterlist_available = True
    filterlist = FilterList(
        Filter('filter_all', tmf('all')),
        ActiveOnlyFilter('filter_active', tmf('Active'), default=True))

    def __call__(self):
        self.selected_filter_id = self.request.get(self.filterlist_name)
        return super(Committees, self).__call__()

    def extend_query_with_statefilter(self, query):
        return self.filterlist.update_query(
            query, self.request.get(self.filterlist_name))

    def committees(self):
        committees = []
        filter = self.get_filter_text()
        query = Committee.query.order_by(Committee.title)
        query = query.by_searchable_text(text_filters=filter)
        query = self.extend_query_with_statefilter(query)

        for committee in query.all():
            content_obj = committee.resolve_committee()
            if not content_obj:
                continue
            if not api.user.has_permission('View', obj=content_obj):
                continue

            committees.append({
                'title':
                committee.title,
                'url':
                committee.get_url(),
                'state_class':
                'active' if committee.is_active() else 'inactive',
                'number_unscheduled_proposals':
                len(meeting_service().get_submitted_proposals(committee)),
                'next_meeting':
                Meeting.query.get_next_meeting(committee),
                'last_meeting':
                Meeting.query.get_last_meeting(committee)
            })

        return committees
Example #4
0
class Organizations(OrganizationListingTab):
    grok.name('tabbedview_view-organizations')
    grok.context(IContactFolder)

    sort_on = 'name'

    show_selects = False
    filterlist_name = 'organization_state_filter'
    filterlist_available = True
    filterlist = FilterList(
        Filter('filter_all', tmf('all')),
        ActiveOnlyFilter('filter_active', tmf('Active'), default=True))

    enabled_actions = []
    major_actions = []