[FIX] Some interfaces, add review validation

parent 89bd9fb8
...@@ -79,8 +79,13 @@ h1 { ...@@ -79,8 +79,13 @@ h1 {
} }
.right_button{ .right_button{
flex-basis: 350px; flex-basis: 350px;
margin-right: 120px; margin-right: 20px;
} }
#address {
font-family: 'Arial';
}
.upload-btn-wrapper { .upload-btn-wrapper {
position: relative; position: relative;
margin-left: 10px; margin-left: 10px;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
.history-image-item { .history-image-item {
height: 200px; height: 200px;
width: 200px; width: 200px;
border: 2px solid black;
} }
#label-history { #label-history {
......
...@@ -70,4 +70,5 @@ input, textarea { ...@@ -70,4 +70,5 @@ input, textarea {
color: orange; color: orange;
font-weight: bold; font-weight: bold;
letter-spacing: 2px; letter-spacing: 2px;
cursor: pointer;
} }
\ No newline at end of file
.book-detail {
margin-block-end: 50px;
}
.textarea-comment { .textarea-comment {
width: 100%; width: 100%;
font-size: 28px; font-size: 28px;
...@@ -6,12 +10,18 @@ ...@@ -6,12 +10,18 @@
resize: none; resize: none;
} }
.warning-empty-inputs { .warning-empty-input {
position: relative; display: none;
position: absolute;
}
#rating-area {
text-align: center;
} }
.comment-bar { .comment-bar {
margin-block-end: 50px; margin-block-end: 50px;
width: 100%;
} }
.fivestar-rating { .fivestar-rating {
......
...@@ -54,6 +54,19 @@ img{ ...@@ -54,6 +54,19 @@ img{
height: 150px; height: 150px;
width: 150px; width: 150px;
} }
.pp {
border: 2px solid black;
}
button {
cursor: pointer;
}
.button_row {
font-size: 25px;
}
h3{ h3{
color: #F16303; color: #F16303;
word-wrap: normal; word-wrap: normal;
......
...@@ -12,6 +12,7 @@ function ratingClick(starValue) { ...@@ -12,6 +12,7 @@ function ratingClick(starValue) {
} }
} }
document.getElementById("rating-given").value = starValue; document.getElementById("rating-given").value = starValue;
document.getElementById("rating-area").style.display = 'none';
} }
function hoverStar(starValue) { function hoverStar(starValue) {
...@@ -31,16 +32,20 @@ function noHoverStar(starValue) { ...@@ -31,16 +32,20 @@ function noHoverStar(starValue) {
} }
} }
function IsEmptyCommentBar() { function isEmptyCommentBar() {
return document.getElementById('comment').value === ""; return document.getElementById('comment').value === "";
} }
function isEmptyRating() {
return document.getElementById("rating-given").value == 0;
}
function trySubmitSearch() { function trySubmitSearch() {
if (IsEmptyCommentBar()) { if (isEmptyCommentBar()) {
document.getElementById("warning-empty-input").style.display = 'table'; document.getElementById("comment-area").style.display = 'table';
} else { }
document.getElementById('book-review').submit(); if (isEmptyRating()) {
document.getElementById("rating-area").style.display = 'table';
} }
} }
......
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<div class="flex-review-tab"> <div class="flex-review-tab">
<div class="comment-bar"> <div class="comment-bar">
<textarea id="comment" class="textarea-comment" name="comment" cols="180" rows="5"></textarea> <textarea id="comment" class="textarea-comment" name="comment" cols="180" rows="5"></textarea>
<span id="warning-empty-input" class="red-theme alert-box text-size-20 add-nunito-font c-round"> <p id="comment-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Input can\'t be empty</span> Input can\'t be empty</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -84,7 +84,9 @@ ...@@ -84,7 +84,9 @@
$str = ' $str = '
<div class="rating-pict">'. <div class="rating-pict">'.
self::show5Stars(). self::show5Stars().
'</div>'; '<p id="rating-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Rating can\'t be empty</p>
</div>';
return $str; return $str;
} }
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
</div> </div>
<div class="button_row"> <div class="button_row">
<button type="button" class="text-size-30 add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button> <button type="button" class="add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button>
</div> </div>
'; ';
$i += 1; $i += 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment