2017-02-10 18:28:39 +05:30
|
|
|
{% extends "templates/web.html" %}
|
|
|
|
|
|
|
|
{% block title %} {{ title }} {% endblock %}
|
|
|
|
|
|
|
|
{% block breadcrumbs %}
|
|
|
|
{% include "templates/includes/breadcrumbs.html" %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block page_content %}
|
|
|
|
{% from "erpnext/templates/includes/macros.html" import product_image %}
|
2017-02-13 21:52:43 +05:30
|
|
|
{% from "erpnext/templates/includes/macros.html" import media_image %}
|
|
|
|
<div class="bom-content" style="margin-top:20px;">
|
|
|
|
<div class="bom-page-content" itemscope itemtype="http://schema.org/Product">
|
2017-02-10 18:28:39 +05:30
|
|
|
<div class="row">
|
2017-02-13 21:52:43 +05:30
|
|
|
<div class="col-sm-12">
|
|
|
|
<h2 itemprop="name" style="margin-top: 0px;">{{ name }}</h2>
|
2017-02-10 18:28:39 +05:30
|
|
|
|
|
|
|
<p class="text-muted">
|
2017-02-13 21:52:43 +05:30
|
|
|
{{ _("Item") }}: <span itemprop="itemName">{{ item_name }}</span></p>
|
2017-02-10 18:28:39 +05:30
|
|
|
<br>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-02-13 21:52:43 +05:30
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
{{ product_image(website_image, "product-full-image") }}
|
|
|
|
<br>
|
|
|
|
<p>{{ _("Quantity") }}: <span itemprop="productID">{{ quantity }}</span></p>
|
|
|
|
<br>
|
|
|
|
</div>
|
2017-02-10 18:28:39 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if show_items -%}
|
|
|
|
<div class="row items" style="margin-top: 40px">
|
|
|
|
<div class="col-md-12">
|
2017-02-13 21:52:43 +05:30
|
|
|
<h3>{{ _("Items") }}</h3>
|
2017-02-10 18:28:39 +05:30
|
|
|
<table class="table borderless" style="width: 100%">
|
|
|
|
<tr>
|
2017-02-13 21:52:43 +05:30
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
<th>{{ _("Qty") }}</th>
|
|
|
|
</tr>
|
|
|
|
{% for d in items -%}
|
|
|
|
<tr>
|
|
|
|
<td>{{ media_image(d.image, "product-full-image") }}</td>
|
|
|
|
<td><div><b>{{ d.item_name }}</b></div>
|
|
|
|
{% if d.item_name != d.item_code -%}
|
|
|
|
<div class="text-muted">{{ d.item_code }}</div>
|
|
|
|
{% else -%}
|
|
|
|
|
|
|
|
{%- endif %}
|
|
|
|
<br>
|
|
|
|
{{ d.description }}
|
|
|
|
</td>
|
2017-02-10 18:28:39 +05:30
|
|
|
<td>{{ d.qty }}</td>
|
|
|
|
</tr>
|
|
|
|
{%- endfor %}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
{% if show_operations -%}
|
|
|
|
<div class="row operations" style="margin-top: 40px">
|
|
|
|
<div class="col-md-12">
|
2017-02-13 21:52:43 +05:30
|
|
|
<h3>{{ _("Operations") }}</h3>
|
2017-02-10 18:28:39 +05:30
|
|
|
<table class="table borderless" style="width: 100%">
|
|
|
|
<tr>
|
2017-02-13 21:52:43 +05:30
|
|
|
<th></th>
|
|
|
|
<th style="padding:8px 20px;"></th>
|
|
|
|
|
|
|
|
<th>{{ _("Workstation") }}</th>
|
|
|
|
<th style="width: 20%;">{{ _("Time(in mins)") }}</th>
|
|
|
|
</tr>
|
|
|
|
{% for d in operations -%}
|
|
|
|
<tr>
|
|
|
|
<td>{{ media_image(d.image, d.operation, "product-full-image") }}</td>
|
|
|
|
<td style="padding:8px 20px;"><div>{{ d.operation }}</div>
|
|
|
|
<div class="text-muted">{{ d.description }}</div>
|
|
|
|
</td>
|
|
|
|
|
2017-02-10 18:28:39 +05:30
|
|
|
<td>{{ d.workstation }}</td>
|
2017-02-13 21:52:43 +05:30
|
|
|
<td class="duration" style="width: 20%;"><span class="duration-bar">
|
|
|
|
<span class="duration-value">{{ d.time_in_mins }}</span></span></td>
|
2017-02-10 18:28:39 +05:30
|
|
|
</tr>
|
|
|
|
{%- endfor %}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endif %}
|
|
|
|
|
2017-02-13 21:52:43 +05:30
|
|
|
<div class="row" style="margin-top: 30px;">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<br>
|
|
|
|
<div class="h6 text-uppercase">{{ _("Description") }}</div>
|
|
|
|
<div itemprop="description" class="item-desc">
|
|
|
|
{{ web_long_description or _("No description given") }}</div>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-02-10 18:28:39 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2017-02-13 21:52:43 +05:30
|
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
|
|
|
|
<script>
|
|
|
|
var max_width = $(".duration").width() * 0.8;
|
|
|
|
var durations = [];
|
|
|
|
$(".duration .duration-bar").each(function() {
|
|
|
|
durations.push($(this).find(".duration-value").html());
|
|
|
|
});
|
|
|
|
var max_duration = Math.max(...durations);
|
|
|
|
var width_factor = max_width/max_duration;
|
|
|
|
|
|
|
|
$(".duration .duration-bar").each(function() {
|
|
|
|
var duration = $(this).find(".duration-value").html();
|
|
|
|
$(this).width(duration * width_factor);
|
|
|
|
if($(this).width() < $(this).find(".duration-value").width()) {
|
|
|
|
var html = $($(this).html());
|
|
|
|
html.addClass("duration-bar");
|
|
|
|
html.addClass("bar-outer-text");
|
|
|
|
$(this).find(".duration-value").removeClass("duration-value").addClass("duration-invisible");
|
|
|
|
$(this).closest("td").append(html);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2017-02-10 18:28:39 +05:30
|
|
|
{% endblock %}
|