From 3f2b63aaa5d9fa1f3b6e3fc60f662d4cc53f9fc9 Mon Sep 17 00:00:00 2001 From: thomas girod Date: Thu, 15 Aug 2024 00:40:30 +0200 Subject: [PATCH] move forum style into its own file --- core/static/core/style.scss | 159 -------------------- forum/static/forum/css/forum.scss | 158 +++++++++++++++++++ forum/templates/forum/favorite_topics.jinja | 4 + forum/templates/forum/forum.jinja | 4 + forum/templates/forum/last_unread.jinja | 4 + forum/templates/forum/main.jinja | 4 + forum/templates/forum/reply.jinja | 5 + forum/templates/forum/search.jinja | 5 + forum/templates/forum/topic.jinja | 5 + 9 files changed, 189 insertions(+), 159 deletions(-) create mode 100644 forum/static/forum/css/forum.scss diff --git a/core/static/core/style.scss b/core/static/core/style.scss index 8fbc665e..0e5f5845 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -1248,165 +1248,6 @@ textarea { display: inline; } -/*------------------------------FORUM----------------------------------*/ - -#forum { - .button { - background-color: rgb(230, 230, 230); - padding: 10px; - font-weight: bold; - border-radius: 5px; - &:hover { - background-color: rgb(211, 211, 211); - } - } - .topic { - border: solid $primary-neutral-color 1px; - padding: 1px; - margin: 1px; - p { - margin: 1px; - font-size: smaller; - } - a { - color: $black-color; - } - a:hover { - text-decoration: underline; - } - } - - .tools { - font-size: x-small; - border: none; - font-weight: bold; - a { - padding: 1px; - } - } - - .title { - font-size: small; - font-weight: bold; - padding: 2px; - } - - .last_message date { - white-space: nowrap; - } - - .last_message span { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - width: 100%; - display: block; - } - - .forum { - background: $primary-neutral-light-color; - padding: 1px; - margin: 1px; - p { - margin: 1px; - font-size: smaller; - } - a { - color: $black-color; - } - a:hover { - text-decoration: underline; - } - } - - .search_bar { - margin: 10px 0; - display: flex; - flex-wrap: wrap; - height: 20px; - align-items: center; - } - .search_check { - margin-left: 10px; - } - .search_bouton { - margin-left: 10px; - } - .category { - margin-top: 5px; - background: $secondary-color; - color: white; - border-radius: 10px 10px 0 0; - .title { - text-transform: uppercase; - } - } - - .message { - padding: 1px; - margin: 1px; - background: $secondary-neutral-light-color; - &:nth-child(odd) { - background: $primary-neutral-light-color; - } - .title { - font-size: 100%; - } - &.unread { - background: #e9eea1; - } - } - - .msg_author.deleted { - background: #ffcfcf; - } - - .msg_content { - &.deleted { - background: #ffefef; - } - display: inline-block; - width: 80%; - vertical-align: top; - } - - .msg_author { - display: inline-block; - width: 19%; - text-align: center; - img { - max-width: 70%; - margin: 0 auto; - } - } - - .msg_header { - display: inline-block; - width: 100%; - font-size: small; - } - - .msg_meta { - font-size: small; - list-style-type: none; - li { - padding: 1px; - margin: 1px; - } - } - - .forum_signature { - color: hsl(0, 0%, 75%); - border-top: 1px solid hsl(0, 0%, 75%); - a { - color: hsl(0, 0%, 75%); - &:hover { - text-decoration: underline; - } - } - } -} - /*--------------------------------FOOTER-------------------------------*/ footer { diff --git a/forum/static/forum/css/forum.scss b/forum/static/forum/css/forum.scss new file mode 100644 index 00000000..b592231d --- /dev/null +++ b/forum/static/forum/css/forum.scss @@ -0,0 +1,158 @@ +@import "core/static/core/colors"; + +#forum { + .button { + background-color: rgb(230, 230, 230); + padding: 10px; + font-weight: bold; + border-radius: 5px; + &:hover { + background-color: rgb(211, 211, 211); + } + } + .topic { + border: solid $primary-neutral-color 1px; + padding: 1px; + margin: 1px; + p { + margin: 1px; + font-size: smaller; + } + a { + color: $black-color; + } + a:hover { + text-decoration: underline; + } + } + + .tools { + font-size: x-small; + border: none; + font-weight: bold; + a { + padding: 1px; + } + } + + .title { + font-size: small; + font-weight: bold; + padding: 2px; + } + + .last_message date { + white-space: nowrap; + } + + .last_message span { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + width: 100%; + display: block; + } + + .forum { + background: $primary-neutral-light-color; + padding: 1px; + margin: 1px; + p { + margin: 1px; + font-size: smaller; + } + a { + color: $black-color; + } + a:hover { + text-decoration: underline; + } + } + + .search_bar { + margin: 10px 0; + display: flex; + flex-wrap: wrap; + height: 20px; + align-items: center; + } + .search_check { + margin-left: 10px; + } + .search_bouton { + margin-left: 10px; + } + .category { + margin-top: 5px; + background: $secondary-color; + color: white; + border-radius: 10px 10px 0 0; + .title { + text-transform: uppercase; + } + } + + .message { + padding: 1px; + margin: 1px; + background: $secondary-neutral-light-color; + &:nth-child(odd) { + background: $primary-neutral-light-color; + } + .title { + font-size: 100%; + } + &.unread { + background: #e9eea1; + } + } + + .msg_author.deleted { + background: #ffcfcf; + } + + .msg_content { + &.deleted { + background: #ffefef; + } + display: inline-block; + width: 80%; + vertical-align: top; + } + + .msg_author { + display: inline-block; + width: 19%; + text-align: center; + img { + max-width: 70%; + margin: 0 auto; + } + } + + .msg_header { + display: inline-block; + width: 100%; + font-size: small; + } + + .msg_meta { + font-size: small; + list-style-type: none; + li { + padding: 1px; + margin: 1px; + } + } + + .forum_signature { + color: hsl(0, 0%, 75%); + border-top: 1px solid hsl(0, 0%, 75%); + a { + color: hsl(0, 0%, 75%); + &:hover { + text-decoration: underline; + } + } + } +} \ No newline at end of file diff --git a/forum/templates/forum/favorite_topics.jinja b/forum/templates/forum/favorite_topics.jinja index c46498b0..15b861d6 100644 --- a/forum/templates/forum/favorite_topics.jinja +++ b/forum/templates/forum/favorite_topics.jinja @@ -5,6 +5,10 @@ {% trans %}Favorite topics{% endtrans %} {% endblock %} +{% block additional_css %} + +{% endblock %} + {% block content %}

Forum > diff --git a/forum/templates/forum/forum.jinja b/forum/templates/forum/forum.jinja index 2a328c55..f8969baa 100644 --- a/forum/templates/forum/forum.jinja +++ b/forum/templates/forum/forum.jinja @@ -5,6 +5,10 @@ {{ forum }} {% endblock %} +{% block additional_css %} + +{% endblock %} + {% block content %} {{ display_breadcrumb(forum) }}

diff --git a/forum/templates/forum/last_unread.jinja b/forum/templates/forum/last_unread.jinja index 4d574ff0..57fe5226 100644 --- a/forum/templates/forum/last_unread.jinja +++ b/forum/templates/forum/last_unread.jinja @@ -5,6 +5,10 @@ {% trans %}Last unread messages{% endtrans %} {% endblock %} +{% block additional_css %} + +{% endblock %} + {% block content %}

Forum > diff --git a/forum/templates/forum/main.jinja b/forum/templates/forum/main.jinja index 3cd3c70e..d5006a26 100644 --- a/forum/templates/forum/main.jinja +++ b/forum/templates/forum/main.jinja @@ -6,6 +6,10 @@ {% trans %}Forum{% endtrans %} {% endblock %} +{% block additional_css %} + +{% endblock %} + {% block content %}

{% trans %}Forum{% endtrans %} > diff --git a/forum/templates/forum/reply.jinja b/forum/templates/forum/reply.jinja index a819a400..d0995cf8 100644 --- a/forum/templates/forum/reply.jinja +++ b/forum/templates/forum/reply.jinja @@ -9,6 +9,11 @@ {% endif %} {% endblock %} + +{% block additional_css %} + +{% endblock %} + {% block content %} {% if topic %} {{ display_search_bar(request) }} diff --git a/forum/templates/forum/search.jinja b/forum/templates/forum/search.jinja index fee1e86a..a335ad20 100644 --- a/forum/templates/forum/search.jinja +++ b/forum/templates/forum/search.jinja @@ -2,6 +2,11 @@ {% from 'forum/macros.jinja' import display_message, display_breadcrumb, display_search_bar %} + +{% block additional_css %} + +{% endblock %} + {% block content %}

{{ display_search_bar(request) }} diff --git a/forum/templates/forum/topic.jinja b/forum/templates/forum/topic.jinja index f1a01473..f730544e 100644 --- a/forum/templates/forum/topic.jinja +++ b/forum/templates/forum/topic.jinja @@ -6,6 +6,11 @@ {{ topic }} {% endblock %} + +{% block additional_css %} + +{% endblock %} + {% block head %} {{ super() }}