Commit 8ef8640a authored by Bert Leunis's avatar Bert Leunis

ESSENTIALS-1033 change markup of event templates so the result is always a single dom element

parent 03313596
......@@ -3,41 +3,43 @@
<#-- @ftlvariable name="item" type="{{beansPackage}}.EventsDocument" -->
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<div>
<#list pageable.items as item>
<@hst.link var="link" hippobean=item />
<div class="media">
<div class="media-left" style="float: left">
<a href="${link}">
<#if item.image?? && item.image.thumbnail??>
<@hst.link var="img" hippobean=item.image.thumbnail/>
<img src="${img}" title="${item.image.fileName?html}" alt="${item.image.fileName?html}"/>
</#if>
</a>
</div>
<div class="media-body">
<h4 class="media-heading"><a href="${link}">${item.title?html}</a>
<span class="label label-warning pull-right">
<#if item.date?? && item.endDate.time??>
<@fmt.formatDate value=item.endDate.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
<span class="label label-success pull-right">
<#if item.date?? && item.date.time??>
<@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
</h4>
<p>${item.introduction?html}</p>
</div>
<@hst.link var="link" hippobean=item />
<div class="media">
<div class="media-left" style="float: left">
<a href="${link}">
<#if item.image?? && item.image.thumbnail??>
<@hst.link var="img" hippobean=item.image.thumbnail/>
<img src="${img}" title="${item.image.fileName?html}" alt="${item.image.fileName?html}"/>
</#if>
</a>
</div>
<div class="media-body">
<h4 class="media-heading"><a href="${link}">${item.title?html}</a>
<span class="label label-warning pull-right">
<#if item.date?? && item.endDate.time??>
<@fmt.formatDate value=item.endDate.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
<span class="label label-success pull-right">
<#if item.date?? && item.date.time??>
<@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
</h4>
<p>${item.introduction?html}</p>
</div>
</div>
</#list>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
<#include "../../include/pagination.ftl">
</#if>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
</div>
</#if>
......@@ -3,26 +3,30 @@
<#-- @ftlvariable name="item" type="{{beansPackage}}.EventsDocument" -->
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<div>
<#list pageable.items as item>
<@hst.link var="link" hippobean=item />
<article class="has-edit-button">
<@hst.link var="link" hippobean=item />
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<h3><a href="${link}">${item.title?html}</a></h3>
<#if item.date?? && item.date.time??>
<p><@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<#if item.enddate?? && item.endDate.time??>
<p><@fmt.formatDate value=item.endDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=item.endDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<p>${item.location?html}</p>
<p>${item.introduction?html}</p>
</article>
</article>
</#list>
<#if cparam.showPagination>
<#include "../include/pagination.ftl">
<#include "../include/pagination.ftl">
</#if>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
</div>
</#if>
......@@ -2,29 +2,34 @@
<%--@elvariable name="item" type="{{beansPackage}}.EventsDocument"--%>
<%--@elvariable id="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable"--%>
<c:forEach var="item" items="${requestScope.pageable.items}" varStatus="status">
<hst:link var="link" hippobean="${item}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${item.title}"/></a></h3>
<c:if test="${hst:isReadable(item, 'date.time')}">
<p>
<fmt:formatDate value="${item.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<c:if test="${hst:isReadable(item, 'enddate.time')}">
<p>
<fmt:formatDate value="${item.enddate.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
<c:if test="${requestScope.pageable ne null && requestScope.pageable.total gt 0}">
<div>
<c:forEach var="item" items="${requestScope.pageable.items}" varStatus="status">
<hst:link var="link" hippobean="${item}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${item.title}"/></a></h3>
<c:if test="${hst:isReadable(item, 'date.time')}">
<p>
<fmt:formatDate value="${item.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<c:if test="${hst:isReadable(item, 'enddate.time')}">
<p>
<fmt:formatDate value="${item.enddate.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<p><c:out value="${item.location}"/></p>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</c:if>
<p><c:out value="${item.location}"/></p>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</div>
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and empty requestScope.pageable}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
<div>
<img src="<hst:link path='/images/essentials/catalog-component-icons/events-list.png'/>"> Click to edit Event List
</div>
</c:if>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment