Merge branch 'master' of git@gitlab.antadis.net:dev-antadis/versionecologique.git

This commit is contained in:
Michael RICOIS 2017-07-04 11:25:14 +02:00
commit f7ba2465bf
7 changed files with 358 additions and 31 deletions

View File

@ -45,7 +45,7 @@
{/foreach}
</div>
{else}
<select id="id_contact" class="custom-input form-control" name="id_contact">
<select id="id_contact" class="custom-input search form-control" name="id_contact">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$contacts item=contact}
<option value="{$contact.id_contact|intval}" {if isset($smarty.request.id_contact) && $smarty.request.id_contact == $contact.id_contact}selected="selected"{/if}>{$contact.name|escape:'html':'UTF-8'}</option>

View File

@ -2414,7 +2414,7 @@ body.content_only { margin: 0 }
}
#product .section-product {
background: url(../img/background-motif-2.png) left top repeat;
padding: 70px 15px;
padding: 70px 15px 150px;
}
#product #image-block {
background: #fff;
@ -2470,7 +2470,7 @@ body.content_only { margin: 0 }
#product .bloc-product-right-configurator { font-family:"RubikRegular"; }
#product .product-configurator { background:#fff; padding:42px 35px; position:relative;}
#product .product-configurator i {
#product .product-configurator i.icon-close {
background: #c6c6c6;
color: #fff;
cursor:pointer;
@ -2479,11 +2479,145 @@ body.content_only { margin: 0 }
right: 0;
top: 0;
}
#product .product-configurator i:hover { background:#818181}
#product .product-configurator i.icon-close:hover { background:#818181}
#product .product-configurator .title-configurator { color:#302698; font-family:"RubikMedium"; font-size:20px; margin-bottom:20px; }
#product .product-configurator .subtitle-configurator{ display:block; font-size:14px; margin-bottom:50px;}
#product .product-configurator .bloc-options { margin-bottom:40px;}
#product .product-configurator [class^="bloc-options-"] { margin-bottom:40px; font-size:12px;}
#product .product-configurator [class^="bloc-options-"] h4 { font-family: "RubikMedium"; font-size:15px; margin-bottom:15px;}
#product .product-configurator [class^="bloc-options-"] li {
background: #333;
border-radius: 100px;
color:#fff;
cursor:pointer;
display: inline-block;
margin-bottom: 5px;
margin-right: 5px;
}
#product .product-configurator [class^="bloc-options-"] li:hover { background:#715bf4;}
#product .product-configurator [class^="bloc-options-"] li > * { cursor:pointer; float:left; }
#product .product-configurator [class^="bloc-options-"] li .custom-checkbox { padding:15px; border-radius: 100px;}
#product .product-configurator [class^="bloc-options-"] li .custom-checkbox:before { content:none;}
#product .product-configurator [class^="bloc-options-"] li .custom-checkbox:after { opacity:0;}
#product .product-configurator [class^="bloc-options-"] li .custom-checkbox input { height:inherit; width:100%; top:0; bottom:0; margin-top:0;}
#product .product-configurator [class^="bloc-options-"] input {}
#product .product-configurator [class^="bloc-options-"] label {}
#product .product-configurator [class^="bloc-options-"] li .custom-checkbox.checked { background:#715bf4;}
#product .product-configurator .bloc-options-FILEVISUEL1 {}
#product .product-configurator .bloc-options-FILEVISUEL1 h4 { display:none;}
#product .product-configurator .bloc-options-FILEVISUEL1 .file-value {
border: 2px solid #ccc;
border-radius: 6px;
display: inline-block;
font-family: "RubikMedium";
font-size: 14px;
margin-right:30px;
padding: 13px 22px;
}
#product .product-configurator .bloc-options-FILEVISUEL1 .file-infos { display:inline-block; font-size:12px; margin-right:30px; }
#product .product-configurator .bloc-options-FILEVISUEL1 .file-infos span { font-size:14px; }
#product .product-configurator .bloc-options-FILEVISUEL1 .file-infos p { margin:0; width:150px; }
#product .product-configurator .bloc-options-FILEVISUEL1 .already-uploaded { font-size:12px; margin-left:20px;}
#product .product-configurator .bloc-options-FILEVISUEL1 .already-uploaded .custom-checkbox:before {
border-color:#ccc;
height:23px;
width:23px;
background-color: #fff;
}
#product .product-configurator .bloc-options-FILEVISUEL1 .already-uploaded .custom-checkbox:after {
color:#333;
margin-top: -7px;
}
#product .product-configurator .bloc-options-FILEVISUEL1 .upload-file {
background: #ccc;
border-radius: 40px;
cursor:pointer;
font-family: "RubikRegular";
font-size: 14px;
padding: 13px 24px;
}
#product .product-configurator .bloc-options-FILEVISUEL1 .upload-file ~ input[type="file"] {display:none;}
#product .product-configurator .bloc-options-FILEVISUEL1 .upload-file i {
color: #333;
font-size: 20px;
margin-left: 15px;
margin-top: -3px;
}
#product .product-configurator .bloc-options-QTY1 {}
#product .product-configurator .bloc-options-QTY1 input {
border: 2px solid #ccc;
border-radius:6px;
font-family:"RubikMedium";
font-size: 14px;
margin-right:10px;
padding: 9px 20px;
width: 80px;
}
#product .product-configurator .bloc-options-QTY1 div { }
#product .product-configurator .bloc-options-QTY1 div span {
display: inline-block;
font-size: 12px;
width: 140px;
}
#product .product-configurator .bloc-options-QTY1 div i {
border:2px solid #ccc;
border-radius:6px;
color:#ccc;
font-size: 21px;
margin-right:10px;
padding: 7px;
}
#product .product-configurator .bloc-options-PRECISION1 { margin-bottom:0}
#product .product-configurator .bloc-options-PRECISION1 textarea {
background:#f2f2f2;
border: 0;
min-height: 80px;
padding: 10px;
resize: none;
width: 100%;
}
#product .product-configurator .steps-devis {
bottom:0;
left:0;
position: absolute;
width: 100%;
}
#product .product-configurator [class^="step-"] { padding:0 3px; position:relative;}
#product .product-configurator [class^="step-"]:first-child { padding-left:0;}
#product .product-configurator [class^="step-"]:last-child { padding-right:0;}
#product .product-configurator .step { background:#715bf4; height:4px; display:block;}
#product .product-configurator .stepCount {
bottom:-20px;
font-size: 11px;
left:50%;
position: absolute;
transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
}
#product .product-configurator .submit-devis {
background:#302698;
border:0;
border-radius:30px;
bottom:-110px;
color:#fff;
cursor:pointer;
font-family:"RubikMedium";
font-size: 16px;
padding:15px 25px;
position:absolute;
right:50px;
}
#product .product-configurator .submit-devis:hover { background:#715bf4;}
#product .bloc-product-right { display:none;}
@ -2620,6 +2754,9 @@ body.content_only { margin: 0 }
#product .devis-button span:last-child a {
padding:15px;
}
#product .product-configurator .bloc-options-FILEVISUEL1 .file-value { padding:13px 12px; margin-right:10px;}
#product .product-configurator .bloc-options-FILEVISUEL1 .file-infos { margin-right:10px;}
#product .product-configurator .bloc-options-FILEVISUEL1 .upload-file { padding: 13px 16px 10px; }
}
@media (max-width: 991px) {

View File

@ -1256,7 +1256,7 @@ body .fancybox-overlay {
margin-bottom: 0;
}
.custom-checkbox:after {
content: "\e914";
content: "\e90b";
cursor: pointer;
display: block;
font-family: 'icomoon';

View File

@ -232,10 +232,142 @@ $(document).ready(function() {
$(".bloc-product-right").css("display","none");
$(".bloc-product-right-configurator").css("display","block");
});
$(".product-configurator i").on("click", function(){
$(".product-configurator .icon-close").on("click", function(){
$(".bloc-product-right-configurator").css("display","none");
$(".bloc-product-right").css("display","block");
});
$(".bloc-options-FILEVISUEL1 .file-value").hide();
$(".configurator-opt-file").change(function(){
if($(".bloc-options-FILEVISUEL1 .file-value").html().length > 0) {
console.log("toto");
$(".bloc-options-FILEVISUEL1 .file-value").show();
$(".bloc-options-FILEVISUEL1 .already-uploaded").hide();
} else {
console.log("tata");
$(".bloc-options-FILEVISUEL1 .file-value").hide();
$(".bloc-options-FILEVISUEL1 .already-uploaded").show();
}
});
/********* CONFIGURATEUR DEVIS ********/
/** Steps **/
var step1 = $("#MARQUAGE1"),
step1Count = $(".steps-devis .step-1 .stepCount"),
step2 = $("#QTY1"),
step2Line = $(".steps-devis .step-2"),
step2Count = $(".steps-devis .step-2 .stepCount"),
step3 = $("#DELAI1"),
step3Line = $(".steps-devis .step-3"),
step3Count = $(".steps-devis .step-3 .stepCount"),
step4 = $("#PRECISION1"),
step4Line = $(".steps-devis .step-4"),
step4Count = $(".steps-devis .step-4 .stepCount"),
btnSubmit = $(".submit-devis");
/** On cache tout par défaut **/
$(step2).hide();
$(step2Line).hide();
$(step2Count).hide();
$(step3).hide();
$(step3Line).hide();
$(step3Count).hide();
$(step4).hide();
$(step4Line).hide();
$(step4Count).hide();
$(btnSubmit).hide();
/** Fonction qui cache tout **/
function hideAll() {
$(step1Count).hide();
$(step2).hide();
$(step2Line).hide();
$(step2Count).hide();
$(step3).hide();
$(step3Line).hide();
$(step3Count).hide();
$(step4).hide();
$(step4Line).hide();
$(step4Count).hide();
$(btnSubmit).hide();
}
/** Vérifications **/
$(step1).find(".custom-checkbox").on("click", function(){
if($(step1).find(".custom-checkbox").hasClass("checked")) {
$(step1Count).hide();
$(step2).show();
$(step2Line).show();
$(step2Count).show();
if(($(step2).find("input").val().length > 0)) {
$(step2Count).hide();
$(step3).show();
$(step3Line).show();
$(step3Count).show();
if($(step3).find(".custom-checkbox").hasClass("checked")) {
$(step3Count).hide();
$(step4).show();
$(step4Line).show();
$(step4Count).show();
$(btnSubmit).show();
}
}
} else {
hideAll();
$(step1Count).show();
}
});
$(step2).find("input").on("input", function(){
if($(this).val().length > 0) {
$(step2Count).hide();
$(step3).show();
$(step3Line).show();
$(step3Count).show();
if($(step3).find(".custom-checkbox").hasClass("checked")) {
$(step3Count).hide();
$(step4).show();
$(step4Line).show();
$(step4Count).show();
$(btnSubmit).show();
}
} else {
if($(step1).find(".custom-checkbox").hasClass("checked")) {
hideAll();
$(step2Count).show();
$(step2Line).show();
$(step2).show();
} else {
hideAll();
$(step1Count).show();
}
}
});
$(step3).find(".custom-checkbox").on("click", function(){
if($(step3).find(".custom-checkbox").hasClass("checked")) {
$(step3Count).hide();
$(step4).show();
$(step4Line).show();
$(step4Count).show();
$(btnSubmit).show();
} else {
$(step3Count).show();
$(step4).hide();
$(step4Line).hide();
$(step4Count).hide();
$(btnSubmit).hide();
}
});
/************ END CONFIGURATEUR *************/
});
function highdpiInit()

View File

@ -6,26 +6,32 @@
{if $optGroupList|@count > 0}
<input type="hidden" name="id_product" value="{$product->id}" />
{foreach item=optGroup from=$optGroupList}
<div id="{$optGroup['reference']}" class="bloc-options">
<div id="{$optGroup['reference']}" class="bloc-options-{$optGroup['reference']}">
<h4>{$optGroup['name']}</h4>
{if $optGroup['type'] == 'text'}
<div class="valign-middle">
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<input type="text" class="configurator-opt"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optImpact['name']}"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder=""
value="{$optValue}"/>
<div class="valign-middle">
<i class="icon icon-plus"></i>
<span>{$optImpact['name']}</span>
</div>
{/foreach}
</div>
{elseif $optGroup['type'] == 'textarea'}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<textarea class="configurator-opt" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
placeholder="{$optImpact['name']}" rows="3" cols="50">
{$optValue}
placeholder="{$optValue}">
</textarea>
{elseif $optGroup['type'] == 'date'}
{assign var="optValue" value=""}
@ -36,43 +42,60 @@
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
value="{if $optValue eq ''}{$smarty.now|date_format:"%d %B %Y"}{else}{$optValue}{/if}" />
{elseif $optGroup['type'] == 'file'}
<input type="file" class="configurator-opt-file" name="files"
data-field="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
data-url="/configurator/upload/{$id_product}/{$optGroup['reference']}"/>
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<span id="response-optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">{$optValue}</span>
<input type="hidden" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" value="{$optValue}"/>
<div class="valign-middle">
{assign var="optValue" value=""}
<span id="response-optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" class="file-value"">{$optValue}</span>
<div class="file-infos">
<span>{$optGroup['name']}</span>
<p>{l s='Formats image : AI, PSD, SVG, EPS, PDF, PNG, JPG.'}</p>
</div>
<span class="upload-file">{l s='Parcourir'}<i class="icon icon-download"></i></span>
<input type="file" class="configurator-opt-file" name="files"
data-field="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
data-url="/configurator/upload/{$id_product}/{$optGroup['reference']}"/>
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<input type="hidden" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" class="blabla" value="{$optValue}"/>
<div class="already-uploaded">
<input type="checkbox" class="custom-input inline" id="visuel-ok">
<label for="visuel-ok">{l s='J\'ai déjà joint mon visuel'}</label>
</div>
</div>
{elseif $optGroup['type'] == 'radio'}
<ul>
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click"
name="optgroup-{$optGroup['id_configurator_opt_group']}"
value="{$optImpact['id_configurator_opt']}"{if in_array($optImpact['id_configurator_opt'], $optValue)} checked{/if}/>
<label>
{$optImpact['name']}
</label>
<li>
<input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click custom-input"
name="optgroup-{$optGroup['id_configurator_opt_group']}"
value="{$optImpact['id_configurator_opt']}"{if in_array($optImpact['id_configurator_opt'], $optValue)} checked{/if}/>
<label>
{$optImpact['name']}
</label>
</li>
{/foreach}
</ul>
{elseif $optGroup['type'] == 'checkbox'}
<ul>
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<li>
<label for="group-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">{$optImpact['name']}</label>
<input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1"
id="group-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
class="configurator-opt-click"
class="configurator-opt-click custom-input"
name="optgroup-{$optGroup['id_configurator_opt_group']}[]"
value="{$optImpact['id_configurator_opt']}"{if in_array($optImpact['id_configurator_opt'], $optValue)} checked{/if}/>
<label for="group-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">
{$optImpact['name']}
</label>
</li>
{/foreach}
</ul>
{elseif $optGroup['type'] == 'select'}
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}

View File

@ -241,7 +241,7 @@
var input_check = $(this).parent().find('input');
if(input_check.attr('checked')){
$(this).removeClass('check');
}else{
} else{
$(this).addClass('check');
}
input_check.trigger("click");

View File

@ -116,7 +116,28 @@
<span class="subtitle-configurator">{l s='Précisez votre demande pour faciliter la création dun devis personnalisé. Vous pouvez faire plusieurs choix pour obtenir un devis à options'}</span>
<form action="">
{hook h='displayProductForm' mod='antadisconfigurator'}
<input type="submit" class="submit-devis" value="{l s='Ajouter à mon devis'}">
</form>
<div class="steps-devis ctn">
<div class="row">
<div class="step-1 md3">
<span class="step"></span>
<span class="stepCount">{l s='Etape 1/4'}</span>
</div>
<div class="step-2 md3">
<span class="step"></span>
<span class="stepCount">{l s='Etape 2/4'}</span>
</div>
<div class="step-3 md3">
<span class="step"></span>
<span class="stepCount">{l s='Etape 3/4'}</span>
</div>
<div class="step-4 md3">
<span class="step"></span>
<span class="stepCount">{l s='Etape 4/4'}</span>
</div>
</div>
</div>
</div>
</div>
@ -342,6 +363,20 @@
mouseDrag: true,
items:3
});
$('.fake_checkbox').on("click", function(){
var input_check = $(this).parent().find('input');
if(input_check.attr('checked')){
$(this).removeClass('check');
} else{
$(this).addClass('check');
}
input_check.trigger("click");
});
$('.upload-file').on("click", function(){
var input_file = $(this).siblings('input[type=file]');
input_file.trigger("click");
});
});
</script>