Added user profile editing support

This commit is contained in:
Polonkai Gergely
2012-07-09 17:29:37 +02:00
parent 0fad11ffd0
commit 8a55e32303
12 changed files with 775 additions and 24 deletions

View File

@@ -41,3 +41,11 @@ KekRozsak\FrontBundle\Entity\User:
manyToMany:
roles:
targetEntity: Role
oneToOne:
user_data:
targetEntity: UserData
mappedBy: user
joinColumns:
id:
referencedColumnName: user_id
cascade: [ 'persist' ]

View File

@@ -0,0 +1,71 @@
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

@@ -31,3 +31,8 @@ KekRozsakFrontBundle_forum_new_post:
_controller: KekRozsakFrontBundle:Forum:postList
requirements:
_method: POST
KekRozsakFrontBundle_profile_edit:
pattern: /profil
defaults:
_controller: KekRozsakFrontBundle:Default:profileEdit

View File

@@ -0,0 +1,14 @@
{% extends '::main_template.html.twig' %}
{% form_theme form 'KekRozsakFrontBundle:Form:user_form.html.twig' %}
{% block title %} - Profil szerkesztése{% endblock %}
{% block content %}
<h3>Felhasználói profil</h3>
<p>Az itt megadott adataidat szigorúan kezeljük, azt más számára kizárólag hatósági felszólításra adjuk ki.</p>
<p>A publikusnak megjelölt adataidat csak a kör tagjai láthatják, míg a nem publikusnak megjelölteket kizárólag az oldal adminisztrátorai.</p>
<form method="post" action="{{ path('KekRozsakFrontBundle_profile_edit') }}">
<table>
{{ form_widget(form) }}
</table>
<button type="submit">Mentés</button>
</form>
{% endblock content %}