]> Raphaƫl G. Git Repositories - blogbundle/blob - Resources/views/keyword/read.html.twig
Add keyword controller with index and view member functions
[blogbundle] / Resources / views / keyword / read.html.twig
1 {% extends 'RapsysBlogBundle::body.html.twig' %}
2 {% block blog_title %}<h1><a href="{{ path('homepage') }}">{% trans %}Dev log{% endtrans %}</a></h1>{% endblock %}
3 {% block blog_subtitle %}<h2><a href="{{ path('keywords') }}">{% trans %}Keywords list{% endtrans %}</a></h2>{% endblock %}
4 {% block content %}
5 {% if keyword is defined and keyword %}
6 <article id="keyword">
7 <header>
8 <h3><a href="{{ path('keywords_keyword', {'_keyword': keyword.slug}) }}">{{keyword.title}}</a></h3>
9 <p>
10 <span>{% trans with {'%date%': keyword.created|localizeddate('full', 'short')} %}Published the %date%{% endtrans %}{% if keyword.created != keyword.updated %}{% trans with {'%date%': keyword.updated|localizeddate('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %}</span>
11 </p>
12 </header>
13 <p>{{ keyword.description }}</p>
14 {% if keyword.articles %}
15 <p style="margin-bottom: 0">{% transchoice keyword.articles|length %}{1} Article:|]1,Inf[ Articles:{% endtranschoice %}</p>
16 <nav>
17 <ul>
18 {% for slug, article in keyword.articles %}
19 <li><a href="{{ path('articles_article', {'_article': slug}) }}">{{ article }}</a></li>
20 {% endfor %}
21 </ul>
22 </nav>
23 {% endif %}
24 </article>
25 {% endif %}
26 {% endblock %}
27 {% block alternate %}
28 <link rel="alternate" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" hreflang="{{ app.request.locale }}"/>
29 {% for locale, slug in keyword.slugs %}
30 <link rel="alternate" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all|merge({'_locale': locale, '_keyword': slug}))) }}" hreflang="{{ locale }}"/>
31 {% endfor %}
32 {% endblock %}
33 {% block footer_nav %}
34 <nav>
35 {% for locale, slug in keyword.slugs %}
36 <a href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all|merge({'_locale': locale, '_keyword': slug}))) }}">{{ ('Display in ' ~ locale)|trans }}</a>
37 {% endfor %}
38 </nav>
39 {% endblock %}