aboutsummaryrefslogtreecommitdiff
path: root/app/templates/packages/review_create_edit.html
blob: eb4dff2767d6d2bad51257af34e38870beaf44c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{% extends "base.html" %}

{% block title %}
	{{ _("Review") }}
{% endblock %}

{% block link %}
	<a href="{{ package.getDetailsURL() }}">{{ package.title }}</a>
{% endblock %}

{% block content %}
<h1>{{ _("Post a review for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}</h1>

{% from "macros/forms.html" import render_field, render_submit_field, render_toggle_field %}
<form method="POST" action="" enctype="multipart/form-data">
	{{ form.hidden_tag() }}
	<div class="row mt-0 mb-4 comments mx-0">
		<div class="col-md-1 p-1">
			<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
		</div>
		<div class="col">
			<div class="card">
				<div class="card-header {{ current_user.rank.name }}">
					{{ current_user.display_name }}
					<a name="reply"></a>
				</div>
				<div class="card-body">
					<p>
						{{ _("Do you recommend this %(type)s?", type=package.type.value | lower) }}
					</p>
					{{ render_toggle_field(form.recommends, icons={"yes":"fa-thumbs-up", "no":"fa-thumbs-down"}) }}

					<p class="mt-4 mb-3">
						{{ _("Why or why not? Try to be constructive") }}
					</p>

					{{ render_field(form.title) }}
					{{ render_field(form.comment, label="", class_="m-0", fieldclass="form-control markdown") }} <br />
					{{ render_submit_field(form.submit) }}
				</div>
			</div>
		</div>
	</div>
</form>

{% if review %}
<form method="POST" action="{{ review.getDeleteURL() }}" class="alert alert-secondary my-5">
	<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
	<input class="btn btn-sm btn-danger float-right" type="submit" value="{{ _('Delete') }}">
	<b>{{ _("Delete review.") }}</b>
	{{ _("This will convert the review into a thread, keeping the comments but removing its effect on the package's rating.") }}
	<div style="clear:both;"></div>
</form>
{% endif %}

{% endblock %}