Removed getter/setter methods in favour of property hooks and asymmetric visibility.
This commit is contained in:
parent
2cb2918533
commit
d103477fe1
149 changed files with 2169 additions and 3565 deletions
templates
|
@ -21,7 +21,7 @@
|
|||
|
||||
{% if image is defined %}
|
||||
{% if image|slice(0, 1) == '/' %}
|
||||
{% set image = globals.site_info.hasURL ? (globals.site_info.url ~ image) : '' %}
|
||||
{% set image = globals.site_info.url is not empty ? (globals.site_info.url ~ image) : '' %}
|
||||
{% endif %}
|
||||
|
||||
{% if image|length > 0 %}
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
{% if canonical_url is defined %}
|
||||
{% if canonical_url|slice(0, 1) == '/' %}
|
||||
{% set canonical_url = globals.site_info.hasURL ? (globals.site_info.url ~ canonical_url) : '' %}
|
||||
{% set canonical_url = globals.site_info.url is not empty ? (globals.site_info.url ~ canonical_url) : '' %}
|
||||
{% endif %}
|
||||
|
||||
{% if canonical_url|length > 0 %}
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<div class="changelog__change__text markdown">
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{% if change_info.hasBody %}
|
||||
{% if change_info.body is not empty %}
|
||||
{{ change_info.body|escape|parse_text(2)|raw }}
|
||||
{% else %}
|
||||
<p>This change has no additional notes.</p>
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
</div>
|
||||
|
||||
<div class="changelog__entry__text">
|
||||
<a class="changelog__entry__log{% if change.hasBody %} changelog__entry__log--link{% endif %}"
|
||||
{% if change.hasBody %}href="{{ change_url }}"{% endif %}>
|
||||
<a class="changelog__entry__log{% if change.body is not empty %} changelog__entry__log--link{% endif %}"
|
||||
{% if change.body is not empty %}href="{{ change_url }}"{% endif %}>
|
||||
{{ change.summary }}
|
||||
</a>
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
{% set is_archived = info.forum_archived != 0 %}
|
||||
{% else %}
|
||||
{% set forum_id = info.id %}
|
||||
{% set is_archived = info.isArchived %}
|
||||
{% set is_archived = info.archived %}
|
||||
{% endif %}
|
||||
|
||||
{% set is_locked = is_archived %}
|
||||
|
@ -143,7 +143,7 @@
|
|||
{% set forum_link_clicks = forum.info.linkClicks %}
|
||||
{% set forum_count_topics = forum.info.topicsCount %}
|
||||
{% set forum_count_posts = forum.info.postsCount %}
|
||||
{% set forum_show_activity = forum.info.mayHaveTopics or forum.info.hasLinkClicks %}
|
||||
{% set forum_show_activity = forum.info.mayHaveTopics or forum.info.linkClicks is not null %}
|
||||
{% set forum_unread = forum.unread %}
|
||||
{% set forum_colour = forum.colour %}
|
||||
|
||||
|
@ -340,8 +340,8 @@
|
|||
{% set topic_count_posts = topic.info.postsCount %}
|
||||
{% set topic_count_views = topic.info.viewsCount %}
|
||||
{% set topic_created = topic.info.createdTime %}
|
||||
{% set topic_locked = topic.info.isLocked %}
|
||||
{% set topic_deleted = topic.info.isDeleted %}
|
||||
{% set topic_locked = topic.info.locked %}
|
||||
{% set topic_deleted = topic.info.deleted %}
|
||||
{% set topic_pages = (topic.info.postsCount / 10)|round(0, 'ceil') %}
|
||||
|
||||
{% set has_topic_author = topic.user is defined %}
|
||||
|
@ -464,7 +464,7 @@
|
|||
{% set post_id = post.info.id %}
|
||||
{% set post_created = post.info.createdTime %}
|
||||
{% set post_edited = post.info.editedTime %}
|
||||
{% set post_is_deleted = post.info.isDeleted %}
|
||||
{% set post_is_deleted = post.info.deleted %}
|
||||
{% set post_is_op = post.isOriginalPost %}
|
||||
{% set post_body = post.info.body|escape|parse_text(post.info.parser) %}
|
||||
{% set post_is_markdown = post.info.isBodyMarkdown %}
|
||||
|
@ -482,7 +482,7 @@
|
|||
{% set author_created = post.user.createdTime %}
|
||||
{% set author_posts_count = post.postsCount %}
|
||||
{% set author_is_op = post.isOriginalPoster %}
|
||||
{% set signature_body = post.user.signatureContent|default('')|escape|parse_text(post.user.signatureParser) %}
|
||||
{% set signature_body = post.user.signatureBody|default('')|escape|parse_text(post.user.signatureBodyParser) %}
|
||||
{% set signature_is_markdown = post.user.isSignatureBodyMarkdown %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
{% set forum_post_csrf = csrf_token() %}
|
||||
{% set topic_tools = forum_topic_tools(topic_info, topic_pagination, can_reply) %}
|
||||
{% set topic_notice = forum_topic_locked(topic_info.lockedTime, category_info.isArchived) ~ forum_topic_redirect(topic_redir_info|default(null)) %}
|
||||
{% set topic_notice = forum_topic_locked(topic_info.lockedTime, category_info.archived) ~ forum_topic_redirect(topic_redir_info|default(null)) %}
|
||||
{% set topic_actions = [
|
||||
{
|
||||
'html': '<i class="far fa-trash-alt fa-fw"></i> Delete',
|
||||
|
@ -44,12 +44,12 @@
|
|||
{
|
||||
'html': '<i class="fas fa-lock fa-fw"></i> Lock',
|
||||
'url': url('forum-topic-lock', { topic: topic_info.id, csrf: csrf_token() }),
|
||||
'display': topic_can_lock and not topic_info.isLocked,
|
||||
'display': topic_can_lock and not topic_info.locked,
|
||||
},
|
||||
{
|
||||
'html': '<i class="fas fa-lock-open fa-fw"></i> Unlock',
|
||||
'url': url('forum-topic-unlock', { topic: topic_info.id, csrf: csrf_token() }),
|
||||
'display': topic_can_lock and topic_info.isLocked,
|
||||
'display': topic_can_lock and topic_info.locked,
|
||||
},
|
||||
] %}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<div class="manage-list-setting-key-text">{{ redir.topicId }}</div>
|
||||
</td>
|
||||
<td class="manage-list-setting-key">
|
||||
<div class="manage-list-setting-key-text">{{ redir.hasUserId ? redir.userId : 'System' }}</div>
|
||||
<div class="manage-list-setting-key-text">{{ redir.userId|default('System') }}</div>
|
||||
</td>
|
||||
<td class="manage-list-setting-value">
|
||||
<div class="manage-list-setting-value-text">{{ redir.linkTarget }}</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>
|
||||
<a href="{{ url('manage-news-category', {'category': cat.id}) }}" class="input__button">#{{ cat.id }}</a>
|
||||
{{ cat.name }} |
|
||||
{{ cat.isHidden ? 'Unlisted' : 'Public' }} |
|
||||
{{ cat.hidden ? 'Unlisted' : 'Public' }} |
|
||||
{{ cat.createdAt }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<tr>
|
||||
<td>Is Hidden</td>
|
||||
<td>{{ input_checkbox('nc_hidden', '', category_info.isHidden|default(false)) }}</td>
|
||||
<td>{{ input_checkbox('nc_hidden', '', category_info.hidden|default(false)) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<tr>
|
||||
<td>Is Featured</td>
|
||||
<td>{{ input_checkbox('np_featured', '', post_info.isFeatured|default(false)) }}</td>
|
||||
<td>{{ input_checkbox('np_featured', '', post_info.featured|default(false)) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
<a href="{{ url('manage-news-post', {'post': post.id}) }}" class="input__button">#{{ post.id }}</a>
|
||||
<a href="{{ url('manage-news-category', {'category': post.categoryId}) }}" class="input__button">Category #{{ post.categoryId }}</a>
|
||||
{{ post.title }} |
|
||||
{{ post.isFeatured ? 'Featured' : 'Normal' }} |
|
||||
{{ post.featured ? 'Featured' : 'Normal' }} |
|
||||
User #{{ post.userId }} |
|
||||
{% if post.hasCommentsCategoryId %}Comments category #{{ post.commentsCategoryId }}{% else %}No comments category{% endif %} |
|
||||
{% if post.commentsSectionId is not null %}Comments category #{{ post.commentsCategoryId }}{% else %}No comments category{% endif %} |
|
||||
Created {{ post.createdAt }} |
|
||||
{{ post.isPublished ? 'published' : 'Published ' ~ post.scheduledAt }} |
|
||||
{{ post.isEdited ? 'Edited ' ~ post.updatedAt : 'not edited' }} |
|
||||
{{ post.isDeleted ? 'Deleted ' ~ post.deletedAt : 'not deleted' }}
|
||||
{{ post.published ? 'published' : 'Published ' ~ post.scheduledAt }} |
|
||||
{{ post.edited ? 'Edited ' ~ post.updatedAt : 'not edited' }} |
|
||||
{{ post.deleted ? 'Deleted ' ~ post.deletedAt : 'not deleted' }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<time datetime="{{ ban.info.createdTime|date('c') }}" title="{{ ban.info.createdTime|date('r') }}">{{ ban.info.createdTime|time_format }}</time>
|
||||
</div>
|
||||
</div>
|
||||
{% if ban.info.isPermanent %}
|
||||
{% if ban.info.permanent %}
|
||||
<div class="manage__bans__item__attribute manage__bans__item__permanent">
|
||||
<div class="manage__bans__item__permanent__icon"><i class="fas fa-dumpster"></i></div>
|
||||
<div class="manage__bans__item__permanent__time">
|
||||
|
@ -58,13 +58,13 @@
|
|||
<div class="manage__bans__item__attribute manage__bans__item__expires">
|
||||
<div class="manage__bans__item__expires__icon"><i class="fas fa-stopwatch"></i></div>
|
||||
<div class="manage__bans__item__expires__time" title="{{ ban.info.expiresTime|date('r') }}">
|
||||
{% if ban.info.isActive %}
|
||||
{% if ban.info.active %}
|
||||
<span>{{ ban.info.remainingString }} remaining</span>
|
||||
{% else %}
|
||||
<span>{{ ban.info.durationString }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if ban.info.isActive %}
|
||||
{% if ban.info.active %}
|
||||
<div class="manage__bans__item__expires__status manage__bans__item__expires__status--active">
|
||||
<span>active</span>
|
||||
</div>
|
||||
|
@ -94,7 +94,7 @@
|
|||
<a href="{{ url('manage-users-ban-delete', { ban: ban.info.id, csrf: csrf_token() }) }}" title="Revoke/Delete" class="input__button input__button--autosize input__button--destroy manage__bans__item__action" onclick="return confirm('Are you sure?');"><i class="fas fa-times fa-fw"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
{% if ban.info.hasPublicReason %}
|
||||
{% if ban.info.publicReason is not empty %}
|
||||
<div class="manage__bans__item__reason">
|
||||
<div class="manage__bans__item__reason__title">Reason displayed publicly and to the user themselves:</div>
|
||||
<div class="manage__bans__item__reason__body">{{ ban.info.publicReason }}</div>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<div class="manage__bans__item__reason__title">This ban does not display any reason.</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ban.info.hasPrivateReason %}
|
||||
{% if ban.info.privateReason is not empty %}
|
||||
<div class="manage__bans__item__reason">
|
||||
<div class="manage__bans__item__reason__title">Additional information for moderators:</div>
|
||||
<div class="manage__bans__item__reason__body">{{ ban.info.privateReason }}</div>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if not note_new and note_info.hasBody %}
|
||||
{% if not note_new and note_info.body is not empty %}
|
||||
<div class="manage__note__body markdown manage__note--viewing">
|
||||
{{ note_info.body|escape|parse_text(2)|raw }}
|
||||
</div>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if note.info.hasBody %}
|
||||
{% if note.info.body is not empty %}
|
||||
<div class="manage__notes__item__body markdown">
|
||||
{% if notes_filtering %}
|
||||
{{ note.info.body|escape|parse_text(2)|raw }}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<div class="manage__users__collection">
|
||||
{% for user in manage_users %}
|
||||
<div class="manage__user-item{% if user.info.isDeleted %} manage__user-item--deleted{% endif %}" style="--accent-colour: {{ user.colour }}">
|
||||
<div class="manage__user-item{% if user.info.deleted %} manage__user-item--deleted{% endif %}" style="--accent-colour: {{ user.colour }}">
|
||||
<a href="{{ url('manage-user', {'user': user.info.id}) }}" class="manage__user-item__background"></a>
|
||||
|
||||
<div class="manage__user-item__container">
|
||||
|
@ -30,14 +30,14 @@
|
|||
<time datetime="{{ user.info.createdTime|date('c') }}" title="{{ user.info.createdTime|date('r') }}">{{ user.info.createdTime|time_format }}</time> /
|
||||
<span>{{ user.info.registerRemoteAddress }}</span>
|
||||
</div>
|
||||
{% if user.info.hasLastActive %}
|
||||
{% if user.info.lastActiveTime is not null %}
|
||||
<div class="manage__user-item__detail">
|
||||
<i class="fas fa-user-clock fa-fw"></i>
|
||||
<time datetime="{{ user.info.lastActiveTime|date('c') }}" title="{{ user.info.lastActiveTime|date('r') }}">{{ user.info.lastActiveTime|time_format }}</time> /
|
||||
<span>{{ user.info.lastRemoteAddress }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.info.isDeleted %}
|
||||
{% if user.info.deleted %}
|
||||
<div class="manage__user-item__detail">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
<time datetime="{{ user.info.deletedTime|date('c') }}" title="{{ user.info.deletedTime|date('r') }}">{{ user.info.deletedTime|time_format }}</time>
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
{% if globals.active_ban_info is not null %}
|
||||
<div class="warning warning--red">
|
||||
<div class="warning__content">
|
||||
<p>You have been banned {% if globals.active_ban_info.isPermanent %}<strong>permanently</strong>{% else %}for <strong title="{{ globals.active_ban_info.expiresTime|date('r') }}">{{ globals.active_ban_info.remainingString }}</strong>{% endif %} since <strong><time datetime="{{ globals.active_ban_info.createdTime|date('c') }}" title="{{ globals.active_ban_info.createdTime|date('r') }}">{{ globals.active_ban_info.createdTime|time_format }}</time></strong>.</p>
|
||||
{% if globals.active_ban_info.hasPublicReason %}
|
||||
<p>You have been banned {% if globals.active_ban_info.permanent %}<strong>permanently</strong>{% else %}for <strong title="{{ globals.active_ban_info.expiresTime|date('r') }}">{{ globals.active_ban_info.remainingString }}</strong>{% endif %} since <strong><time datetime="{{ globals.active_ban_info.createdTime|date('c') }}" title="{{ globals.active_ban_info.createdTime|date('r') }}">{{ globals.active_ban_info.createdTime|time_format }}</time></strong>.</p>
|
||||
{% if globals.active_ban_info.publicReason is not empty %}
|
||||
<p>Reason: {{ globals.active_ban_info.publicReason }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -64,10 +64,10 @@
|
|||
{% for message in folder_messages %}
|
||||
{% set user_info = (folder_name == 'drafts' or folder_name == 'sent' ? message.recipient_info : message.author_info) %}
|
||||
{% set user_colour = (folder_name == 'drafts' or folder_name == 'sent' ? message.recipient_colour : message.author_colour) %}
|
||||
<div class="messages-folder-item messages-entry js-messages-entry" tabindex="0" data-msg-id="{{ message.info.id }}" data-msg-url="{{ url('messages-view', {message: message.info.id}) }}" data-msg-sent="{{ message.info.isSent ? 'sent' : 'draft' }}" data-msg-read="{{ message.info.isRead ? 'read' : 'unread' }}" style="--user-colour: {{ user_colour }};">
|
||||
<div class="messages-folder-item messages-entry js-messages-entry" tabindex="0" data-msg-id="{{ message.info.id }}" data-msg-url="{{ url('messages-view', {message: message.info.id}) }}" data-msg-sent="{{ message.info.sent ? 'sent' : 'draft' }}" data-msg-read="{{ message.info.read ? 'read' : 'unread' }}" style="--user-colour: {{ user_colour }};">
|
||||
<div class="messages-entry-header">
|
||||
<div class="messages-entry-check"><input type="checkbox" class="js-entry-checkbox"></div>
|
||||
<div class="messages-entry-unread js-messages-entry-unread"{% if not message.info.isSent or message.info.isRead %} hidden{% endif %}><div class="messages-entry-unread-orb"></div></div>
|
||||
<div class="messages-entry-unread js-messages-entry-unread"{% if not message.info.sent or message.info.read %} hidden{% endif %}><div class="messages-entry-unread-orb"></div></div>
|
||||
<div class="messages-entry-author"><div class="messages-entry-overflow">{{ user_info.name|default('Deleted User') }}</div></div>
|
||||
<div class="messages-entry-spacing"></div>
|
||||
<div class="messages-entry-datetime"><time datetime="{{ message.info.displayTime|date('c') }}" title="{{ message.info.displayTime|date('r') }}">{{ message.info.displayTime|time_format }}</time></div>
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
<div class="container messages-sidebar-section messages-actions">
|
||||
{{ container_title('<i class="fas fa-comments fa-fw"></i> Actions') }}
|
||||
|
||||
<button class="messages-actions-item js-messages-actions-mark-read"{% if not message.info.isSent %} hidden{% endif %} data-state="active" data-inactive-str="Mark as read" data-inactive-ico="fas fa-envelope-open fa-fw" data-active-str="Mark as unread" data-active-ico="fas fa-envelope">
|
||||
<button class="messages-actions-item js-messages-actions-mark-read"{% if not message.info.sent %} hidden{% endif %} data-state="active" data-inactive-str="Mark as read" data-inactive-ico="fas fa-envelope-open fa-fw" data-active-str="Mark as unread" data-active-ico="fas fa-envelope">
|
||||
<div class="messages-actions-item-icon js-messages-button-icon"><i></i></div>
|
||||
<div class="messages-actions-item-label js-messages-button-label"></div>
|
||||
</button>
|
||||
<button class="messages-actions-item js-messages-actions-move-trash" data-state="{{ message.info.isDeleted ? 'active' : 'inactive' }}" data-inactive-str="Move to Trash" data-inactive-ico="fas fa-trash-alt fa-fw" data-active-str="Restore item" data-active-ico="fas fa-trash-restore-alt">
|
||||
<button class="messages-actions-item js-messages-actions-move-trash" data-state="{{ message.info.deleted ? 'active' : 'inactive' }}" data-inactive-str="Move to Trash" data-inactive-ico="fas fa-trash-alt fa-fw" data-active-str="Restore item" data-active-ico="fas fa-trash-restore-alt">
|
||||
<div class="messages-actions-item-icon js-messages-button-icon"><i></i></div>
|
||||
<div class="messages-actions-item-label js-messages-button-label"></div>
|
||||
</button>
|
||||
<button class="messages-actions-item js-messages-actions-nuke"{% if not message.info.isDeleted %} hidden{% endif %}>
|
||||
<button class="messages-actions-item js-messages-actions-nuke"{% if not message.info.deleted %} hidden{% endif %}>
|
||||
<div class="messages-actions-item-icon"><i class="fas fa-radiation-alt"></i></div>
|
||||
<div class="messages-actions-item-label">Permanently delete</div>
|
||||
</button>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<div class="messages-columns-content">
|
||||
<div class="messages-thread js-messages-thread">
|
||||
{% if reply_to is defined and reply_to is not empty %}
|
||||
<article class="{{ html_classes('container', 'messages-message', 'messages-message-snippet', 'js-messages-message', {'messages-message-deleted': reply_to.info.isDeleted, 'messages-message-draft': not reply_to.info.isSent}) }}" tabindex="0" data-msg-id="{{ reply_to.info.id }}" data-msg-url="{{ url('messages-view', {message: reply_to.info.id}) }}" data-msg-type="snip" data-msg-sent="{{ reply_to.info.isSent ? 'sent' : 'draft' }}" data-msg-read="{{ reply_to.info.isRead ? 'read' : 'unread' }}">
|
||||
<article class="{{ html_classes('container', 'messages-message', 'messages-message-snippet', 'js-messages-message', {'messages-message-deleted': reply_to.info.deleted, 'messages-message-draft': not reply_to.info.sent}) }}" tabindex="0" data-msg-id="{{ reply_to.info.id }}" data-msg-url="{{ url('messages-view', {message: reply_to.info.id}) }}" data-msg-type="snip" data-msg-sent="{{ reply_to.info.sent ? 'sent' : 'draft' }}" data-msg-read="{{ reply_to.info.read ? 'read' : 'unread' }}">
|
||||
<div class="messages-message-header">
|
||||
<div class="messages-message-sender-avatar">
|
||||
{{ avatar(reply_to.author_info.id|default(0), 80) }}
|
||||
|
@ -66,7 +66,7 @@
|
|||
</article>
|
||||
{% endif %}
|
||||
|
||||
<article class="{{ html_classes('container', 'messages-message', 'js-messages-message', {'messages-message-deleted': message.info.isDeleted, 'messages-message-draft': not message.info.isSent}) }}" data-msg-id="{{ message.info.id }}" data-msg-url="{{ url('messages-view', {message: message.info.id}) }}" data-msg-type="full" data-msg-sent="{{ message.info.isSent ? 'sent' : 'draft' }}" data-msg-read="{{ message.info.isRead ? 'read' : 'unread' }}" data-msg-deleted="{{ message.info.isDeleted ? 'yes' : 'no' }}">
|
||||
<article class="{{ html_classes('container', 'messages-message', 'js-messages-message', {'messages-message-deleted': message.info.deleted, 'messages-message-draft': not message.info.sent}) }}" data-msg-id="{{ message.info.id }}" data-msg-url="{{ url('messages-view', {message: message.info.id}) }}" data-msg-type="full" data-msg-sent="{{ message.info.sent ? 'sent' : 'draft' }}" data-msg-read="{{ message.info.read ? 'read' : 'unread' }}" data-msg-deleted="{{ message.info.deleted ? 'yes' : 'no' }}">
|
||||
<div class="messages-message-header">
|
||||
<div class="messages-message-sender-avatar">
|
||||
{{ avatar(message.author_info.id|default(0), 80) }}
|
||||
|
@ -98,7 +98,7 @@
|
|||
{% if can_send_messages %}
|
||||
{% set has_draft_info = draft_info is defined and draft_info is not null %}
|
||||
{% set reply_field_is_draft = false %}
|
||||
{% if not has_draft_info and not message.info.isSent %}
|
||||
{% if not has_draft_info and not message.info.sent %}
|
||||
{% set has_draft_info = true %}
|
||||
{% set reply_field_is_draft = true %}
|
||||
{% set draft_info = message.info %}
|
||||
|
@ -108,7 +108,7 @@
|
|||
{% set msg_recipient_id = message.info.recipientId|default(0) %}
|
||||
|
||||
{% if has_draft_info or (msg_author_id > 0 and msg_recipient_id > 0) %}
|
||||
<div class="container messages-reply js-messages-reply"{% if (reply_field_is_draft ? draft_info.isDeleted : message.info.isDeleted) %} hidden{% endif %}>
|
||||
<div class="container messages-reply js-messages-reply"{% if (reply_field_is_draft ? draft_info.deleted : message.info.deleted) %} hidden{% endif %}>
|
||||
{{ container_title(has_draft_info ? '<i class="fas fa-edit"></i> Edit' : '<i class="fas fa-reply"></i> Reply') }}
|
||||
|
||||
<form class="messages-reply-form js-messages-reply-form">
|
||||
|
@ -141,7 +141,7 @@
|
|||
|
||||
{% if replies_for is defined and replies_for is iterable %}
|
||||
{% for reply_for in replies_for %}
|
||||
<article class="{{ html_classes('container', 'messages-message', 'messages-message-snippet', 'js-messages-message', {'messages-message-deleted': reply_for.info.isDeleted, 'messages-message-draft': not reply_for.info.isSent}) }}" tabindex="0" data-msg-id="{{ reply_for.info.id }}" data-msg-url="{{ url('messages-view', {message: reply_for.info.id}) }}" data-msg-type="snip" data-msg-sent="{{ reply_for.info.isSent ? 'sent' : 'draft' }}" data-msg-read="{{ reply_for.info.isRead ? 'read' : 'unread' }}">
|
||||
<article class="{{ html_classes('container', 'messages-message', 'messages-message-snippet', 'js-messages-message', {'messages-message-deleted': reply_for.info.deleted, 'messages-message-draft': not reply_for.info.sent}) }}" tabindex="0" data-msg-id="{{ reply_for.info.id }}" data-msg-url="{{ url('messages-view', {message: reply_for.info.id}) }}" data-msg-type="snip" data-msg-sent="{{ reply_for.info.sent ? 'sent' : 'draft' }}" data-msg-read="{{ reply_for.info.read ? 'read' : 'unread' }}">
|
||||
<div class="messages-message-header">
|
||||
<div class="messages-message-sender-avatar">
|
||||
{{ avatar(reply_for.author_info.id|default(0), 80) }}
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</time>
|
||||
</div>
|
||||
|
||||
{% if post.isEdited %}
|
||||
{% if post.edited %}
|
||||
<div class="news__post__date">
|
||||
Updated
|
||||
<time datetime="{{ post.updatedTime|date('c') }}" title="{{ post.updatedTime|date('r') }}">
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
{{ profile_user.name }}
|
||||
</div>
|
||||
|
||||
{% if profile_user.hasTitle %}
|
||||
{% if profile_user.title is not empty %}
|
||||
<div class="profile__header__title">
|
||||
{{ profile_user.title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set hasCountryCode = profile_user.hasCountryCode %}
|
||||
{% set hasCountryCode = profile_user.countryCode != 'XX' %}
|
||||
{% set age = profile_user.age %}
|
||||
{% set hasAge = age > 0 %}
|
||||
{% if hasCountryCode or hasAge %}
|
||||
|
@ -122,8 +122,8 @@
|
|||
{% if profile_is_banned %}
|
||||
<div class="warning warning--red warning--bigger">
|
||||
<div class="warning__content">
|
||||
This user has been banned {% if profile_ban_info.isPermanent %}<strong>permanently</strong>{% else %}for <strong title="{{ profile_ban_info.expiresTime|date('r') }}">{{ profile_ban_info.remainingString }}</strong>{% endif %} since <strong><time datetime="{{ profile_ban_info.createdTime|date('c') }}" title="{{ profile_ban_info.createdTime|date('r') }}">{{ profile_ban_info.createdTime|time_format }}</time></strong>.
|
||||
{% if not profile_is_guest and profile_ban_info.hasPublicReason %}
|
||||
This user has been banned {% if profile_ban_info.permanent %}<strong>permanently</strong>{% else %}for <strong title="{{ profile_ban_info.expiresTime|date('r') }}">{{ profile_ban_info.remainingString }}</strong>{% endif %} since <strong><time datetime="{{ profile_ban_info.createdTime|date('c') }}" title="{{ profile_ban_info.createdTime|date('r') }}">{{ profile_ban_info.createdTime|time_format }}</time></strong>.
|
||||
{% if not profile_is_guest and profile_ban_info.publicReason is not empty %}
|
||||
<p>Reason: {{ profile_ban_info.publicReason }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
Most active topic
|
||||
</div>
|
||||
|
||||
<div class="forum__topic{% if profile_active_topic_info.isLocked %} forum__topic--locked{% endif %}">
|
||||
<div class="forum__topic{% if profile_active_topic_info.locked %} forum__topic--locked{% endif %}">
|
||||
<a href="{{ url('forum-topic', {'topic': profile_active_topic_info.id}) }}" class="forum__topic__link"></a>
|
||||
|
||||
<div class="forum__topic__container">
|
||||
|
@ -260,35 +260,35 @@
|
|||
|
||||
{% if profile_user is defined %}
|
||||
<div class="profile__content__main">
|
||||
{% if (not profile_is_banned or profile_can_edit) and ((profile_is_editing and perms.edit_about) or profile_user.hasAboutContent) %}
|
||||
{% if (not profile_is_banned or profile_can_edit) and ((profile_is_editing and perms.edit_about) or profile_user.aboutBody is not empty) %}
|
||||
<div class="container profile__container profile__about" id="about">
|
||||
{{ container_title('About ' ~ profile_user.name) }}
|
||||
|
||||
{% if profile_is_editing %}
|
||||
<div class="profile__signature__editor">
|
||||
{{ input_select('about[parser]', constant('\\Misuzu\\Parsers\\Parser::NAMES'), profile_user.aboutParser, '', '', false, 'profile__about__select') }}
|
||||
<textarea name="about[text]" class="input__textarea profile__about__text" id="about-textarea">{{ profile_user.aboutContent }}</textarea>
|
||||
{{ input_select('about[parser]', constant('\\Misuzu\\Parsers\\Parser::NAMES'), profile_user.aboutBodyParser, '', '', false, 'profile__about__select') }}
|
||||
<textarea name="about[text]" class="input__textarea profile__about__text" id="about-textarea">{{ profile_user.aboutBody }}</textarea>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="profile__about__content{% if profile_is_editing %} profile__about__content--edit{% elseif profile_user.aboutParser == constant('\\Misuzu\\Parsers\\Parser::MARKDOWN') %} markdown{% endif %}">
|
||||
{{ profile_user.aboutContent|escape|parse_text(profile_user.aboutParser)|raw }}
|
||||
<div class="profile__about__content{% if profile_is_editing %} profile__about__content--edit{% elseif profile_user.isAboutBodyMarkdown %} markdown{% endif %}">
|
||||
{{ profile_user.aboutBody|escape|parse_text(profile_user.aboutBodyParser)|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (not profile_is_banned or profile_can_edit) and ((profile_is_editing and perms.edit_signature) or profile_user.hasSignatureContent) %}
|
||||
{% if (not profile_is_banned or profile_can_edit) and ((profile_is_editing and perms.edit_signature) or profile_user.signatureBody is not empty) %}
|
||||
<div class="container profile__container profile__signature" id="signature">
|
||||
{{ container_title('Signature') }}
|
||||
|
||||
{% if profile_is_editing %}
|
||||
<div class="profile__signature__editor">
|
||||
{{ input_select('signature[parser]', constant('\\Misuzu\\Parsers\\Parser::NAMES'), profile_user.signatureParser, '', '', false, 'profile__signature__select') }}
|
||||
<textarea name="signature[text]" class="input__textarea profile__signature__text" id="signature-textarea">{{ profile_user.signatureContent }}</textarea>
|
||||
{{ input_select('signature[parser]', constant('\\Misuzu\\Parsers\\Parser::NAMES'), profile_user.signatureBodyParser, '', '', false, 'profile__signature__select') }}
|
||||
<textarea name="signature[text]" class="input__textarea profile__signature__text" id="signature-textarea">{{ profile_user.signatureBody }}</textarea>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="profile__signature__content{% if profile_is_editing %} profile__signature__content--edit{% elseif profile_user.signatureParser == constant('\\Misuzu\\Parsers\\Parser::MARKDOWN') %} markdown{% endif %}">
|
||||
{{ profile_user.signatureContent|escape|parse_text(profile_user.signatureParser)|raw }}
|
||||
<div class="profile__signature__content{% if profile_is_editing %} profile__signature__content--edit{% elseif profile_user.isSignatureBodyMarkdown %} markdown{% endif %}">
|
||||
{{ profile_user.signatureBody|escape|parse_text(profile_user.signatureBodyParser)|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
{% endif %}
|
||||
|
||||
<div class="settings__two-factor__settings">
|
||||
{% if settings_user.hasTOTPKey %}
|
||||
{% if settings_user.hasTOTP %}
|
||||
<div class="settings__two-factor__settings__status">
|
||||
<i class="fas fa-lock fa-fw"></i> Two Factor Authentication is enabled!
|
||||
</div>
|
||||
|
|
|
@ -10,11 +10,8 @@
|
|||
{% set info = {
|
||||
'id': user.user_id,
|
||||
'name': user.username,
|
||||
'hasTitle': user.user_title is defined and user.user_title is not empty,
|
||||
'title': user.user_title|default(''),
|
||||
'hasCountryCode': user.user_country is defined and user.user_country != 'XX',
|
||||
'countryCode': user.user_country|default('XX'),
|
||||
'hasLastActive': user.user_active is defined and user.user_active > 0,
|
||||
'lastActiveTime': user.user_active,
|
||||
'createdTime': user.user_created
|
||||
} %}
|
||||
|
@ -36,13 +33,13 @@
|
|||
{{ info.name }}
|
||||
</div>
|
||||
|
||||
{% if info.hasTitle %}
|
||||
{% if info.title is not empty %}
|
||||
<div class="usercard__details__title">
|
||||
{{ info.title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if info.hasCountryCode %}
|
||||
{% if info.countryCode != 'XX' %}
|
||||
<div class="usercard__details__country">
|
||||
<div class="flag flag--{{ info.countryCode|lower }}"></div>
|
||||
<div class="usercard__details__country__name">
|
||||
|
@ -68,7 +65,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if info.hasLastActive %}
|
||||
{% if info.lastActiveTime is not null %}
|
||||
<div class="usercard__stat usercard__stat--wide" title="{{ info.lastActiveTime|date('r') }}">
|
||||
<div class="usercard__stat__name">Last seen</div>
|
||||
<div class="usercard__stat__value"><time datetime="{{ info.lastActiveTime|date('c') }}">{{ info.lastActiveTime|time_format }}</time></div>
|
||||
|
@ -119,7 +116,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if session.hasLastRemoteAddress %}
|
||||
{% if session.lastRemoteAddress is not null %}
|
||||
<div class="settings__session__detail">
|
||||
<div class="settings__session__detail__title">
|
||||
Last used from IP
|
||||
|
@ -148,7 +145,7 @@
|
|||
</time>
|
||||
</div>
|
||||
|
||||
{% if session.hasLastActive %}
|
||||
{% if session.lastActiveTime is not null %}
|
||||
<div class="settings__session__detail" title="{{ session.lastActiveTime|date('r') }}">
|
||||
<div class="settings__session__detail__title">
|
||||
Last Active
|
||||
|
@ -228,7 +225,7 @@
|
|||
{% from 'macros.twig' import avatar %}
|
||||
|
||||
<div class="settings__account-log">
|
||||
{% if data.hasUserId and users[data.userId] is defined %}
|
||||
{% if data.userId is not null and users[data.userId] is defined %}
|
||||
{% set user = users[data.userId] %}
|
||||
{% set colour = colours[data.userId]|default(null) %}
|
||||
<a href="{{ url('user-profile', {'user': user.id}) }}" class="settings__account-log__user"{% if colour is not null %} style="--user-colour: {{ colour }}"{% endif %}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue