diff --git a/tildes/scss/modules/_user.scss b/tildes/scss/modules/_user.scss new file mode 100644 index 0000000..a59dc22 --- /dev/null +++ b/tildes/scss/modules/_user.scss @@ -0,0 +1,33 @@ +// Copyright (c) 2019 Tildes contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +.user-bio { + @extend %links-text; + @extend %lists-text; + + border: 1px solid; + padding: 0.4rem; + margin-bottom: 1rem; + font-size: 0.6rem; + + summary::after { + font-size: 0.6rem; + font-style: italic; + content: "Hide bio"; + display: none; + } + + &[open] { + font-size: 0.8rem; + + summary { + &::after { + display: inline; + } + + span { + display: none; + } + } + } +} diff --git a/tildes/scss/styles.scss b/tildes/scss/styles.scss index c197317..665d7f7 100644 --- a/tildes/scss/styles.scss +++ b/tildes/scss/styles.scss @@ -33,6 +33,7 @@ @import 'modules/time'; @import 'modules/toast'; @import 'modules/topic'; +@import 'modules/user'; // Note: if you add a new theme, you may also want to add a new theme-color // meta tag inside the base.jinja2 template, so mobile browsers can match diff --git a/tildes/scss/themes/_theme_base.scss b/tildes/scss/themes/_theme_base.scss index dcbedfe..2d1dea3 100644 --- a/tildes/scss/themes/_theme_base.scss +++ b/tildes/scss/themes/_theme_base.scss @@ -470,6 +470,15 @@ } } + .user-bio { + border-color: map-get($theme, "border"); + background-color: map-get($theme, "background-secondary"); + + &[open] { + color: map-get($theme, "foreground-highlight"); + } + } + .is-comment-deleted, .is-comment-removed { color: map-get($theme, "foreground-secondary"); } diff --git a/tildes/tildes/templates/user.jinja2 b/tildes/tildes/templates/user.jinja2 index 9a75569..194ca47 100644 --- a/tildes/tildes/templates/user.jinja2 +++ b/tildes/tildes/templates/user.jinja2 @@ -48,6 +48,13 @@ {% endif %} + {% if user.bio_rendered_html %} +
+ View {{ user.username }}'s bio + {{ user.bio_rendered_html|safe }} +
+ {% endif %} + {% if posts %} {% if request.has_permission("view_history", user) and posts.has_prev_page %}