From 99f04893bb110729d4668528359b6378f9df3113 Mon Sep 17 00:00:00 2001 From: Bat Date: Wed, 5 Sep 2018 16:41:31 +0100 Subject: [PATCH] Add tabs to the user profile --- static/main.css | 4 ++++ templates/users/details.html.tera | 8 ++++---- templates/users/followers.html.tera | 5 ++++- templates/users/header.html.tera | 12 ++++++------ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/static/main.css b/static/main.css index 8939ec2f..99396f7a 100644 --- a/static/main.css +++ b/static/main.css @@ -799,3 +799,7 @@ figcaption { color: #7765E3; border-bottom: 1px solid #7765E3; } + +.user-summary { + margin: 2em 0px; +} diff --git a/templates/users/details.html.tera b/templates/users/details.html.tera index 3939846b..c48e9f21 100644 --- a/templates/users/details.html.tera +++ b/templates/users/details.html.tera @@ -14,11 +14,11 @@ {% block content %} {% include "users/header" %} -
- {{ user.summary | safe }} -
+ {% set user_link = ['/@', user.fqn] %} + {% set followers_link = ['/@', user.fqn, 'followers'] %} + {{ macros::tabs(links=[ user_link | join(sep='/'), followers_link | join(sep='/')], titles=['Articles', 'Followers'], selected=1) }} - {% if recents | length != 0 %} + {% if recents | length != 0 %}

{{ "Latest articles" | _ }} diff --git a/templates/users/followers.html.tera b/templates/users/followers.html.tera index 6c330e20..fb2a3f91 100644 --- a/templates/users/followers.html.tera +++ b/templates/users/followers.html.tera @@ -8,7 +8,10 @@ {% block content %} {% include "users/header" %} -

{{ "Followers" | _ }}

+ {% set user_link = ['/@', user.fqn] %} + {% set followers_link = ['/@', user.fqn, 'followers'] %} + {{ macros::tabs(links=[ user_link | join(sep='/'), followers_link | join(sep='/')], titles=['Articles', 'Followers'], selected=2) }} +
{% for follower in followers %}
diff --git a/templates/users/header.html.tera b/templates/users/header.html.tera index af4daa34..437e7187 100644 --- a/templates/users/header.html.tera +++ b/templates/users/header.html.tera @@ -15,12 +15,11 @@ {{ "It is you" | _ }} {% endif %} + {% if is_self %} + {{ "Edit your profile" | _ }} + {% endif %}
- {% if is_self %} - {{ "Edit your profile" | _ }} - {% endif %} - {% if is_remote %} {{ "Open on {{ instance_url }}" | _(instance_url=instance_url) }} {% endif %} @@ -35,6 +34,7 @@ {% endif %}
-
- {{ "{{ count }} followers" | _n(singular="One follower", count=n_followers) }} + +
+ {{ user.summary | safe }}