Renamed forum locked container to status.

This commit is contained in:
flash 2018-10-15 16:29:35 +02:00
parent d5ba3b7fd8
commit 2d2b2c62a0
4 changed files with 47 additions and 45 deletions

View file

@ -0,0 +1,30 @@
.forum__status {
border: 1px solid var(--accent-colour);
display: flex;
align-items: center;
min-height: 40px;
margin-bottom: 2px;
box-shadow: 0 1px 2px var(--accent-colour);
&__icon {
height: 40px;
width: 40px;
background-size: 35px;
background-image: url('https://static.flash.moe/images/topic-icons/topic-locked-read.png');
background-position: center;
background-repeat: no-repeat;
background-color: var(--accent-colour);
flex-grow: 0;
flex-shrink: 0;
}
&__text {
margin: 0 10px;
flex-grow: 1;
flex-shrink: 1;
}
&__emphasis {
font-weight: 700;
}
}

View file

@ -1,32 +1,2 @@
.forum__topic { .forum__topic {
&__locked {
border: 1px solid var(--accent-colour);
display: flex;
align-items: center;
min-height: 40px;
margin-bottom: 2px;
box-shadow: 0 1px 2px var(--accent-colour);
&__icon {
height: 40px;
width: 40px;
background-size: 35px;
background-image: url('https://static.flash.moe/images/topic-icons/topic-locked-read.png');
background-position: center;
background-repeat: no-repeat;
background-color: var(--accent-colour);
flex-grow: 0;
flex-shrink: 0;
}
&__text {
margin: 0 10px;
flex-grow: 1;
flex-shrink: 1;
}
&__time {
font-weight: 700;
}
}
} }

View file

@ -155,6 +155,7 @@ body {
@import "classes/forum/posting"; @import "classes/forum/posting";
@import "classes/forum/topic"; @import "classes/forum/topic";
@import "classes/forum/topics"; @import "classes/forum/topics";
@import "classes/forum/status";
// User stuff // User stuff
@import "classes/usercard"; @import "classes/usercard";

View file

@ -21,7 +21,7 @@
{% macro forum_category_buttons(forum, perms) %} {% macro forum_category_buttons(forum, perms) %}
<div class="forum__actions forum__actions__content"> <div class="forum__actions forum__actions__content">
{% if perms|perms_check(constant('MSZ_FORUM_PERM_CREATE_TOPIC')) %} {% if perms|perms_check(constant('MSZ_FORUM_PERM_CREATE_TOPIC')) %}
<a href="/forum/posting.php?f={{ forum.forum_id }}" class="input__button forum__actions__button">New Topic</a> <a href="/forum/posting.php?f={{ forum.forum_id }}" class="input__button input__button--new forum__actions__button">New Topic</a>
{% endif %} {% endif %}
</div> </div>
{% endmacro %} {% endmacro %}
@ -137,14 +137,14 @@
{% macro forum_topic_locked(locked, archived) %} {% macro forum_topic_locked(locked, archived) %}
{% if locked is not null or archived %} {% if locked is not null or archived %}
<div class="forum__topic__locked"> <div class="forum__status">
<div class="forum__topic__locked__icon"></div> <div class="forum__status__icon"></div>
<div class="forum__topic__locked__text"> <div class="forum__status__text">
{% if archived %} {% if archived %}
This topic has been <span class="forum__topic__locked__time">archived</span>. This topic has been <span class="forum__status__emphasis">archived</span>.
{% else %} {% else %}
This topic was locked <time This topic was locked <time
class="forum__topic__locked__time" class="forum__status__emphasis"
datetime="{{ locked|date('c') }}" datetime="{{ locked|date('c') }}"
title="{{ locked|date('r') }}">{{ locked|time_diff }}</time>. title="{{ locked|date('r') }}">{{ locked|time_diff }}</time>.
{% endif %} {% endif %}
@ -172,29 +172,30 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% macro forum_topic_entry(topic, topic_type, topic_unread, topic_icon) %} {% macro forum_topic_entry(topic, topic_type, topic_unread) %}
{% set topic_type = topic_type|default(null) %} {% set topic_type = topic_type|default(null) %}
{% set topic_unread = topic_unread|default(topic.topic_unread|default(false)) ? 'unread' : 'read' %} {% set topic_unread = topic_unread|default(topic.topic_unread|default(false)) ? 'unread' : 'read' %}
{% set topic_icon = topic_icon|default('https://static.flash.moe/images/topic-icons/topic-%s-%s.png') %}
{% if topic_type is null %} {% if topic_type is null %}
{% if topic.topic_deleted is defined and topic.topic_deleted is not null %} {% if topic.topic_deleted is defined and topic.topic_deleted is not null %}
{% set topic_type = 'deleted' %} {% set topic_type = 'fas fa-trash-alt' %}
{% elseif topic.topic_type is defined and topic.topic_type != 0 %} {% elseif topic.topic_type is defined and topic.topic_type != 0 %}
{% if topic.topic_type == 2 %} {% if topic.topic_type == 2 %}
{% set topic_type = 'announcement' %} {% set topic_type = 'fas fa-bullhorn' %}
{% elseif topic.topic_type == 1 %} {% elseif topic.topic_type == 1 %}
{% set topic_type = 'pinned' %} {% set topic_type = 'fas fa-thumbtack' %}
{% endif %} {% endif %}
{% elseif topic.topic_locked is defined and topic.topic_locked is not null %} {% elseif topic.topic_locked is defined and topic.topic_locked is not null %}
{% set topic_type = 'locked' %} {% set topic_type = 'fas fa-lock' %}
{% else %} {% else %}
{% set topic_type = 'default' %} {% set topic_type = 'fas fa-comment' %}
{% endif %} {% endif %}
{% endif %} {% endif %}
<div class="forum__topics__entry forum__topics__entry--{{ topic_type }}"> <div class="forum__topics__entry">
<img src="{{ topic_icon|format(topic_type, topic_unread) }}" alt="{{ topic_unread }}" class="forum__topics__entry__icon"> <div class="forum__topics__entry__icon forum__topics__entry__icon--{{ topic_unread }}">
<i class="{{ topic_type }}"></i>
</div>
<div class="forum__topics__entry__info"> <div class="forum__topics__entry__info">
<div class="forum__topics__entry__info__title forum__topics__entry__info__title--{{ topic_unread }}"> <div class="forum__topics__entry__info__title forum__topics__entry__info__title--{{ topic_unread }}">