Last active
December 22, 2015 11:09
Revisions
-
baxtheman revised this gist
Sep 6, 2013 . 1 changed file with 53 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,58 +5,94 @@ <#assign namespace = renderResponse.getNamespace() /> <#macro translate key > ${languageUtil.get(pageContext, key)} </#macro> <#-- BODY --> <article class="container-fluid" id="${namespace}${item.itemId}"> <div class="row-fluid"> <#assign imageUrl = oneshopHelper.getIconURL(item,themeDisplay)!"holder.js/300x200/text:missing"> <#assign relatedUrls = oneshopHelper.getRelatedURLs(item,themeDisplay)> <#assign attributes = oneshopHelper.getSimpleAttributes(item)> <#assign addtoCartUrl = oneshopHelper.getAddToCartUrl(currentURL,renderResponse)> <div class="span6"> <a name="thumbnail" class="thumbnail"> <img src="${imageUrl}" class="picture"/> </a> <div class="thumbnails-list clearfix"> <#list relatedUrls as relatedUrl> <div class="span3"> <a href='#thumbnail'> <img src="${relatedUrl}" class="picture thumbnail-small"/> </a> </div> </#list> </div> </div> <div class="span6"> <h1> ${htmlUtil.escape(item.getTitle(locale))} </h1> <p class="muted"> ${htmlUtil.escape(item.getDescription(locale))}<br/> </p> <p> <#if attributes.weight??> <span>${attributes.weight.getTitle(locale)}</span> <strong>${oneshopHelper.getAttributeValue(item,attributes.weight,locale)}</strong> </#if> </p> <hr/> <@aui.form action="${addtoCartUrl}" name="fm${item.itemId}" method="post"> <div class="input-append"> <input type="hidden" name="${namespace}itemId" value="${item.itemId}" /> <span class="label label-success span4"> <p class="lead"> € ${item.getPriceUnit(locale)!"--"} </p> </span> <select name="${namespace}quantity" class="offset1 input-small"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> <button class="btn" type="submit"> <i class="icon-plus-sign"></i> <span class=""> <@translate key="add-to-cart" /> </span> </button> </div> </@> </div> </div> </article> <@aui.script use="aui-base"> <#-- <script> --> var bigThumbnail = A.one('#${namespace}${item.itemId} .thumbnail img'); @@ -69,12 +105,12 @@ event.currentTarget.setAttribute('src', oldSrc); bigThumbnail.setAttribute('src', newSrc); }, '.thumbnail-small' ); <#-- </script> --> </@> -
baxtheman created this gist
Sep 6, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,80 @@ <#-- DECLARATIONS --> <#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> <#assign aui = taglibLiferayHash["/WEB-INF/tld/aui.tld"] /> <#assign namespace = renderResponse.getNamespace() /> <#-- BODY --> <article class="container-fluid" id="${namespace}${item.itemId}"> <div class="row-fluid"> <#assign imageUrl = oneshopHelper.getIconURL(item,themeDisplay)!"holder.js/300x200/text:missing"> <#assign relatedUrls = oneshopHelper.getRelatedURLs(item,themeDisplay)> <#assign attributes = oneshopHelper.getSimpleAttributes(item)> <div class="span6"> <div class="thumbnail"> <img src="${imageUrl}" class="picture"/> </div> <div class="thumbnails-list"> <#list relatedUrls as relatedUrl> <div class="span3"> <img src="${relatedUrl}" class="picture thumbnail-small"/> </div> </#list> </div> </div> <div class="span6"> <h1> ${htmlUtil.escape(item.getTitle(locale))} </h1> <span class="lead badge badge-success">€ ${item.getPriceUnit(locale)!"--"}</span> <p class="muted"> ${htmlUtil.escape(item.getDescription(locale))}<br/> </p> <p> <#if attributes.weight??> <span>${attributes.weight.getTitle(locale)}</span> <strong>${oneshopHelper.getAttributeValue(item,attributes.weight,locale)}</strong> </#if> </p> </div> </div> </article> <script> //<@aui["script"] use="aui-base"> var bigThumbnail = A.one('#${namespace}${item.itemId} .thumbnail img'); A.one('#${namespace}${item.itemId} .thumbnails-list').delegate( 'click', function (event) { var newSrc = event.currentTarget.getAttribute('src'); var oldSrc = bigThumbnail.getAttribute('src'); event.currentTarget.setAttribute('src', oldSrc); bigThumbnail.setAttribute('src', newSrc); }, '.thumbnail-small' ); //</@> </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ <#-- DECLARATIONS --> <#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> <#-- BODY --> <ul class="thumbnails"> <#list entries as entry> <#assign fullUrl = oneshopHelper.getItemFullViewUrl(entry, renderRequest, renderResponse)> <#assign imageUrl = oneshopHelper.getIconURL(entry,themeDisplay)!"holder.js/300x200/text:missing"> <#assign attributes = oneshopHelper.getSimpleAttributes(entry)> <li class="span4"> <div class="thumbnail"> <a href="${fullUrl}"> <img src="${imageUrl}" /> </a> <h3> ${htmlUtil.escape(entry.getTitle(locale))} </h3> <span class="lead badge badge-success">€ ${entry.getPriceUnit(locale)!"--"}</span> <p class="muted"> ${htmlUtil.escape(entry.getDescription(locale))}<br/> </p> <p> <#if attributes.weight??> <span>${attributes.weight.getTitle(locale)}</span> <#assign value = oneshopHelper.getAttributeValue(entry,attributes.weight,locale)> <strong>${value}</strong> </#if> </p> <a href="${fullUrl}"> <@liferay.language key="read-more" /> </a> </div> </li> </#list> </ul>