/
home
/
obinna
/
html
/
mixchief_app
/
var
/
cache
/
dev
/
twig
/
a0
/
Upload File
HOME
<?php use Twig\Environment; use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Extension\SandboxExtension; use Twig\Markup; use Twig\Sandbox\SecurityError; use Twig\Sandbox\SecurityNotAllowedTagError; use Twig\Sandbox\SecurityNotAllowedFilterError; use Twig\Sandbox\SecurityNotAllowedFunctionError; use Twig\Source; use Twig\Template; /* Inventory/edititem.html.twig */ class __TwigTemplate_9b8639b30e5749234ab1783a4aa198062be5ed95e249e4035fd65982bc3a682a extends Template { private $source; private $macros = []; public function __construct(Environment $env) { parent::__construct($env); $this->source = $this->getSourceContext(); $this->blocks = [ 'content' => [$this, 'block_content'], 'javascripts' => [$this, 'block_javascripts'], ]; } protected function doGetParent(array $context) { // line 1 return "base1.html.twig"; } protected function doDisplay(array $context, array $blocks = []) { $macros = $this->macros; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"]; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Inventory/edititem.html.twig")); $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Inventory/edititem.html.twig")); $this->parent = $this->loadTemplate("base1.html.twig", "Inventory/edititem.html.twig", 1); $this->parent->display($context, array_merge($this->blocks, $blocks)); $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof); $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof); } // line 3 public function block_content($context, array $blocks = []) { $macros = $this->macros; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"]; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content")); $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content")); // line 4 echo "\t<div class=\"content\"> \t\t<div class=\"card\"> \t\t\t<div class=\"card-body\"> \t\t\t\t<form action=\""; // line 7 echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("editItem"); echo "\" method=\"POST\" name=\"edit\" enctype=\"multipart/form-data\"> \t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\""; // line 8 echo twig_escape_filter($this->env, (isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (function () { throw new RuntimeError('Variable "id" does not exist.', 8, $this->source); })()), "html", null, true); echo "\"> \t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"name\" class=\"form-control\" placeholder=\"Item Name\" value=\""; // line 12 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "name", [], "any", true, true, false, 12)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "name", [], "any", false, false, false, 12), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"selling\" class=\"form-control\" placeholder=\"Price\" value=\""; // line 15 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "sellingPrice", [], "any", true, true, false, 15)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "sellingPrice", [], "any", false, false, false, 15), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"description\" class=\"form-control\" placeholder=\"Description\" value=\""; // line 18 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "description", [], "any", true, true, false, 18)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "description", [], "any", false, false, false, 18), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<select class=\"form-control ajaxSelect\" name=\"category\"> \t\t\t\t\t\t\t\t\t<option value=\"-1\">Select Category</option> \t\t\t\t\t\t\t\t\t"; // line 24 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 24, $this->source); })())); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 25 echo "\t\t\t\t\t\t\t\t\t\t<option value=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 25), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_upper_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 25)), "html", null, true); echo "</option> \t\t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 27 echo "\t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<!-- image input --> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"file\" name=\"image\" class=\"form-control\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t \t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t<h3>Item Parts</h3> \t\t\t\t\t\t\t<table class=\"table\"> \t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t<th>Name</th> \t\t\t\t\t\t\t\t\t<th>Portions</th> \t\t\t\t\t\t\t\t\t<th>Delete</th> \t\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t\t\t"; // line 44 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["itempart"]) || array_key_exists("itempart", $context) ? $context["itempart"] : (function () { throw new RuntimeError('Variable "itempart" does not exist.', 44, $this->source); })())); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 45 echo "\t\t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t\t<td>"; // line 46 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 46), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td>"; // line 47 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "portions", [], "any", false, false, false, 47), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td><a href=\""; // line 48 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("removeStockItem", ["id" => twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 48)]), "html", null, true); echo "\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></a></td> \t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t \t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 51 echo "\t\t\t\t\t\t\t</table> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t \t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t<h4>Add Item Parts <small>(Optional)</small></h4> \t\t\t\t\t\t<div id=\"stockitems\"> \t\t\t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t\t\t<select class=\"form-control select-list ajaxSelect\" name=\"stock[]\"> \t\t\t\t\t\t\t\t\t\t\t<option value=\"\">Select Inventory Item</option> \t\t\t\t\t\t\t\t\t\t\t"; // line 63 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["stock"]) || array_key_exists("stock", $context) ? $context["stock"] : (function () { throw new RuntimeError('Variable "stock" does not exist.', 63, $this->source); })())); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 64 echo "\t\t\t\t\t\t\t\t\t\t\t\t<option value=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 64), "html", null, true); echo "|"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "unit", [], "any", false, false, false, 64), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_upper_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 64)), "html", null, true); echo "</option> \t\t\t\t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 66 echo "\t\t\t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\"> \t\t\t\t\t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<button type=\"button\" class=\"btn btn-warning pull-right\" id=\"add-item\">+</button> \t\t\t\t\t</div> \t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Save\" class=\"btn btn-primary\"> \t\t\t\t</form> \t\t\t\t \t\t\t</div> \t\t</div> \t</div> "; $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof); $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof); } // line 90 public function block_javascripts($context, array $blocks = []) { $macros = $this->macros; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"]; $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts")); $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts")); // line 91 echo "\t"; $this->displayParentBlock("javascripts", $context, $blocks); echo " \t<script src=\""; // line 92 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("js/itemselect.js"), "html", null, true); echo "\"></script> \t<script> \t\t// var units = { \t\t// kg: ['kg', 'g'], \t\t// g: 'g', \t\t// l: ['cl', 'ml'], \t\t// cl: ['cl', 'ml'], \t\t// ml: 'ml', \t\t// cups: 'cups', \t\t// bags: 'bags', \t\t// packets: 'packets', \t\t// dozen: ['dozen', 'piece'], \t\t// sachet: 'sachet' \t\t// } \t\tvar cat = \""; // line 108 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "cId", [], "any", true, true, false, 108)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "cId", [], "any", false, false, false, 108), "")) : ("")), "html", null, true); echo "\"; \t\tif(cat) { \t\t\tdocument.forms.edit.category.value = cat; \t\t} \t\t\$('#stockitems').on('change', '.select-list', function(e){ \t\t\tvar \$target = \$(e.currentTarget) \t\t\tconsole.log(\$target.val()) \t\t\tvar split = \$target.val().split(\"|\") \t\t\tvar unit = split[1]; \t\t\t\$target.closest('.row').find('.input-group-text').html(unit); \t\t}) \t\tvar itemRow = (items) => ` \t\t\t<div class=\"row\"> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\${selectTemplate(items)} \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\" required> \t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-1 cancel-button\" style=\"display: flex;\"> \t\t\t\t\t<button style=\"margin:auto;\" type=\"button\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></button> \t\t\t\t</div> \t\t\t</div> \t\t`; \t\t\$('#stockitems').on('click', '.cancel-button', function(e){ \t\t\te.preventDefault(); \t\t\tconst \$target = \$(e.currentTarget) \t\t\tconst parent = \$target.closest('.row').remove() \t\t\t\$('#stockitems .row').last().find('.cancel-button').show() \t\t}); \t</script> "; $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof); $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof); } public function getTemplateName() { return "Inventory/edititem.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 261 => 108, 242 => 92, 237 => 91, 227 => 90, 195 => 66, 182 => 64, 178 => 63, 164 => 51, 155 => 48, 151 => 47, 147 => 46, 144 => 45, 140 => 44, 121 => 27, 110 => 25, 106 => 24, 97 => 18, 91 => 15, 85 => 12, 78 => 8, 74 => 7, 69 => 4, 59 => 3, 36 => 1,); } public function getSourceContext() { return new Source("{% extends 'base1.html.twig' %} {% block content %} \t<div class=\"content\"> \t\t<div class=\"card\"> \t\t\t<div class=\"card-body\"> \t\t\t\t<form action=\"{{ path('editItem') }}\" method=\"POST\" name=\"edit\" enctype=\"multipart/form-data\"> \t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{{ id }}\"> \t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"name\" class=\"form-control\" placeholder=\"Item Name\" value=\"{{ item.name |default('') }}\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"selling\" class=\"form-control\" placeholder=\"Price\" value=\"{{ item.sellingPrice |default('') }}\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"description\" class=\"form-control\" placeholder=\"Description\" value=\"{{ item.description |default('') }}\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<select class=\"form-control ajaxSelect\" name=\"category\"> \t\t\t\t\t\t\t\t\t<option value=\"-1\">Select Category</option> \t\t\t\t\t\t\t\t\t{% for item in category %} \t\t\t\t\t\t\t\t\t\t<option value=\"{{ item.id }}\">{{ item.name|upper }}</option> \t\t\t\t\t\t\t\t\t{% endfor %} \t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<!-- image input --> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"file\" name=\"image\" class=\"form-control\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t \t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t<h3>Item Parts</h3> \t\t\t\t\t\t\t<table class=\"table\"> \t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t<th>Name</th> \t\t\t\t\t\t\t\t\t<th>Portions</th> \t\t\t\t\t\t\t\t\t<th>Delete</th> \t\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t\t\t{% for item in itempart %} \t\t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t\t<td>{{ item.name }}</td> \t\t\t\t\t\t\t\t\t\t<td>{{ item.portions }}</td> \t\t\t\t\t\t\t\t\t\t<td><a href=\"{{ path('removeStockItem', {'id': item.id}) }}\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></a></td> \t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t \t\t\t\t\t\t\t\t{% endfor %} \t\t\t\t\t\t\t</table> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t \t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t<h4>Add Item Parts <small>(Optional)</small></h4> \t\t\t\t\t\t<div id=\"stockitems\"> \t\t\t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t\t\t<select class=\"form-control select-list ajaxSelect\" name=\"stock[]\"> \t\t\t\t\t\t\t\t\t\t\t<option value=\"\">Select Inventory Item</option> \t\t\t\t\t\t\t\t\t\t\t{% for item in stock %} \t\t\t\t\t\t\t\t\t\t\t\t<option value=\"{{ item.id }}|{{ item.unit }}\">{{ item.name|upper }}</option> \t\t\t\t\t\t\t\t\t\t\t{% endfor %} \t\t\t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\"> \t\t\t\t\t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<button type=\"button\" class=\"btn btn-warning pull-right\" id=\"add-item\">+</button> \t\t\t\t\t</div> \t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Save\" class=\"btn btn-primary\"> \t\t\t\t</form> \t\t\t\t \t\t\t</div> \t\t</div> \t</div> {% endblock %} {% block javascripts %} \t{{ parent() }} \t<script src=\"{{ asset('js/itemselect.js') }}\"></script> \t<script> \t\t// var units = { \t\t// kg: ['kg', 'g'], \t\t// g: 'g', \t\t// l: ['cl', 'ml'], \t\t// cl: ['cl', 'ml'], \t\t// ml: 'ml', \t\t// cups: 'cups', \t\t// bags: 'bags', \t\t// packets: 'packets', \t\t// dozen: ['dozen', 'piece'], \t\t// sachet: 'sachet' \t\t// } \t\tvar cat = \"{{ item.cId|default('') }}\"; \t\tif(cat) { \t\t\tdocument.forms.edit.category.value = cat; \t\t} \t\t\$('#stockitems').on('change', '.select-list', function(e){ \t\t\tvar \$target = \$(e.currentTarget) \t\t\tconsole.log(\$target.val()) \t\t\tvar split = \$target.val().split(\"|\") \t\t\tvar unit = split[1]; \t\t\t\$target.closest('.row').find('.input-group-text').html(unit); \t\t}) \t\tvar itemRow = (items) => ` \t\t\t<div class=\"row\"> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\${selectTemplate(items)} \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\" required> \t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-1 cancel-button\" style=\"display: flex;\"> \t\t\t\t\t<button style=\"margin:auto;\" type=\"button\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></button> \t\t\t\t</div> \t\t\t</div> \t\t`; \t\t\$('#stockitems').on('click', '.cancel-button', function(e){ \t\t\te.preventDefault(); \t\t\tconst \$target = \$(e.currentTarget) \t\t\tconst parent = \$target.closest('.row').remove() \t\t\t\$('#stockitems .row').last().find('.cancel-button').show() \t\t}); \t</script> {% endblock %}", "Inventory/edititem.html.twig", "/var/www/html/mixchief_app/templates/Inventory/edititem.html.twig"); } }