-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontpage: replace react recent uploads component with jinja
- Loading branch information
Showing
9 changed files
with
370 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
.ui.label.stats-popup { | ||
position: relative; | ||
|
||
.ui.popup { | ||
display: none; | ||
position: absolute; | ||
top: -200%; | ||
width: max-content; | ||
|
||
&:before { | ||
top: 95%; | ||
} | ||
|
||
} | ||
|
||
&#uniqueViews { | ||
.ui.popup { | ||
left: 0; | ||
|
||
&:before { | ||
top: 87%; | ||
left: 24%; | ||
} | ||
} | ||
} | ||
|
||
&#uniqueDownloads { | ||
.ui.popup { | ||
right: 0; | ||
|
||
&:before { | ||
top: 87%; | ||
right: 16%; | ||
} | ||
} | ||
} | ||
|
||
&:hover { | ||
.ui.popup { | ||
display: block !important; | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{# | ||
# This file is part of Zenodo. | ||
# Copyright (C) 2022 CERN. | ||
# | ||
# Zenodo is free software; you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 2 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Zenodo is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Zenodo; if not, write to the | ||
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307, USA. | ||
# | ||
# In applying this license, CERN does not | ||
# waive the privileges and immunities granted to it by virtue of its status | ||
# as an Intergovernmental Organization or submit itself to any jurisdiction. | ||
-#} | ||
|
||
{% macro creators(creators=None) %} | ||
{% for creator in creators %} | ||
{% set creator_name = creator.person_or_org.get("name", "No name") if creator.person_or_org %} | ||
{% set ids = creator.person_or_org.get("identifiers", []) if creator.person_or_org %} | ||
|
||
<span class="creatibutor-wrap separated"> | ||
<a | ||
class="creatibutor-link" | ||
href="/search?q=metadata.creators.person_or_org.name:{{ creator_name }}" | ||
title="{{ creator_name }}: {{_('Search')}}" | ||
> | ||
<span class="creatibutor-name">{{ creator_name }}</span> | ||
</a> | ||
|
||
{{ creator_icons(creator_name=creator_name, ids=ids) }} | ||
</span> | ||
{% endfor%} | ||
{% endmacro %} | ||
|
||
|
||
{% macro creator_icons(creator_name=None, ids=None) %} | ||
{% for id in ids %} | ||
{% if id.scheme == "orcid" %} | ||
{% set link = "https://orcid.org/{identifier}".format(identifier=id.identifier) %} | ||
{% set link_title = _("ORCID profile") %} | ||
{% set icon = "/static/images/orcid.svg" %} | ||
|
||
{% elif id.scheme == "ror" %} | ||
{% set link = "https://ror.org/{identifier}".format(identifier=id.identifier) %} | ||
{% set link_title = _("ROR profile") %} | ||
{% set icon = "/static/images/ror-icon.svg" %} | ||
|
||
{% elif id.scheme == "gnd" %} | ||
{% set link = "https://d-nb.info/gnd/{identifier}".format(identifier=id.identifier) %} | ||
{% set link_title = _("GND profile") %} | ||
{% set icon = "/static/images/gnd-icon.svg" %} | ||
{% endif %} | ||
<a | ||
class="no-text-decoration mr-0" | ||
href="{{ link }}" | ||
aria-label="{{ creator_name }}: {{ link_title }}" | ||
title="{{ creator_name }}: {{ link_title }}" | ||
> | ||
<img class="inline-id-icon ml-5" src="{{ icon }}" alt="" /> | ||
</a> | ||
{% endfor %} | ||
{% endmacro %} |
46 changes: 46 additions & 0 deletions
46
templates/semantic-ui/zenodo_rdm/macros/recent_uploads_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{# | ||
# This file is part of Zenodo. | ||
# Copyright (C) 2022 CERN. | ||
# | ||
# Zenodo is free software; you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 2 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Zenodo is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Zenodo; if not, write to the | ||
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307, USA. | ||
# | ||
# In applying this license, CERN does not | ||
# waive the privileges and immunities granted to it by virtue of its status | ||
# as an Intergovernmental Organization or submit itself to any jurisdiction. | ||
-#} | ||
|
||
{% from "zenodo_rdm/macros/record_item.html" import record_item %} | ||
|
||
{% macro recent_uploads_list(title="Recent uploads", records=None) %} | ||
<div id="records-list" data-title="{{ title }}"> | ||
|
||
<h2 class="ui header">{{ title }}</h2> | ||
|
||
<div class="ui container rel-mb-2 ml-0-mobile mr-0-mobile"> | ||
<ul class="ui divided link relaxed items pl-0"> | ||
{% for record in records %} | ||
{{ record_item(record=record) }} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
|
||
<div class="ui center aligned container"> | ||
<a class="ui button" href="/search" aria-label="See more records"> | ||
More | ||
</a> | ||
</div> | ||
</div> | ||
{% endmacro %} |
Oops, something went wrong.