{%- macro list_groups(groups) -%} {%- if groups -%} {%- endif -%} {%- endmacro -%} {%- macro date(d) -%} {{d.format('YYYY-MM-DD hh:mm A')}} ({{d.humanize()}}) {%- endmacro -%}

Recent users

{%- for user,last_seen in users -%} {%- endfor -%}
Username Groups Last seen
ℹ︎ {{user.humanize}} {{list_groups(user.groups)}} {{date(last_seen)}}
{% if focus_user %}
{% with user=focus_user, profile=focus_user.profile %}

Profile for {{user.humanize}} {% if user.name != user.humanize %}({{user.name}}){% endif %} {{list_groups(user.groups)}}

{% if profile.avatar %} {% endif %} {% if profile.bio %}

{{profile.bio}}

{% endif %}
{% endwith %}
{% endif %}

Access Log

{%- set columns = [ ('authorized',True,1), ('date',False,1), ('user',True,2), ('entry',True,1), ('groups',False,1), ] -%} {%- set headers = { 'authorized': 'Vis', } -%} {%- macro format(col, rec, grouper=False) -%} {%- if col == 'entry' -%} {{rec.title}} {%- elif col == 'date' -%} {{rec.format('YYYY-MM-DD hh:mm A')}} {%- elif col == 'profile' -%} ℹ︎ {%- elif col == 'user' -%} {{rec.humanize}} {%- elif col == 'groups' -%}{{list_groups(rec)}} {%- elif col == 'authorized' -%} {%- if grouper -%} {{'Authorized' if rec else 'Forbidden'}} {%- else -%} {{'✅' if rec else '❌'}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- macro column(col, rec, add_class='') -%} {%- if col != by -%}{{format(col, rec)}}{%- endif -%} {%- endmacro -%} {%- macro show_row(access) -%} {{column('authorized', access.authorized)}} {{column('date', access.date)}} {%- if by != 'user' -%} {{column('profile', access.user, ' admin' if access.user.is_admin else '')}} {{column('user', access.user, ' admin' if access.user.is_admin else '')}} {%- endif -%} {{column('entry', access.entry)}} {{column('groups', access.user_groups)}} {%- endmacro -%} {%- macro navlink(group,offset=request.args['offset'],count=request.args['count'],days=request.args['days']) -%} {{url_for('admin',by=group or None,offset=offset or None,count=count or None,days=days or None,_anchor='access')}} {%- endmacro -%} {%- set paging -%} {%- endset -%} {{paging}} {%- for column, groupable, colspan in columns -%} {%- if by != column -%} {%- endif -%} {%- endfor -%} {%- if by -%} {%- for group in log|groupby(by)|sort -%} {%- for access in group.list|sort(True,'date') -%} {{ show_row(access) }} {%- endfor -%} {%- endfor -%} {%- else -%} {%- for access in log|sort(True,'date') -%} {{ show_row(access) }} {%- endfor -%} {%- endif -%}
{%- if groupable -%} {{headers.get(column,column.title())}} {%- elif column == 'date' -%} {{column.title()}} {%- else -%} {{column.title()}} {%- endif -%}
{{format(by, group.grouper, True)}}
{{paging}}