This is an automated email from the ASF dual-hosted git repository. dklco pushed a commit to branch SLING-8913-multiple-instance-types in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit dbccacc4a0fb25dc8eacb00aff64c506fcf3b75b Author: Dan Klco <[email protected]> AuthorDate: Fri Aug 28 08:35:30 2020 -0400 Fixing double click not firing --- .../components/cms/contentgrid/contentgrid.jsp | 167 ++++++++++----------- 1 file changed, 80 insertions(+), 87 deletions(-) diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentgrid/contentgrid.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentgrid/contentgrid.jsp index 8b2d6a8..f0d3fe7 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentgrid/contentgrid.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentgrid/contentgrid.jsp @@ -28,97 +28,90 @@ </c:forEach> <c:if test="${showCard}"> <div class="tile is-parent is-3 contentnav__item"> - <sling:getResource base="${resource}" path="types/${child.valueMap['jcr:primaryType']}/columns/name" var="nameConfig" /> - <c:choose> - <c:when test="${not empty child.valueMap['jcr:content/jcr:title']}"> - <c:set var="title" value="${child.valueMap['jcr:content/jcr:title']}" /> - </c:when> - <c:when test="${not empty child.valueMap['jcr:title']}"> - <c:set var="title" value="${child.valueMap['jcr:title']}" /> - </c:when> - <c:otherwise> - <c:set var="title" value="${child.name}" /> - </c:otherwise> - </c:choose> - <div class="tile is-child"> - <div class="card is-linked" title="${sling:encode(child.name,'HTML_ATTR')}" data-value="${child.path}"> - <div class="card-image"> - <figure class="image is-5by4"> - <c:choose> - <c:when test="${child.resourceType == 'sling:File' || child.resourceType == 'nt:file'}"> - <img src="${child.path}.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> - </c:when> - <c:when test="${child.resourceType == 'sling:Site'}"> - <img src="/static/sling-cms/thumbnails/site.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> - </c:when> - <c:when test="${child.resourceType == 'sling:OrderedFolder' || child.resourceType == 'sling:Folder' || child.resourceType == 'nt:folder'}"> - <img src="/static/sling-cms/thumbnails/folder.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> - </c:when> - <c:when test="${child.resourceType == 'sling:Page'}"> - <c:set var="templateThumbnail" value="${child.valueMap['jcr:content/sling:template']}/thumbnail"/> - <c:choose> - <c:when test="${sling:getResource(resourceResolver, templateThumbnail) != null}"> - <img src="${templateThumbnail}.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> - </c:when> - <c:otherwise> - <img src="/static/sling-cms/thumbnails/page.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> - </c:otherwise> - </c:choose> - </c:when> - <c:otherwise> - <img src="/static/sling-cms/thumbnails/file.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> - </c:otherwise> - </c:choose> - </figure> - <div class="is-vhidden cell-actions"> - <sling:getResource base="${resource}" path="types/${child.valueMap['jcr:primaryType']}/columns/actions" var="colConfig" /> - <c:forEach var="ac" items="${sling:listChildren(colConfig)}"> - <c:set var="actionConfig" value="${ac}" scope="request" /> - <sling:include path="${child.path}" resourceType="${actionConfig.resourceType}" /> - </c:forEach> - </div> + <sling:getResource base="${resource}" path="types/${child.valueMap['jcr:primaryType']}/columns/name" var="nameConfig" /> + <c:choose> + <c:when test="${not empty child.valueMap['jcr:content/jcr:title']}"> + <c:set var="title" value="${child.valueMap['jcr:content/jcr:title']}" /> + </c:when> + <c:when test="${not empty child.valueMap['jcr:title']}"> + <c:set var="title" value="${child.valueMap['jcr:title']}" /> + </c:when> + <c:otherwise> + <c:set var="title" value="${child.name}" /> + </c:otherwise> + </c:choose> + <div class="tile is-child"> + <div class="card is-linked" title="${sling:encode(child.name,'HTML_ATTR')}" data-value="${child.path}"> + <div class="card-image"> + <figure class="image is-5by4"> + <c:choose> + <c:when test="${child.resourceType == 'sling:File' || child.resourceType == 'nt:file'}"> + <img src="${child.path}.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> + </c:when> + <c:when test="${child.resourceType == 'sling:Site'}"> + <img src="/static/sling-cms/thumbnails/site.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> + </c:when> + <c:when test="${child.resourceType == 'sling:OrderedFolder' || child.resourceType == 'sling:Folder' || child.resourceType == 'nt:folder'}"> + <img src="/static/sling-cms/thumbnails/folder.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> + </c:when> + <c:when test="${child.resourceType == 'sling:Page'}"> + <c:set var="templateThumbnail" value="${child.valueMap['jcr:content/sling:template']}/thumbnail"/> + <c:choose> + <c:when test="${sling:getResource(resourceResolver, templateThumbnail) != null}"> + <img src="${templateThumbnail}.transform/sling-cms-thumbnail.png" loading="lazy" alt="${sling:encode(child.name, 'HTML_ATTR')}"> + </c:when> + <c:otherwise> + <img src="/static/sling-cms/thumbnails/page.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <img src="/static/sling-cms/thumbnails/file.png.transform/sling-cms-thumbnail.png" loading="lazy" alt="${child.name}"> + </c:otherwise> + </c:choose> + </figure> + <div class="is-vhidden cell-actions"> + <sling:getResource base="${resource}" path="types/${child.valueMap['jcr:primaryType']}/columns/actions" var="colConfig" /> + <c:forEach var="ac" items="${sling:listChildren(colConfig)}"> + <c:set var="actionConfig" value="${ac}" scope="request" /> + <sling:include path="${child.path}" resourceType="${actionConfig.resourceType}" /> + </c:forEach> </div> - <footer class="card-footer"> - <div class="card-footer-item card-footer-group"> - <c:choose> - <c:when test="${child.resourceType == 'sling:Site' || child.resourceType == 'sling:OrderedFolder' || child.resourceType == 'sling:Folder' || child.resourceType == 'nt:folder' || child.resourceType == 'sling:Page'}"> - <a href="${nameConfig.valueMap.prefix}${child.path}" class="item-link">${sling:encode(title,'HTML')}</a> - </c:when> - <c:otherwise> - <span>${sling:encode(title,'HTML')}</span> - </c:otherwise> - </c:choose> - <c:catch var="ex"> - <small> - <fmt:formatDate type="both" dateStyle="long" timeStyle="long" value = "${child.valueMap['jcr:content/jcr:lastModified'].time}" /> - </small> - </c:catch> - </div> - </footer> - <footer class="card-footer"> - <sling:adaptTo adaptable="${child}" adaptTo="org.apache.sling.cms.PublishableResource" var="publishableResource" /> - <c:if test="${child.resourceType == 'sling:Page' || child.resourceType == 'sling:File' || child.resourceType == 'nt:file'}"> - <c:choose> - <c:when test="${publishableResource.published}"> - <a class="Fetch-Modal card-footer-item" href="/cms/shared/unpublish.html${child.path}" title="Content Published" data-title="Unpublish" data-path=".Main-Content form"> - Unpublish - </a> - </c:when> - <c:otherwise> - <a class="Fetch-Modal card-footer-item" href="/cms/shared/publish.html${child.path}" title="Content Not Published" data-title="Publish" data-path=".Main-Content form"> - Publish - </a> - </c:otherwise> - </c:choose> - </c:if> - <c:if test="${child.resourceType == 'sling:Site' || child.resourceType == 'sling:OrderedFolder' || child.resourceType == 'sling:Folder' || child.resourceType == 'nt:folder' || child.resourceType == 'sling:Page'}"> - <a href="${nameConfig.valueMap.prefix}${child.path}" class="card-footer-item">Open</a> - </c:if> - </footer> </div> + <footer class="card-footer"> + <div class="card-footer-item card-footer-group"> + <span>${sling:encode(title,'HTML')}</span> + <c:catch var="ex"> + <small> + <fmt:formatDate type="both" dateStyle="long" timeStyle="long" value = "${child.valueMap['jcr:content/jcr:lastModified'].time}" /> + </small> + </c:catch> + </div> + </footer> + <footer class="card-footer"> + <sling:adaptTo adaptable="${child}" adaptTo="org.apache.sling.cms.PublishableResource" var="publishableResource" /> + <c:if test="${child.resourceType == 'sling:Page' || child.resourceType == 'sling:File' || child.resourceType == 'nt:file'}"> + <c:choose> + <c:when test="${publishableResource.published}"> + <a class="Fetch-Modal card-footer-item" href="/cms/shared/unpublish.html${child.path}" title="Content Published" data-title="Unpublish" data-path=".Main-Content form"> + Unpublish + </a> + </c:when> + <c:otherwise> + <a class="Fetch-Modal card-footer-item" href="/cms/shared/publish.html${child.path}" title="Content Not Published" data-title="Publish" data-path=".Main-Content form"> + Publish + </a> + </c:otherwise> + </c:choose> + </c:if> + <c:if test="${child.resourceType == 'sling:Site' || child.resourceType == 'sling:OrderedFolder' || child.resourceType == 'sling:Folder' || child.resourceType == 'nt:folder' || child.resourceType == 'sling:Page'}"> + <a href="${nameConfig.valueMap.prefix}${child.path}" class="card-footer-item item-link">Open</a> + </c:if> + </footer> </div> </div> - </c:if> + </div> + </c:if> </c:forEach> </div> </div>
