mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-24 06:52:24 +01:00
542 lines
18 KiB
HTML
542 lines
18 KiB
HTML
{% set query=package.name %}
|
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
{{ package.title }}
|
|
{% endblock %}
|
|
|
|
{% block headextra %}
|
|
<meta name="og:title" content="{{ package.title }}"/>
|
|
<meta name="og:description" content="{{ package.short_desc }}"/>
|
|
<meta name="description" content="{{ package.short_desc }}"/>
|
|
<meta name="og:url" content="{{ package.getDetailsURL(absolute=True) }}"/>
|
|
{% if package.getMainScreenshotURL() %}
|
|
<meta name="og:image" content="{{ package.getMainScreenshotURL(absolute=True) }}"/>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block container %}
|
|
{% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %}
|
|
{% set package_warning="Non-free code and media" %}
|
|
{% elif not package.license.is_foss and package.type != package.type.TXP %}
|
|
{% set package_warning="Non-free code" %}
|
|
{% elif not package.media_license.is_foss %}
|
|
{% set package_warning="Non-free media" %}
|
|
{% endif %}
|
|
{% set release = package.getDownloadRelease() %}
|
|
<main>
|
|
{% set cover_image = package.cover_image.url or package.getMainScreenshotURL() %}
|
|
<header class="jumbotron pb-3"
|
|
style="background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7)), url('{{ cover_image }}');
|
|
background-size: cover;
|
|
background-repeat: no-repeat;
|
|
background-position: center;">
|
|
<div class="container">
|
|
<div class="btn-group float-right mb-4">
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
<a class="btn btn-primary" href="{{ package.getEditURL() }}">
|
|
<i class="fas fa-pen mr-1"></i>
|
|
{{ _("Edit") }}
|
|
</a>
|
|
{% endif %}
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
|
<a class="btn btn-primary" href="{{ package.getCreateReleaseURL() }}">
|
|
<i class="fas fa-plus mr-1"></i>
|
|
{{ _("Release") }}
|
|
</a>
|
|
{% endif %}
|
|
{% if package.checkPerm(current_user, "DELETE_PACKAGE") or package.checkPerm(current_user, "UNAPPROVE_PACKAGE") %}
|
|
<a class="btn btn-danger" href="{{ package.getRemoveURL() }}">
|
|
<i class="fas fa-trash mr-1"></i>
|
|
{{ _("Remove") }}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<h1 class="display-3">
|
|
{{ package.title }}
|
|
</h1>
|
|
|
|
<p class="lead">
|
|
{{ package.short_desc }}
|
|
</p>
|
|
|
|
<p>
|
|
{% if package_warning %}
|
|
<a class="badge badge-danger" href="/help/non_free/">
|
|
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
|
{{ package_warning }}
|
|
</a>
|
|
{% endif %}
|
|
{% for warning in package.content_warnings %}
|
|
<a class="badge badge-warning" rel="nofollow" href="/help/content_flags/"
|
|
title="{{ warning.description }}">
|
|
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
|
{{ warning.title }}
|
|
</a>
|
|
{% endfor %}
|
|
{% for t in package.tags %}
|
|
<a class="badge badge-primary" rel="nofollow"
|
|
title="{{ t.description or '' }}"
|
|
href="{{ url_for('packages.list_all', tag=t.name) }}">
|
|
{{ t.title }}
|
|
</a>
|
|
{% endfor %}
|
|
</p>
|
|
|
|
<div class="info-row row" style="margin-top: 2rem;">
|
|
<div class="btn-group-horizontal col">
|
|
<a class="btn" href="{{ url_for('users.profile', username=package.author.username) }}" title="{{ _("Author") }}">
|
|
<i class="fas fa-user"></i>
|
|
<span class="count">
|
|
{{ package.author.display_name }}
|
|
</span>
|
|
</a>
|
|
{% if release %}
|
|
<a class="btn" rel="nofollow" href="{{ package.getDownloadURL() }}" title="{{ _("Downloads") }}"
|
|
download="{{ release.getDownloadFileName() }}">
|
|
<i class="fas fa-download"></i>
|
|
<span class="count">{{ package.downloads }}</span>
|
|
</a>
|
|
{% endif %}
|
|
<a class="btn" href="{{ url_for('threads.list_all', pid=package.id) }}" title="{{ _("Threads") }}">
|
|
<i class="fas fa-comment-alt"></i>
|
|
<span class="count">{{ threads | length }}</span>
|
|
</a>
|
|
<a class="btn" href="#reviews" title="{{ _("Reviews") }}">
|
|
<i class="fas fa-star-half-alt"></i>
|
|
<span class="count">
|
|
+{{ package.reviews | selectattr("recommends") | list | length }}
|
|
/
|
|
-{{ package.reviews | rejectattr("recommends") | list | length }}
|
|
</span>
|
|
</a>
|
|
{% if package.website %}
|
|
<a class="btn" href="{{ package.website }}">
|
|
<i class="fas fa-globe-europe"></i>
|
|
<span class="count">{{ _("Website") }}</span>
|
|
</a>
|
|
{% endif %}
|
|
{% if package.repo %}
|
|
<a class="btn" href="{{ package.repo }}">
|
|
<i class="fas fa-code"></i>
|
|
<span class="count">{{ _("Source") }}</span>
|
|
</a>
|
|
{% endif %}
|
|
{% if package.forums %}
|
|
<a class="btn" href="https://forum.minetest.net/viewtopic.php?t={{ package.forums }}">
|
|
<i class="fas fa-comments"></i>
|
|
<span class="count">{{ _("Forums") }}</span>
|
|
</a>
|
|
{% endif %}
|
|
{% if package.issueTracker %}
|
|
<a class="btn" href="{{ package.issueTracker }}">
|
|
<i class="fas fa-bug"></i>
|
|
<span class="count">{{ _("Issue Tracker") }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
{% if release and (release.min_rel or release.max_rel) %}
|
|
<div class="btn col-md-auto">
|
|
<img src="https://www.minetest.net/media/icon.svg" style="max-height: 1.2em;">
|
|
<span class="count">
|
|
{% if release.min_rel and release.max_rel %}
|
|
{{ _("%(min)s - %(max)s", min=release.min_rel.name, max=release.max_rel.name) }}
|
|
{% elif release.min_rel %}
|
|
{{ _("%(min)s and above", min=release.min_rel.name) }}
|
|
{% elif release.max_rel %}
|
|
{{ _("%(max)s and below", max=release.max_rel.name) }}
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
{% endif %}
|
|
<div class="btn-group btn-group-horizontal col-md-auto">
|
|
{% if release %}
|
|
<a class="btn btn-download" rel="nofollow" download="{{ release.getDownloadFileName() }}"
|
|
href="{{ package.getDownloadURL() }}">
|
|
{{ _("Download") }}
|
|
</a>
|
|
{% if package.type == package.type.MOD %}
|
|
{% set installing_url = "https://wiki.minetest.net/Installing_Mods" %}
|
|
{% elif package.type == package.type.GAME %}
|
|
{% set installing_url = "https://wiki.minetest.net/Games#Installing_games" %}
|
|
{% elif package.type == package.type.TXP %}
|
|
{% set installing_url = "https://wiki.minetest.net/Installing_Texture_Packs" %}
|
|
{% else %}
|
|
{{ 0 / 0 }}
|
|
{% endif %}
|
|
|
|
|
|
<a href="{{ installing_url }}" class="btn btn-download">
|
|
<i class="fas fa-question-circle"></i>
|
|
</a>
|
|
{% else %}
|
|
<i>
|
|
{{ _("No downloads available") }}
|
|
</i>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
{% if not package.approved %}
|
|
<section class="my-4 pb-3" style="border-bottom: 1px solid rgba(0,0,0,0.5);">
|
|
<div class="container">
|
|
{% from "macros/package_approval.html" import render_banners %}
|
|
{{ render_banners(package, current_user, topic_error, topic_error_lvl, similar_topics) }}
|
|
|
|
{% if review_thread and review_thread.checkPerm(current_user, "SEE_THREAD") %}
|
|
<h2>{% if review_thread.private %}🔒{% endif %} {{ review_thread.title }}</h2>
|
|
{% if review_thread.private %}
|
|
<p><i>
|
|
This thread is only visible to the package owner and users of
|
|
Editor rank or above.
|
|
</i></p>
|
|
{% endif %}
|
|
|
|
{% from "macros/threads.html" import render_thread %}
|
|
{{ render_thread(review_thread, current_user) }}
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="container mt-4">
|
|
<div class="row">
|
|
<div class="col-md-9" style="padding-right: 45px;">
|
|
{% set screenshots = package.screenshots.all() %}
|
|
{% if screenshots or package.checkPerm(current_user, "ADD_SCREENSHOTS") %}
|
|
{% if package.checkPerm(current_user, "ADD_SCREENSHOTS") %}
|
|
<a href="{{ package.getEditScreenshotsURL() }}" class="btn btn-primary float-right">
|
|
<i class="fas fa-images mr-1"></i>
|
|
Edit
|
|
</a>
|
|
{% endif %}
|
|
|
|
<ul class="screenshot_list">
|
|
{% for ss in screenshots %}
|
|
{% if ss.approved or package.checkPerm(current_user, "ADD_SCREENSHOTS") %}
|
|
<li>
|
|
<a href="{{ ss.url }}">
|
|
<img src="{{ ss.getThumbnailURL() }}" alt="{{ ss.title }}" />
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% else %}
|
|
<li>
|
|
<a href="{{ package.getNewScreenshotURL() }}">
|
|
<i class="fas fa-plus screenshot-add"></i>
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% if package.desc %}
|
|
<article class="markdown panel mb-5">
|
|
{{ package.desc | markdown }}
|
|
</article>
|
|
{% endif %}
|
|
|
|
<h2 id="reviews" class="mt-0">{{ _("Reviews") }}</h2>
|
|
|
|
{% from "macros/reviews.html" import render_reviews, render_review_form, render_review_preview %}
|
|
{% if current_user.is_authenticated %}
|
|
{% if has_review %}
|
|
<p>
|
|
<a class="btn btn-primary" href="{{ package.getReviewURL() }}">
|
|
{{ _("Edit Review") }}
|
|
</a>
|
|
</p>
|
|
{% elif current_user in package.maintainers %}
|
|
<p>
|
|
{{ _("You can't review your own package.") }}
|
|
</p>
|
|
{% else %}
|
|
{{ render_review_preview(package) }}
|
|
{% endif %}
|
|
{% else %}
|
|
{{ render_review_preview(package) }}
|
|
{% endif %}
|
|
{{ render_reviews(package.reviews, current_user) }}
|
|
|
|
{% if alternatives %}
|
|
<h2>Related</h2>
|
|
|
|
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
|
{{ render_pkggrid(alternatives) }}
|
|
{% endif %}
|
|
|
|
{% if similar_topics %}
|
|
<h2>Similar Forum Topics</h2>
|
|
<ul>
|
|
{% for t in similar_topics %}
|
|
<li>
|
|
[{{ t.type.value }}]
|
|
<a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}">
|
|
{{ t.title }} by {{ t.author.display_name }}
|
|
</a>
|
|
{% if t.wip %}[WIP]{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
<h2>Badges</h2>
|
|
|
|
<p>
|
|
{{ package.makeShield("title") | markdown }}
|
|
</p>
|
|
|
|
<p>
|
|
<pre><code>{{ package.makeShield("title") }}</code></pre>
|
|
</p>
|
|
|
|
<p>
|
|
{{ package.makeShield("downloads") | markdown }}
|
|
</p>
|
|
|
|
<p>
|
|
<pre><code>{{ package.makeShield("downloads") }}</code></pre>
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<aside class="col-md-3 info-sidebar">
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") and package.update_config and package.update_config.outdated_at %}
|
|
{% set config = package.update_config %}
|
|
<div class="alert alert-warning">
|
|
<p class="mt-0 my-1">
|
|
<b>Package may be outdated</b>
|
|
</p>
|
|
<p class="mt-0 my-1">
|
|
{{ config.get_message() }}
|
|
</p>
|
|
<p class="mt-0 my-1" style="font-size: 80%; opacity: 85%;">
|
|
<i class="fas fa-lock mr-1"></i>
|
|
{{ _("Only visible to the author and Editors.") }}
|
|
</p>
|
|
<div class="btn-group btn-group-sm my-0">
|
|
<a class="btn btn-warning" href="{{ config.get_create_release_url() }}">
|
|
<i class="fas fa-plus mr-1"></i>
|
|
{{ _("Release") }}
|
|
</a>
|
|
<a class="btn btn-warning" href="{{ package.getUpdateConfigURL() }}">
|
|
<i class="fas fa-cog mr-1"></i>
|
|
{{ _("Update settings") }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if package_warning %}
|
|
<p class="alert alert-danger">
|
|
<a href="/help/non_free/" class="float-right">Info</a>
|
|
<b>Warning:</b> {{ package_warning }}
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if package.type != package.type.TXP %}
|
|
<h3>{{ _("Dependencies") }}</h3>
|
|
<dl>
|
|
<dt>{{ _("Required") }}</dt>
|
|
<dd>
|
|
{% for dep in package.getSortedHardDependencies() %}
|
|
{%- if dep.package %}
|
|
<a class="badge badge-primary"
|
|
href="{{ dep.package.getDetailsURL() }}">
|
|
{{ dep.package.title }} by {{ dep.package.author.display_name }}
|
|
</a>
|
|
{% elif dep.meta_package %}
|
|
<a class="badge badge-primary"
|
|
href="{{ url_for('metapackages.view', name=dep.meta_package.name) }}">
|
|
{{ dep.meta_package.name }}
|
|
</a>
|
|
{% else %}
|
|
{{ "Expected package or meta_package in dep!" | throw }}
|
|
{% endif %}
|
|
{% else %}
|
|
No required dependencies
|
|
{% endfor %}
|
|
</dd>
|
|
|
|
{% set optional_deps=package.getSortedOptionalDependencies() %}
|
|
{% if optional_deps %}
|
|
<dt>{{ _("Optional") }}</dt>
|
|
<dd>
|
|
{% for dep in optional_deps %}
|
|
{%- if dep.package %}
|
|
<a class="badge badge-secondary"
|
|
href="{{ dep.package.getDetailsURL() }}">
|
|
{{ dep.package.title }} by {{ dep.package.author.display_name }}
|
|
{% elif dep.meta_package %}
|
|
<a class="badge badge-secondary"
|
|
href="{{ url_for('metapackages.view', name=dep.meta_package.name) }}">
|
|
{{ dep.meta_package.name }}
|
|
{% else %}
|
|
{{ "Expected package or meta_package in dep!" | throw }}
|
|
{% endif %}</a>
|
|
{% endfor %}
|
|
</dd>
|
|
{% endif %}
|
|
</dl>
|
|
{% endif %}
|
|
|
|
<h3>
|
|
{{ _("Information") }}
|
|
</h3>
|
|
|
|
<dl>
|
|
<dt>{{ _("Type") }}</dt>
|
|
<dd>{{ package.type.value }}</dd>
|
|
<dt>{{ _("Technical Name") }}</dt>
|
|
<dd>{{ package.name }}</dd>
|
|
<dt>{{ _("License") }}</dt>
|
|
<dd>
|
|
{% if package.license == package.media_license %}
|
|
{{ package.license.name }}
|
|
{% elif package.type == package.type.TXP %}
|
|
{{ package.media_license.name }}
|
|
{% else %}
|
|
{{ package.license.name }} for code,<br />
|
|
{{ package.media_license.name }} for media.
|
|
{% endif %}
|
|
</dd>
|
|
<dt>Added</dt>
|
|
<dd>{{ package.created_at | datetime }}</dd>
|
|
<dt>Maintainers</dt>
|
|
<dd>
|
|
{% if package.checkPerm(current_user, "EDIT_MAINTAINERS") %}
|
|
<a class="btn btn-primary btn-sm ml-1 float-right" href="{{ package.getEditMaintainersURL() }}"><i class="fas fa-pen"></i></a>
|
|
{% endif %}
|
|
|
|
{% for user in package.maintainers %}
|
|
<a class="badge badge-primary"
|
|
href="{{ url_for('users.profile', username=user.username) }}">
|
|
{{ user.display_name }}
|
|
</a>
|
|
{% endfor %}
|
|
|
|
{% if current_user in package.maintainers and current_user != package.author %}
|
|
<form class="mt-2" method="post" action="{{ package.getRemoveSelfMaintainerURL() }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<input class="btn btn-sm btn-link p-0" type="submit" value="{{ _("Remove myself") }}" />
|
|
</form>
|
|
{% endif %}
|
|
</dd>
|
|
{% if package.provides %}
|
|
<dt>Provides</dt>
|
|
<dd>{% for meta in package.provides %}
|
|
<a class="badge badge-secondary"
|
|
href="{{ url_for('metapackages.view', name=meta.name) }}">{{ meta.name }}</a>
|
|
{% endfor %}</dd>
|
|
{% endif %}
|
|
</dl>
|
|
|
|
{% if package.author.donate_url %}
|
|
<a class="btn btn-secondary btn-block my-4" href="{{ package.author.donate_url }}" rel="nofollow">
|
|
Like {{ package.author.display_name }}'s work? Donate now!
|
|
</a>
|
|
{% endif %}
|
|
|
|
<h3>
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
|
<div class="btn-group float-right">
|
|
<a class="btn btn-secondary btn-sm ml-1" href="{{ package.getBulkReleaseURL() }}">
|
|
<i class="fas fa-wrench"></i>
|
|
{{ _("Bulk") }}
|
|
</a>
|
|
<a class="btn btn-primary btn-sm" href="{{ package.getCreateReleaseURL() }}"><i class="fas fa-plus"></i></a>
|
|
</div>
|
|
{% endif %}
|
|
{{ _("Releases") }}
|
|
</h3>
|
|
<ul class="list-group">
|
|
{% for rel in releases %}
|
|
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
|
|
<li class="list-group-item">
|
|
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
|
|
<a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">Edit
|
|
{% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %}
|
|
/ Approve
|
|
{% endif %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if not rel.approved %}<i>{% endif %}
|
|
|
|
<a href="{{ rel.getDownloadURL() }}" rel="nofollow"
|
|
download="{{ rel.getDownloadFileName() }}">
|
|
{{ rel.title }}
|
|
</a>
|
|
|
|
<span style="color:#ddd;">
|
|
{% if rel.min_rel and rel.max_rel %}
|
|
[MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}]
|
|
{% elif rel.min_rel %}
|
|
[MT {{ rel.min_rel.name }}+]
|
|
{% elif rel.max_rel %}
|
|
[MT ≤{{ rel.max_rel.name }}]
|
|
{% endif %}
|
|
</span>
|
|
|
|
<br>
|
|
|
|
<small style="color:#999;">
|
|
{% if rel.commit_hash %}
|
|
[{{ rel.commit_hash | truncate(5, end='') }}]
|
|
{% endif %}
|
|
|
|
created {{ rel.releaseDate | date }}.
|
|
</small>
|
|
{% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %}
|
|
<a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getDetailsURL()) }}">Importing...</a>
|
|
{% elif not rel.approved %}
|
|
Waiting for approval.
|
|
{% endif %}
|
|
|
|
{% if not rel.approved %}</i>{% endif %}
|
|
|
|
</li>
|
|
{% endif %}
|
|
{% else %}
|
|
<li class="list-group-item">No releases available.</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
<h3>
|
|
{% if package.approved and package.checkPerm(current_user, "CREATE_THREAD") %}
|
|
<div class="btn-group float-right">
|
|
<a class="btn btn-primary btn-sm mx-1" href="{{ url_for('threads.new', pid=package.id) }}"><i class="fas fa-plus"></i></a>
|
|
</div>
|
|
{% endif %}
|
|
Threads
|
|
</h3>
|
|
|
|
<div class="list-group">
|
|
{% from "macros/threads.html" import render_compact_threadlist %}
|
|
{{ render_compact_threadlist(threads) }}
|
|
</div>
|
|
|
|
<p class="mt-3">
|
|
{% if package.approved and current_user != package.author %}
|
|
<a class="float-right"
|
|
href="{{ url_for('threads.new', pid=package.id) }}">
|
|
Report a problem with this listing
|
|
</a>
|
|
{% endif %}
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
<a class="float-right" href="{{ package.getAuditLogURL() }}">
|
|
See audit log
|
|
</a>
|
|
{% endif %}
|
|
</p>
|
|
</aside>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
{% endblock %}
|