Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recent-uploads: show unique views/downloads instead of total #529

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/less/zenodo-rdm/modules/popup.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

}

&.total-views {
&.stats-views {
.ui.popup {
left: 0;

Expand All @@ -25,7 +25,7 @@
}
}

&.total-downloads {
&.stats-downloads {
.ui.popup {
right: 0;

Expand Down
12 changes: 6 additions & 6 deletions templates/semantic-ui/zenodo_rdm/macros/record_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,25 @@
</div>

{# Statistics #}
{% set downloads = record.stats.all_versions.downloads %}
{% set views = record.stats.all_versions.views %}
{% set downloads = record.stats.all_versions.unique_downloads %}
{% set views = record.stats.all_versions.unique_views %}
<small class="flex align-items-center">
{% if views is defined %}
<div class="ui transparent label stats-popup total-views" aria-label="{{ _('Total views') }}">
<div class="ui transparent label stats-popup stats-views" aria-label="{{ _('Views') }}">
<i class="ui eye icon" aria-hidden="true"></i>
{{ views }}
<div class="ui tiny popup" aria-hidden="true">
{{ _("Total views") }}
{{ _("Views") }}
</div>
</div>
{% endif %}

{% if downloads is defined %}
<div class="ui transparent label stats-popup total-downloads" aria-label="{{ _('Total downloads') }}">
<div class="ui transparent label stats-popup stats-downloads" aria-label="{{ _('Downloads') }}">
<i class="ui download icon" aria-hidden="true"></i>
{{ downloads}}
<div class="ui tiny popup" aria-hidden="true">
{{ _("Total downloads") }}
{{ _("Downloads") }}
</div>
</div>
{% endif %}
Expand Down
Loading