mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-14 03:23:46 +01:00
416 lines
14 KiB
HTML
416 lines
14 KiB
HTML
{% set query=package.name %}
|
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
{{ package.title }}
|
|
{% endblock %}
|
|
|
|
{% block container %}
|
|
<header class="jumbotron pb-3"
|
|
style="background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('{{ package.getMainScreenshotURL() }}');
|
|
background-size: cover;
|
|
background-repeat: no-repeat;
|
|
background-position: center;">
|
|
<div class="container">
|
|
<h1 class="display-3">
|
|
{{ package.title }}
|
|
<small>by {{ package.author.display_name }}</small>
|
|
</h1>
|
|
|
|
<p class="lead">
|
|
{{ package.short_desc }}
|
|
</p>
|
|
|
|
<div class="row" style="margin-top: 2rem;">
|
|
<div class="col text-secondary">
|
|
{{ package.getDownloadCount() }} downloads
|
|
</div>
|
|
<div class="btn-group-horizontal col-md-auto">
|
|
{% if package.repo %}<a class="btn btn-outline-secondary" href="{{ package.repo }}">View Source</a>{% endif %}
|
|
{% if package.forums %}<a class="btn btn-outline-secondary" href="https://forum.minetest.net/viewtopic.php?t={{ package.forums }}">Forums</a>{% endif %}
|
|
{% if package.issueTracker %}<a class="btn btn-outline-secondary" href="{{ package.issueTracker }}">Issue Tracker</a>{% endif %}
|
|
{% if package.website %}<a class="btn btn-outline-secondary" href="{{ package.website }}">Website</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container mt-4">
|
|
{% if not package.approved %}
|
|
<div class="alert alert-warning">
|
|
<span class="icon_message"></span>
|
|
{% if package.releases.count() == 0 %}
|
|
<h4 class="alert-heading">Release Required</h4>
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
|
<p>You need to create a release before this package can be approved.</p>
|
|
<p>
|
|
A release is a single downloadable version of your {{ package.type.value | lower }}.
|
|
You need to create releases even if you use a rolling release development cycle,
|
|
as Minetest needs them to check for updates.
|
|
</p>
|
|
<a class="btn" href="{{ package.getCreateReleaseURL() }}">Create Release</a>
|
|
{% else %}
|
|
A release is required before this package can be approved.
|
|
{% endif %}
|
|
|
|
{% elif (package.type == package.type.GAME or package.type == package.type.TXP) and package.screenshots.count() == 0 %}
|
|
You need to add at least one screenshot.
|
|
|
|
{% elif topic_error_lvl == "danger" %}
|
|
Please fix the below topic issue(s).
|
|
|
|
{% elif "Other" in package.license.name or "Other" in package.media_license.name %}
|
|
Please wait for the license to be added to CDB.
|
|
|
|
{% else %}
|
|
{% if package.screenshots.count() == 0 %}
|
|
<b>You should add at least one screenshot, but this isn't required.</b><br />
|
|
{% endif %}
|
|
|
|
{% if not package.getDownloadRelease() %}
|
|
Please wait for the release to be approved.
|
|
{% elif package.checkPerm(current_user, "APPROVE_NEW") %}
|
|
<form class="float-right" method="post" action="{{ package.getApproveURL() }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<input class="btn btn-sm btn-warning" type="submit" value="Approve" />
|
|
</form>
|
|
You can now approve this package if you're ready.
|
|
{% else %}
|
|
Please wait for the package to be approved.
|
|
{% endif %}
|
|
{% endif %}
|
|
<div style="clear: both;"></div>
|
|
</div>
|
|
|
|
{% if topic_error %}
|
|
<div class="alert alert-{{ topic_error_lvl }}">
|
|
<span class="icon_message"></span>
|
|
{{ topic_error | safe }}
|
|
<div style="clear: both;"></div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if similar_topics %}
|
|
<div class="alert alert-warning">
|
|
Please make sure that this package has the right to
|
|
the name '{{ package.name }}'.
|
|
See the
|
|
<a href="/policy_and_guidance/">Inclusion Policy</a>
|
|
for more info.
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if not review_thread and (package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW")) %}
|
|
<div class="alert alert-info">
|
|
<a class="float-right btn btn-sm btn-info" href="{{ url_for('threads.new', pid=package.id, title='Package approval comments') }}">Open Thread</a>
|
|
|
|
Privately ask a question or give feedback
|
|
<div style="clear:both;"></div>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<aside class="float-right ml-4" style="width: 18rem;">
|
|
{% set release = package.getDownloadRelease() %}
|
|
{% if release %}
|
|
<a class="btn btn-download btn-lg btn-block" rel="nofollow"
|
|
href="{{ package.getDownloadURL() }}" class="btn_green">
|
|
Download
|
|
</a>
|
|
|
|
<p class="text-center m-2" style="font-size: 80%;">
|
|
{% if release.min_rel and release.max_rel %}
|
|
Minetest {{ release.min_rel.name }} - {{ release.max_rel.name }}
|
|
{% elif release.min_rel %}
|
|
Supports Minetest {{ release.min_rel.name }} and above.
|
|
{% elif release.max_rel %}
|
|
Supports Minetest {{ release.max_rel.name }} and below.
|
|
{% endif %}
|
|
</p>
|
|
{% else %}
|
|
No download available.
|
|
{% endif %}
|
|
|
|
<div class="card my-4">
|
|
<div class="card-header">
|
|
Details
|
|
<div class="btn-group float-right">
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
<a class="btn btn-default btn-sm mx-1" href="{{ package.getEditURL() }}">Edit</a>
|
|
{% endif %}
|
|
{# {% if current_user.is_authenticated %}
|
|
<a class="btn btn-default btn-sm mx-1" href="{{ package.getCreateEditRequestURL() }}">Suggest Changes</a>
|
|
{% endif %} #}
|
|
{% if package.checkPerm(current_user, "DELETE_PACKAGE") or package.checkPerm(current_user, "UNAPPROVE_PACKAGE") %}
|
|
<a class="btn btn-danger btn-sm mx-1" href="{{ package.getRemoveURL() }}">Remove</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
{% 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 %}
|
|
{% if package_warning %}
|
|
<div class="card-body">
|
|
<div class="alert alert-danger">
|
|
<b>Warning:</b> {{ package_warning }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<table class="table">
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>{{ package.name }}</td>
|
|
</tr>
|
|
{% if package.provides %}
|
|
<tr>
|
|
<td>Provides</td>
|
|
<td>{% for meta in package.provides %}
|
|
<a class="badge badge-primary"
|
|
href="{{ url_for('metapackages.view', name=meta.name) }}">{{ meta.name }}</a>
|
|
{% endfor %}</td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr>
|
|
<td>Author</td>
|
|
<td class="{{ package.author.rank }}">
|
|
<a href="{{ url_for('users.profile', username=package.author.username) }}">
|
|
{{ package.author.display_name }}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Type</td>
|
|
<td>{{ package.type.value }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>License</td>
|
|
<td>
|
|
{% 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 %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Added</td>
|
|
<td>{{ package.created_at | datetime }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Tags</td>
|
|
<td>
|
|
{% for t in package.tags %}
|
|
<span class="badge badge-primary">{{ t.title }}</span>
|
|
{% else %}
|
|
<i>No tags.</i>
|
|
{% endfor %}
|
|
</td>
|
|
</table>
|
|
</div>
|
|
|
|
{% if package.author.donate_url %}
|
|
<div class="alert alert-secondary">
|
|
Like {{ package.author.display_name }}'s work?
|
|
<a href="{{ package.author.donate_url }}" rel="nofollow">Donate now!</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if package.type == package.type.MOD %}
|
|
<div class="card my-4">
|
|
<div class="card-header">Dependencies</div>
|
|
<div class="card-body">
|
|
{% for dep in package.dependencies %}
|
|
{% if dep.optional %}
|
|
{% set color="secondary" %}
|
|
{% else %}
|
|
{% set color="primary" %}
|
|
{% endif %}
|
|
|
|
{%- if dep.package %}
|
|
<a class="badge badge-{{ color }}"
|
|
href="{{ dep.package.getDetailsURL() }}">
|
|
{{ dep.package.title }} by {{ dep.package.author.display_name }}
|
|
{% elif dep.meta_package %}
|
|
<a class="badge badge-{{ color }}"
|
|
href="{{ url_for('metapackages.view', name=dep.meta_package.name) }}">
|
|
{{ dep.meta_package.name }}
|
|
{% else %}
|
|
{{ "Excepted package or meta_package in dep!" | throw }}
|
|
{% endif %}</a>
|
|
{% else %}
|
|
<i>No dependencies</i>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="card my-4">
|
|
<div class="card-header">
|
|
Releases
|
|
<div class="float-right">
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
|
<a href="{{ package.getBulkReleaseURL() }}">bulk</a>
|
|
|
|
|
<a href="{{ package.getCreateReleaseURL() }}">+</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<ul class="list-group list-group-flush">
|
|
{% for rel in releases %}
|
|
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or package.checkPerm(current_user, "APPROVE_RELEASE") %}
|
|
<li class="list-group-item">
|
|
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") or package.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 package.checkPerm(current_user, "APPROVE_RELEASE") %}
|
|
/ Approve
|
|
{% endif %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if not rel.approved %}<i>{% endif %}
|
|
|
|
<a href="{{ rel.getDownloadURL() }}" rel="nofollow">{{ 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 package.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>
|
|
</div>
|
|
|
|
<div class="card my-4"">
|
|
<div class="card-header">
|
|
{% if package.approved and package.checkPerm(current_user, "CREATE_THREAD") %}
|
|
<a class="float-right"
|
|
href="{{ url_for('threads.new', pid=package.id) }}">+</a>
|
|
{% endif %}
|
|
Threads
|
|
</div>
|
|
<ul class="list-group list-group-flush">
|
|
{% from "macros/threads.html" import render_threadlist %}
|
|
{{ render_threadlist(threads, list_group=True) }}
|
|
</ul>
|
|
</div>
|
|
|
|
{% if package.approved and package.checkPerm(current_user, "CREATE_THREAD") and current_user != package.author and not current_user.rank.atLeast(current_user.rank.EDITOR) %}
|
|
<a class="float-right"
|
|
href="{{ url_for('threads.new', pid=package.id) }}">
|
|
Report a problem with this listing
|
|
</a>
|
|
{% endif %}
|
|
</aside>
|
|
|
|
{% if not package.approved and (package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW")) %}
|
|
{% if review_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 %}
|
|
{% endif %}
|
|
|
|
<ul class="screenshot_list mb-4">
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
<a class="btn btn-primary float-right" href="{{ package.getNewScreenshotURL() }}">Add screenshot</a>
|
|
{% endif %}
|
|
{% for ss in package.screenshots %}
|
|
{% if ss.approved or package.checkPerm(current_user, "ADD_SCREENSHOTS") %}
|
|
<li>
|
|
<a href="{% if package.checkPerm(current_user, 'ADD_SCREENSHOTS') %}{{ ss.getEditURL() }}{% else %}{{ ss.url }}{% endif %}">
|
|
<img src="{{ ss.getThumbnailURL() }}" alt="{{ ss.title }}" />
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{{ package.desc | markdown }}
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
{#
|
|
{% if current_user.is_authenticated or requests %}
|
|
<h3>Edit Requests</h3>
|
|
|
|
<ul>
|
|
{% for r in requests %}
|
|
<li>
|
|
<a href="{{ r.getURL() }}">{{ r.title }}</a>
|
|
by
|
|
<a href="{{ url_for('users.profile', username=r.author.username) }}">{{ r.author.display_name }}</a>
|
|
</li>
|
|
{% else %}
|
|
<li>No edit requests have been made.</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
#}
|
|
|
|
{% if alternatives %}
|
|
<h3>Related</h3>
|
|
|
|
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
|
{{ render_pkggrid(alternatives) }}
|
|
{% endif %}
|
|
|
|
{% if similar_topics %}
|
|
<h3>Similar Forum Topics</h3>
|
|
<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 %}
|
|
</main>
|
|
{% endblock %}
|