Added very-very basic forum functionality
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
KekRozsak\FrontBundle\Entity\ForumTopic:
|
||||
type: entity
|
||||
table: forum_topics
|
||||
id:
|
||||
id:
|
||||
type: integer
|
||||
generator:
|
||||
strategy: AUTO
|
||||
fields:
|
||||
title:
|
||||
type: string(100)
|
||||
nullable: false
|
||||
slug:
|
||||
type: string(100)
|
||||
nullable: false
|
||||
unique: true
|
||||
created_at:
|
||||
type: datetime
|
||||
nullable: false
|
||||
updated_at:
|
||||
type: datetime
|
||||
nullable: true
|
||||
update_reason:
|
||||
type: text
|
||||
nullable: true
|
||||
manyToOne:
|
||||
created_by:
|
||||
targetEntity: User
|
||||
inversedBy: articles
|
||||
nullable: false
|
||||
updated_by:
|
||||
targetEntity: User
|
||||
nullable: true
|
||||
default: null
|
||||
topic_group:
|
||||
targetEntity: ForumTopicGroup
|
||||
inversedBy: topics
|
||||
nullable: false
|
||||
uniqueConstraint:
|
||||
uniqueSlugByGroup:
|
||||
columns: [ topic_group, slug ]
|
@@ -0,0 +1,38 @@
|
||||
KekRozsak\FrontBundle\Entity\ForumTopicGroup:
|
||||
type: entity
|
||||
table: forum_topic_groups
|
||||
id:
|
||||
id:
|
||||
type: integer
|
||||
generator:
|
||||
strategy: AUTO
|
||||
fields:
|
||||
title:
|
||||
type: string(100)
|
||||
nullable: false
|
||||
slug:
|
||||
type: string(100)
|
||||
nullable: false
|
||||
unique: true
|
||||
created_at:
|
||||
type: datetime
|
||||
nullable: false
|
||||
updated_at:
|
||||
type: datetime
|
||||
nullable: true
|
||||
update_reason:
|
||||
type: text
|
||||
nullable: true
|
||||
manyToOne:
|
||||
created_by:
|
||||
targetEntity: User
|
||||
inversedBy: articles
|
||||
nullable: false
|
||||
updated_by:
|
||||
targetEntity: User
|
||||
nullable: true
|
||||
default: null
|
||||
oneToMany:
|
||||
topics:
|
||||
targetEntity: ForumTopic
|
||||
mappedBy: topic_group
|
@@ -11,4 +11,14 @@ KekRozsakFrontBundle_article:
|
||||
KekRozsakFrontBundle_forum_main:
|
||||
pattern: /forum
|
||||
defaults:
|
||||
_controller: KekRozsakFrontBundle:Default:forumMain
|
||||
_controller: KekRozsakFrontBundle:Forum:main
|
||||
|
||||
KekRozsakFrontBundle_forum_topic_list:
|
||||
pattern: /forum/{topicGroupSlug}
|
||||
defaults:
|
||||
_controller: KekRozsakFrontBundle:Forum:topicList
|
||||
|
||||
KekRozsakFrontBundle_forum_post_list:
|
||||
pattern: /forum/{topicGroupSlug}/{topicSlug}
|
||||
defaults:
|
||||
_controller: KekRozsakFrontBundle:Forum:postList
|
||||
|
@@ -0,0 +1,5 @@
|
||||
{% extends '::main_template.html.twig' %}
|
||||
{% block title %} - Fórum - {{ topicGroup.title }} - {{ topic.title }}{% endblock %}
|
||||
{% block content %}
|
||||
<h3>Fórum - {{ topicGroup.title }} - {{ topic.title }}</h3>
|
||||
{% endblock %}
|
@@ -0,0 +1,29 @@
|
||||
{% extends '::main_template.html.twig' %}
|
||||
{% block title %} - Fórum{% endblock %}
|
||||
{% block content %}
|
||||
<h3>Fórum</h3>
|
||||
{% for topicGroup in topicGroups %}
|
||||
<table id="temakor-lista">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><a href="{{ path('KekRozsakFrontBundle_forum_topic_list', {topicGroupSlug: topicGroup.slug}) }}">{{ topicGroup.title }}</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if topicGroup.topics|length > 0 %}
|
||||
{% for topic in topicGroup.topics %}
|
||||
<tr>
|
||||
<td><a href="{{ path('KekRozsakFrontBundle_forum_post_list', {topicGroupSlug: topicGroup.slug, topicSlug: topic.slug}) }}">{{ topic.title }}</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2">Ebben a kategóriában nincsenek témák</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endfor %}
|
||||
{% endblock content %}
|
@@ -0,0 +1,20 @@
|
||||
{% extends '::main_template.html.twig' %}
|
||||
{% block title %} - Fórum - {{ topicGroup.title }}{% endblock %}
|
||||
{% block content %}
|
||||
<h3>Fórum - {{ topicGroup.title }}</h3>
|
||||
{% if topicGroup.topics|length > 0 %}
|
||||
<table>
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for topic in topicGroup.topics %}
|
||||
<tr>
|
||||
<td><a href="{{ path('KekRozsakFrontBundle_forum_post_list', { topicGroupSlug: topicGroup.slug, topicSlug: topic.slug }) }}">{{ topic.title }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
Ebben a témakörben nincsenek témák.
|
||||
{% endif %}
|
||||
{% endblock content %}
|
Reference in New Issue
Block a user