Added very-very basic forum functionality

This commit is contained in:
Polonkai Gergely
2012-07-03 14:11:18 +02:00
parent ffda918ee5
commit 0649408e60
14 changed files with 727 additions and 31 deletions

View File

@@ -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 ]

View File

@@ -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

View File

@@ -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

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}