diff --git a/assets/less/classes/forum/post.less b/assets/less/classes/forum/post.less index a605dd2e..b2853d6a 100644 --- a/assets/less/classes/forum/post.less +++ b/assets/less/classes/forum/post.less @@ -1,8 +1,5 @@ .forum__post { display: flex; - border: 1px solid var(--accent-colour); - box-shadow: 0 1px 2px var(--accent-colour); - background-color: var(--background-colour); margin: 2px 0; @media (max-width: @site-mobile-width) { @@ -16,100 +13,112 @@ flex-shrink: 1; word-wrap: break-word; overflow: hidden; - - &__text { - margin: 2px; - line-height: 1.2em; - - @media (max-width: @site-mobile-width) { - margin: 4px; - font-size: 1.2em; - line-height: 1.3em; - } - } - - &__info { - font-size: .9em; - line-height: 1.7em; - padding: 0 2px; - border-bottom: 1px solid var(--accent-colour); - display: flex; - justify-content: space-between; - - &__link { - color: inherit; - text-decoration: none; - - &:hover { - text-decoration: underline; - } - } - } } - &__author { - border-right: 1px solid var(--accent-colour); - text-align: center; - flex-grow: 0; - flex-shrink: 0; - min-width: 170px; + &__details { + font-size: .9em; + line-height: 1.7em; + padding: 0 2px; display: flex; - flex-direction: column; - align-items: center; + justify-content: space-between; + color: #888; + } - @media (max-width: @site-mobile-width) { - border-right-width: 0; - border: 1px solid var(--accent-colour); - flex-direction: row; - border-bottom-width: 2px; - } + &__datetime, + &__id { + color: inherit; + text-decoration: none; - &__joined { - flex-grow: 1; - flex-shrink: 1; - margin: 5px; - max-width: 170px; - - @media (max-width: @site-mobile-width) { - display: none; - } - } - - &__link { - margin: 15px; - color: inherit; - text-decoration: none; - flex-grow: 0; - flex-shrink: 0; - - @media (max-width: @site-mobile-width) { - display: flex; - align-items: center; - margin: 5px; - flex-grow: 1; - } - } - - &__avatar { - width: 120px; - height: 120px; - box-shadow: 0 1px 2px var(--accent-colour); - - @media (max-width: @site-mobile-width) { - width: 40px; - height: 40px; - margin-right: 5px; - } - } - - &__username { - color: var(--user-colour); - font-size: 1.5em; - line-height: 1.7em; - } - - &:not(&--deleted) &__username:hover { + &:hover { text-decoration: underline; } } + + &__text { + margin: 2px; + line-height: 1.2em; + + @media (max-width: @site-mobile-width) { + margin: 4px; + font-size: 1.2em; + line-height: 1.3em; + } + } + + &__info { + background-image: linear-gradient(90deg, var(--user-colour), transparent); + min-width: 150px; + text-align: center; + display: flex; + flex-direction: column; + align-items: center; + padding: 15px; + flex: 0 0 auto; + margin-right: 4px; + + @media (max-width: @site-mobile-width) { + background-image: linear-gradient(180deg, var(--user-colour), transparent); + flex-direction: row; + margin: 0; + padding: 5px; + } + } + + &__icons { + display: flex; + align-items: center; + + @media (max-width: @site-mobile-width) { + flex-direction: column; + align-items: flex-end; + } + } + + &__posts-count { + font-size: .9em; + margin-left: 4px; + } + + &__joined { + flex: 1 1 auto; + margin: 2px; + max-width: 170px; + font-size: .9em; + justify-self: flex-end; + margin-top: 10px; + margin-bottom: -10px; + + @media (max-width: @site-mobile-width) { + display: none; + } + } + + &__avatar { + width: 120px; + height: 120px; + + @media (max-width: @site-mobile-width) { + width: 40px; + height: 40px; + margin-right: 4px; + } + } + + &__username { + color: inherit; + font-size: 1.4em; + line-height: 1.5em; + text-decoration: none; + margin: 2px 0 1px; + + &[href]:hover { + text-decoration: underline; + } + + @media (max-width: @site-mobile-width) { + flex: 1 1 auto; + text-align: left; + margin: 0 4px; + } + } } diff --git a/src/Forum/post.php b/src/Forum/post.php index 70113059..48cf8d0d 100644 --- a/src/Forum/post.php +++ b/src/Forum/post.php @@ -53,7 +53,14 @@ define('MSZ_FORUM_POST_LISTING_QUERY_STANDARD', ' u.`user_id` as `poster_id`, u.`username` as `poster_name`, u.`created_at` as `poster_joined`, - COALESCE(u.`user_colour`, r.`role_colour`) as `poster_colour` + u.`user_country` as `poster_country`, + COALESCE(u.`user_colour`, r.`role_colour`) as `poster_colour`, + ( + SELECT COUNT(`post_id`) + FROM `msz_forum_posts` + WHERE `user_id` = p.`user_id` + AND `post_deleted` IS NULL + ) as `poster_post_count` FROM `msz_forum_posts` as p LEFT JOIN `msz_users` as u ON u.`user_id` = p.`user_id` diff --git a/templates/forum/macros.twig b/templates/forum/macros.twig index 9887181a..ddd42a8b 100644 --- a/templates/forum/macros.twig +++ b/templates/forum/macros.twig @@ -130,7 +130,7 @@ {% macro forum_topic_buttons(topic) %}
Reply
{% endmacro %} @@ -263,40 +263,41 @@ {% set is_original_post = is_original_post|default(false) %} {% set is_original_poster = is_original_poster|default(false) %} -
- {% if post.poster_id is not null %} -
-
-