contentdb/app/templates/packages/view.html

134 lines
3.9 KiB
HTML
Raw Normal View History

2018-03-19 19:08:41 +01:00
{% extends "base.html" %}
{% block title %}
2018-03-20 03:17:33 +01:00
{{ package.title }}
2018-03-19 19:08:41 +01:00
{% endblock %}
{% block content %}
2018-03-21 20:03:14 +01:00
{% if not package.approved %}
<div class="box box_grey alert alert-warning">
<span class="icon_message"></span>
This package needs to be approved before it can be found.
{% if package.checkPerm(current_user, "APPROVE_NEW") %}
<a href="{{ package.getApproveURL() }}">Approve</a>
{% endif %}
<div style="clear: both;"></div>
</div>
{% endif %}
2018-03-20 03:17:33 +01:00
<h1>{{ package.title }} by {{ package.author.display_name }}</h1>
2018-03-26 11:52:25 +02:00
<ul class="screenshot_list">
{% for ss in package.screenshots %}
<li>
<a href="{{ ss.url }}">
<img src="{{ ss.getThumbnailURL() }}" alt="{{ ss.title }}" />
</a>
</li>
{% endfor %}
</ul>
2018-03-20 03:17:33 +01:00
<aside class="asideright box box_grey">
<table>
<tr>
<td>Name</td>
<td>{{ package.name }}</td>
</tr>
2018-03-20 05:03:13 +01:00
<tr>
<td>Author</td>
<td>
<a href="{{ url_for('user_profile_page', username=package.author.username) }}">
{{ package.author.display_name }}
</a>
</td>
</tr>
2018-03-20 03:17:33 +01:00
<tr>
<td>Type</td>
2018-03-20 04:16:46 +01:00
<td>{{ package.type.value }}</td>
2018-03-20 03:17:33 +01:00
</tr>
2018-04-03 15:13:11 +02:00
<tr>
<td>License</td>
<td>{{ package.license.name }}</td>
</tr>
2018-03-20 03:17:33 +01:00
</table>
<ul class="buttonset linedbuttonset">
2018-03-23 17:20:56 +01:00
{% if package.getDownloadRelease() %}<li><a href="{{ package.getDownloadURL() }}">Download</a></li>{% endif %}
2018-03-20 03:17:33 +01:00
{% if package.repo %}<li><a href="{{ package.repo }}">View Source</a></li>{% endif %}
2018-03-21 18:42:43 +01:00
{% if package.forums %}<li><a href="https://forum.minetest.net/viewtopic.php?t={{ package.forums }}">Forums</a></li>{% endif %}
2018-03-20 03:17:33 +01:00
{% if package.issueTracker %}<li><a href="{{ package.issueTracker }}">Issue Tracker</a></li>{% endif %}
{% if package.website %}<li><a href="{{ package.website }}">Website</a></li>{% endif %}
2018-03-20 04:24:52 +01:00
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
<li><a href="{{ package.getEditURL() }}">Edit</a></li>
2018-03-26 11:52:25 +02:00
<li><a href="{{ package.getNewScreenshotURL() }}">Add screenshot</a></li>
2018-03-20 04:24:52 +01:00
{% elif current_user.is_authenticated %}
2018-03-24 03:49:30 +01:00
<li><a href="{{ package.getCreateEditRequestURL() }}">Suggest Change</a></li>
2018-03-20 04:24:52 +01:00
{% endif %}
2018-03-20 19:40:19 +01:00
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
<li><a href="{{ package.getCreateReleaseURL() }}">Create Release</a></li>
{% endif %}
2018-03-20 03:17:33 +01:00
</ul>
</aside>
<p class="package-short-large">{{ package.shortDesc }}</p>
{{ package.desc | markdown }}
2018-03-20 19:20:30 +01:00
<h3>Releases</h3>
<ul>
{% for rel in releases %}
2018-05-11 16:04:17 +02:00
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or package.checkPerm(current_user, "APPROVE_RELEASE") %}
<li>
{% if not rel.approved %}<i>{% endif %}
<a href="{{ rel.url }}">{{ rel.title }}</a>,
created {{ rel.releaseDate }}.
{% if rel.task_id %}
<a href="{{ url_for('check_task', id=rel.task_id, r=package.getDetailsURL()) }}">Importing</a>
{% elif not rel.approved %}
Waiting for approval.
2018-03-20 19:20:30 +01:00
{% endif %}
2018-05-11 16:04:17 +02:00
{% if not rel.task_id and (package.checkPerm(current_user, "MAKE_RELEASE") or package.checkPerm(current_user, "APPROVE_RELEASE")) %}
<a href="{{ rel.getEditURL() }}">Edit
{% if not rel.approved and package.checkPerm(current_user, "APPROVE_RELEASE") %}
/ Approve
{% endif %}
</a>
{% endif %}
{% if not rel.approved %}</i>{% endif %}
</li>
{% endif %}
2018-03-20 19:20:30 +01:00
{% else %}
<li>No releases available.</li>
{% endfor %}
</ul>
2018-03-23 20:25:48 +01:00
2018-03-26 12:28:34 +02:00
<h3>Tags</h3>
<ul>
{% for t in package.tags %}
<li>{{ t.title }}</li>
{% else %}
<li>No tags.</li>
{% endfor %}
</ul>
2018-03-23 20:49:57 +01:00
{% if current_user.is_authenticated or requests %}
2018-03-23 20:25:48 +01:00
<h3>Edit Requests</h3>
<ul>
2018-03-23 20:49:57 +01:00
{% for r in requests %}
2018-03-23 20:25:48 +01:00
<li>
<a href="{{ r.getURL() }}">{{ r.title }}</a>
by
<a href="{{ url_for('user_profile_page', username=r.author.username) }}">{{ r.author.display_name }}</a>
</li>
{% else %}
<li>No edit requests have been made.</li>
{% endfor %}
</ul>
{% endif %}
2018-03-19 19:08:41 +01:00
{% endblock %}