]> git.lizzy.rs Git - cheatdb.git/blobdiff - app/templates/packages/view.html
Add comment system
[cheatdb.git] / app / templates / packages / view.html
index 834ea63732b862b8f2c295d5d4ff222b97ee23d8..3a83995907b4566d4cb723291f478b3926b59a8b 100644 (file)
                        {% endif %}
                        <div style="clear: both;"></div>
                </div>
+
+               {% if package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW") %}
+                       {% if review_thread %}
+                               {% from "macros/threads.html" import render_thread %}
+                               {{ render_thread(review_thread, current_user) }}
+                       {% else %}
+                               <div class="box box_grey alert alert-info">
+                                       Privately ask a question or give feedback
+
+                                       <a class="alert_right button" href="{{ url_for('new_thread_page', pid=package.id, title='Package approval comments') }}">Open Thread</a>
+                               </div>
+                       {% endif %}
+               {% endif %}
        {% endif %}
 
        <h1>{{ package.title }} by {{ package.author.display_name }}</h1>
 
        <aside class="asideright box box_grey">
                <h3>Details</h3>
+
                <div class="box-body">
+                       {% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP  %}
+                               <div class="box box_grey alert alert-error" style="margin-top: 0;">
+                                       <b>Warning:</b> Non-free code and media.
+                               </div>
+                       {% elif not package.license.is_foss and package.type != package.type.TXP %}
+                               <div class="box box_grey alert alert-error" style="margin-top: 0;">
+                                       <b>Warning:</b> Non-free code.
+                               </div>
+                       {% elif not package.media_license.is_foss %}
+                               <div class="box box_grey alert alert-error" style="margin-top: 0;">
+                                       <b>Warning:</b> Non-free media.
+                               </div>
+                       {% endif %}
                        <table>
                                <tr>
                                        <td>Name</td>
                                        <td>{{ package.name }}</td>
                                </tr>
+                               {% if package.provides %}
                                <tr>
                                        <td>Provides</td>
                                        <td>{% for meta in package.provides %}
                                                {% endif %}
                                        {% endfor %}</td>
                                </tr>
+                               {% endif %}
                                <tr>
                                        <td>Author</td>
                                        <td class="{{ package.author.rank }}">
                                </tr>
                                <tr>
                                        <td>License</td>
-                                       <td>{{ package.license.name }}</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>
                        </table>
 
                        <ul class="buttonset linedbuttonset">
-                               {% if package.getDownloadRelease() %}<li><a href="{{ package.getDownloadURL() }}">Download</a></li>{% endif %}
+                               {% if package.getDownloadRelease() %}<li><a href="{{ package.getDownloadURL() }}" class="btn_green">Download</a></li>{% endif %}
                                {% if package.repo %}<li><a href="{{ package.repo }}">View Source</a></li>{% endif %}
                                {% if package.forums %}<li><a href="https://forum.minetest.net/viewtopic.php?t={{ package.forums }}">Forums</a></li>{% endif %}
                                {% if package.issueTracker %}<li><a href="{{ package.issueTracker }}">Issue Tracker</a></li>{% endif %}
                                        <li><a href="{{ package.getEditURL() }}">Edit</a></li>
                                        <li><a href="{{ package.getNewScreenshotURL() }}">Add screenshot</a></li>
                                {% endif %}
-                               {% if current_user.is_authenticated %}
+                               {# {% if current_user.is_authenticated %}
                                        <li><a href="{{ package.getCreateEditRequestURL() }}">Suggest Changes</a></li>
-                               {% endif %}
+                               {% endif %} #}
                                {% if package.checkPerm(current_user, "MAKE_RELEASE") %}
                                        <li><a href="{{ package.getCreateReleaseURL() }}">Create Release</a></li>
                                {% endif %}
                                        {% if not rel.approved %}<i>{% endif %}
 
                                        <a href="{{ rel.url }}">{{ rel.title }}</a>,
-                                       created {{ rel.releaseDate }}.
+                                       created {{ rel.releaseDate | datetime }}.
                                        {% if rel.task_id %}
                                                <a href="{{ url_for('check_task', id=rel.task_id, r=package.getDetailsURL()) }}">Importing...</a>
                                        {% elif not rel.approved %}
                {% endfor %}
        </ul>
 
-       <table class="table-topalign">
+       <!-- <table class="table-topalign">
                <tr>
-                       <td>
+                       <td> -->
                                <h3>Dependencies</h3>
                                <ul>
                                        {% for dep in package.dependencies %}
                                                <li><i>No dependencies</i></li>
                                        {% endfor %}
                                </ul>
-                       </td>
+                       <!-- </td>
                        <td>
                                <h3>Required by</h3>
                                <ul>
-                                       <!-- {% for p in package.dependents %}
+                                       {% for p in package.dependents %}
                                                <li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }}</li>
                                        {% else %}
                                                {% if not package.softdependents %}
                                        {% endfor %}
                                        {% for p in package.softdependents %}
                                                <li><a href="{{ p.getDetailsURL() }}">{{ p.title }}</a> by {{ p.author.display_name }} [optional]</li>
-                                       {% endfor %} -->
+                                       {% endfor %}
                                </ul>
                        </td>
                </tr>
-       </table>
+       </table> -->
+
+       {#
+               {% 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('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 %}
+       #}
 
-       {% if current_user.is_authenticated or requests %}
-               <h3>Edit Requests</h3>
+       {% if alternatives %}
+               <h3>Alternatives</h3>
+               <ul>
+                       {% for p in alternatives %}
+                               <li><a href="{{ p.getDetailsURL() }}">{{ p.title }} by {{ p.author.display_name }}</a></li>
+                       {% endfor %}
+               </ul>
+       {% endif %}
 
+       {% if similar_topics %}
+               <h3>Similar Forum Topics</h3>
+               {% if not package.approved and package.type == package.type.MOD %}
+                       <div class="box box_grey 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 %}
                <ul>
-                       {% for r in requests %}
+                       {% for t in similar_topics %}
                                <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>
+                                       [{{ t.getType().value }}]
+                                       <a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}">
+                                               {{ t.title }} by {{ t.author.display_name }}
+                                       </a>
                                </li>
-                       {% else %}
-                               <li>No edit requests have been made.</li>
                        {% endfor %}
                </ul>
        {% endif %}