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