misuzu/templates/manage/users/notes.twig

100 lines
5.7 KiB
Twig
Raw Normal View History

2023-07-25 14:40:31 +00:00
{% extends 'manage/users/master.twig' %}
{% from 'macros.twig' import pagination, container_title, avatar %}
2023-09-08 20:40:48 +00:00
{% set notes_pagination = pagination(manage_notes_pagination, 'manage-users-notes', {'user': manage_notes_filter_user.id|default(0)}) %}
2023-07-25 14:40:31 +00:00
{% set notes_filtering = manage_notes_filter_user is not null %}
{% block manage_content %}
<div class="container manage__notes">
2023-07-26 22:43:50 +00:00
{{ container_title('<i class="fas fa-sticky-note fa-fw"></i> Moderator Notes') }}
2023-07-25 14:40:31 +00:00
<div class="manage__description">
Private moderator notes, can be used for anything you'd like to share internally.
{% if not notes_filtering %}Filter by a user to create a new note.{% endif %}
</div>
{% if notes_pagination|trim|length > 0 %}
<div class="manage__notes__pagination">
{{ notes_pagination }}
</div>
{% endif %}
{% if notes_filtering %}
<div class="manage__notes__actions">
<a href="{{ url('manage-users-note', {'user': manage_notes_filter_user.id}) }}" class="input__button">New Note</a>
</div>
{% endif %}
<div class="manage__notes__list">
{% for note in manage_notes %}
<div class="manage__notes__item">
<div class="manage__notes__item__header">
<div class="manage__notes__item__title"><a href="{{ url('manage-users-note', {'note': note.info.id}) }}">{{ note.info.title }}</a></div>
<div class="manage__notes__item__actions">
<a href="{{ url('manage-users-note', { note: note.info.id }) }}" title="View/Edit" class="input__button input__button--autosize manage__notes__item__action"><i class="fas fa-pen fa-fw"></i></a>
<a href="{{ url('manage-users-note-delete', { note: note.info.id, csrf: csrf_token() }) }}" title="Delete" class="input__button input__button--autosize input__button--destroy manage__notes__item__action" onclick="return confirm('Are you sure?');"><i class="fas fa-times fa-fw"></i></a>
2023-07-25 14:40:31 +00:00
</div>
</div>
<div class="manage__notes__item__attributes">
{% if note.author is not null %}
<div class="manage__notes__item__attribute manage__notes__item__author"{% if note.author_colour is not null %} style="--user-colour: {{ note.author_colour }}"{% endif %}>
2023-07-25 14:40:31 +00:00
<div class="manage__notes__item__author__prefix">Created by</div>
<div class="manage__notes__item__author__avatar">
<a href="{{ url('user-profile', {'user': note.author.id}) }}">{{ avatar(note.author.id, 20, note.author.name) }}</a>
2023-07-25 14:40:31 +00:00
</div>
<div class="manage__notes__item__author__name">
<a href="{{ url('user-profile', {'user': note.author.id}) }}">{{ note.author.name }}</a>
2023-07-25 14:40:31 +00:00
</div>
</div>
{% endif %}
<div class="manage__notes__item__attribute manage__notes__item__created">
<div class="manage__notes__item__created__icon"><i class="fas fa-clock"></i></div>
<div class="manage__notes__item__created__time">
<time datetime="{{ note.info.createdTime|date('c') }}" title="{{ note.info.createdTime|date('r') }}">{{ note.info.createdTime|time_format }}</time>
</div>
</div>
<div class="manage__notes__item__attribute manage__notes__item__user"{% if note.user_colour is not null %} style="--user-colour: {{ note.user_colour }}"{% endif %}>
2023-07-25 14:40:31 +00:00
<div class="manage__notes__item__user__prefix">Regarding</div>
<div class="manage__notes__item__user__avatar">
<a href="{{ url('manage-user', {'user': note.user.id}) }}">{{ avatar(note.user.id, 20, note.user.name) }}</a>
2023-07-25 14:40:31 +00:00
</div>
<div class="manage__notes__item__user__name">
<a href="{{ url('manage-user', {'user': note.user.id}) }}">{{ note.user.name }}</a>
2023-07-25 14:40:31 +00:00
</div>
{% if not notes_filtering %}
<div class="manage__notes__item__user__filter">
<a href="{{ url('manage-users-notes', {'user': note.user.id}) }}">Filter</a>
</div>
{% endif %}
</div>
</div>
{% if note.info.body is not empty %}
2023-07-25 14:40:31 +00:00
<div class="manage__notes__item__body markdown">
{% if notes_filtering %}
{{ note.info.body|escape|parse_text(2)|raw }}
2023-07-25 14:40:31 +00:00
{% else %}
{{ note.info.firstParagraph|escape|parse_text(2)|raw }}
2023-07-25 14:40:31 +00:00
{% endif %}
</div>
{% else %}
<div class="manage__notes__item__nobody">
This note has no additional content.
</div>
{% endif %}
{% if not notes_filtering and note.info.hasMoreParagraphs %}
<div class="manage__notes__item__continue">
<a href="{{ url('manage-users-note', {'note': note.info.id}) }}">Continue reading</a>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% if notes_pagination|trim|length > 0 %}
<div class="manage__notes__pagination">
{{ notes_pagination }}
</div>
{% endif %}
</div>
{% endblock %}