From bef1ed712fcf9ef80c936d770e9eeecfd922b65e Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Mon, 19 Feb 2024 11:18:08 +0100 Subject: [PATCH] frontpage: display verified community logo * closes https://github.com/zenodo/zenodo-rdm/issues/716 --- .../zenodo_rdm/macros/record_item.html | 38 +++++++++++++++---- .../details/home/index.html | 2 +- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/templates/semantic-ui/zenodo_rdm/macros/record_item.html b/templates/semantic-ui/zenodo_rdm/macros/record_item.html index 66b85da6..a0e1489c 100644 --- a/templates/semantic-ui/zenodo_rdm/macros/record_item.html +++ b/templates/semantic-ui/zenodo_rdm/macros/record_item.html @@ -25,7 +25,7 @@ {% from "zenodo_rdm/macros/creators.html" import creators %} {% from "zenodo_rdm/macros/communities_list.html" import communities_list %} -{% macro record_item(record=None) %} +{% macro record_item(record=None, highlightCommunity=True) %}
  • @@ -46,7 +46,7 @@ {{ access_status }}
    - + {# Title #}
    @@ -68,12 +68,6 @@ {{ description | truncate(length=350, end='...') }}

    - {# Communities list #} -
    - {% set communities_entries = record.parent.communities.entries %} - {{ _("Part of:")}} {{ communities_list(communities=communities_entries) }} -
    -
    {# Publishing details #} @@ -87,6 +81,16 @@
    {% endif %}

    + + {# Communities list #} +

    + + {% set communities_entries = record.parent.communities.entries %} + {% if communities_entries %} + {{ _("Part of:")}} {{ communities_list(communities=communities_entries) }} + {% endif %} + +

    {% if publishing_journal %} @@ -134,6 +138,24 @@

    {% endif %}
    + {% if highlightCommunity %} + {% set communities = record.parent.communities.entries %} + {% set branded_community_id = record.parent.communities.default %} + + {% if communities and branded_community_id %} + {% for community in communities %} + {% if community.id == branded_community_id and community.theme %} + + {{ community.metadata.title }} + + + {% endif %} + {% endfor %} + {% endif %} + {% endif %}
  • diff --git a/templates/themes/horizon/invenio_communities/details/home/index.html b/templates/themes/horizon/invenio_communities/details/home/index.html index a3aad6df..e459d77e 100644 --- a/templates/themes/horizon/invenio_communities/details/home/index.html +++ b/templates/themes/horizon/invenio_communities/details/home/index.html @@ -59,7 +59,7 @@

    {{ title }}

    {% for record in records %} {% endfor %}