{*
* 2007-2014 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-2014 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{function switcher_option label = '' tooltip = '' id = '' input_name = '' current_value = '' class = ''}
	<div class="form-group {$class|escape:'html'}">
		<label class="control-label col-lg-6">
			{if $tooltip == ''}
				{$label|escape:'html'}
			{else}
				<span class="label-tooltip" data-toggle="tooltip" title="{$tooltip|escape:'html'}">
					{$label|escape:'html'}
				</span>
			{/if}
		</label>
		<div class=" col-lg-6">		
			<span class="switch prestashop-switch">
				<input type="radio" id="{$id|escape:'html'}" name="{$input_name|escape:'html'}" value="1" {if $current_value} checked="checked"{/if} >
				<label for="{$id|escape:'html'}">
					{l s='Yes' mod='multicarousels'}
				</label>
				<input type="radio" id="{$id|escape:'html'}_0" name="{$input_name|escape:'html'}" value="0" {if !$current_value}checked="checked"{/if} >
				<label for="{$id|escape:'html'}_0">
					{l s='No' mod='multicarousels'}
				</label>
				<a class="slide-button btn"></a>
			</span>
		</div>
	</div>
{/function}

<div class="carousel_item clearfix" data-id="{$carousel.id_carousel|intval}">	
	<div class="carousel_header clearfix">
		<i class="dragger icon icon-arrows-v icon-2x"></i>
		<span class="carousel_name">
			{if isset($carousel.name)}
				{$carousel.name|escape:'html'}
				{if $carousel.group_in_tabs}
					({l s='in tabs' mod='multicarousels'})
				{/if}
			{/if}
		</span>
		<span class="actions pull-right">
			<a class="activateCarousel list-action-enable action-{if $carousel.active == 1}enabled{else}disabled{/if}" href="#" title="{l s='Activate/Deactivate' mod='custombanners'}">
				<i class="icon-check"></i>
				<i class="icon-remove"></i>
			</a>
			<div class="actions btn-group pull-right">
				<button title="{l s='Edit' mod='multicarousels'}" class="editCarousel btn btn-default" data-id="{$carousel.id_carousel|intval}" data-hook="{$carousel.hook_name|escape:'html'}">
					<i class="icon-pencil"></i> {l s='Edit' mod='multicarousels'}
				</button>
				<button title="{l s='Scroll Up' mod='amazzingfilter'}" class="scrollUp btn btn-default">
					<i class="icon icon-minus"></i> {l s='Scroll Up' mod='amazzingfilter'}
				</button>
				<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
					<i class="icon-caret-down"></i>
				</button>
				<ul class="dropdown-menu">			
					<li>
						<a class="deleteCarousel" href="#" onclick="event.preventDefault();">
							<i class="icon icon-trash"></i>
							{l s='Delete' mod='multicarousels'}
						</a>
					</li>			
				</ul>
			</div>
		</span>
	</div>
	{if $full}
		<form method="post" action="" class="form-horizontal" style="display:none;">	
			<div class="ajax_errors alert alert-danger" style="display:none;"></div>			
			<div class="col-lg-4">
				<div class="form-group">
					<label class="control-label col-lg-6" for="carousel_type">
						{l s='Carousel type' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<select name="carousel_type" id="carousel_type">
							{foreach $type_names item=type key=k}
								<option value="{$k|escape:'html'}" {if $carousel.carousel_type == $k}selected="selected{/if}">
									{$type|escape:'html'}
								</option>
							{/foreach}
						</select>
					</div>
				</div>
				<div class="form-group" style="display:none;">
					<label class="control-label col-lg-6" for="filter_feature">
						{l s='Feature to filter by' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<select name="filter_feature" id="filter_feature">
							{foreach $available_features item=feature}
								<option value="{$feature.id_feature|intval}" {if $selected_feature == $feature.id_feature}selected="selected{/if}">{$feature.name|escape:'html'}</option>
							{/foreach}
						</select>
					</div>
				</div>
				<div class="form-group" style="display:none;">
					<label class="control-label col-lg-6" for="cat_ids">
						<span class="label-tooltip" data-toggle="tooltip" title="{l s='Enter category ids, separated by comma (1,2,3 ...)' mod='multicarousels'}">
							{l s='Category ids' mod='multicarousels'}
						</span>
					</label>
					<div class="col-lg-6">
						<input type="text" name="general_settings[cat_ids]" id="cat_ids" value="{if isset($carousel.general_settings.cat_ids)}{$carousel.general_settings.cat_ids|escape:'html'}{/if}">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-lg-6" for="items_in_carousel">
						{l s='Total items in carousel' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<input type="text" name="general_settings[items_in_carousel]" id="items_in_carousel" value="{$carousel.general_settings.items_in_carousel|intval}">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-lg-6" for="visible_cols">
						{l s='Visible columns' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<input type="text" name="owl_settings[i]" id="visible_cols" value="{$carousel.owl_settings.i|intval}">
					</div>
				</div>		
				<div class="form-group">
					<label class="control-label col-lg-6" for="visible_rows">
						{l s='Visible rows' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<input type="text" name="general_settings[rows]" id="visible_rows" value="{$carousel.general_settings.rows|intval}">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-lg-6" for="image_type">
						{l s='Image type' mod='multicarousels'}
					</label>
					<div class="col-lg-6">
						<select name="general_settings[image_type]" id="image_type" class="product_option">
							{foreach $image_types.products item=image_type key=k}
								<option value="{$k|escape:'html'}" {if $carousel.general_settings.image_type == $k}selected="selected{/if}">
									{$image_type|escape:'html'}
								</option>
							{/foreach}
						</select>
						<select name="nosubmit" id="image_type" class="manufacturer_option">
							{foreach $image_types.manufacturers item=image_type key=k}
								<option value="{$k|escape:'html'}" {if $carousel.general_settings.image_type == $k}selected="selected{/if}">
									{$image_type|escape:'html'}
								</option>
							{/foreach}
						</select>			
					</div>		
				</div>
			</div>
			<div class="col-lg-8">
				<div class="form-group">
					<label class="control-label col-lg-3" for="carousel_name">
						{l s='Displayed name' mod='multicarousels'}
					</label>
					<div class="col-lg-8">
						{foreach from=$languages item=lang}
							<input type="text" name="name_multilang[{$lang.id_lang|intval}]" class="multilang lang_{$lang.id_lang|intval}" {if isset($carousel.name_multilang[$lang.id_lang])}value="{$carousel.name_multilang[$lang.id_lang]|escape:'html'}"{else}data-saved="false"{/if} style="{if $lang.id_lang != $id_lang_current}display:none;{/if}"
							/>
						{/foreach}
					</div>
					<div class="col-lg-1 pull-right">
						<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
							{foreach from=$languages item=lang}
								<span class="multilang lang_{$lang.id_lang|intval}" style="{if $lang.id_lang != $id_lang_current}display:none;{/if}">{$lang.iso_code|escape:'html'}</span>
							{/foreach}			
							<span class="caret"></span>
						</button>
						<ul class="dropdown-menu">
							{foreach from=$languages item=lang}
							<li>
								<a href="#" class="lang_switcher" data-id-lang="{$lang.id_lang|intval}" onclick="event.preventDefault();">
									{$lang.name|escape:'html'}
								</a>
							</li>
							{/foreach}
						</ul>
					</div>
				</div>					
			</div>			
			<div class="col-lg-4">
			{switcher_option
					label = {l s='Group in tabs?' mod='multicarousels'}
					tooltip = {l s='If set to YES, carousels will be grouped in tabs, if no, they will be simply displayed one after another' mod='multicarousels'}
					id = 'group_in_tabs'
					input_name = 'group_in_tabs'
					current_value = {$carousel.group_in_tabs|intval}
				}
				{switcher_option
					label = {l s='Display price?' mod='multicarousels'}
					tooltip = ''
					id = 'show_price'
					input_name = 'general_settings[show_price]'
					current_value = {$carousel.general_settings.show_price|intval}
					class = 'product_option'
				}
				{switcher_option
					label = {l s='Display add to cart?' mod='multicarousels'}
					tooltip = ''
					id = 'show_add_to_cart'
					input_name = 'general_settings[show_add_to_cart]'
					current_value = {$carousel.general_settings.show_add_to_cart|intval}
					class = 'product_option'
				}
				{switcher_option
					label = {l s='Display view more?' mod='multicarousels'}
					tooltip = ''
					id = 'show_view_more'
					input_name = 'general_settings[show_view_more]'
					current_value = {$carousel.general_settings.show_view_more|intval}
					class = 'product_option'
				}
			</div>
			<div class="col-lg-4">
				{switcher_option
					label = {l s='Display slickers?' mod='multicarousels'}
					tooltip = ''
					id = 'show_stickers'
					input_name = 'general_settings[show_stickers]'
					current_value = {$carousel.general_settings.show_stickers|intval}
					class = 'product_option'					
				}
				{switcher_option
					label = {l s='Display pagination?' mod='multicarousels'}
					tooltip = ''
					id = 'show_pagination'
					input_name = 'owl_settings[p]'
					current_value = {$carousel.owl_settings.p|intval}		
				}
				{switcher_option
					label={l s='Display navigation?' mod='multicarousels'}
					tooltip=''
					id = 'show_navigation'
					input_name = 'owl_settings[n]'
					current_value = {$carousel.owl_settings.n|intval}
				}
				{switcher_option
					label={l s='Enable autoplay?' mod='multicarousels'}
					tooltip=''
					id = 'autoplay'
					input_name = 'owl_settings[a]'
					current_value = {$carousel.owl_settings.a|intval}
				}
			</div>			
			<div class="form-group col-lg-12">				
				<button id="saveCarousel" class="btn btn-default">
					<i class="process-icon-save"></i>
					{l s='Save' mod='multicarousels'}
				</button>				
			</div>
		</form>
	{/if}
</div>