diff --git a/content/katedra/pracovnici/battistova/battistova.jpg b/content/katedra/pracovnici/battistova/img.jpg similarity index 100% rename from content/katedra/pracovnici/battistova/battistova.jpg rename to content/katedra/pracovnici/battistova/img.jpg diff --git a/content/katedra/pracovnici/battistova/index.md b/content/katedra/pracovnici/battistova/index.md index 85a60f1..a56a084 100644 --- a/content/katedra/pracovnici/battistova/index.md +++ b/content/katedra/pracovnici/battistova/index.md @@ -6,6 +6,5 @@ role = "Studijní referent, Garant elektronického zápisu pro KITTV" email = "eva.battistova@pedf.cuni.cz" phone = "+420 221 900 141" time = "Pondělí 12:00 – 13:00" -image = "battistova.jpg" +++ diff --git a/content/katedra/pracovnici/cernochova/cernochova.jpg b/content/katedra/pracovnici/cernochova/img.jpg similarity index 100% rename from content/katedra/pracovnici/cernochova/cernochova.jpg rename to content/katedra/pracovnici/cernochova/img.jpg diff --git a/content/katedra/pracovnici/cernochova/index.md b/content/katedra/pracovnici/cernochova/index.md index 0ce3a69..dd8e00c 100644 --- a/content/katedra/pracovnici/cernochova/index.md +++ b/content/katedra/pracovnici/cernochova/index.md @@ -6,6 +6,5 @@ role = "Zahraniční referent" email = "miroslava.cernochova@pedf.cuni.cz" phone = "+420 221 900 238" time = "Středa 12:00 – 13:00" -image = "cernochova.jpg" +++ diff --git a/static/placeholder-avatar.jpg b/static/placeholder-avatar.jpg new file mode 100644 index 0000000..624d628 Binary files /dev/null and b/static/placeholder-avatar.jpg differ diff --git a/templates/macros.html b/templates/macros.html index 4ef695f..cfca372 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -113,11 +113,7 @@ {% macro list_people() %} {% for page in section.pages %}
- {% if page.extra.image %} - {{ page.title }} - {% else %} - {{ page.title }} - {% endif %} + {{ macro::profile_picture(person=page) }}
@@ -140,3 +136,17 @@
{% endfor %} {% endmacro %} + +{% macro profile_picture(person) %} + {% set_global img_found = 0 %} + {% for asset in person.assets %} + {% if asset is matching("img.(jpg|png)$") %} + {% set_global img_found = 1 %} + {{ person.title }} + {% break %} + {% endif %} + {% endfor %} + {% if not img_found == 1 %} + {{ person.title }} + {% endif %} +{% endmacro %}