blob: f514f2dd8ee75f914db49b6e875fb0bf90ba45d5 [file] [log] [blame]
pratu16x7dee36e12017-02-10 18:28:39 +05301{% 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 %}
pratu16x760fe77c2017-02-13 21:52:43 +053011{% 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">
pratu16x7dee36e12017-02-10 18:28:39 +053014 <div class="row">
pratu16x760fe77c2017-02-13 21:52:43 +053015 <div class="col-sm-12">
16 <h2 itemprop="name" style="margin-top: 0px;">{{ name }}</h2>
pratu16x7dee36e12017-02-10 18:28:39 +053017
18 <p class="text-muted">
pratu16x760fe77c2017-02-13 21:52:43 +053019 {{ _("Item") }}: <span itemprop="itemName">{{ item_name }}</span></p>
pratu16x7dee36e12017-02-10 18:28:39 +053020 <br>
21
22 </div>
23 </div>
pratu16x760fe77c2017-02-13 21:52:43 +053024 <div class="row">
25 <div class="col-sm-6">
26 {{ product_image(website_image, "product-full-image") }}
27 <br>
28 <p>{{ _("Quantity") }}: <span itemprop="productID">{{ quantity }}</span></p>
29 <br>
30 </div>
pratu16x7dee36e12017-02-10 18:28:39 +053031 </div>
32
33 {% if show_items -%}
34 <div class="row items" style="margin-top: 40px">
35 <div class="col-md-12">
pratu16x760fe77c2017-02-13 21:52:43 +053036 <h3>{{ _("Items") }}</h3>
pratu16x7dee36e12017-02-10 18:28:39 +053037 <table class="table borderless" style="width: 100%">
pratu16x7dee36e12017-02-10 18:28:39 +053038 <tr>
pratu16x760fe77c2017-02-13 21:52:43 +053039 <th></th>
40 <th></th>
41 <th>{{ _("Qty") }}</th>
42 </tr>
43 {% for d in items -%}
44 <tr>
45 <td>{{ media_image(d.image, "product-full-image") }}</td>
46 <td><div><b>{{ d.item_name }}</b></div>
47 {% if d.item_name != d.item_code -%}
48 <div class="text-muted">{{ d.item_code }}</div>
49 {% else -%}
50
51 {%- endif %}
52 <br>
53 {{ d.description }}
54 </td>
pratu16x7dee36e12017-02-10 18:28:39 +053055 <td>{{ d.qty }}</td>
56 </tr>
57 {%- endfor %}
58 </table>
59 </div>
60 </div>
61 {%- endif %}
62
63 {% if show_operations -%}
64 <div class="row operations" style="margin-top: 40px">
65 <div class="col-md-12">
pratu16x760fe77c2017-02-13 21:52:43 +053066 <h3>{{ _("Operations") }}</h3>
pratu16x7dee36e12017-02-10 18:28:39 +053067 <table class="table borderless" style="width: 100%">
pratu16x7dee36e12017-02-10 18:28:39 +053068 <tr>
pratu16x760fe77c2017-02-13 21:52:43 +053069 <th></th>
70 <th style="padding:8px 20px;"></th>
71
72 <th>{{ _("Workstation") }}</th>
73 <th style="width: 20%;">{{ _("Time(in mins)") }}</th>
74 </tr>
75 {% for d in operations -%}
76 <tr>
77 <td>{{ media_image(d.image, d.operation, "product-full-image") }}</td>
78 <td style="padding:8px 20px;"><div>{{ d.operation }}</div>
79 <div class="text-muted">{{ d.description }}</div>
80 </td>
81
pratu16x7dee36e12017-02-10 18:28:39 +053082 <td>{{ d.workstation }}</td>
pratu16x760fe77c2017-02-13 21:52:43 +053083 <td class="duration" style="width: 20%;"><span class="duration-bar">
84 <span class="duration-value">{{ d.time_in_mins }}</span></span></td>
pratu16x7dee36e12017-02-10 18:28:39 +053085 </tr>
86 {%- endfor %}
87 </table>
88 </div>
89 </div>
90 {%- endif %}
91
pratu16x760fe77c2017-02-13 21:52:43 +053092 <div class="row" style="margin-top: 30px;">
93 <div class="col-sm-12">
94 <br>
95 <div class="h6 text-uppercase">{{ _("Description") }}</div>
96 <div itemprop="description" class="item-desc">
97 {{ web_long_description or _("No description given") }}</div>
98 <br>
99
100 </div>
101 </div>
102
pratu16x7dee36e12017-02-10 18:28:39 +0530103 </div>
104</div>
pratu16x760fe77c2017-02-13 21:52:43 +0530105<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
106<script>
107 var max_width = $(".duration").width() * 0.8;
108 var durations = [];
109 $(".duration .duration-bar").each(function() {
110 durations.push($(this).find(".duration-value").html());
111 });
112 var max_duration = Math.max(...durations);
113 var width_factor = max_width/max_duration;
114
115 $(".duration .duration-bar").each(function() {
116 var duration = $(this).find(".duration-value").html();
117 $(this).width(duration * width_factor);
118 if($(this).width() < $(this).find(".duration-value").width()) {
119 var html = $($(this).html());
120 html.addClass("duration-bar");
121 html.addClass("bar-outer-text");
122 $(this).find(".duration-value").removeClass("duration-value").addClass("duration-invisible");
123 $(this).closest("td").append(html);
124 }
125 });
126</script>
pratu16x7dee36e12017-02-10 18:28:39 +0530127{% endblock %}