generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit_review.html
121 lines (113 loc) · 4.86 KB
/
edit_review.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{% extends "base.html" %}
{% block content %}
<section>
<!-- Error Messages-->
<!-- Username Input Errors -->
{% if form.review_text.errors %}
<div class="container">
<div class="row justify-content-center">
<div class="alert alert-warning alert-dismissible fade show col-6 mt-5 shadow-lg p-3 mb-5 rounded"
role="alert">
{% for error in form.review_type.errors %}
<strong>{{ error }}</strong><br>
{% endfor %}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>
</div>
{% endif %}
<!-- Email Input Errors -->
{% if form.image_url.errors %}
<div class="container">
<div class="row justify-content-center">
<div class="alert alert-warning alert-dismissible fade show col-6 mt-5 shadow-lg p-3 mb-5 rounded"
role="alert">
{% for error in form.image.errors %}
<strong>{{ error }}</strong>
{% endfor %}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>
</div>
{% endif %}
</section>
<div class="container">
<div class="row justify-content-center">
<div class="card mt-3 col-10 col-md-8 text-white bg-primary shadow p-1 mb-3 rounded">
<div class="card-body title-card text-center">
<h3>
Edit Review:
</h3>
</div>
</div>
</div>
<div class="row justify-content-center">
<form class="card mt-5 col-10 col-md-8 text-white bg-primary shadow p-3 mb-5 rounded" method="POST"
action="{{ url_for('edit_review', review_id=review_to_edit._id) }}">
{{ form.hidden_tag() }}
<div class="card-body">
<!-- Material Name -->
<h6>Filament type: </h6>
<div class="input-group flex-nowrap">
{{ form.material_name(class_='form-control', placeholder='Filament Type') }}
</div>
<!-- Brand -->
<h6>Filament Maker:</h6>
<div class="input-group flex-nowrap">
{{ form.brand(class_='form-control', placeholder='Filament Maker') }}
</div>
<!-- Filament Name -->
<h6>Filament Name:</h6>
<div class="input-group flex-nowrap">
{{ form.filament_name(class_='form-control', placeholder='Filament Name') }}
</div>
<!-- rating -->
<h6>Rating (1 = Bad):</h6>
<div class="input-group flex-nowrap">
{{ form.rating(class_='form-control', placeholder='Rating (1 = Bad)') }}
</div>
<!-- Cost -->
<h6>Cost (1 = Cheap):</h6>
<div class="input-group flex-nowrap">
{{ form.cost(class_='form-control', placeholder='Cost (1 = Cheap)') }}
</div>
<!-- Temperature -->
<h6>Temperature you printed:</h6>
<div class="input-group flex-nowrap">
{{ form.temperature(class_='form-control', placeholder='Printing Temperature') }}
</div>
<!-- Colour -->
<h6>Colour:</h6>
<div class="input-group flex-nowrap">
{{ form.colour(class_='form-control', placeholder='Filament Colour') }}
</div>
<!-- Finish -->
<h6>Finish:</h6>
<div class="input-group flex-nowrap">
{{ form.finish(class_='form-control', placeholder='Filament Finish') }}
</div>
<h6>Review Text:</h6>
<!-- Review Text -->
<div class="input-group flex-nowrap">
{{ form.review_text(class_='form-control', placeholder='Review Text (Max 250 characters)') }}
</div>
<!-- Image -->
<h6>Image URL:</h6>
<div class="input-group flex-nowrap mb-3">
{{ form.image_url(class_='form-control', placeholder='Image URL of a print') }}
</div>
<div class="row text-center">
<!-- Cancel and Submit button -->
<div class="text-center">
<div>
<a class="btn btn-secondary" role="button"
href="{{ url_for('profile', username=session['user']) }}">Cancel</a>
{{ form.submit(class_='btn btn-success') }}
</div>
</div>
</div>
</div>
</form>
</div>
</div>
{% endblock %}