contentdb/app/templates/index.html

179 lines
6.0 KiB
HTML
Raw Normal View History

2018-03-18 18:43:30 +01:00
{% extends "base.html" %}
{% block title %}
2019-07-29 22:44:39 +02:00
{{ _("Welcome") }}
2018-03-18 18:43:30 +01:00
{% endblock %}
2023-04-30 01:53:55 +02:00
{% block description %}
{{ _("Welcome to the best place to find Minetest mods, games, and texture packs") }}
{% endblock %}
{% block scriptextra %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "https://content.minetest.net/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://content.minetest.net/packages?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
{% if current_user.is_authenticated %}
<script src="/static/js/quick_review_voting.js?v=2"></script>
{% endif %}
{% endblock %}
2018-12-22 22:03:01 +01:00
{% block content %}
2018-05-18 02:32:34 +02:00
{% from "macros/packagegridtile.html" import render_pkggrid %}
2023-08-22 20:58:43 +02:00
<div id="featuredCarousel" class="carousel slide mt-0 mb-5" data-bs-ride="carousel" data-bs-interval="7500">
<div class="carousel-indicators">
{% for package in spotlight_pkgs %}
2023-08-22 20:58:43 +02:00
<button
data-bs-target="#featuredCarousel"
data-bs-slide-to="{{ loop.index - 1 }}"
{% if loop.index == 1 %}class="active" aria-current="true"{% endif %}></button>
{% endfor %}
2023-08-22 20:58:43 +02:00
</div>
<div class="carousel-inner">
{% for package in spotlight_pkgs %}
{% 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 %}">
2023-06-18 23:00:24 +02:00
<a href="{{ package.get_url('packages.view') }}">
2023-08-22 20:58:43 +02:00
<div class="ratio ratio-16x9">
2023-08-25 22:28:39 +02:00
<img src="{{ cover_image }}"
alt="{{ _('%(title)s by %(author)s', title=package.title, author=package.author.display_name) }}">
</div>
<div class="carousel-caption text-shadow">
<h3 class="mt-0 mb-3">
2021-11-23 01:58:53 +01:00
{% if package.author %}
{{ _('<strong>%(title)s</strong> by %(author)s', title=package.title, author=package.author.display_name) }}
{% else %}
<strong>{{ package.title }}</strong>
{% endif %}
</h3>
<p>
{{ package.short_desc }}
</p>
2021-11-23 01:58:53 +01:00
{% if package.author %}
<div class="d-none d-md-block">
2023-08-22 20:58:43 +02:00
<span class="me-2">
2022-01-14 19:25:28 +01:00
{{ package.type.text }}
</span>
2021-11-23 01:58:53 +01:00
{% for warning in package.content_warnings %}
2023-08-22 20:58:43 +02:00
<span class="badge bg-warning" title="{{ warning.description }}">
2021-11-23 01:58:53 +01:00
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
{{ warning.title }}
</span>
{% endfor %}
{% for t in tags[:3] %}
2023-08-22 20:58:43 +02:00
<span class="badge bg-primary" title="{{ t.description or '' }}">
{{ t.title }}
</span>
2021-11-23 01:58:53 +01:00
{% endfor %}
<span class="btn" title="{{ _('Reviews') }}">
2021-11-23 01:58:53 +01:00
<i class="fas fa-star-half-alt"></i>
<span class="count">
2023-11-19 14:49:36 +01:00
{% set summary = package.get_review_summary() %}
+{{ summary[0] }} / {{ summary[1] }} / -{{ summary[2] }}
</span>
</span>
2021-11-23 01:58:53 +01:00
</div>
{% endif %}
</div>
</a>
</div>
{% endfor %}
</div>
2023-08-22 20:58:43 +02:00
<button class="carousel-control-prev" role="button" data-bs-target="#featuredCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
2023-08-22 20:58:43 +02:00
<span class="visually-hidden">{{ _("Previous") }}</span>
</button>
<button class="carousel-control-next" role="button" data-bs-target="#featuredCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
2023-08-22 20:58:43 +02:00
<span class="visually-hidden">{{ _("Next") }}</span>
</button>
</div>
2023-08-22 20:58:43 +02:00
<!-- <div class="text-end mb-5 text-muted" style="opacity: 0.4;">
<a href="/help/featured/" class="btn">
2023-08-22 20:58:43 +02:00
<i class="fas fa-question-circle me-1"></i>
{{ _("Featured") }}
</a>
</div> -->
2018-12-22 22:03:01 +01:00
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', sort='approved_at', order='desc') }}" class="btn btn-secondary float-end">
2020-07-18 02:27:23 +02:00
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Recently Added") }}</h2>
{{ render_pkggrid(new) }}
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', sort='last_release', order='desc') }}" class="btn btn-secondary float-end">
2019-07-29 22:44:39 +02:00
{{ _("See more") }}
2018-12-22 22:03:01 +01:00
</a>
2020-07-18 02:22:52 +02:00
<h2 class="my-3">{{ _("Recently Updated") }}</h2>
{{ render_pkggrid(updated) }}
2018-12-22 22:03:01 +01:00
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', type='game', sort='score', order='desc') }}" class="btn btn-secondary float-end">
2019-07-29 22:44:39 +02:00
{{ _("See more") }}
2018-12-22 22:03:01 +01:00
</a>
2020-07-18 02:22:52 +02:00
<h2 class="my-3">{{ _("Top Games") }}</h2>
{{ render_pkggrid(pop_gam) }}
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', type='mod', sort='score', order='desc') }}" class="btn btn-secondary float-end">
2019-07-29 22:44:39 +02:00
{{ _("See more") }}
2018-12-22 22:13:56 +01:00
</a>
2020-07-18 02:22:52 +02:00
<h2 class="my-3">{{ _("Top Mods") }}</h2>
{{ render_pkggrid(pop_mod) }}
2018-12-22 22:13:56 +01:00
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', type='txp', sort='score', order='desc') }}" class="btn btn-secondary float-end">
2019-07-29 22:44:39 +02:00
{{ _("See more") }}
2018-12-22 22:03:01 +01:00
</a>
2019-07-29 22:44:39 +02:00
<h2 class="my-3">{{ _("Top Texture Packs") }}</h2>
2018-12-22 22:03:01 +01:00
{{ render_pkggrid(pop_txp) }}
2020-07-18 03:48:22 +02:00
<h2 class="my-3">{{ _("Search by Tags") }}</h2>
{% for pair in tags %}
{% set count = pair[0] %}
{% set tag = pair[1] %}
<a class="btn btn-sm btn-secondary m-1" rel="nofollow"
2020-07-18 03:54:40 +02:00
title="{{ tag.description or '' }}"
2020-07-18 03:48:22 +02:00
href="{{ url_for('packages.list_all', tag=tag.name) }}">
{{ tag.title }}
2023-08-22 20:58:43 +02:00
<span class="badge roaded-pill bg-light text-dark ms-1">{{ count }}</span>
2020-07-18 03:48:22 +02:00
</a>
{% endfor %}
<div class="clearfix mb-4"></div>
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_all', sort='reviews', order='desc') }}" class="btn btn-secondary float-end">
2020-12-14 12:48:07 +01:00
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Highest Reviewed") }}</h2>
2020-12-14 12:48:07 +01:00
{{ render_pkggrid(high_reviewed) }}
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('packages.list_reviews') }}" class="btn btn-secondary float-end">
2020-07-10 21:30:31 +02:00
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Recent Positive Reviews") }}</h2>
2021-08-18 23:09:41 +02:00
{% from "macros/reviews.html" import render_reviews with context %}
{{ render_reviews(reviews, current_user, True) }}
2020-07-18 02:27:23 +02:00
2020-07-09 06:34:25 +02:00
<div class="text-center mt-5">
<small>
2019-07-29 22:44:39 +02:00
{{ _("CDB has %(count)d packages, with a total of %(downloads)d downloads.", count=count, downloads=downloads) }}
</small>
</div>
2018-12-22 22:03:01 +01:00
<!-- </main> -->
2018-03-18 18:43:30 +01:00
{% endblock %}