{% extends 'frontend/base.html.twig' %}
{% block CSS %}
<link rel="preload" href="{{asset('build/admin/user.css')}}" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{asset('build/admin/user.css')}}"></noscript>
{{block('CSS', 'frontend/homepage.html.twig')}}
{% endblock %}
{% block JS %}
<script src="{{ asset('build/admin/user.js') }}"></script>
<script src="{{ asset('build/frontend/cart.js') }}"></script>
{{block('JS', 'frontend/homepage.html.twig')}}
<script>
jQuery(document).ready(function($) {
jQuery( "ul>li" ).click(function() {
var theCity = jQuery(this).html();
var url = "{{ path('companyAssociationList', {'urlName': association})}}/" + theCity;
window.location.href = url;
});
});
</script>
{% endblock %}
{% block title %}{% endblock %}
{% block metaDescription %}{% endblock %}
{% block content %}
<style>
section{margin: 0;}
</style>
{% if logoPage is defined %}
<div class="category row mb-rem">
<section class="category-header">
<div class="category-header-top">
<!-- @todo Change for banner -->
{% set url = path('getImageAsThumb', { 'id': logoPage.id, 'height': '383', 'width':'1920'}) %}
<img class="card-img-top img-fluid full-width" src="{{url}}" alt="" style="">
</div>
</section>
</div>
{% endif %}
<section style="width: 80%;margin-left: auto; margin-right: auto;" class="section-blog-archive">
<!-- Page-Title -->
<div class="row">
<div class="col-12">
{% if inCity == NULL %}
<h2 class="m-t-20 m-b-20 text-center">{% if title is defined %}{{title | upper}}{% else %}Les épiceries{% endif %}</h2>
{% if logoPage is defined or pageText is defined %}
<div class="row">
{% if app.request.attributes and app.request.attributes.get('_route_params')["urlName"] == "UPA_Mangeons_local" %}
<div class="col-xl-2 col-lg-2 col-md-8 col-8 m-lg-0 mx-auto">
<img class="card-img-top img-fluid" src="/image/thumbnail/4356/180/180" alt="" style="margin-left: auto; margin-right: auto;">
</div>
<div class="col-xl-10 col-lg-10 col-md-12 col-12 text-center align-self-center">
{% if pageText is defined %}
{{pageText | raw}}
{% endif %}
</div>
{% else %}
<div class="col-12 text-center">
{% if pageText is defined %}
{{pageText | raw}}
{% endif %}
</div>
{% endif %}
</div>
<br>
{% endif %}
<select id="cities" class="mb-3">
<option value="---">Sélectionnez une municipalité...</option>
{% for city in cities %}
<option value="{{ city|e }}">{{ city|e }}</option>
{% endfor %}
</select>
{% endif %}
<br />
<br />
{% set currentCity = '' %}
{% set cmtp = 0 %}
<div class="card-deck">
{% for c in companies%}
<div class="col-xs-12 col-md-6 col-lg-4">
{# starting the cards #}
<div class="card m-b-20">
<a href="{{path('companyStore', {'urlname': c.urlName, 'id': c.id})}}">
{# <a href="{{path('viewCompanyInGroup', {'urlname': c.urlName, 'id': c.id, 'groupurlname': association}) }}"> #}
{% if c.image %}
{% set url = path('getImageAsThumb', { 'id': c.image.id, 'height': '250', 'width':'350'}) %}
{% else %}
{% set url = "/assets/frontend/images/logo.png" %}
{% endif %}
<div style="height: 370px;display:table-cell; vertical-align:middle; text-align:center; width: 370px;">
<img class="card-img-top img-fluid" src="{{url}}" alt="" style="margin-left: auto; margin-right: auto;">
</div>
{#<img class="card-img-top img-fluid" src="{{path('getImageAsCroppedThumb', {'id': post.image.id, 'height': '250', 'width' : '350'})}}" alt="Card image cap">#}
<div class="card-body">
<h5 class="card-title">{{c.name}}</h5>
{% if c.mainLocation %}
<h5 class="card-title">{{c.mainLocation.region.name }}</h5>
{% endif %}
<p class="card-text">
{{c.description | striptags | slice(0, 350) | raw}}{% if c.description | length > 350 %}...{%endif %}
</p>
<p class="card-text">
<small class="text-muted">Inscrit depuis {{c.dateCreated | date('d/m/Y')}}</small>
</p>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</section>
{% endblock %}