<% logic = tplData.items.logic; var mainVersionId = logic.getMainVersionId(); var carData = logic.getCarData(); var gtm = tplData.items.gtm; var labels = tplData.items.viewElements; var pluginId = tplData.items.pluginId; var expandOpened = tplData.items.expandOpened; var equipmentOrSpec = tplData.items.eqOrSpec || 'equipment'; var versionCount = tplData.items.car[equipmentOrSpec].versions.length; var isOneVersion = versionCount === 1 ? true : false; var isEq = function() { return equipmentOrSpec === 'equipment' }; var getCarVersionObj = logic.getCarVersionObj; var selectedCarsArr = tplData.items.selectedCarsId; var optionLabel = logic.getOptionLabel(); var versions = tplData.items.car[equipmentOrSpec].versions; var mainVersion = selectedCarsArr.length > 0 ? getCarVersionObj(selectedCarsArr[0]) : ""; var accordeonTag = tplData.items.viewElements.accordeonTag %>
", "hide": "<%= labels.showDetailsLabel.replace(/\'/g, ''').replace(/\"/g, '\\"') %>" } }'> <% if (!isOneVersion) { %>
<% } %>
style="display: none; <% } %>"> <% if (versions.length > 1) { %>
<%= labels.compareTitle %> <% %> <%= labels.modelName%>

<%= labels.compareDescription %>

<% for (var i=0, selectedCarsArrLen=selectedCarsArr.length; i < selectedCarsArrLen+1; i++) { var colClass = i === 2 ? "hidden-xs" : ''; %> <% if (i == 3 || (i==2 && versions.length == 2)) { break; }%>
<% if (!_.isUndefined(selectedCarsArr[i])) { %>
<% if (currentCar.startingPrice) { %> <%= labels.startingPriceLabel %> <%=currentCar.startingPrice%>

<%=currentCar.priceCaption%>

<% } %>
alt="">
<% } %>
<% } %>
<% } %>
<% var eqSpecElements = tplData.items.targetSpecificViewElements; var eqSpecDiff = equipmentOrSpec == 'equipment' ? 0 : 1; var optionGroups = tplData.items.car[equipmentOrSpec].optionGroups; var openedAccordionItemsArr = tplData.items.openedAccordionItemsArr[equipmentOrSpec]; var accordionFirstBarOpened = tplData.items.accordionFirstBarOpened; %>
<%= labels.dropdownTitle %>
<% if (versions.length > 1 && optionGroups.length > 0 && selectedCarsArr.length > 1) { %> ", "diff" : "<%= eqSpecElements[0].showDifferencesInTargetLabel.replace(/\'/g, ''').replace(/\"/g, '\\"') %>" }, "specifications" : { "show" : "<%= eqSpecElements[1].showAllTargetLabel.replace(/\'/g, ''').replace(/\"/g, '\\"') %>", "diff" : "<%= eqSpecElements[1].showDifferencesInTargetLabel.replace(/\'/g, ''').replace(/\"/g, '\\"') %>" } }' > <%= eqSpecElements[eqSpecDiff].showDifferencesInTargetLabel %> <% } %>
<% if (equipmentOrSpec === 'equipment') { %>
  • <%= labels.includedOptionLabel %>
  • <%= labels.notAvailableOptionLabel %>
<% } %>
<% var setActive = logic.setActive; %> <% _.each(optionGroups, function(optionGroup, index){ var checkActive = setActive(optionGroup.id); %>
<<%= accordeonTag %> class="headline headline--c154"><%= optionGroup.name %>>
<% for (var j = 0, optionArr = optionGroup.option, optionArrLen = optionArr.length; j < optionArrLen; j++) { %>
<% var currentOptionObj = optionArr[j]; %> <%= currentOptionObj.Name %>
<% if (!_.isUndefined(selectedCarsArr[0])) { %> <% for (var k = 0, firstValue; k < 3; k++) { %>
<% var optValueObj = (function(VersionIndex){ var textValue = '', icoValue = '', spanClass = '', optionObj = {}; if (_.isUndefined(selectedCarsArr[k])) { optionObj.Value = ''; spanClass = 'visibility-hidden'; return {textValue : textValue, icoValue : icoValue, spanClass : spanClass} } else { optionObj = logic.getOptionObj(currentOptionObj.Values, k); if (k === 0) {firstValue = optionObj.Value} } if (isEq()) { switch(optionObj.Value) { case "null": case null: case "0": icoValue = ''; spanClass = ''; break; case '2': icoValue = ''; spanClass = ''; break; case '1': textValue = optionLabel.label; break; default: textValue = optionObj.Value } } else { textValue = optionObj.Value; } if (optionObj.Value === firstValue && k == 1) { spanClass+= ' first-as-first'; } else if (k == 2) { spanClass+= optionObj.Value === firstValue ? ' second-as-first' : ' different-as-first'; } return {textValue : textValue, icoValue : icoValue, spanClass : spanClass} })(); %> <%= optValueObj.textValue %>
<% } %> <% } %>
<% } %>
<% }); %>