Moved everything under annotations.

Some review is still needed.
This commit is contained in:
Polonkai Gergely
2012-07-13 12:07:21 +02:00
parent 60b5eecbc8
commit 00190c3e37
41 changed files with 3264 additions and 2509 deletions

View File

@@ -1,44 +0,0 @@
KekRozsak\FrontBundle\Entity\Article:
type: entity
table: articles
id:
id:
type: integer
generator:
strategy: AUTO
fields:
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
unique: true
text:
type: text
nullable: false
source:
type: string(255)
nullable: true
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: text
nullable: true
main_page:
type: boolean
nullable: true
default: false
manyToOne:
created_by:
targetEntity: User
inversedBy: articles
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null

View File

@@ -1,33 +0,0 @@
KekRozsak\FrontBundle\Entity\ForumPost:
type: entity
table: forum_posts
id:
id:
type: integer
generator:
strategy: AUTO
fields:
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: string
nullable: true
text:
type: text
nullable: false
manyToOne:
created_by:
targetEntity: User
inversedBy: forum_posts
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null
topic:
targetEntity: ForumTopic
inversedBy: posts

View File

@@ -1,50 +0,0 @@
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
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: text
nullable: true
oneToMany:
posts:
targetEntity: ForumPost
mappedBy: topic
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
oneToOne:
last_post:
targetEntity: ForumPost
nullable: true
default: null
cascade: [ persist ]
uniqueConstraint:
uniqueSlugByGroup:
columns: [ topic_group, slug ]

View File

@@ -1,44 +0,0 @@
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
oneToOne:
last_post:
targetEntity: ForumPost
nullable: true
default: null
cascade: [ persist ]
oneToMany:
topics:
targetEntity: ForumTopic
mappedBy: topic_group

View File

@@ -1,39 +0,0 @@
KekRozsak\FrontBundle\Entity\News:
type: entity
table: news
id:
id:
type: integer
generator:
strategy: AUTO
fields:
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
default: null
update_reason:
type: text
nullable: true
default: null
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
unique: true
text:
type: text
nullable: false
manyToOne:
created_by:
targetEntity: User
nullable: false
inversedBy: news
updated_by:
targetEntity: User
nullable: true
default: null

View File

@@ -1,30 +0,0 @@
KekRozsak\FrontBundle\Entity\Role:
type: entity
table: roles
id:
id:
type: integer
generator:
strategy: AUTO
fields:
name:
type: string(100)
nullable: false
display_name:
type: string(100)
nullable: false
can_be_assigned:
type: boolean
default: false
manyToMany:
included_roles:
targetEntity: Role
joinTable:
name: role_hierarchy
joinColumns:
parent_role_id:
referencedColumnName: id
inverseJoinColumns:
child_role_id:
referencedColumnName: id

View File

@@ -1,51 +0,0 @@
KekRozsak\FrontBundle\Entity\User:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
username:
type: string(50)
nullable: false
password:
type: string(50)
nullable: false
email:
type: string(50)
nullable: false
registered_at:
type: datetime
display_name:
type: string(50)
nullable: false
last_login_at:
type: datetime
nullable: true
default: null
oneToMany:
articles:
targetEntity: Article
mappedBy: created_by
fetch: EXTRA_LAZY
forum_posts:
targetEntity: ForumPost
mappedBy: created_by
fetch: EXTRA_LAZY
manyToOne:
accepted_by:
targetEntity: User
fetch: EXTRA_LAZY
manyToMany:
roles:
targetEntity: Role
oneToOne:
user_data:
targetEntity: UserData
mappedBy: user
joinColumns:
id:
referencedColumnName: user_id
cascade: [ 'persist' ]

View File

@@ -1,71 +0,0 @@
KekRozsak\FrontBundle\Entity\UserData:
type: entity
table: user_data
id:
user_id:
type: integer
fields:
emailPublic:
type: boolean
nullable: false
default: false
realName:
name: real_name
type: string(100)
nullable: true
default: null
realNamePublic:
name: real_name_public
type: boolean
nullable: true
default: false
selfDescription:
name: self_description_public
type: text
nullable: true
default: null
msnAddress:
name: msn
type: string(100)
nullable: true
default: null
msnAddressPublic:
name: msn_public
type: boolean
nullable: false
default: false
googleTalk:
name: google_talk
type: string(100)
nullable: true
default: null
googleTalkPublic:
name: goole_talk_public
type: boolean
nullable: false
default: false
skype:
type: string(100)
nullable: true
default: null
skypePublic:
name: skype_public
type: boolean
nullable: false
default: false
phoneNumber:
name: phone_number
type: string(30)
nullable: true
phoneNumberPublic:
name: phone_number_public
type: boolean
nullable: false
default: false
oneToOne:
user:
targetEntity: User
inversedBy: user_data
joinColumns:
user_id:
referencedColumnName: id

View File

@@ -1,38 +0,0 @@
KekRozsakFrontBundle_homepage:
pattern: /
defaults:
_controller: KekRozsakFrontBundle:Default:homepage
KekRozsakFrontBundle_article:
pattern: /cikk/{articleSlug}
defaults:
_controller: KekRozsakFrontBundle:Default:article
KekRozsakFrontBundle_forum_main:
pattern: /forum
defaults:
_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
requirements:
_method: GET
KekRozsakFrontBundle_forum_new_post:
pattern: /forum/{topicGroupSlug}/{topicSlug}/post
defaults:
_controller: KekRozsakFrontBundle:Forum:postList
requirements:
_method: POST
KekRozsakFrontBundle_profile_edit:
pattern: /profil
defaults:
_controller: KekRozsakFrontBundle:Default:profileEdit

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="kek_rozsak_front.twig_extension.news" class="KekRozsak\FrontBundle\Twig\NewsExtension">
<argument type="service" id="doctrine" />
<tag name="twig.extension" />
</service>
<service id="form.type_extension.help_message" class="KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension">
<tag name="form.type_extension" alias="field" />
</service>
<service id="bb.twig.extension" class="KekRozsak\FrontBundle\Extension\TwigBBExtension">
<argument type="service" id="service_container" />
<tag name="twig.extension" />
</service>
</services>
</container>

View File

@@ -1,23 +0,0 @@
parameters:
# kek_rozsak_front.example.class: KekRozsak\FrontBundle\Example
services:
# kek_rozsak_front.example:
# class: %kek_rozsak_front.example.class%
# arguments: [@service_id, "plain_value", %parameter%]
kek_rozsak_front.twig_extension.news:
class: KekRozsak\FrontBundle\Twig\NewsExtension
arguments:
doctrine: @doctrine
tags:
- { name: twig.extension }
form.type_extension.help_message:
class: KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension
tags:
- { name: "form.type_extension", alias: "field" }
bb.twig.extension:
class: KekRozsak\FrontBundle\Extension\TwigBBExtension
arguments:
- @service_container
tags:
- { name: "twig.extension" }

View File

@@ -1,29 +0,0 @@
KekRozsak\FrontBundle\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: username
message: "Ez a felhasználónév már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: email
message: "Ez az e-mail cím már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: display_name
message: "Ez a név már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
properties:
username:
- NotBlank: { groups: [ registration ] }
password:
- NotBlank: { groups: [ registration ] }
email:
- NotBlank: { groups: [ registration ] }
- Email: { groups: [ registration ] }
registered_at:
- NotBlank: ~
- Type: \DateTime
display_name:
- NotBlank: { groups: [ registration ] }
KekRozsak\FrontBundle\Form\Type\UserType:

View File

@@ -6,7 +6,7 @@
<tbody>
<tr>
<td class="uj-post">
<form method="post" action="{{ path('KekRozsakFrontBundle_forum_new_post', { topicGroupSlug: topicGroup.slug, topicSlug: topic.slug } ) }}">
<form method="post" action="{{ path('KekRozsakFrontBundle_forum_post_list', { topicGroupSlug: topicGroup.slug, topicSlug: topic.slug } ) }}">
{{ form_widget(form) }}
<p>
<span class="eszkoztar">Súgó</span><span class="kuldes-gomb" /><button type="submit">Küldés</button>