Commit 1e8a2417 authored by Mat's avatar Mat

page dump, tableau de la table Image

parent ee93d4ae
......@@ -18,6 +18,15 @@ class GalleryController extends Controller
));
}
public function dumpAction()
{
$tableau = $this->getDoctrine()->getRepository('TechnoBundle:Image')->findAll();
return $this->render('@Techno/Default/dump.html.twig', array(
'tableau' => $tableau,
'date' => date('Y')
));
}
public function imageAction($id)
{
$image = $this->getDoctrine()->getRepository('TechnoBundle:Image')->find($id);
......
......@@ -14,6 +14,10 @@ techno_authors:
path: /gallery/authors
defaults: { _controller: TechnoBundle:Gallery:authors }
techno_dump:
path: /gallery/dump
defaults: { _controller: TechnoBundle:Gallery:dump }
techno_image:
path: /gallery/{id}
defaults: { _controller: TechnoBundle:Gallery:image }
{% extends '@Techno/base.html.twig' %}
{% block title %}
Table Image
{% endblock %}
{% block body %}
{{ block('breadcrumb') }}
<h1>{{ block('title') }}</h1>
<table>
<thead>
<td>#ID</td>
<td>Path</td>
<td>Name</td>
<td>Legend</td>
<td>CreatedAt</td>
<td>ModifyAt</td>
<td>Owner</td>
</thead>
{% for image in tableau %}
<tr class="{{ cycle(['even', 'odd'], loop.index) }}">
<td><a href="{{ path('techno_gallery') }}/{{ image.id }}">
{{ image.id }}</a></td>
<td>{{ image.path }}</td>
<td>{{ image.name }}</td>
<td>{{ image.legend }}</td>
<td>{{ image.createdAt.format('d/m/Y') }}</td>
<td>{{ image.modifyAt.format('d/m/Y') }}</td>
<td>{{ image.getOwner().Firstname }} {{ image.getOwner().Lastname }}</td>
</a>
</tr>
{% endfor %}
</table>
{% endblock %}
......@@ -60,6 +60,12 @@
<i class="fas fa-users"></i> Les auteurs
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_dump' ? 'active' }}">
<a href="{{ path('techno_dump') }}">
<i class="fas fa-table"></i> Table Image
</a>
</li>
<li><a href=""><i class="fas fa-images"></i> Page 1</a></li>
<li><a href=""><i class="fas fa-images"></i> Page 2</a></li>
<li><a href=""><i class="fas fa-images"></i> Page 3</a></li>
......
......@@ -150,8 +150,23 @@ div.cadre img {
color: grey;
}
td { padding: 0.5em; }
tr.even { background-color: #ececec; }
table {
border: 1px solid #d2d2d2;
width: 100%;
}
table td {
padding: 0.5em;
}
table thead tr {
background-color: #ececec;
font-weight: bold;
}
table tbody tr.odd {
background-color: white;
}
table tbody tr.even {
background-color: #ececec;
}
/*
* Exceptions
......
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