From 574525c0a47ec40572558a20aeb95e14422fcfdd Mon Sep 17 00:00:00 2001 From: "R. Eric Wheeler" Date: Wed, 26 Apr 2017 21:32:43 -0700 Subject: [PATCH] Finished Social logins..almost --- .gitattributes | 4 + app/AppKernel.php | 3 +- .../ChangePassword/change_password.html.twig | 2 +- .../change_password_content.html.twig | 22 +- .../views/Registration/register.html.twig | 2 +- .../Registration/register_content.html.twig | 14 +- .../views/Resetting/check_email.html.twig | 9 +- .../views/Resetting/email.txt.twig | 15 +- .../views/Resetting/request.html.twig | 2 +- .../views/Resetting/request_content.html.twig | 18 +- .../views/Resetting/reset.html.twig | 7 +- .../views/Resetting/reset_content.html.twig | 19 +- .../views/Security/login.html.twig | 2 +- .../views/Security/login_content.html.twig | 15 +- .../views/Connect/login.html.twig | 2 +- .../views/Connect/registration.html.twig | 38 ++- app/Resources/views/base.html.twig | 90 +++---- app/Resources/views/default/index.html.twig | 20 +- app/Resources/views/form/contact.html.twig | 59 +++++ app/Resources/views/location.html.twig | 72 ++++++ app/Resources/views/map.html.twig | 168 +++++++++++++ app/Resources/views/off_canvas.html.twig | 44 ++++ app/Resources/views/our_story.html.twig | 16 +- .../views/user_registered.txt.twig.html.twig | 22 ++ app/config/config.yml | 8 +- app/config/config_dev.yml | 3 +- app/config/easy_admin.yml | 5 + app/config/security.yml | 6 +- app/config/services.yml | 14 +- build/images/favicon.png | 3 + build/images/home_photo.jpg | 3 - build/images/home_photo_1.jpg | 3 + build/images/home_photo_2.jpg | 3 + build/images/location.jpg | 3 + build/less/doughnut.less | 44 +++- composer.json | 1 + .../Controller/DefaultController.php | 75 ++++++ .../Controller/GalleryController.php | 4 +- .../DoughnutWeddingBundle/Entity/Contact.php | 220 ++++++++++++++++++ ...hatEmailAndUserNameExistOnResetRequest.php | 43 ++++ .../NeedToAuthenticateListenerEvent.php | 49 ++++ .../RedirectOnUserRegisterListener.php | 27 ++- .../UserRedirectOnLoggedInListener.php | 3 +- .../Form/ContactFormType.php | 128 ++++++++++ .../Form/RegistrationType.php | 8 +- .../Repository/ContactRepository.php | 13 ++ .../Resources/views/Image/category.html.twig | 4 +- .../Resources/views/Image/index.html.twig | 5 +- .../Resources/views/Image/tag.html.twig | 4 +- .../Resources/views/Image/upload.html.twig | 2 +- .../Security/AccessDeniedHandler.php | 67 ++++++ 51 files changed, 1266 insertions(+), 147 deletions(-) create mode 100644 app/Resources/views/form/contact.html.twig create mode 100644 app/Resources/views/location.html.twig create mode 100644 app/Resources/views/map.html.twig create mode 100644 app/Resources/views/user_registered.txt.twig.html.twig create mode 100644 build/images/favicon.png delete mode 100644 build/images/home_photo.jpg create mode 100644 build/images/home_photo_1.jpg create mode 100644 build/images/home_photo_2.jpg create mode 100644 build/images/location.jpg create mode 100644 src/Sikofitt/DoughnutWeddingBundle/Entity/Contact.php create mode 100644 src/Sikofitt/DoughnutWeddingBundle/EventListener/CheckThatEmailAndUserNameExistOnResetRequest.php create mode 100644 src/Sikofitt/DoughnutWeddingBundle/EventListener/NeedToAuthenticateListenerEvent.php create mode 100644 src/Sikofitt/DoughnutWeddingBundle/Form/ContactFormType.php create mode 100644 src/Sikofitt/DoughnutWeddingBundle/Repository/ContactRepository.php create mode 100644 src/Sikofitt/DoughnutWeddingBundle/Security/AccessDeniedHandler.php diff --git a/.gitattributes b/.gitattributes index f28ca7b..1b23cea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -23,3 +23,7 @@ build/images/amazon.svg filter=lfs diff=lfs merge=lfs -text build/images/home_doughnut_1.jpg filter=lfs diff=lfs merge=lfs -text build/images/home_location.jpg filter=lfs diff=lfs merge=lfs -text build/images/home_photo.jpg filter=lfs diff=lfs merge=lfs -text +build/images/favicon.png filter=lfs diff=lfs merge=lfs -text +build/images/home_photo_1.jpg filter=lfs diff=lfs merge=lfs -text +build/images/home_photo_2.jpg filter=lfs diff=lfs merge=lfs -text +build/images/location.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/app/AppKernel.php b/app/AppKernel.php index 919be84..dc96687 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -18,7 +18,6 @@ * along with this program. If not, see . */ -use JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\HttpKernel\Kernel; @@ -40,7 +39,7 @@ class AppKernel extends Kernel new \FOS\UserBundle\FOSUserBundle(), new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(), new Vich\UploaderBundle\VichUploaderBundle(), - new EasyAdminBundle(), + new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(), new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(), ]; diff --git a/app/Resources/FOSUserBundle/views/ChangePassword/change_password.html.twig b/app/Resources/FOSUserBundle/views/ChangePassword/change_password.html.twig index 827ef6f..78378bb 100644 --- a/app/Resources/FOSUserBundle/views/ChangePassword/change_password.html.twig +++ b/app/Resources/FOSUserBundle/views/ChangePassword/change_password.html.twig @@ -1,5 +1,5 @@ {% extends "base.html.twig" %} - +{% block title %}Change password{% endblock title %} {% block body %} {% include "@FOSUser/ChangePassword/change_password_content.html.twig" %} {% endblock body %} diff --git a/app/Resources/FOSUserBundle/views/ChangePassword/change_password_content.html.twig b/app/Resources/FOSUserBundle/views/ChangePassword/change_password_content.html.twig index 6c3d0cc..36704df 100644 --- a/app/Resources/FOSUserBundle/views/ChangePassword/change_password_content.html.twig +++ b/app/Resources/FOSUserBundle/views/ChangePassword/change_password_content.html.twig @@ -1,8 +1,20 @@ {% trans_default_domain 'FOSUserBundle' %} -{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }} - {{ form_widget(form) }} -
- -
+

Change your password

+{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'uk-form uk-form-horizontal fos_user_resetting_reset' } }) }} + +{{ form_label(form.plainPassword.first, 'New password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} +
+ {{ form_errors(form.plainPassword.first) }} + {{ form_widget(form.plainPassword.first, {'attr':{'class':'uk-input uk-form-large','placeholder':'New password'}}) }} +
+ +{{ form_label(form.plainPassword.second, 'Repeat password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} +
+ {{ form_errors(form.plainPassword.second) }} + {{ form_widget(form.plainPassword.second, {'attr':{'class':'uk-input uk-form-large','placeholder':'Repeat password'}}) }} +
+
+ +
{{ form_end(form) }} diff --git a/app/Resources/FOSUserBundle/views/Registration/register.html.twig b/app/Resources/FOSUserBundle/views/Registration/register.html.twig index 460926f..cdb4dfa 100644 --- a/app/Resources/FOSUserBundle/views/Registration/register.html.twig +++ b/app/Resources/FOSUserBundle/views/Registration/register.html.twig @@ -1,5 +1,5 @@ {% extends "base.html.twig" %} - +{% block title %}Register{% endblock title %} {% block body %} {% include "@FOSUser/Registration/register_content.html.twig" %} {% endblock body %} diff --git a/app/Resources/FOSUserBundle/views/Registration/register_content.html.twig b/app/Resources/FOSUserBundle/views/Registration/register_content.html.twig index c92b982..ab49e49 100644 --- a/app/Resources/FOSUserBundle/views/Registration/register_content.html.twig +++ b/app/Resources/FOSUserBundle/views/Registration/register_content.html.twig @@ -2,7 +2,7 @@
{{ form_errors(form) }}
-{{ dump(app.session) }} + {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register uk-form'}}) }}
@@ -17,6 +17,7 @@
+ {{ form_errors(form.name) }} {{ form_widget(form.name, { 'attr': {'placeholder':'Name', 'class':'uk-input uk-form-large uk-padding-small'} }) }}
@@ -24,14 +25,23 @@
+ {{ form_errors(form.rsvp) }} {{ form_widget(form.rsvp) }}
+
+ +
+ {{ form_errors(form.comment) }} + {{ form_widget(form.comment) }} +
+
+ {{ form_errors(form.plainPassword) }} {{ form_widget(form.plainPassword.first, { 'attr': {'placeholder':'Password', 'class':'uk-input uk-form-large uk-padding-small'} }) }}
- +
diff --git a/app/Resources/FOSUserBundle/views/Resetting/check_email.html.twig b/app/Resources/FOSUserBundle/views/Resetting/check_email.html.twig index 1b589f7..f4201ce 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/check_email.html.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/check_email.html.twig @@ -1,9 +1,8 @@ -{% extends "@FOSUser/layout.html.twig" %} - +{% extends "base.html.twig" %} +{% block title %}Check Email{% endblock title %} {% trans_default_domain 'FOSUserBundle' %} - -{% block fos_user_content %} -

+{% block body %} +

{{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime})|nl2br }}

{% endblock %} diff --git a/app/Resources/FOSUserBundle/views/Resetting/email.txt.twig b/app/Resources/FOSUserBundle/views/Resetting/email.txt.twig index bd52c9e..caa4724 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/email.txt.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/email.txt.twig @@ -1,13 +1,24 @@ {% trans_default_domain 'FOSUserBundle' %} {% block subject %} {%- autoescape false -%} -{{ 'resetting.email.subject'|trans({'%username%': user.username}) }} +[Doughnut Wedding] Password reset requested {%- endautoescape -%} {% endblock %} {% block body_text %} {% autoescape false %} -{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }} +Hi {{ user.name }}, + +Someone has requested to reset the password for your account. + +If this was not you please ignore this message. No further action is required. + +To reset your password please visit this link in your browser : +{{ confirmationUrl }} + +Thank you, +Katrina and Eric ❤ + {% endautoescape %} {% endblock %} {% block body_html %}{% endblock %} diff --git a/app/Resources/FOSUserBundle/views/Resetting/request.html.twig b/app/Resources/FOSUserBundle/views/Resetting/request.html.twig index 2da4765..23eb767 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/request.html.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/request.html.twig @@ -1,5 +1,5 @@ {% extends "base.html.twig" %} - +{% block title %}Reset Password{% endblock title %} {% block body %} {% include "@FOSUser/Resetting/request_content.html.twig" %} {% endblock body %} diff --git a/app/Resources/FOSUserBundle/views/Resetting/request_content.html.twig b/app/Resources/FOSUserBundle/views/Resetting/request_content.html.twig index d7c6494..63b8153 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/request_content.html.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/request_content.html.twig @@ -1,12 +1,16 @@ {% trans_default_domain 'FOSUserBundle' %}

Reset your password

-
- -
- -
-
- + + +
+
+ + +
+
+
+
+ diff --git a/app/Resources/FOSUserBundle/views/Resetting/reset.html.twig b/app/Resources/FOSUserBundle/views/Resetting/reset.html.twig index fab676a..e97b06d 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/reset.html.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/reset.html.twig @@ -1,5 +1,6 @@ -{% extends "@FOSUser/layout.html.twig" %} +{% extends "base.html.twig" %} -{% block fos_user_content %} +{% block title %}Reset Password{% endblock title %} +{% block body %} {% include "@FOSUser/Resetting/reset_content.html.twig" %} -{% endblock fos_user_content %} +{% endblock body %} diff --git a/app/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig b/app/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig index d8b0c4d..5f74be0 100644 --- a/app/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig +++ b/app/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig @@ -1,8 +1,19 @@ {% trans_default_domain 'FOSUserBundle' %} +

Reset your password

+{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'uk-form uk-form-horizontal fos_user_resetting_reset' } }) }} -{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'fos_user_resetting_reset' } }) }} - {{ form_widget(form) }} -
- +{{ form_label(form.plainPassword.first, 'New password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} +
+ {{ form_errors(form.plainPassword.first) }} + {{ form_widget(form.plainPassword.first, {'attr':{'class':'uk-input uk-form-large','placeholder':'New password'}}) }} +
+ +{{ form_label(form.plainPassword.second, 'Repeat password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} +
+ {{ form_errors(form.plainPassword.second) }} + {{ form_widget(form.plainPassword.second, {'attr':{'class':'uk-input uk-form-large','placeholder':'Repeat password'}}) }} +
+
+
{{ form_end(form) }} diff --git a/app/Resources/FOSUserBundle/views/Security/login.html.twig b/app/Resources/FOSUserBundle/views/Security/login.html.twig index 004cfd5..76fd4ed 100644 --- a/app/Resources/FOSUserBundle/views/Security/login.html.twig +++ b/app/Resources/FOSUserBundle/views/Security/login.html.twig @@ -1,5 +1,5 @@ {% extends "base.html.twig" %} - +{% block title %}Login{% endblock title %} {% block body %} {{ include('@FOSUser/Security/login_content.html.twig') }} {% endblock body %} diff --git a/app/Resources/FOSUserBundle/views/Security/login_content.html.twig b/app/Resources/FOSUserBundle/views/Security/login_content.html.twig index 50a3c9c..d581f6c 100644 --- a/app/Resources/FOSUserBundle/views/Security/login_content.html.twig +++ b/app/Resources/FOSUserBundle/views/Security/login_content.html.twig @@ -1,7 +1,7 @@ {% trans_default_domain 'FOSUserBundle' %} {% if error %} -
{{ error.messageKey|trans(error.messageData, 'security') }}
+
{{ error.messageKey|trans(error.messageData, 'security') }}
{% endif %}
-
+
+ +
-
-
+ +
+
+
+

Forgot your password? Click here

+
diff --git a/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig b/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig index eeba7d7..0310aa5 100644 --- a/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig +++ b/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig @@ -1,7 +1,7 @@ {% extends 'HWIOAuthBundle::layout.html.twig' %} {% block hwi_oauth_content %} - {{ dump() }} + {% if error is defined and error %} {{ error }} {% endif %} diff --git a/app/Resources/HWIOAuthBundle/views/Connect/registration.html.twig b/app/Resources/HWIOAuthBundle/views/Connect/registration.html.twig index c441a26..3a9cc6c 100644 --- a/app/Resources/HWIOAuthBundle/views/Connect/registration.html.twig +++ b/app/Resources/HWIOAuthBundle/views/Connect/registration.html.twig @@ -1,20 +1,43 @@ {% extends 'base.html.twig' %} - +{% block title %}Register with {{ userInformation.resourceOwner.name|capitalize }}{% endblock title %} {% block body %} -
- {% if userInformation.resourceOwner.name == 'yahoo' %} +
+ {% if userInformation.response.name is defined %} + {% set name = userInformation.response.name %} + {% elseif userInformation.response.data.username is defined %} + {% set name = userInformation.response.data.username %} + {% elseif userInformation.resourceOwner.name == 'yahoo' %} {% set name = userInformation.nickname %} {% else %} {% set name = userInformation.email %} {% endif %} -

{{ 'header.register' | trans({'%name%': name }, 'HWIOAuthBundle') }}

+
+
+
+
+ {% if userInformation.profilePicture is not empty %} + + {% endif %} +
+
+

Register with {{ userInformation.resourceOwner.name|capitalize }} account?

+ +
+
+
+ +
{{ form_start(form, {'action': path('hwi_oauth_connect_registration', {'key': key}), 'attr': {'class': 'hwi_oauth_registration_register uk-form uk-form-horizontal'}}) }} {{ form_label(form.name, 'Name', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
- {{ form_widget(form.name, {'attr':{'class':'uk-input uk-form-large', 'placeholder':'Your name'}}) }} + {{ form_widget(form.name, {'value': name,'attr':{'class':'uk-input uk-form-large', 'placeholder':'Your name'}}) }}
{{ form_label(form.email, 'Email address', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
@@ -48,11 +71,6 @@
{{ form_end(form) }} - - {% if userInformation.profilePicture is not empty %} - - {% endif %} -
{% endblock body %} diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index b87f368..9053a5c 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -2,25 +2,48 @@ {% form_theme form with [_self, 'form_errors.html.twig'] %} {% endif %} - + - - Title + + {% block title %}{% endblock title %}{% if app.request.requestUri != '/' %} | {% endif %}♥ Doughnut Wedding - + - + + + {% block stylesheets %}{% endblock %} + + {% block javascripts %}{% endblock %} -{% block debug %}{% endblock %} +{% block debug %} + {% if app.request.requestUri != '/' %} + {# dump(app.request.requestUri) #} + {% endif %} +{% endblock %}
+