marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | {% from "erpnext/templates/includes/macros.html" import user_review, ratings_summary %} |
| 3 | |
| 4 | {% block title %} {{ _("Customer Reviews") }} {% endblock %} |
| 5 | |
| 6 | {% block page_content %} |
marination | 2fec068 | 2021-07-13 23:46:24 +0530 | [diff] [blame] | 7 | <div class="product-container reviews-full-page col-md-12"> |
marination | b4529b8 | 2021-08-09 21:00:31 +0530 | [diff] [blame^] | 8 | {% if enable_reviews %} |
| 9 | <!-- Title and Action --> |
| 10 | <div class="w-100 mb-6 d-flex"> |
| 11 | <div class="reviews-header col-9"> |
| 12 | {{ _("Customer Reviews") }} |
| 13 | </div> |
| 14 | |
| 15 | <div class="write-a-review-btn col-3"> |
| 16 | <!-- Write a Review for legitimate users --> |
| 17 | {% if frappe.session.user != "Guest" and user_is_customer %} |
| 18 | <button class="btn btn-write-review" |
| 19 | data-web-item="{{ web_item }}"> |
| 20 | {{ _("Write a Review") }} |
| 21 | </button> |
| 22 | {% endif %} |
| 23 | </div> |
marination | 2fec068 | 2021-07-13 23:46:24 +0530 | [diff] [blame] | 24 | </div> |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 25 | |
marination | b4529b8 | 2021-08-09 21:00:31 +0530 | [diff] [blame^] | 26 | <!-- Summary --> |
| 27 | {{ ratings_summary(reviews, reviews_per_rating, average_rating, average_whole_rating, for_summary=True, total_reviews=total_reviews) }} |
| 28 | |
| 29 | |
| 30 | <!-- Reviews and Comments --> |
| 31 | <div class="mt-8"> |
| 32 | {% if reviews %} |
| 33 | {{ user_review(reviews) }} |
| 34 | |
| 35 | {% if not reviews | len >= total_reviews %} |
| 36 | <button class="btn btn-light btn-view-more mr-2 mt-4 mb-4 w-30" |
| 37 | data-web-item="{{ web_item }}"> |
| 38 | {{ _("View More") }} |
| 39 | </button> |
| 40 | {% endif %} |
| 41 | |
| 42 | {% else %} |
| 43 | <h6 class="text-muted mt-6"> |
| 44 | {{ _("No Reviews") }} |
| 45 | </h6> |
marination | 2fec068 | 2021-07-13 23:46:24 +0530 | [diff] [blame] | 46 | {% endif %} |
| 47 | </div> |
marination | b4529b8 | 2021-08-09 21:00:31 +0530 | [diff] [blame^] | 48 | {% else %} |
| 49 | <!-- If reviews are disabled --> |
| 50 | <div class="text-center"> |
| 51 | <h3 class="text-muted mt-8"> |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 52 | {{ _("No Reviews") }} |
marination | b4529b8 | 2021-08-09 21:00:31 +0530 | [diff] [blame^] | 53 | </h3> |
| 54 | </div> |
| 55 | {% endif %} |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 56 | </div> |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 57 | |
marination | 0a70374 | 2021-05-08 12:10:27 +0530 | [diff] [blame] | 58 | {% endblock %} |
| 59 | |
| 60 | {% block base_scripts %} |
| 61 | <!-- js should be loaded in body! --> |
| 62 | <script type="text/javascript" src="/assets/frappe/js/lib/jquery/jquery.min.js"></script> |
| 63 | <script type="text/javascript" src="/assets/js/frappe-web.min.js"></script> |
| 64 | <script type="text/javascript" src="/assets/js/control.min.js"></script> |
| 65 | <script type="text/javascript" src="/assets/js/dialog.min.js"></script> |
| 66 | <script type="text/javascript" src="/assets/js/bootstrap-4-web.min.js"></script> |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 67 | {% endblock %} |