2021-07-25 04:54:08 +02:00
|
|
|
{% macro render_banners(package, current_user, topic_error, topic_error_lvl, show_modname_warning) -%}
|
2020-09-16 18:51:03 +02:00
|
|
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
<span class="col">
|
|
|
|
State: <strong>{{ package.state.value }}</strong>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
{% for state in package.getNextStates(current_user) %}
|
|
|
|
<form class="col-auto" method="post" action="{{ package.getSetStateURL(state) }}">
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2020-09-16 22:52:40 +02:00
|
|
|
<input class="btn btn-sm btn-primary" type="submit" value="{{ state.verb() }}" />
|
2020-09-16 18:51:03 +02:00
|
|
|
</form>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% set level = "warning" %}
|
|
|
|
{% if package.releases.count() == 0 %}
|
|
|
|
{% set message %}
|
|
|
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
2020-12-15 22:22:17 +01:00
|
|
|
{% if package.update_config %}
|
2021-07-24 05:30:14 +02:00
|
|
|
<a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.create_release") }}">Create first release</a>
|
2020-12-15 22:22:17 +01:00
|
|
|
{% else %}
|
2021-07-24 05:30:14 +02:00
|
|
|
<a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.setup_releases") }}">Set up releases</a>
|
2020-12-15 22:22:17 +01:00
|
|
|
{% endif %}
|
|
|
|
{{ _("You need to create a release before this package can be approved.") }}
|
2020-09-16 18:51:03 +02:00
|
|
|
{% else %}
|
2020-12-15 22:22:17 +01:00
|
|
|
{{ _("A release is required before this package can be approved.") }}
|
2020-09-16 18:51:03 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endset %}
|
2020-12-04 01:59:09 +01:00
|
|
|
|
2020-09-16 18:51:03 +02:00
|
|
|
{% elif (package.type == package.type.GAME or package.type == package.type.TXP) and package.screenshots.count() == 0 %}
|
|
|
|
{% set message = "You need to add at least one screenshot." %}
|
|
|
|
|
2020-12-04 01:59:09 +01:00
|
|
|
{% elif package.getMissingHardDependenciesQuery().count() > 0 %}
|
|
|
|
{% set deps = package.getMissingHardDependencies() | join(", ") %}
|
|
|
|
{% set message = "The following hard dependencies need to be added to ContentDB first: " + deps %}
|
|
|
|
|
2020-09-16 18:51:03 +02:00
|
|
|
{% elif topic_error_lvl == "danger" %}
|
|
|
|
{% elif package.state == package.state.READY_FOR_REVIEW and ("Other" in package.license.name or "Other" in package.media_license.name) %}
|
|
|
|
{% set message = "Please wait for the license to be added to CDB." %}
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
{% set level = "info" %}
|
|
|
|
{% set message %}
|
|
|
|
{% if package.screenshots.count() == 0 %}
|
|
|
|
<b>You should add at least one screenshot, but this isn't required.</b><br />
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if package.state == package.state.READY_FOR_REVIEW %}
|
|
|
|
{% if not package.getDownloadRelease() %}
|
|
|
|
Please wait for the release to be approved.
|
|
|
|
{% elif package.checkPerm(current_user, "APPROVE_NEW") %}
|
|
|
|
You can now approve this package if you're ready.
|
|
|
|
{% else %}
|
|
|
|
Please wait for the package to be approved.
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
|
|
|
You can now submit this package for approval if you're ready.
|
|
|
|
{% else %}
|
|
|
|
This package can be submitted for approval when ready.
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if message %}
|
|
|
|
<div class="alert alert-{{ level }}">
|
|
|
|
<span class="icon_message"></span>
|
|
|
|
|
|
|
|
{{ message | safe }}
|
|
|
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% 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 %}
|
|
|
|
|
2021-07-25 04:54:08 +02:00
|
|
|
{% if show_modname_warning %}
|
2020-09-16 18:51:03 +02:00
|
|
|
<div class="alert alert-warning">
|
2021-07-25 04:54:08 +02:00
|
|
|
Please make sure that this package has the right to all the technical names it provides.
|
|
|
|
See the <a href="/policy_and_guidance/">Inclusion Policy</a> for more info.
|
2020-09-16 18:51:03 +02:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if not package.review_thread and (package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW")) %}
|
|
|
|
<div class="alert alert-secondary">
|
|
|
|
<a class="float-right btn btn-sm btn-secondary" href="{{ url_for('threads.new', pid=package.id, title='Package approval comments') }}">Open Thread</a>
|
|
|
|
|
2020-09-23 20:17:06 +02:00
|
|
|
{{ _("Package review thread") }}:
|
|
|
|
{{ _("You can open a thread if you have a question for the reviewer or package author.") }}
|
2020-09-16 18:51:03 +02:00
|
|
|
<div style="clear:both;"></div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endmacro %}
|