From b70fe0c39c28af66dea9605db8e4c5ed27234d46 Mon Sep 17 00:00:00 2001 From: Erma Safira Nurmasyita Date: Fri, 26 Oct 2018 13:00:48 +0700 Subject: [PATCH] [FIX] Some interfaces, add review validation --- web/css/edit_profile.css | 7 ++++++- web/css/history.css | 1 + web/css/login.css | 1 + web/css/review.css | 14 ++++++++++++-- web/css/search_result.css | 13 +++++++++++++ web/javascript/review-book.js | 15 ++++++++++----- web/review/view.php | 8 +++++--- web/search_result/view.php | 2 +- 8 files changed, 49 insertions(+), 12 deletions(-) diff --git a/web/css/edit_profile.css b/web/css/edit_profile.css index fbef09c..49e157d 100644 --- a/web/css/edit_profile.css +++ b/web/css/edit_profile.css @@ -79,8 +79,13 @@ h1 { } .right_button{ flex-basis: 350px; - margin-right: 120px; + margin-right: 20px; } + +#address { + font-family: 'Arial'; +} + .upload-btn-wrapper { position: relative; margin-left: 10px; diff --git a/web/css/history.css b/web/css/history.css index 32ee339..2c5783d 100644 --- a/web/css/history.css +++ b/web/css/history.css @@ -15,6 +15,7 @@ .history-image-item { height: 200px; width: 200px; + border: 2px solid black; } #label-history { diff --git a/web/css/login.css b/web/css/login.css index 20f6f3e..e0266be 100644 --- a/web/css/login.css +++ b/web/css/login.css @@ -70,4 +70,5 @@ input, textarea { color: orange; font-weight: bold; letter-spacing: 2px; + cursor: pointer; } \ No newline at end of file diff --git a/web/css/review.css b/web/css/review.css index 2120e76..3d5dd71 100644 --- a/web/css/review.css +++ b/web/css/review.css @@ -1,3 +1,7 @@ +.book-detail { + margin-block-end: 50px; +} + .textarea-comment { width: 100%; font-size: 28px; @@ -6,12 +10,18 @@ resize: none; } -.warning-empty-inputs { - position: relative; +.warning-empty-input { + display: none; + position: absolute; +} + +#rating-area { + text-align: center; } .comment-bar { margin-block-end: 50px; + width: 100%; } .fivestar-rating { diff --git a/web/css/search_result.css b/web/css/search_result.css index 2016041..89fccf7 100644 --- a/web/css/search_result.css +++ b/web/css/search_result.css @@ -54,6 +54,19 @@ img{ height: 150px; width: 150px; } + +.pp { + border: 2px solid black; +} + +button { + cursor: pointer; +} + +.button_row { + font-size: 25px; +} + h3{ color: #F16303; word-wrap: normal; diff --git a/web/javascript/review-book.js b/web/javascript/review-book.js index 46389cc..a577d25 100644 --- a/web/javascript/review-book.js +++ b/web/javascript/review-book.js @@ -12,6 +12,7 @@ function ratingClick(starValue) { } } document.getElementById("rating-given").value = starValue; + document.getElementById("rating-area").style.display = 'none'; } function hoverStar(starValue) { @@ -31,16 +32,20 @@ function noHoverStar(starValue) { } } -function IsEmptyCommentBar() { +function isEmptyCommentBar() { return document.getElementById('comment').value === ""; } +function isEmptyRating() { + return document.getElementById("rating-given").value == 0; +} function trySubmitSearch() { - if (IsEmptyCommentBar()) { - document.getElementById("warning-empty-input").style.display = 'table'; - } else { - document.getElementById('book-review').submit(); + if (isEmptyCommentBar()) { + document.getElementById("comment-area").style.display = 'table'; + } + if (isEmptyRating()) { + document.getElementById("rating-area").style.display = 'table'; } } diff --git a/web/review/view.php b/web/review/view.php index 174acbc..ef28e9f 100644 --- a/web/review/view.php +++ b/web/review/view.php @@ -65,8 +65,8 @@
- - Input can\'t be empty +

+ Input can\'t be empty

@@ -84,7 +84,9 @@ $str = '
'. self::show5Stars(). - '
'; + '

+ Rating can\'t be empty

+ '; return $str; } diff --git a/web/search_result/view.php b/web/search_result/view.php index 4136368..255c8cf 100644 --- a/web/search_result/view.php +++ b/web/search_result/view.php @@ -64,7 +64,7 @@
- +
'; $i += 1; -- GitLab