'Provide a dropdown of links to events'

def event_list(self):

    T = current.T
    s3db = current.s3db
    resource = s3db.resource('event_event')
    data = resource.select(['id', 'name'])
    event_list = UL(_id='event_list', _class='f-dropdown', data={'dropdown-content': ''})
    rows = data['rows']
    if rows:
        for row in rows:
            event_list.append(LI(A(row['event_event.name'], _href=URL(c='event', f='event', args=[row['event_event.id']]))))
        return LI(A(T('Events'), _class='button    dropdown', data={'dropdown': 'event_list'}), event_list)
    else:
        return ''
