-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreview.html
79 lines (68 loc) · 2.08 KB
/
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
{% extends "layout.html" %}
{% block head %}
<script>
document.addEventListener('DOMContentLoaded', () => {
let counter=0;
document.querySelectorAll('#rate').forEach(button => {
button.onclick = () => {
button.style.color ="rgb(255,194,102)";
counter++;
document.querySelector('#number').innerHTML=counter;
button.disabled=true;
};
});
});
</script>
{% endblock %}
{% block body %}
<ul class="nav nav-pills"style= "font-size:25px">
<li class="nav-item">
<a class="nav-link" href="{{url_for('logout')}}"><b>Logout</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{url_for('home')}}"><b>Home</b></a>
</li>
</ul>
<br>
<b><h3> @{{username}}</h3></b>
<br><br>
<ul>
<h3>TITLE: {{books.title}} </h3>
<li><b>AUTHOR:</b> {{books.author}}</li>
<li><b>ISBN:</b> {{books.isbn}}</li>
<li><b>YEAR OF PUBLICATION: </b> {{books.year}}</li>
</ul>
<br><br>
<ul style="list-style-type:none;">
{% for rev in revs %}
<li style= "background-color: #ffffe6; padding: 20px; border: 3px solid black; border-radius: 5px; ">
<h5 style="float: right;">@{{rev.username}}</h5>
<br>
{% for rating in range(0, rev.ratings) %}
<i class="fas fa-star" style="float:right;"></i>
{% endfor %}
<br>
<b> {{rev.review}}</b>
</li>
{% endfor %}
</ul>
<br><br>
<label><b>Write your review and rate it</b></label>
<br>
<div style="float:right;">
<button id="rate"><i class="fas fa-star"></i></button>
<button id="rate"><i class="fas fa-star"></i></button>
<button id="rate"><i class="fas fa-star"></i></button>
<button id="rate"><i class="fas fa-star"></i></button>
<button id="rate"><i class="fas fa-star"></i></button>
:<div id="number"></div>
</div>
<br>
<form action="{{url_for('reviews', title= books.title)}}">
<div class="form-group">
<textarea class="form-control" name="myrev" rows=5></textarea>
<br>
<button class="btn btn-primary">+ Add review</button>
</div>
</form>
{% endblock %}