{extends file="admin-layout.tpl"}

{block name="page-title"}{intl l='Store'}{/block}

{block name="check-resource"}admin.configuration.store{/block}
{block name="check-access"}update{/block}

{block name="main-content"}
<div class="variables edit-variable">

    <div id="wrapper" class="container">

        <ul class="breadcrumb">
			<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
            <li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
            <li>{intl l="Store"}</li>
        </ul>

		<div class="row">
			<div class="col-md-12 general-block-decorator">
				<div class="row">

					<div class="col-md-12 title title-without-tabs">
					   {intl l="Store configuration"}
					</div>
                </div>

                <div class="form-container">
                    <div class="row">
                        <div class="col-md-12">
                            {form name='thelia.configuration.store'}
	 						<form method="POST" action="{url path='/admin/configuration/store/save'}">
                                {form_hidden_fields form=$form}

                                {form_field form=$form field='success_url'}
                                    <input type="hidden" name="{$name}" value="{url path='/admin/configuration'}">
                                {/form_field}
                                {include
                                    file = "includes/inner-form-toolbar.html"
                                    hide_flags = true

                                    page_url  = "{url path='/admin/configuration/store'}"
                                    close_url = "{url path='/admin/configuration'}"
                                }
                                <div class="row">
                                    <div class="col-md-6">
                                        <p class="title title-without-tabs">{intl l='General'}</p>

                                        {if $form_error}
                                            <div class="alert alert-danger">{$form_error_message}</div>
                                        {/if}

                                        <fieldset>
                                            {form_field form=$form field='store_name'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>

                                                    <div class="form-group">
                                                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Used in your store front'}">
                                                    </div>
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_business_id'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>

                                                    <div class="form-group">
                                                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Store Business Identification Number (SIRET, etc).'}">
                                                    </div>
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_email'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>

                                                    <div class="form-group">
                                                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Email used when you send an email to your customers (Order confirmations, etc).'}">
                                                    </div>
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_phone'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>

                                                    <div class="form-group">
                                                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Phone number'}">
                                                    </div>
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_fax'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>

                                                    <div class="form-group">
                                                        <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Fax number'}">
                                                    </div>
                                                </div>
                                            {/form_field}
                                        </div>
                                        <div class="col-md-6">

                                            <p class="title title-without-tabs">{intl l="Store address"}</p>

                                            {form_field form=$form field='store_address1'}
                                                <div style="margin-bottom: 5px" class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
                                                    <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Address'}">
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_address2'}
                                                <div style="margin-bottom: 5px" class="form-group">
                                                    <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Additional address'}">
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_address3'}
                                                <div class="form-group">
                                                    <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Additional address'}">
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_zipcode'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if} </label>
                                                    <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Zip code'}">
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_city'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
                                                    <input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='City'}">
                                                </div>
                                            {/form_field}

                                            {form_field form=$form field='store_country'}
                                                <div class="form-group {if $error}has-error{/if}">
                                                    <label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
                                                    <select name="{$name}" id="{$label_attr.for}" class="form-control"{if $required} aria-required="true" required{/if}>
                                                        {loop type="country" name="country1"}
                                                            <option value="{$ID}" {if {$value} == $ID || (empty($value) && $IS_DEFAULT)}selected{/if}>{$TITLE}</option>
                                                        {/loop}
                                                    </select>
                                                </div>
                                            {/form_field}

                                        </fieldset>
                                    </div>
                                </div>

                                {include
                                file = "includes/inner-form-toolbar.html"
                                hide_flags = true

                                page_url  = "{url path='/admin/configuration/store'}"
                                close_url = "{url path='/admin/configuration'}"
                                }

							</form>
							{/form}
						</div>
					</div>
				</div>
			</div>
		</div>
    </div>
</div>
{/block}

{block name="javascript-last-call"}
    {module_include location='config-store-js'}
{/block}
