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

Use package metadata translations in spotlight carousel #577

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,25 @@
</div>
<div class="carousel-inner">
{% for package in spotlight_pkgs %}
{% set meta = package.get_translated(load_desc=False) %}
{% set cover_image = package.get_cover_image_url() %}
{% set tags = package.tags | sort(attribute="views", reverse=True) %}
<div class="carousel-item {% if loop.index == 1 %}active{% endif %}">
<a href="{{ package.get_url('packages.view') }}">
<div class="ratio ratio-16x9">
<img src="{{ cover_image }}"
alt="{{ _('%(title)s by %(author)s', title=package.title, author=package.author.display_name) }}">
alt="{{ _('%(title)s by %(author)s', title=meta.title, author=package.author.display_name) }}">
</div>
<div class="carousel-caption text-shadow">
<h3 class="mt-0 mb-3">
{% if package.author %}
{{ _('<strong>%(title)s</strong> by %(author)s', title=package.title, author=package.author.display_name) }}
{{ _('<strong>%(title)s</strong> by %(author)s', title=meta.title, author=package.author.display_name) }}
{% else %}
<strong>{{ package.title }}</strong>
<strong>{{ meta.title }}</strong>
{% endif %}
</h3>
<p>
{{ package.short_desc }}
{{ meta.short_desc }}
</p>
{% if package.author %}
<div class="d-none d-md-block">
Expand Down
Loading