Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<section class="p-strip is-shallow u-no-padding--bottom">
<div class="u-fixed-width">
<h2>Most popular snaps</h2>
<h2>{{ title }}</h2>
</div>
</section>
<section class="p-strip is-shallow u-no-padding--bottom">
<div class="row">
{% for snap in popular_snaps %}
{% for snap in snaps_list %}
{% if loop.index <= 8 %}
<div class="col-3">
<p class="p-heading--4" style="float: left; margin-right: 1rem">{{ loop.index }}</p>
Comment thread
steverydz marked this conversation as resolved.
Expand Down
10 changes: 9 additions & 1 deletion templates/explore/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ <h1 class="p-heading--2">The app store for Linux</h1>
{% endif %}

{% if popular_snaps %}
{% include "explore/_popular-snaps.html" %}
{% with snaps_list = popular_snaps, title = "Most popular snaps" %}
{% include "explore/_snaps-list.html" %}
{% endwith %}
{% endif %}

{% if categories %}
{% include "explore/_categories.html" %}
{% endif %}

{% if top_rated_snaps %}
{% with snaps_list = top_rated_snaps, title = "Top rated snaps" %}
{% include "explore/_snaps-list.html" %}
{% endwith %}
{% endif %}

{% if trending_snaps %}
{% include "explore/_trending-snaps.html" %}
{% endif %}
Expand Down
8 changes: 8 additions & 0 deletions webapp/store/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ def explore_view():
except api_requests.exceptions.RequestException:
trending_snaps = []

try:
top_rated_snaps = api_requests.get(
f"{recommendations_api_url}/top_rated"
).json()
except api_requests.exceptions.RequestException:
top_rated_snaps = []

try:
categories_results = device_gateway.get_categories()
except StoreApiError:
Expand All @@ -166,6 +173,7 @@ def explore_view():
popular_snaps=popular_snaps,
recent_snaps=recent_snaps,
trending_snaps=trending_snaps,
top_rated_snaps=top_rated_snaps,
)

@store.route("/youtube", methods=["POST"])
Expand Down