2012-07-31 07:52:24 +00:00
|
|
|
{# vim: ft=htmljinja
|
|
|
|
#}
|
2012-08-15 10:31:02 +00:00
|
|
|
{% extends 'KekRozsakFrontBundle:Default:main_template.html.twig' %}
|
2012-08-23 14:56:26 +00:00
|
|
|
{% form_theme newTopicGroupForm 'KekRozsakFrontBundle:Form:user_form.html.twig' %}
|
|
|
|
|
2012-07-03 12:11:18 +00:00
|
|
|
{% block title %} - Fórum{% endblock %}
|
2012-08-23 14:56:26 +00:00
|
|
|
|
2012-07-03 12:11:18 +00:00
|
|
|
{% block content %}
|
|
|
|
<h3>Fórum</h3>
|
2012-08-23 14:56:26 +00:00
|
|
|
{% if is_granted('ROLE_ADMIN') %}
|
|
|
|
<span class="gomb" id="new-topic-group-button">[Új témakör]</span><br />
|
|
|
|
<div id="new-topic-group">
|
|
|
|
{# TODO: make this an AJAX form #}
|
|
|
|
<form method="post" action="{{ path('KekRozsakFrontBundle_forumTopicGroupList') }}">
|
|
|
|
<table>
|
|
|
|
{{ form_widget(newTopicGroupForm) }}
|
|
|
|
</table>
|
|
|
|
<button type="submit">Mentés</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{#
|
|
|
|
{% else %}
|
|
|
|
<span class="gomb">[Új témakör kérése]</span>
|
|
|
|
#}
|
|
|
|
{% endif %}
|
2012-07-03 12:11:18 +00:00
|
|
|
{% for topicGroup in topicGroups %}
|
2012-07-07 10:12:33 +00:00
|
|
|
<table class="forum-lista">
|
2012-08-16 13:52:41 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td colspan="2"><a href="{{ path('KekRozsakFrontBundle_forumTopicList', {slug: topicGroup.slug}) }}">{{ topicGroup.title }}</a></td>
|
|
|
|
<td>Hozzászólások száma</td>
|
|
|
|
<td>Utolsó hozzászólás</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2012-07-03 12:11:18 +00:00
|
|
|
{% if topicGroup.topics|length > 0 %}
|
|
|
|
{% for topic in topicGroup.topics %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
|
2012-08-25 15:03:08 +00:00
|
|
|
<td>
|
|
|
|
[ikon]
|
|
|
|
{% if app.user.userData and app.user.userData.isFavouriteForumTopic(topic) %}
|
2012-08-25 15:32:14 +00:00
|
|
|
<span class="unfavourite-topic-button topicgroup-{{ topic.topicGroup.slug }}" id="unfavourite-topic-button-{{ topic.slug }}"><img src="{{ asset('bundles/kekrozsakfront/images/penta-yellow-24.png') }}" alt="[Kedvenc]" /></span>
|
2012-08-25 15:03:08 +00:00
|
|
|
{% else %}
|
2012-08-25 15:32:14 +00:00
|
|
|
<span class="favourite-topic-button topicgroup-{{ topic.topicGroup.slug }}" id="favourite-topic-button-{{ topic.slug }}"><img src="{{ asset('bundles/kekrozsakfront/images/penta-blue-24.png') }}" alt="[Nem kedvenc]" /></span>
|
2012-08-25 15:03:08 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
2012-08-16 13:52:41 +00:00
|
|
|
<td><a href="{{ path('KekRozsakFrontBundle_forumPostList', {topicGroupSlug: topicGroup.slug, topicSlug: topic.slug}) }}">{{ topic.title }}</a></td>
|
|
|
|
<td></td>
|
|
|
|
<td>
|
2012-07-17 08:22:41 +00:00
|
|
|
{% if topic.lastPost %}
|
2012-08-16 13:52:41 +00:00
|
|
|
{{ topic.lastPost.createdBy|userdataspan }}<br />
|
|
|
|
{{ topic.lastPost.createdAt|date('Y-m-d H:i') }}
|
2012-07-17 08:22:41 +00:00
|
|
|
{% else %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<br />
|
2012-07-17 08:22:41 +00:00
|
|
|
{% endif %}
|
2012-08-16 13:52:41 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2012-07-03 12:11:18 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<tr>
|
|
|
|
<td colspan="4">Ebben a kategóriában nincsenek témák</td>
|
|
|
|
</tr>
|
2012-07-03 12:11:18 +00:00
|
|
|
{% endif %}
|
2012-08-16 13:52:41 +00:00
|
|
|
</tbody>
|
2012-07-03 12:11:18 +00:00
|
|
|
</table>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock content %}
|
2012-08-23 14:56:26 +00:00
|
|
|
|
|
|
|
{% block bottomscripts %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#new-topic-group-button').click(function() {
|
|
|
|
alert('Juj!');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock bottomscripts %}
|