Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
Ref #23: Create page to display a strip to the public. Unclean at the…
Browse files Browse the repository at this point in the history
… moment, mainly usefull to work on frontend.
  • Loading branch information
hundrex committed Feb 16, 2018
1 parent d210e80 commit b8af80b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
39 changes: 39 additions & 0 deletions app/Resources/views/strip/display.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% extends 'base.html.twig' %}

{% block body %}
<h1>{{ strip.title }}</h1>

<table>
<tbody>
<tr>
{# TODO : do something clean #}
<th>Stripelements</th>
{% for stripElement in strip.stripElements %}
<td>
<img src="{{ app.request.scheme ~ '://' ~ app.request.host ~ ':8000/images/strips/' ~ stripElement }}"/>
</td>
{% endfor %}
</tr>
<tr>
<th>Publicationdate</th>
<td>{% if strip.publicationDate %}{{ strip.publicationDate|date('Y-m-d H:i:s') }}{% endif %}</td>
</tr>
<tr>
<th>Content Warnings</th>
<td>
{% for contentWarning in strip.contentWarnings%}
<a href="{{ path('contentwarning_show', { 'slug': contentWarning.slug }) }}">{{ contentWarning.slug }}</a>
{% endfor %}
</td>
</tr>
<tr>
<th>Author</th>
<td>
{% for account in strip.author%}
<a href="{{ path('acount_show', { 'slug': account.slug }) }}">{{ account.slug }}</a>
{% endfor %}
</td>
</tr>
</tbody>
</table>
{% endblock %}
12 changes: 12 additions & 0 deletions src/AppBundle/Controller/StripController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,17 @@
*/
class StripController extends Controller {

/**
* Finds and displays a strip entity to the public.
*
* @Route("/{id}", name="strip_display")
* @Method("GET")
*/
public function displayStripAction(Request $request, Strip $strip) {

return $this->render('strip/display.html.twig', [
'strip' => $strip,
]);
}

}

0 comments on commit b8af80b

Please sign in to comment.