pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
| 3 | {% block title %} {{ title }} {% endblock %} |
| 4 | |
| 5 | {% block breadcrumbs %} |
| 6 | {% include "templates/includes/breadcrumbs.html" %} |
| 7 | {% endblock %} |
| 8 | |
| 9 | {% block page_content %} |
| 10 | {% from "erpnext/templates/includes/macros.html" import product_image %} |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 11 | {% from "erpnext/templates/includes/macros.html" import media_image %} |
| 12 | <div class="bom-content" style="margin-top:20px;"> |
| 13 | <div class="bom-page-content" itemscope itemtype="http://schema.org/Product"> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 14 | <div class="row"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 15 | <div class="col-sm-12"> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 16 | <h1 itemprop="name" style="margin-top: 0px;">{{ name }}</h1> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 17 | |
| 18 | <p class="text-muted"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 19 | {{ _("Item") }}: <span itemprop="itemName">{{ item_name }}</span></p> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 20 | <br> |
| 21 | |
| 22 | </div> |
| 23 | </div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 24 | <div class="row"> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 25 | <div class="col-sm-4"> |
| 26 | {{ media_image(website_image, item_name, "product-full-image") }} |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 27 | <br> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 28 | </div> |
| 29 | <div class="col-sm-offset-1 col-sm-4"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 30 | <p>{{ _("Quantity") }}: <span itemprop="productID">{{ quantity }}</span></p> |
| 31 | <br> |
| 32 | </div> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 33 | </div> |
| 34 | |
| 35 | {% if show_items -%} |
| 36 | <div class="row items" style="margin-top: 40px"> |
| 37 | <div class="col-md-12"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 38 | <h3>{{ _("Items") }}</h3> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 39 | <hr> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 40 | {% for d in items -%} |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 41 | <div class="row"> |
| 42 | <div class="col-sm-4">{{ media_image(d.image, d.item_name, "product-full-image") }}</div> |
| 43 | <div class="col-sm-4"><div><b>{{ d.item_name }}</b></div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 44 | {% if d.item_name != d.item_code -%} |
| 45 | <div class="text-muted">{{ d.item_code }}</div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 46 | {%- endif %} |
| 47 | <br> |
| 48 | {{ d.description }} |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 49 | </div> |
| 50 | <div class="col-sm-4">{{ _("Qty") }}: {{ d.qty }}</div> |
| 51 | </div> |
| 52 | <hr> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 53 | {%- endfor %} |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 54 | </div> |
| 55 | </div> |
| 56 | {%- endif %} |
| 57 | |
| 58 | {% if show_operations -%} |
| 59 | <div class="row operations" style="margin-top: 40px"> |
| 60 | <div class="col-md-12"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 61 | <h3>{{ _("Operations") }}</h3> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 62 | <hr> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 63 | {% for d in operations -%} |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 64 | <div class="row"> |
pratu16x7 | 462e89e | 2017-02-14 17:17:28 +0530 | [diff] [blame] | 65 | <div class="col-sm-3 bom-spec">{{ media_image(d.image, d.operation, "product-full-image") }}</div> |
| 66 | <div class="col-sm-3 bom-spec"><div>{{ d.operation }}</div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 67 | <div class="text-muted">{{ d.description }}</div> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 68 | </div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 69 | |
pratu16x7 | 462e89e | 2017-02-14 17:17:28 +0530 | [diff] [blame] | 70 | <div class="col-sm-3 bom-spec"><b>{{ _("Workstation") }}</b><br>{{ d.workstation }}</div> |
| 71 | <div class="col-sm-3 bom-spec"><b>{{ _("Time(in mins)") }}</b><br><div class="duration"><span class="duration-bar"> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 72 | <span class="duration-value">{{ d.time_in_mins }}</span></span></div></div> |
| 73 | </div> |
| 74 | <hr> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 75 | {%- endfor %} |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 76 | </div> |
| 77 | </div> |
| 78 | {%- endif %} |
| 79 | |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 80 | <div class="row" style="margin-top: 30px;"> |
| 81 | <div class="col-sm-12"> |
| 82 | <br> |
| 83 | <div class="h6 text-uppercase">{{ _("Description") }}</div> |
| 84 | <div itemprop="description" class="item-desc"> |
| 85 | {{ web_long_description or _("No description given") }}</div> |
| 86 | <br> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 87 | </div> |
| 88 | </div> |
| 89 | |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 90 | </div> |
| 91 | </div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 92 | <script> |
pratu16x7 | 86415f3 | 2017-02-16 09:27:53 +0530 | [diff] [blame] | 93 | frappe.ready(function() { |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 94 | var max_width = $(".duration").width() * 0.8; |
| 95 | var durations = []; |
| 96 | $(".duration .duration-bar").each(function() { |
| 97 | durations.push($(this).find(".duration-value").html()); |
| 98 | }); |
| 99 | var max_duration = Math.max(...durations); |
| 100 | var width_factor = max_width/max_duration; |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 101 | |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 102 | $(".duration .duration-bar").each(function() { |
pratu16x7 | 86415f3 | 2017-02-16 09:27:53 +0530 | [diff] [blame] | 103 | var duration = $(this).find(".duration-value").html(); |
| 104 | $(this).width(duration * width_factor); |
| 105 | if($(this).width() < $(this).find(".duration-value").width()) { |
| 106 | var html = $($(this).html()); |
| 107 | html.addClass("duration-bar"); |
| 108 | html.addClass("bar-outer-text"); |
| 109 | $(this).find(".duration-value").removeClass("duration-value").addClass("duration-invisible"); |
| 110 | $(this).closest(".duration").append(html); |
| 111 | } |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 112 | }); |
| 113 | }) |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 114 | </script> |
pratu16x7 | dee36e1 | 2017-02-10 18:28:39 +0530 | [diff] [blame] | 115 | {% endblock %} |