{% extends 'layouts/app.twig' %} {% import 'macros/base.twig' as m %} {% import 'macros/form.twig' as f %} {% block title %}{{ __('log.log') }}{% endblock %} {% block content %}

{{ block('title') }} ({{ entries|length }})

{{ csrf() }}
{{ f.input('search', __('form.search'), { 'value': search, 'hide_label': true, }) }}
{% if has_permission_to('logs.all') %}
{{ f.select('search_user_id', __('general.user'), users, { 'default_option': __('form.user_select'), 'selected': search_user_id, }) }}
{% endif %}
{{ f.submit(__('form.search'), {'icon_left': 'search'}) }}
{% if not has_permission_to('logs.all') %}
{{ m.alert(__('log.only_own')) }}
{% endif %} {% for entry in entries %} {%- set type = 'default' %} {%- if entry.level in ['notice', 'info'] %} {%- set type = 'info' %} {%- endif %} {%- if entry.level in ['error', 'warning'] %} {%- set type = 'warning' %} {%- endif %} {%- if entry.level in ['emergency', 'alert', 'critical'] %} {%- set type = 'danger' %} {%- endif %} {%- set td_type = '' %} {%- if type in ['warning', 'danger'] %} {%- set td_type = type %} {%- endif %} {% endfor %}
{{ __('log.time') }} {{ __('log.level') }} {{ __('general.user') }} {{ __('log.message') }}
{{ entry.created_at.format(__('general.datetime')) }} {{ entry.level|capitalize }} {% if entry.user %}{{ m.user(entry.user) }}{% endif %} {{ entry.message|nl2br }}
{% endblock %}