Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions templates/web/pages/product/product_page.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,31 @@ <h2 class="title-1" property="food:name" itemprop="name">[% title %]</h1>
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="[% IF code.length == 13 %]EAN13[% ELSIF code.length == 8 %]EAN8[% ELSE %]CODE128[% END %]"
jsbarcode-value="[% code %]"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="[% code %]" datatype="xsd:string"></div>
[% ELSE %]
[%# put in DOM for folksonomy %]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Only-Product – Nutell
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="0200000000235"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="0200000000235" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Only-Product – Nutell
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="0200000000235"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="0200000000235" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Tarte aux pommes et aux
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000002"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000002" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Tarte aux pommes et aux
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000002"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000002" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Apple pie – Bob's pie
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000001"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000001" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Apple pie – Bob's pie
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000001"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000001" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Apple pie – Bob's pie
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000001"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000001" datatype="xsd:string"></div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,31 @@ <h2 class="title-1" property="food:name" itemprop="name">Apple pie – Bob's pie
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-format="EAN13"
jsbarcode-value="3300000000001"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<script>
if (screen && screen.width >= 600) {
var barcodeSvg = document.getElementById("barcode_svg");
try {
JsBarcode(barcodeSvg).init();
}
catch (e) {
// JsBarcode refuses to render EAN13/EAN8 values with an invalid
// check digit (internal codes assigned by assign_new_code(), typos...),
// fall back to CODE128 so that the barcode is still displayed.
JsBarcode(barcodeSvg, barcodeSvg.getAttribute("jsbarcode-value"), {
format: "CODE128",
displayValue: false,
height: 40
});
}
}
</script>
<div property="gr:hasEAN_UCC-13" content="3300000000001" datatype="xsd:string"></div>


Expand Down
Loading