diff --git a/app/static/css/widgets.css b/app/static/css/widgets.css index 4f6a9d8..b28f970 100644 --- a/app/static/css/widgets.css +++ b/app/static/css/widgets.css @@ -3,6 +3,13 @@ align-items: center; width: 265px; } +.profile.minimal { + width: 176px; +} +.profile.minimal .profile-avatar { + width: 64px; + height: 64px; +} .profile-avatar { width: 128px; height: 128px; diff --git a/app/static/less/widgets.less b/app/static/less/widgets.less index 31a2f0f..28ebc7b 100644 --- a/app/static/less/widgets.less +++ b/app/static/less/widgets.less @@ -8,6 +8,15 @@ width: 265px; } +.profile.minimal { + width: 176px; + + .profile-avatar { + width: 64px; + height: 64px; + } + } + .profile-avatar { width: 128px; height: 128px; diff --git a/app/templates/forum/topic.html b/app/templates/forum/topic.html index 86db5ea..e492923 100644 --- a/app/templates/forum/topic.html +++ b/app/templates/forum/topic.html @@ -20,13 +20,10 @@ {% endif %} {% if t.thread.top_comment %} - {% call widget_thread.thread_leader(t.thread.top_comment) %} + {% call widget_thread.thread_leader(t.thread.top_comment, t) %}
Créé le {{ t.date_created | dyndate }} - {% if t.author_id != t.thread.top_comment.author.id %} - par {{ t.author.name }} - {% endif %} {% if t.thread.top_comment.date_created | dyndate != t.date_created | dyndate %} (Posté le {{ t.thread.top_comment.date_created | dyndate }}) diff --git a/app/templates/programs/program.html b/app/templates/programs/program.html index fe07e00..de71ddf 100644 --- a/app/templates/programs/program.html +++ b/app/templates/programs/program.html @@ -17,7 +17,7 @@
{% if p.thread.top_comment %} - {% call widget_thread.thread_leader(p.thread.top_comment) %} + {% call widget_thread.thread_leader(p.thread.top_comment, p) %}
{{ widget_thread.post_actions(p) }}
diff --git a/app/templates/widgets/thread.html b/app/templates/widgets/thread.html index 1add484..b6012fb 100644 --- a/app/templates/widgets/thread.html +++ b/app/templates/widgets/thread.html @@ -98,12 +98,20 @@ leader: Posts's top comment (actual rendering is delegated to caller) #} -{% macro thread_leader(leader) %} +{% macro thread_leader(leader, thread) %} {# Empty line to get normal background (instead of alternate one) #} - +
{{ widget_user.profile(leader.author) }} + {% if thread.author_id != leader.author_id %} + Auteur de la page: + {{ widget_user.profile(thread.author, minimal = True) }} +
+ Auteur du post principal: + {% endif %} + {{ widget_user.profile(leader.author) }} +
{{ caller() }}
diff --git a/app/templates/widgets/user.html b/app/templates/widgets/user.html index 96ad546..b69baed 100644 --- a/app/templates/widgets/user.html +++ b/app/templates/widgets/user.html @@ -1,9 +1,10 @@ -{% macro profile(user) %} +{% macro profile(user, minimal = False) %} {% if user.type == "member" %} -
+
Avatar de {{ user.name }}
+ {% if minimal == False %} {% if user.title %}
{{ user.title.name }}
{% else %} @@ -16,6 +17,7 @@ {% else %}
{% endif %} + {% endif %}
{% else %}