'Handle HTML representation
@param r: the S3Request
@param attr: controller arguments'

def _html(self, r, **attr):

    T = current.T
    alerts = self._alerts_html()
    events = self._events_html()
    map_id = 'incident-gis_location_the_geom-map-filter-map'
    (_map, button) = self._map('Incidents', map_id=map_id, filter=True)
    output = {'alerts': alerts, 'events': events, '_map': _map}
    date_filter = S3DateFilter(['date', 'end_date'], label='', slider=True, clear_text='X')
    date_filter.input_labels = {'ge': 'Start    Time/Date', 'le': 'End    Time/Date'}
    filter_widgets = [S3TextFilter(['name', 'comments'], formstyle=text_filter_formstyle, label=T('Search'), _placeholder=T('Enter    search    term\xe2\x80\xa6')), S3LocationFilter('location_id', label='', widget='multiselect', levels=('L3',)), S3MapFilter('location_id$the_geom', label='', button=button), S3OptionsFilter('tag.tag_id', label='', noneSelectedText='Tag', no_opts=''), S3OptionsFilter('source', label='', noneSelectedText='Source', no_opts=''), S3OptionsFilter('status', label='', noneSelectedText='Status', no_opts=''), S3OptionsFilter('incident_type_id', label='', noneSelectedText='Incident    Type', no_opts=''), S3OptionsFilter('organisation_id', label='', noneSelectedText='Agency', no_opts=''), date_filter]
    user = current.auth.user
    if user:
        filter_widgets.insert(1, S3OptionsFilter('bookmark.user_id', label='', options={'*': T('All'), user.id: T('My    Bookmarks')}, cols=2, multiple=False, table=False))
    filter_form = S3FilterForm(filter_widgets, formstyle=filter_formstyle_profile, submit=True, ajax=True, url=URL(args=['browse.dl'], vars={}), ajaxurl=URL(c='event', f='incident', args=['filter.options'], vars={}))
    output['filter_form'] = filter_form.html(r.resource, r.get_vars, target=('%s    custom-list-event_incident' % map_id), alias=None)
    tablename = 'event_incident'
    ajax_vars = {'browse': 1}
    self._datatable(output=output, tablename=tablename, search=False, updateable=False, export=True, ajax_vars=ajax_vars)
    self._view(output, 'incident_browse.html')
    return output
