diff --git a/static/css/main.css b/static/css/main.css index e94d312e..948ad303 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -737,8 +737,9 @@ figcaption { /** Avatars **/ .avatar { + background-position: center; + background-size: cover; border-radius: 100%; - text-align: center; /* for alt-text */ } .avatar.small { diff --git a/templates/base.html.tera b/templates/base.html.tera index db40f8d3..0fd1047f 100644 --- a/templates/base.html.tera +++ b/templates/base.html.tera @@ -1,3 +1,5 @@ +{% import "macros" as macros %} + @@ -33,8 +35,8 @@ {{ "Log Out" | _ }} - - {{ + + {{ macros::avatar(user=account) }} {{ "My account" | _ }} {% else %} diff --git a/templates/instance/about.html.tera b/templates/instance/about.html.tera index 95dcfef0..5eb1a687 100644 --- a/templates/instance/about.html.tera +++ b/templates/instance/about.html.tera @@ -29,7 +29,7 @@ About {{ instance.name }}

{{ "Administred by" | _ }}

- {{ admin.name }} + {{ macros::avatar(user=admin) }}

{{ admin.name }}(@{{ admin.fqn }})

diff --git a/templates/instance/users.html.tera b/templates/instance/users.html.tera index a3a572cb..672f4732 100644 --- a/templates/instance/users.html.tera +++ b/templates/instance/users.html.tera @@ -13,7 +13,7 @@ Users
{% for user in users %}
- {{ user.name }} + {{ macros::avatar(user=user) }}

{{ user.name }} @{{ user.username }} diff --git a/templates/macros.html.tera b/templates/macros.html.tera index e8ed7f45..6ac6a4f8 100644 --- a/templates/macros.html.tera +++ b/templates/macros.html.tera @@ -52,7 +52,7 @@ {% macro comment(comm) %}

{% endif %} {% endmacro %} +{% macro avatar(user, size="small", pad=true) %} + +{% endmacro %} diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index 1a0bf59a..b723063d 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -42,7 +42,7 @@ {% endfor %}
- {{ author.name }} + {{ macros::avatar(user=author, pad=true, size="medium") }}

{{ author.name }}

{{ author.summary | safe }} diff --git a/templates/users/header.html.tera b/templates/users/header.html.tera index c466e40f..eded30ee 100644 --- a/templates/users/header.html.tera +++ b/templates/users/header.html.tera @@ -1,6 +1,6 @@

- {{ + {{ macros::avatar(user=user, size="medium") }}

{{ user.name }}