2018-06-11 23:49:25 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
2021-08-17 22:16:43 +02:00
|
|
|
{%- if thread.package -%}
|
|
|
|
{%- if thread.review -%}
|
2023-04-15 03:37:58 +02:00
|
|
|
{%- if thread.review.rating > 3 -%}
|
2021-08-17 22:16:43 +02:00
|
|
|
{%- set rating = "👍" -%}
|
2023-04-15 03:37:58 +02:00
|
|
|
{%- elif thread.review.rating < 3 -%}
|
2021-08-17 22:16:43 +02:00
|
|
|
{%- set rating = "👎" -%}
|
2023-04-15 03:37:58 +02:00
|
|
|
{%- else -%}
|
|
|
|
{%- set rating = "-" -%}
|
2021-08-17 22:16:43 +02:00
|
|
|
{%- endif -%}
|
|
|
|
{%- endif -%}
|
2022-01-21 14:15:07 +01:00
|
|
|
{{ rating }} {{ thread.title }} - {{ thread.package.title }}
|
2021-08-17 22:16:43 +02:00
|
|
|
{%- else -%}
|
|
|
|
{{ thread.title }}
|
|
|
|
{%- endif -%}
|
|
|
|
{% endblock %}
|
|
|
|
|
2023-04-30 01:53:55 +02:00
|
|
|
{% block description -%}
|
|
|
|
{{ thread.get_description() }}
|
|
|
|
{%- endblock %}
|
|
|
|
|
2021-08-17 22:16:43 +02:00
|
|
|
{% block headextra %}
|
2023-06-18 22:56:19 +02:00
|
|
|
<meta name="og:image" content="{{ thread.author.get_profile_pic_url() }}"/>
|
2018-06-11 23:49:25 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
2023-08-21 01:13:22 +02:00
|
|
|
{% block scriptextra %}
|
2023-08-22 01:48:08 +02:00
|
|
|
{% if current_user.is_authenticated %}
|
2023-11-01 00:28:20 +01:00
|
|
|
<script src="/static/js/quick_review_voting.js?v=2"></script>
|
2023-08-22 01:48:08 +02:00
|
|
|
{% endif %}
|
2023-12-16 01:57:13 +01:00
|
|
|
{% from "macros/forms.html" import easymde_scripts %}
|
|
|
|
{{ easymde_scripts() }}
|
2023-08-21 01:13:22 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
2018-06-11 23:49:25 +02:00
|
|
|
{% block content %}
|
2018-12-22 21:13:43 +01:00
|
|
|
{% if current_user.is_authenticated %}
|
|
|
|
{% if current_user in thread.watchers %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<form method="post" action="{{ thread.get_unsubscribe_url() }}" class="float-end">
|
2018-12-22 21:13:43 +01:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2022-01-08 00:27:00 +01:00
|
|
|
<input type="submit" class="btn btn-primary" value="{{ _('Unsubscribe') }}" />
|
2018-12-22 21:13:43 +01:00
|
|
|
</form>
|
|
|
|
{% else %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<form method="post" action="{{ thread.get_subscribe_url() }}" class="float-end">
|
2018-12-22 21:13:43 +01:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2022-01-08 00:27:00 +01:00
|
|
|
<input type="submit" class="btn btn-primary" value="{{ _('Subscribe') }}" />
|
2018-12-22 21:13:43 +01:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
2023-06-18 22:56:19 +02:00
|
|
|
{% if thread.check_perm(current_user, "DELETE_THREAD") %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<a href="{{ url_for('threads.delete_thread', id=thread.id) }}" class="float-end me-2 btn btn-danger">{{ _('Delete') }}</a>
|
2020-12-09 19:40:25 +01:00
|
|
|
{% endif %}
|
2023-06-18 22:56:19 +02:00
|
|
|
{% if thread.review and thread.review.check_perm(current_user, "DELETE_REVIEW") and current_user.username != thread.review.author.username %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<form method="post" action="{{ thread.review.get_delete_url() }}" class="float-end me-2">
|
2022-02-09 13:47:36 +01:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
<input type="submit" class="btn btn-danger" value="{{ _('Convert to Thread') }}" />
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2023-06-18 22:56:19 +02:00
|
|
|
{% if thread.check_perm(current_user, "LOCK_THREAD") %}
|
2020-07-11 02:34:51 +02:00
|
|
|
{% if thread.locked %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<form method="post" action="{{ url_for('threads.set_lock', id=thread.id, lock=0) }}" class="float-end me-2">
|
2020-07-11 02:34:51 +02:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2020-12-09 19:40:25 +01:00
|
|
|
<input type="submit" class="btn btn-secondary" value="{{ _('Unlock') }}" />
|
2020-07-11 02:34:51 +02:00
|
|
|
</form>
|
|
|
|
{% else %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<form method="post" action="{{ url_for('threads.set_lock', id=thread.id, lock=1) }}" class="float-end me-2">
|
2020-07-11 02:34:51 +02:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
2020-12-09 19:40:25 +01:00
|
|
|
<input type="submit" class="btn btn-secondary" value="{{ _('Lock') }}" />
|
2020-07-11 02:34:51 +02:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-12-22 21:13:43 +01:00
|
|
|
{% endif %}
|
|
|
|
|
2020-07-10 20:01:58 +02:00
|
|
|
{% if current_user == thread.author and thread.review %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<a class="btn btn-primary ms-1 float-end me-2"
|
2023-06-18 23:00:24 +02:00
|
|
|
href="{{ thread.review.package.get_url('packages.review') }}">
|
2021-02-28 06:16:15 +01:00
|
|
|
<i class="fas fa-pen"></i>
|
2020-07-10 20:01:58 +02:00
|
|
|
{{ _("Edit Review") }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-07-09 05:10:09 +02:00
|
|
|
<h1>
|
|
|
|
{% if thread.review %}
|
2023-04-15 03:37:58 +02:00
|
|
|
{% if thread.review.rating > 3 %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<i class="fas fa-thumbs-up me-2" style="color:#6f6;"></i>
|
2023-04-15 03:37:58 +02:00
|
|
|
{% elif thread.review.rating < 3 %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<i class="fas fa-thumbs-down me-2" style="color:#f66;"></i>
|
2023-04-15 03:37:58 +02:00
|
|
|
{% else %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<i class="fas fa-minus me-2" style="color:#999"></i>
|
2020-07-09 05:10:09 +02:00
|
|
|
{% endif %}
|
2018-07-28 16:30:59 +02:00
|
|
|
{% endif %}
|
2020-07-09 05:10:09 +02:00
|
|
|
{% if thread.private %}🔒 {% endif %}{{ thread.title }}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
{% if thread.package %}
|
|
|
|
<p>
|
2023-06-18 22:56:19 +02:00
|
|
|
{{ _("Package") }}: <a href="{{ thread.package.get_url('packages.view') }}">{{ thread.package.title }}</a>
|
2020-07-09 05:10:09 +02:00
|
|
|
</p>
|
2018-06-11 23:49:25 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if thread.private %}
|
2022-04-23 21:42:58 +02:00
|
|
|
<aside class="row">
|
|
|
|
<div class="col-md-9">
|
|
|
|
<i>
|
2022-04-23 22:37:03 +02:00
|
|
|
{{ _("This thread is only visible to its creator, package maintainers, users of Approver rank or above, and @mentioned users.") }}
|
2022-04-23 21:42:58 +02:00
|
|
|
</i>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="d-flex flex-row justify-content-end flex-wrap align-items-center" style="gap: 0.5em;">
|
2023-08-22 20:58:43 +02:00
|
|
|
<span class="text-muted me-2" title="{{ _('This thread is visible to the following users') }}">
|
2022-04-23 22:37:03 +02:00
|
|
|
{{ _("Visible to:") }}
|
|
|
|
</span>
|
2022-04-23 21:42:58 +02:00
|
|
|
{% for viewer in thread.get_visible_to() %}
|
|
|
|
<a href="{{ url_for('users.profile', username=viewer.username) }}" title="{{ viewer.display_name }}">
|
2023-08-25 21:49:55 +02:00
|
|
|
<img style="max-height: 2em;" src="{{ viewer.get_profile_pic_url() }}" loading="lazy"
|
|
|
|
alt="{{ viewer.display_name }}">
|
2022-04-23 21:42:58 +02:00
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
<a href="{{ url_for('users.list_all') }}" title="{{ _('Plus approvers and editors') }}">
|
|
|
|
+ <i class="fas fa-user-check"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</aside>
|
2018-06-11 23:49:25 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2024-06-02 13:25:54 +02:00
|
|
|
{% if thread.review and current_user == thread.package.author %}
|
|
|
|
{% set flag %}
|
|
|
|
<i class="fas fa-flag mx-2"></i>
|
|
|
|
{% endset %}
|
|
|
|
<aside class="alert alert-secondary">
|
|
|
|
<strong>{{ _("Is this review outdated?") }}</strong>
|
|
|
|
{{ _("For example, does it complain about issues you've already fixed?") }}
|
|
|
|
{{ _("You can report outdated reviews by clicking %(flag)s on the review.", flag=flag) }}
|
|
|
|
</aside>
|
|
|
|
{% endif %}
|
2018-06-11 23:49:25 +02:00
|
|
|
{% from "macros/threads.html" import render_thread %}
|
2022-04-23 21:05:19 +02:00
|
|
|
{{ render_thread(thread, current_user, form) }}
|
2018-06-11 23:49:25 +02:00
|
|
|
{% endblock %}
|