Skip to content

files: hide archive button over the size cap#3447

Open
slint wants to merge 1 commit into
inveniosoftware:masterfrom
slint:feat/archive-link-gate
Open

files: hide archive button over the size cap#3447
slint wants to merge 1 commit into
inveniosoftware:masterfrom
slint:feat/archive-link-gate

Conversation

@slint
Copy link
Copy Markdown
Member

@slint slint commented May 7, 2026

<i class="file archive icon button" aria-hidden="true"></i> {{_("Download all")}}
</a>
{%- set archive_max_size = config.RECORDS_RESOURCES_ARCHIVE_DOWNLOAD_MAX_SIZE %}
{%- set archive_total_bytes = files|map(attribute='size', default=0)|sum() %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add record.files.total_bytes to the template context?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to, but we're apparently passing a serialized record... I guess it's for permission purposes as well, plus it's a bit dangerous to have "live" API/model instances in templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review 🔍

Development

Successfully merging this pull request may close these issues.

2 participants