Skip to content

Commit

Permalink
frontpage: display verified community logo
Browse files Browse the repository at this point in the history
* closes #716
  • Loading branch information
anikachurilova committed Feb 23, 2024
1 parent 53374ee commit bef1ed7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
38 changes: 30 additions & 8 deletions templates/semantic-ui/zenodo_rdm/macros/record_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) %}
<li class="item">
<div class="content">

Expand All @@ -46,7 +46,7 @@
<i class="icon {{ access_status_icon }}" aria-hidden="true"></i>
{{ access_status }}
</div>
</div>
</div>

{# Title #}
<div class="header theme-primary-text">
Expand All @@ -68,12 +68,6 @@
{{ description | truncate(length=350, end='...') }}
</p>

{# Communities list #}
<h5>
{% set communities_entries = record.parent.communities.entries %}
<b>{{ _("Part of:")}} {{ communities_list(communities=communities_entries) }}</b>
</h5>

<div class="extra">
<div class="flex justify-space-between align-items-end">
{# Publishing details #}
Expand All @@ -87,6 +81,16 @@ <h5>
{% endif %}
</small>
</p>

{# Communities list #}
<p>
<small>
{% set communities_entries = record.parent.communities.entries %}
{% if communities_entries %}
<b>{{ _("Part of:")}} {{ communities_list(communities=communities_entries) }}</b>
{% endif %}
</small>
</p>
<p>
<small>
{% if publishing_journal %}
Expand Down Expand Up @@ -134,6 +138,24 @@ <h5>
{% endif %}
</small>
</div>
{% 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 %}
<a href="/communities/{{ branded_community_id }}"
class="ui label themed-community-label"
style="background-color: rgb(0, 68, 148);"
>
{{ community.metadata.title }}
<img src="/api/communities/{{ branded_community_id }}/logo" alt class="ui image themed-community-logo right-floated">
</a>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
</div>
</div>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h1 class="ui large header">{{ title }}</h1>
<div class="ui fluid stackable three column grid">
{% for record in records %}
<ul class="ui column items m-0">
{{ record_item(record=record) }}
{{ record_item(record=record, highlightCommunity=False) }}
</ul>
{% endfor %}
</div>
Expand Down

0 comments on commit bef1ed7

Please sign in to comment.