Commit 03313596 authored by Bert Leunis's avatar Bert Leunis

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

parent 206036e9
......@@ -6,24 +6,26 @@
<@hst.setBundle basename="essentials.blog"/>
<#if pageable??>
<div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><@fmt.message key="blog.moreby" var="moreby"/>${moreby?html}&nbsp;${author.fullName?html}</h3>
<h3 class="panel-title"><@fmt.message key="blog.moreby" var="moreby"/>${moreby?html}&nbsp;${author.fullName?html}</h3>
</div>
<#if pageable?? && (pageable.total > 0)>
<div class="panel-body">
<#list pageable.items as item>
<@hst.link hippobean=item var="link"/>
<p><a href="${link}">${item.title?html}</a></p>
</#list>
</div>
<div class="panel-body">
<#list pageable.items as item>
<@hst.link hippobean=item var="link"/>
<p><a href="${link}">${item.title?html}</a></p>
</#list>
</div>
<#else>
<div class="panel-body">
<p><@fmt.message key="blog.notfound" var="notfound"/>${notfound?html}</p>
</div>
<div class="panel-body">
<p><@fmt.message key="blog.notfound" var="notfound"/>${notfound?html}</p>
</div>
</#if>
</div>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/blogposts-by-author.png'/>"> Click to edit Blogposts by Author
</div>
</#if>
......@@ -4,50 +4,52 @@
<#-- @ftlvariable name="facetLimit" type="java.lang.Integer" -->
<#-- @ftlvariable name="query" type="java.lang.String" -->
<@hst.setBundle basename="essentials.facets"/>
<form action="<@hst.link />" method="get">
<div class="row form-group">
<div class="col-xs-8">
<@fmt.message key='facets.placeholder' var="placeholder"/>
<#if query??>
<input type="search" value="${query?html}" name="query" class="form-control" placeholder="${placeholder?html}">
<#else>
<input type="search" value="" name="query" class="form-control" placeholder="${placeholder?html}">
</#if>
</div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary pull-right"><@fmt.message key='facets.searchbutton' var="button"/>${button?html}</button>
<div>
<form action="<@hst.link />" method="get">
<div class="row form-group">
<div class="col-xs-8">
<@fmt.message key='facets.placeholder' var="placeholder"/>
<#if query??>
<input type="search" value="${query?html}" name="query" class="form-control" placeholder="${placeholder?html}">
<#else>
<input type="search" value="" name="query" class="form-control" placeholder="${placeholder?html}">
</#if>
</div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary pull-right"><@fmt.message key='facets.searchbutton' var="button"/>${button?html}</button>
</div>
</div>
</div>
</form>
<#if facets??>
<#assign facetLimit = 50>
</form>
<#if facets??>
<#assign facetLimit = 50>
<ul class="nav nav-list">
<#list facets.folders as facetvalue>
<#if facetvalue.folders?? && (facetvalue.folders?size > 0)>
<li><label class="nav-header">${facetvalue.name?html}</label>
<ul class="nav nav-list">
<#list facetvalue.folders as item>
<#if (item.leaf?? && item.leaf && (item.count > 0))>
<@hst.facetnavigationlink current=facets remove=item var="removeLink"/>
<li class="active">
<a href="${removeLink}">${item.name?html}&nbsp;
<span class="alert-danger"><@fmt.message key='facets.remove' var="remove"/>${remove?html}</span>
</a>
</li>
<#else>
<@hst.link var="link" hippobean=item navigationStateful=true/>
<li <#if (item_index >= facetLimit)>class="extra"</#if>>
<a href="${link}">${item.name?html}&nbsp;<span>(${item.count})</span></a>
</li>
</#if>
</#list>
</ul>
</li>
</#if>
</#list>
</ul>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/facets.png'/>"> Click to edit Facets
</#if>
\ No newline at end of file
<ul class="nav nav-list">
<#list facets.folders as facetvalue>
<#if facetvalue.folders?? && (facetvalue.folders?size > 0)>
<li><label class="nav-header">${facetvalue.name?html}</label>
<ul class="nav nav-list">
<#list facetvalue.folders as item>
<#if (item.leaf?? && item.leaf && (item.count > 0))>
<@hst.facetnavigationlink current=facets remove=item var="removeLink"/>
<li class="active">
<a href="${removeLink}">${item.name?html}&nbsp;
<span class="alert-danger"><@fmt.message key='facets.remove' var="remove"/>${remove?html}</span>
</a>
</li>
<#else>
<@hst.link var="link" hippobean=item navigationStateful=true/>
<li <#if (item_index >= facetLimit)>class="extra"</#if>>
<a href="${link}">${item.name?html}&nbsp;<span>(${item.count})</span></a>
</li>
</#if>
</#list>
</ul>
</li>
</#if>
</#list>
</ul>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/facets.png'/>"> Click to edit Facets
</#if>
</div>
\ No newline at end of file
......@@ -2,29 +2,33 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable?has_content>
<div>
<#list pageable.items as item>
<div class="media has-edit-button">
<@hst.cmseditlink hippobean=item/>
<div class="media-body">
<h4 class="media-heading">
<@hst.link var="link" hippobean=item />
<a href="${link}">${item.title?html}</a>
<#if item.publicationDate??>
<span class="label label-success pull-right">
<@fmt.formatDate value=item.publicationDate.time type="both" dateStyle="medium" timeStyle="short"/>
</span>
</#if>
</h4>
<#if item.introduction??>
<p>${item.introduction?html}</p>
</#if>
</div>
<div class="media has-edit-button">
<@hst.cmseditlink hippobean=item/>
<div class="media-body">
<h4 class="media-heading">
<@hst.link var="link" hippobean=item />
<a href="${link}">${item.title?html}</a>
<#if item.publicationDate??>
<span class="label label-success pull-right">
<@fmt.formatDate value=item.publicationDate.time type="both" dateStyle="medium" timeStyle="short"/>
</span>
</#if>
</h4>
<#if item.introduction??>
<p>${item.introduction?html}</p>
</#if>
</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>
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/blog-list.png'/>"> Click to edit Blog List
</div>
</#if>
\ No newline at end of file
......@@ -2,23 +2,25 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable??>
<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.publicationDate?? && item.publicationDate.time??>
<p><@fmt.formatDate value=item.publicationDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=item.publicationDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<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>
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/blog-list.png'/>"> Click to edit Blog List
</div>
</#if>
\ No newline at end of file
......@@ -30,5 +30,7 @@
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and requestScope.pageable eq null}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/blogposts-by-author.png'/>"> Click to edit Blogposts by Author
<div>
<img src="<hst:link path='/images/essentials/catalog-component-icons/blogposts-by-author.png'/>"> Click to edit Blogposts by Author
</div>
</c:if>
......@@ -4,52 +4,54 @@
<%--@elvariable id="facetLimit" type="java.lang.Integer"--%>
<%--@elvariable id="query" type="java.lang.String"--%>
<hst:setBundle basename="essentials.facets"/>
<form action="<hst:link />" method="get">
<div class="row form-group">
<div class="col-xs-8">
<fmt:message key='facets.placeholder' var="placeholder"/>
<input type="search" value="<c:out value='${requestScope.query}'/>" name="query" class="form-control"
placeholder="${fn:escapeXml(placeholder)}">
<div>
<form action="<hst:link />" method="get">
<div class="row form-group">
<div class="col-xs-8">
<fmt:message key='facets.placeholder' var="placeholder"/>
<input type="search" value="<c:out value='${requestScope.query}'/>" name="query" class="form-control"
placeholder="${fn:escapeXml(placeholder)}">
</div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary pull-right">
<fmt:message key='facets.searchbutton' var="button"/><c:out value="${button}"/>
</button>
</div>
</div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary pull-right">
<fmt:message key='facets.searchbutton' var="button"/><c:out value="${button}"/>
</button>
</div>
</div>
</form>
<c:if test="${requestScope.facets ne null}">
<c:set var="facetLimit" value="50"/>
<ul class="nav nav-list">
<c:forEach var="facetvalue" items="${requestScope.facets.folders}">
<c:if test="${not empty facetvalue.folders}">
<li><label class="nav-header"><c:out value="${facetvalue.name}"/></label>
<ul class="nav nav-list">
<c:forEach items="${facetvalue.folders}" var="item" varStatus="index">
<c:choose>
<c:when test="${item.leaf and item.count gt 0}">
<hst:facetnavigationlink remove="${item}" current="${requestScope.facets}" var="removeLink"/>
<li class="active">
<a href="${removeLink}"><c:out value="${item.name}"/>&nbsp;
<span class="alert-danger"><fmt:message key='facets.remove' var="remove"/><c:out value="${remove}"/></span>
</a>
</li>
</c:when>
<c:otherwise>
<hst:link var="link" hippobean="${item}" navigationStateful="true"/>
<li <c:if test="${index.count > facetLimit}">class="extra"</c:if>>
<a href="${link}"><c:out value="${item.name}"/>&nbsp;<span>(${item.count})</span></a>
</li>
</c:otherwise>
</c:choose>
</c:forEach>
</ul>
</li>
</c:if>
</c:forEach>
</ul>
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and requestScope.facets eq null}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/facets.png'/>"> Click to edit Facets
</c:if>
</form>
<c:if test="${requestScope.facets ne null}">
<c:set var="facetLimit" value="50"/>
<ul class="nav nav-list">
<c:forEach var="facetvalue" items="${requestScope.facets.folders}">
<c:if test="${not empty facetvalue.folders}">
<li><label class="nav-header"><c:out value="${facetvalue.name}"/></label>
<ul class="nav nav-list">
<c:forEach items="${facetvalue.folders}" var="item" varStatus="index">
<c:choose>
<c:when test="${item.leaf and item.count gt 0}">
<hst:facetnavigationlink remove="${item}" current="${requestScope.facets}" var="removeLink"/>
<li class="active">
<a href="${removeLink}"><c:out value="${item.name}"/>&nbsp;
<span class="alert-danger"><fmt:message key='facets.remove' var="remove"/><c:out value="${remove}"/></span>
</a>
</li>
</c:when>
<c:otherwise>
<hst:link var="link" hippobean="${item}" navigationStateful="true"/>
<li <c:if test="${index.count > facetLimit}">class="extra"</c:if>>
<a href="${link}"><c:out value="${item.name}"/>&nbsp;<span>(${item.count})</span></a>
</li>
</c:otherwise>
</c:choose>
</c:forEach>
</ul>
</li>
</c:if>
</c:forEach>
</ul>
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and requestScope.facets eq null}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/facets.png'/>"> Click to edit Facets
</c:if>
</div>
......@@ -3,24 +3,28 @@
<%--@elvariable id="item" type="{{beansPackage}}.Blogpost"--%>
<%--@elvariable id="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable"--%>
<c:if test="${requestScope.pageable ne null}">
<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, 'publicationDate.time')}">
<p>
<fmt:formatDate value="${item.publicationDate.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<p><c:out value="${item.introduction}"/></p>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</c:if>
<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, 'publicationDate.time')}">
<p>
<fmt:formatDate value="${item.publicationDate.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<p><c:out value="${item.introduction}"/></p>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</c:if>
</div>
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and requestScope.pageable eq null}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/blog-list.png'/>"> Click to edit Blog List
<div>
<img src="<hst:link path='/images/essentials/catalog-component-icons/blog-list.png'/>"> Click to edit Blog List
</div>
</c:if>
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