Commit 37f5ef7a authored by Thomas Löffler's avatar Thomas Löffler

Add new list without pagination, all links and filter

parent ad7152bb
Pipeline #9018 passed with stages
in 5 minutes and 17 seconds
tx_sfeventmgt.templateLayouts {
1 = Latest view
2 = List view, no category selector
3 = List view, nothing more
}
......@@ -2,75 +2,93 @@
<f:layout name="Default" />
<f:section name="main">
<f:if condition="{settings.templateLayout} == 1">
<f:then>
<ul class="list-unstyled event-list listing__group">
<f:for each="{events}" as="event">
<li class="m-3 m-md-4 mx-lg-5 mt-lg-5">
<f:link.action action="detail" arguments="{event : event}" pageUid="{settings.detailPid}" class="media listing__group-item p-sm-2 card-date">
<div class="d-flex mr-sm-4">
<time class="listing__group-item_time" datetime="{event.startdate -> f:format.date(format:'Y-m-d H:i')}">
<span class="listing__group-item_time-day mt-sm-2">{event.startdate -> f:format.date(format:'d')}</span>
<span class="listing__group-item_time-month">{event.startdate -> f:format.date(format:'M')}</span>
<span class="listing__group-item_time-year">{event.startdate -> f:format.date(format:'Y')}</span>
</time>
</div>
<div class="media-body listing__group-item_body">
<h5 class="mb-0 mt-sm-1 mb-sm-3">
<strong>{event.title}</strong>
</h5>
<p class="listing__group-item_body-text">
{event.location.title}<br>{event.location.city}<br>{event.location.country}<i class="fa fa-chevron-right ml-2" aria-hidden="true"></i>
</p>
</div>
</f:link.action>
</li>
</f:for>
</ul>
<f:link.action class="btn btn-primary btn-block py-lg-3 mb-0" pageUid="433" action="list" controller="Event" arguments="{overwriteDemand:{category:settings.category}}">Show more</f:link.action>
</f:then>
<f:else>
<div class="container">
<div class="row">
<div class="{f:if(condition:'{categories -> f:count()} > 1',then:'col-md-8',else:'col-md-12')}">
<div id="accordion" role="tablist" aria-multiselectable="true">
<f:widget.paginate objects="{events}" as="paginatedEvents" configuration="{itemsPerPage: 10, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 10, addQueryStringMethod: 'GET'}">
<f:for each="{paginatedEvents}" as="event">
<f:render partial="Event/ListItem" arguments="{_all}" />
</f:for>
</f:widget.paginate>
</div>
</div>
<f:if condition="{categories -> f:count()} > 1">
<div class="col-md-4">
<f:render section="Filter" arguments="{_all}" />
</div>
</f:if>
<div class="col-md-12">
<f:link.action action="list" controller="Event">
<f:translate key="event.allEvents" />
</f:link.action>
</div>
</div>
</div>
</f:else>
</f:if>
<f:render section="layout{settings.templateLayout}" arguments="{_all}" />
</f:section>
<f:section name="Filter">
<f:if condition="{settings.templateLayout} == '2'">
<f:else>
<form class="event-filter">
<f:form.select class="custom-select" name="event-filter-neu" additionalAttributes="{onchange: 'location = this.value;'}">
<option value="{f:uri.action(action: 'list', controller: 'Event', arguments: '{overwriteDemand:{category: category}}')}"><f:translate key="tx_t3org_layout.events.all_category" extensionName="t3org_layout"/></option>
<f:for each="{categories}" as="category">
<option value="{f:uri.action(action: 'list', controller: 'Event', arguments: '{overwriteDemand:{category: category}}')}" {f:if(condition: '{overwriteDemand.category} == {category.uid}', then: 'class="active" selected="selected"')}>
{category.title}
</option>
</f:for>
</f:form.select>
</form>
</f:else>
</f:if>
<f:if condition="{settings.templateLayout} == '2'">
<f:else>
<form class="event-filter">
<f:form.select class="custom-select" name="event-filter-neu" additionalAttributes="{onchange: 'location = this.value;'}">
<option value="{f:uri.action(action: 'list', controller: 'Event', arguments: '{overwriteDemand:{category: category}}')}">
<f:translate key="tx_t3org_layout.events.all_category" extensionName="t3org_layout" />
</option>
<f:for each="{categories}" as="category">
<option value="{f:uri.action(action: 'list', controller: 'Event', arguments: '{overwriteDemand:{category: category}}')}" {f:if(condition:'{overwriteDemand.category} == {category.uid}', then: 'class="active" selected="selected"')}>
{category.title}
</option>
</f:for>
</f:form.select>
</form>
</f:else>
</f:if>
</f:section>
<f:section name="layout1">
<ul class="list-unstyled event-list listing__group">
<f:for each="{events}" as="event">
<li class="m-3 m-md-4 mx-lg-5 mt-lg-5">
<f:link.action action="detail" arguments="{event : event}" pageUid="{settings.detailPid}" class="media listing__group-item p-sm-2 card-date">
<div class="d-flex mr-sm-4">
<time class="listing__group-item_time" datetime="{event.startdate -> f:format.date(format:'Y-m-d H:i')}">
<span class="listing__group-item_time-day mt-sm-2">{event.startdate -> f:format.date(format:'d')}</span>
<span class="listing__group-item_time-month">{event.startdate -> f:format.date(format:'M')}</span>
<span class="listing__group-item_time-year">{event.startdate -> f:format.date(format:'Y')}</span>
</time>
</div>
<div class="media-body listing__group-item_body">
<h5 class="mb-0 mt-sm-1 mb-sm-3">
<strong>{event.title}</strong>
</h5>
<p class="listing__group-item_body-text">
{event.location.title}<br>{event.location.city}<br>{event.location.country}<i class="fa fa-chevron-right ml-2" aria-hidden="true"></i>
</p>
</div>
</f:link.action>
</li>
</f:for>
</ul>
<f:link.action class="btn btn-primary btn-block py-lg-3 mb-0" pageUid="433" action="list" controller="Event" arguments="{overwriteDemand:{category:settings.category}}">Show more</f:link.action>
</f:section>
<f:section name="layout2">
<div class="container">
<div class="row">
<div class="{f:if(condition:'{categories -> f:count()} > 1',then:'col-md-8',else:'col-md-12')}">
<div id="accordion" role="tablist" aria-multiselectable="true">
<f:widget.paginate objects="{events}" as="paginatedEvents" configuration="{itemsPerPage: 10, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 10, addQueryStringMethod: 'GET'}">
<f:for each="{paginatedEvents}" as="event">
<f:render partial="Event/ListItem" arguments="{_all}" />
</f:for>
</f:widget.paginate>
</div>
</div>
<f:if condition="{categories -> f:count()} > 1">
<div class="col-md-4">
<f:render section="Filter" arguments="{_all}" />
</div>
</f:if>
<div class="col-md-12">
<f:link.action action="list" controller="Event">
<f:translate key="event.allEvents" />
</f:link.action>
</div>
</div>
</div>
</f:section>
<f:section name="layout3">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>{contentObjectData.header}</h2>
<div id="accordion" role="tablist" aria-multiselectable="true">
<f:for each="{events}" as="event">
<f:render partial="Event/ListItem" arguments="{_all}" />
</f:for>
</div>
</div>
</div>
</div>
</f:section>
</html>
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