Example #1
0
def memberships_pretablehtml():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            cachetime = TableUpdateTime.query.filter_by(
                interest=localinterest(), tablename='member').one().lastchecked
            span(f'(last update time {cachet.dt2asc(cachetime)})')
    return pretablehtml.render()
Example #2
0
def positiondate_pretablehtml():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            filterdiv('positiondate-external-filter-startdate',
                      'In Position On')

    return pretablehtml.render()
def taskchecklist_pretablehtml():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            datefilter = filterdiv('positiondate-external-filter-startdate', 'In Position On')

            with datefilter:
                input(type='text', id='effective-date', name='effective-date' )
                button('Today', id='todays-date-button')

    return pretablehtml.render()
Example #4
0
def clubmembers_filters():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            datefilter = filterdiv('fsrcmembers-external-filter-asof', 'As Of')
            with datefilter:
                with span(id='spinner', style='display:none;'):
                    i(cls='fas fa-spinner fa-spin')
                input(type='text', id='effective-date', name='effective-date')
                button('Today', id='todays-date-button')
                cachetime = TableUpdateTime.query.filter_by(
                    interest=localinterest(),
                    tablename='member').one().lastchecked
                span(f'(last update time {cachet.dt2asc(cachetime)})')
            # filterdiv('members-external-filter-level', 'Levels')
    return pretablehtml.render()
Example #5
0
def distribution_pretablehtml():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            filterdiv('distribution-external-filter-tags', 'Tags')
            filterdiv('distribution-external-filter-positions', 'Positions')
            filterdiv('distribution-external-filter-roles', 'Roles')

            with filterdiv('distribution-external-filter-startdate',
                           'In Position On'):
                input(type='text',
                      id='effective-date',
                      name='effective-date',
                      _class='like-select2-sizing')
                button('Today', id='todays-date-button')

    return pretablehtml.render()
Example #6
0
def position_pretablehtml():
    pretablehtml = div()
    with pretablehtml:
        # hide / show hidden rows
        with filtercontainerdiv(style='margin-bottom: 4px;'):
            datefilter = filterdiv('positiondate-external-filter-startdate',
                                   'In Position On')

            with datefilter:
                input(type='text', id='effective-date', name='effective-date')
                button('Today', id='todays-date-button')

        # make dom repository for Editor wizard standalone form
        with div(style='display: none;'):
            dd(**{'data-editor-field': 'position_id'})
            dd(**{'data-editor-field': 'effective'})
            dd(**{'data-editor-field': 'members'})

    return pretablehtml.render()
Example #7
0
myactionitems_dbattrs = 'id,interest_id,action,status,comments,meeting.date,agendaitem.title,agendaitem.agendaitem,update_time,updated_by'.split(',')
myactionitems_formfields = 'rowid,interest_id,action,status,comments,date,agendatitle,agendatext,update_time,updated_by'.split(',')
myactionitems_dbmapping = dict(zip(myactionitems_dbattrs, myactionitems_formfields))
myactionitems_formmapping = dict(zip(myactionitems_formfields, myactionitems_dbattrs))
myactionitems_formmapping['date'] = lambda row: isodate.dt2asc(row.meeting.date) if row.meeting else ''
# todo: should this be in tables.py? but see https://github.com/louking/loutilities/issues/25
myactionitems_dbmapping['meeting.date'] = '__readonly__'
myactionitems_dbmapping['agendaitem.title'] = '__readonly__'
myactionitems_dbmapping['agendaitem.agendaitem'] = '__readonly__'
myactionitems_formmapping['update_time'] = lambda row: displaytime.dt2asc(row.update_time)
myactionitems_dbmapping['update_time'] = lambda form: datetime.now()
myactionitems_formmapping['updated_by'] = lambda row: LocalUser.query.filter_by(id=row.updated_by).one().name
myactionitems_dbmapping['updated_by'] = lambda form: user2localuser(current_user).id

agendaitems_filters = filtercontainerdiv()
agendaitems_filters += filterdiv('agendaitems-external-filter-status', 'Status')

agendaitems_yadcf_options = [
    yadcfoption('status:name', 'agendaitems-external-filter-status', 'multi_select', placeholder='Select statuses', width='200px'),
]

myactionitems_view = MyActionItemsView(
    roles_accepted=[ROLE_SUPER_ADMIN, ROLE_MEETINGS_ADMIN, ROLE_MEETINGS_MEMBER],
    local_interest_model=LocalInterest,
    app=bp,  # use blueprint instead of app
    db=db,
    model=ActionItem,
    version_id_col='version_id',  # optimistic concurrency control
    template='datatables.jinja2',
    templateargs={'adminguide': adminguide},