{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{if $field.isLang}
	<div class="form-group row {if !empty($field.errors)}has-error{/if}">
		<label class="{if isset($product_menu) && $product_menu == 12}col-md-2{else}col-md-3{/if} form-control-label{if $field.required} required{/if}" for="field-{$field.name|escape:'htmlall':'UTF-8'}">
			{$field.label|escape:'htmlall':'UTF-8'}
		</label>

		<div class="{if isset($product_menu) && $product_menu == 12}col-md-8{else}col-md-6{/if} js-input-column">
			{foreach from=$languages item=language}
				<div class="translatable-field lang-{$language.id_lang|intval}">
					{if $field.type === "text_lang"}
						<input type="text" class="form-control" id="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							name="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							value="{if isset($field.value[$language.id_lang])}{$field.value[$language.id_lang]|escape:'htmlall':'UTF-8'}{/if}"
							onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();" onblur="updateLinkRewrite();"
							{if $field.maxLength}maxlength="{$field.maxLength|intval}"{/if} />
					{elseif $field.type === "textarea_lang"}
						<textarea id="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							name="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							class="form-control">{if isset($field.value[$language.id_lang])}{$field.value[$language.id_lang]|escape:'htmlall':'UTF-8'}{/if}</textarea>
					{elseif $field.type === "html_lang"}
						<textarea id="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							name="{$field.name|escape:'htmlall':'UTF-8'}_{$language.id_lang|intval}"
							class="rte form-control">{if isset($field.value[$language.id_lang])}{$field.value[$language.id_lang|intval]|escape:'htmlall':'UTF-8'}{/if}</textarea>
					{/if}
				</div>
			{/foreach}
		</div>

		<div class="{if isset($product_menu) && $product_menu == 12}col-md-2{else}col-md-3{/if}">
			{foreach from=$languages item=language}
				<div class="translatable-field lang-{$language.id_lang|intval}">
					{if $languages|count > 1}
						<button type="button" class="btn btn-primary dropdown-toggle pl-1 pr-1" data-toggle="dropdown" tabindex="-1">
							{$language.iso_code|escape:'htmlall':'UTF-8'}
						</button>
						<ul class="dropdown-menu" role="menu">
							{foreach from=$languages item=language}
								<li>
									<a
										href="javascript:hideOtherLanguage({$language.id_lang|intval});">{$language.name|escape:'htmlall':'UTF-8'}</a>
								</li>
							{/foreach}
						</ul>
					{/if}
				</div>
			{/foreach}
		</div>
	</div>
{else}
	{if $field.type === "image"}
		<div class="form-group row {if !empty($field.errors)}has-error{/if}">
			<label class="col-md-3 form-control-label{if $field.required} required{/if}" for="field-{$field.name|escape:'htmlall':'UTF-8'}">
				{$field.label.show|escape:'htmlall':'UTF-8'}
			</label>

			<div class="col-md-6 js-input-column">
				<img class="form-seller-logo"
					src="{if $field.value}{$field.value|escape:'htmlall':'UTF-8'}{else}{$urls['no_picture_image']['medium']['url']|escape:'htmlall':'UTF-8'}{/if}"
					alt="{$field.label.show|escape:'htmlall':'UTF-8'}" title="{$field.label.show|escape:'htmlall':'UTF-8'}"
					id="seller_{$field.name|escape:'htmlall':'UTF-8'}" name="seller_{$field.name|escape:'htmlall':'UTF-8'}" />
			</div>
		</div>

		<div class="form-group row {if !empty($field.errors)}has-error{/if}">
			<label class="col-md-3 form-control-label{if $field.required} required{/if}" for="field-{$field.name|escape:'htmlall':'UTF-8'}">
				{$field.label.add|escape:'htmlall':'UTF-8'}
			</label>
			<div class="col-md-6 js-input-column">
				<input type="file" name="{$field.name|escape:'htmlall':'UTF-8'}" id="{$field.name|escape:'htmlall':'UTF-8'}" class="form-control"
					accept="image/png, image/gif, image/jpeg" />
			</div>
			<div class="col-md-3 form-control-comment">
				{block name='form_field_comment'}
					{if (!$field.required && !in_array($field.type, ['radio-buttons', 'checkbox']))}
						{l s='Optional' d='Shop.Forms.Labels'}
					{/if}
				{/block}
			</div>
		</div>
	{elseif $field.type === "label"}
		<h3>{$field.value|escape:'htmlall':'UTF-8'}</h3>
	{else}
		<div class="form-group row {if !empty($field.errors)}has-error{/if} form-group-{$field.name|escape:'htmlall':'UTF-8'}">
			<label class="{if isset($field.colClass.label)}{$field.colClass.label|escape:'htmlall':'UTF-8'}{else}col-md-3{/if} form-control-label{if $field.required} required{/if}" for="field-{$field.name|escape:'htmlall':'UTF-8'}">
				{* do not display label for the specific fields *}
				{if in_array($field.name, ['show_price']) == false}
					{$field.label|escape:'htmlall':'UTF-8'}
				{/if}
			</label>

			<div class="{if isset($field.colClass.input)}{$field.colClass.input|escape:'htmlall':'UTF-8'}{else}col-md-6{/if} js-input-column">

				{if $field.type === "textarea"}
					{block name='form_field_textarea'}
						<textarea id="field-{$field.name|escape:'htmlall':'UTF-8'}"
							name="{$field.name|escape:'htmlall':'UTF-8'}"
							class="form-control">{$field.value|escape:'htmlall':'UTF-8'}</textarea>
					{/block}
				{else}
					{block name='form_field_item_other'}
						{if in_array($field.name, ['show_price'])}
							{* start checkbox wrapper *}
							<span class="custom-checkbox">
								<label>
						{/if}
						{if !empty($field.availableValues.group)}
							<div class="input-group">
						{/if}

						{if !empty($field.availableValues.group.before)}
							<span class="input-group-addon">{$field.availableValues.group.before|escape:'htmlall':'UTF-8'}</span>
						{/if}

						<input
							id="field-{$field.name|escape:'htmlall':'UTF-8'}"
							class="form-control"
							name="{$field.name|escape:'htmlall':'UTF-8'}"
							type="{$field.type|escape:'htmlall':'UTF-8'}"
							{if $field.type === 'checkbox'}
								value="1"
								{if $field.value}checked="checked"{/if}
							{else}
								value="{$field.value|escape:'htmlall':'UTF-8'}"
							{/if}
							{if $field.autocomplete}autocomplete="{$field.autocomplete|escape:'htmlall':'UTF-8'}"{/if}
							{if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder|escape:'htmlall':'UTF-8'}"{/if}
							{if $field.maxLength}maxlength="{$field.maxLength|escape:'htmlall':'UTF-8'}"{/if}
							{if $field.required}required{/if}
							{if isset($field.availableValues.otherAttr)}{$field.availableValues.otherAttr|escape:'htmlall':'UTF-8'}{/if}
						>

						{if !empty($field.availableValues.group.after)}
							<span class="input-group-addon">{$field.availableValues.group.after|escape:'htmlall':'UTF-8'}</span>
						{/if}

						{if !empty($field.availableValues.group)}
							</div>
						{/if}

						{if in_array($field.name, ['show_price'])}
							{* END start checkbox wrapper *}
									<span><i class="material-icons rtl-no-flip checkbox-checked"></i></span>
									{$field.label|escape:'htmlall':'UTF-8'}
								</label>
							</span>
						{/if}

						{if isset($field.availableValues.comment)}
							<span class="form-control-comment">
								{$field.availableValues.comment|escape:'htmlall':'UTF-8'}
							</span>
						{/if}
					{/block}
				{/if}
			</div>

			{if !empty($field.isComment) || (isset($field.required) && $field.required == false)}
				<div class="col-md-3 form-control-comment">
					{block name='form_field_comment'}
						{* !$field.required && *}
						{if ( !in_array($field.type, ['radio-buttons', 'checkbox']))}
							{l s='Optional' d='Shop.Forms.Labels'}
						{/if}
					{/block}
				</div>
			{/if}
		</div>
	{/if}
{/if}
