VichUploaderBundle

This commit is contained in:
R. Eric Wheeler 2017-04-25 15:45:32 -07:00
parent e60363f8c7
commit 2d025468cb
34 changed files with 89001 additions and 821 deletions

View File

@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
use JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle;
use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Kernel;
@ -39,6 +40,7 @@ class AppKernel extends Kernel
new \FOS\UserBundle\FOSUserBundle(), new \FOS\UserBundle\FOSUserBundle(),
new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(), new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
new Vich\UploaderBundle\VichUploaderBundle(), new Vich\UploaderBundle\VichUploaderBundle(),
new EasyAdminBundle(),
new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(), new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(),
]; ];

View File

@ -1,5 +1,5 @@
{% extends "@FOSUser/layout.html.twig" %} {% extends "base.html.twig" %}
{% block fos_user_content %} {% block body %}
{% include "@FOSUser/ChangePassword/change_password_content.html.twig" %} {% include "@FOSUser/ChangePassword/change_password_content.html.twig" %}
{% endblock fos_user_content %} {% endblock body %}

View File

@ -1,7 +1,7 @@
{% trans_default_domain 'SikofittDoughnutweddingBundle' %} {% trans_default_domain 'SikofittDoughnutweddingBundle' %}
<h2 class="uk-width-1-1 uk-margin-medium-bottom uk-text-center">User Information</h2> <h2 class="uk-width-1-1 uk-margin-medium-bottom uk-text-center">User Information</h2>
<div class="uk-width-1-1 uk-text-center uk-grid-divider uk-child-width-1-2" uk-grid> <div class="uk-width-1-1 uk-text-center uk-child-width-1-2" uk-grid>
<div><p class="uk-padding-small uk-text-right">{{ 'profile.name'|trans }}</p></div> <div><p class="uk-padding-small uk-text-right">{{ 'profile.name'|trans }}</p></div>
<div><p class="uk-padding-small uk-text-left">{{ user.name }}</p></div> <div><p class="uk-padding-small uk-text-left">{{ user.name }}</p></div>
@ -11,9 +11,14 @@
<div><p class="uk-padding-small uk-text-right">{{ 'profile.rsvp'|trans }}</p></div> <div><p class="uk-padding-small uk-text-right">{{ 'profile.rsvp'|trans }}</p></div>
<div><p class="uk-padding-small uk-text-left">{% if user.rsvp is not null %}{{ user.rsvp.guests }}{% else %}0{% endif %}</p></div> <div><p class="uk-padding-small uk-text-left">{% if user.rsvp is not null %}{{ user.rsvp.guests }}{% else %}0{% endif %}</p></div>
<div class="uk-width-1-2@m uk-width-1-1@s uk-align-center uk-margin-small uk-grid-margin uk-first-column">
<a href="{{ url('fos_user_profile_edit') }}" title="Edit profile" class="uk-button-large uk-button uk-button-primary uk-width-1-1">Edit Information</a></div> </div>
</div> <div class="uk-width-1-1 uk-margin-medium uk-text-center">
You can change your password <a href="{{ path('fos_user_change_password') }}">here.</a>
</div>
<div class="uk-width-1-2@m uk-width-1-1@s uk-align-center uk-margin-small uk-first-column">
<a href="{{ url('fos_user_profile_edit') }}" title="Edit profile" class="uk-button-large uk-button uk-button-primary uk-width-1-1">Edit Information</a>
</div>
<div class="uk-width-1-6@m uk-visible@m uk-margin-large-top uk-position-center-right"> <div class="uk-width-1-6@m uk-visible@m uk-margin-large-top uk-position-center-right">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">

View File

@ -1,11 +1,12 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
<h1 class="uk-h2 uk-text-center">Reset your password</h1>
<form action="{{ path('fos_user_resetting_send_email') }}" method="POST" class="uk-form uk-form-horizontal fos_user_resetting_request">
<form action="{{ path('fos_user_resetting_send_email') }}" method="POST" class="fos_user_resetting_request"> <label class="uk-form-label uk-visible@m" for="username">Email address </label>
<div> <div class="uk-form-controls-text uk-form-controls">
<label for="username">{{ 'resetting.request.username'|trans }}</label> <input class="uk-input uk-form-large" type="text" id="username" name="username" placeholder="Enter your email address" required="required" />
<input type="text" id="username" name="username" required="required" /> </div>
</div> <div class="uk-width-1-1@s uk-width-1-3@m uk-align-right@m uk-margin-small-top">
<div> <input type="submit" class="uk-width-1-1 uk-button uk-button-large uk-button-primary" value="{{ 'resetting.request.submit'|trans }}" />
<input type="submit" value="{{ 'resetting.request.submit'|trans }}" />
</div> </div>
</form> </form>

View File

@ -1,6 +1,7 @@
{% extends 'HWIOAuthBundle::layout.html.twig' %} {% extends 'HWIOAuthBundle::layout.html.twig' %}
{% block hwi_oauth_content %} {% block hwi_oauth_content %}
{{ dump() }}
{% if error is defined and error %} {% if error is defined and error %}
<span>{{ error }}</span> <span>{{ error }}</span>
{% endif %} {% endif %}

View File

@ -1,29 +1,58 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<div class="uk-width-1-1"> <div class="uk-width-1-1">
{{ dump(form) }}
{% if userInformation.resourceOwner.name == 'yahoo' %} {% if userInformation.resourceOwner.name == 'yahoo' %}
{% set name = userInformation.nickname %} {% set name = userInformation.nickname %}
{% else %} {% else %}
{% set name = userInformation.email %} {% set name = userInformation.email %}
{% endif %} {% endif %}
<h3>{{ 'header.register' | trans({'%name%': name }, 'HWIOAuthBundle') }}</h3> <h3>{{ 'header.register' | trans({'%name%': name }, 'HWIOAuthBundle') }}</h3>
{{ form_start(form, {'action': path('hwi_oauth_connect_registration', {'key': key}), 'attr': {'class': 'hwi_oauth_registration_register uk-form uk-form-horizontal'}}) }} {{ form_start(form, {'action': path('hwi_oauth_connect_registration', {'key': key}), 'attr': {'class': 'hwi_oauth_registration_register uk-form uk-form-horizontal'}}) }}
{{ form_widget(form) }} {{ form_label(form.name, 'Name', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div> <div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
<button type="submit" class="btn btn-primary">{{ 'connect.registration.submit'|trans({}, 'HWIOAuthBundle') }}</button> {{ form_widget(form.name, {'attr':{'class':'uk-input uk-form-large', 'placeholder':'Your name'}}) }}
<a href="{{ path('hwi_oauth_connect') }}" class="btn">{{ 'connect.registration.cancel' | trans({}, 'HWIOAuthBundle') }}</a>
</div>
{{ form_end(form) }}
{% if userInformation.profilePicture is not empty %}
<img src="{{ userInformation.profilePicture }}" />
{% endif %}
</div> </div>
{{ form_label(form.email, 'Email address', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_widget(form.email, {'attr':{'class':'uk-input uk-form-large', 'placeholder':'Email address'}}) }}
</div>
{{ form_label(form.plainPassword.first, 'Password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_widget(form.plainPassword.first, {'attr':{'class':'uk-input uk-form-large', 'placeholder':'Create password'}}) }}
</div>
{{ form_label(form.plainPassword.second, 'Repeat password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_widget(form.plainPassword.second, {'attr':{'class':'uk-input uk-form-large', 'placeholder':'Repeat password'}}) }}
</div>
{{ form_label(form.rsvp, 'Number of guests? (including yourself)', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_widget(form.rsvp, {'attr':{'placeholder':'Guest\'s including yourself.'}}) }}
</div>
{{ form_label(form.comment) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_widget(form.comment) }}
</div>
<div class="uk-child-width-1-2@m uk-child-width-1-1@s uk-grid uk-grid-divider uk-margin-medium-top" uk-grid>
<div>
<input type="submit" class="uk-width-1-1 uk-button-primary uk-button uk-button-large"
value="{{ 'connect.registration.submit'|trans({}, 'HWIOAuthBundle') }}"/>
</div>
<div>
<a href="{{ path('hwi_oauth_connect') }}"
class="uk-width-1-1 uk-button uk-button-large uk-button-danger">{{ 'connect.registration.cancel' | trans({}, 'HWIOAuthBundle') }}</a>
</div>
</div>
{{ form_end(form) }}
{% if userInformation.profilePicture is not empty %}
<img src="{{ userInformation.profilePicture }}"/>
{% endif %}
</div>
{% endblock body %} {% endblock body %}

View File

@ -20,17 +20,17 @@
<div class="uk-container uk-container-expand uk-hidden@m"> <div class="uk-container uk-container-expand uk-hidden@m">
<nav class="uk-navbar"> <nav class="uk-navbar">
<div class="uk-navbar-left uk-responsive-width"> <div class="uk-navbar-left uk-responsive-width">
<a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ asset('images/logo.png') }}" /></a> <a class="uk-transform-origin-center-left uk-animation-scale-up" href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ asset('images/logo.png') }}" /></a>
</div> </div>
<div class="uk-navbar-right"> <div class="uk-navbar-right">
<a uk-navbar-toggle-icon="" href="#offcanvas" uk-toggle="" class="uk-navbar-toggle uk-hidden@m uk-navbar-toggle-icon uk-icon"></a></div> <a uk-navbar-toggle-icon="" href="#offcanvas" uk-toggle="" class="uk-navbar-toggle uk-hidden@m uk-navbar-toggle-icon uk-icon"></a>
</div> </div>
</nav> </nav>
</div> </div>
<div class="uk-container-small uk-container uk-margin-medium-top uk-margin-medium-bottom"> <div class="uk-container-small uk-container uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-visible@m uk-responsive-width uk-width-3-4 uk-align-center"> <div class="uk-visible@m uk-responsive-width uk-width-3-4 uk-align-center">
<div class="uk-logo uk-animation-scale-up uk-transform-origin-top-center"> <div class="uk-logo uk-animation-scale-up uk-transform-origin-bottom-center">
<h2 class="uk-text-center">ERIC + KATRINA'S</h2> <h2 class="uk-text-center">ERIC + KATRINA'S</h2>
<a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ asset('images/logo.png') }}" /></a> <a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ asset('images/logo.png') }}" /></a>
<h3 class="uk-margin-small-top uk-text-center">MAY 12TH, 2017</h3> <h3 class="uk-margin-small-top uk-text-center">MAY 12TH, 2017</h3>
@ -44,23 +44,46 @@
{% include "social_login.html.twig" %} {% include "social_login.html.twig" %}
{% block footer %}{% endblock %} {% block footer %}{% endblock %}
</div> </div>
<div id="offcanvas" uk-offcanvas="overlay: true"> <div id="offcanvas" uk-offcanvas="overlay: true; mode:reveal">
<div class="uk-offcanvas-bar"> <div class="uk-offcanvas-bar uk-offcanvas-bar-animation">
<button class="uk-offcanvas-close" type="button" uk-close></button>
<ul class="uk-nav uk-nav-primary">
<li class="uk-nav-header">Navigation</li>
<li class="uk-nav-divider"></li>
<li><a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><span class="uk-margin-small-right" uk-icon="icon: home"></span> Home</a></li>
<li><a href="{{ path('sikofitt_doughnutwedding_default_ourstory') }}"><span class="uk-margin-small-right" uk-icon="icon: heart"></span> Our Story</a></li>
<li><a href="{{ path('sikofitt_doughnutwedding_rsvp_index') }}"><span class="uk-margin-small-right" uk-icon="icon: bolt"></span> RSVP</a></li>
<li><a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}"><span class="uk-margin-small-right" uk-icon="icon: image"></span> Gallery</a></li>
<li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: location"></span> Location</a></li>
<li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: mail"></span> Get In Touch</a></li>
<ul class="uk-nav uk-nav-default"> {% if not is_granted('IS_AUTHENTICATED_FULLY') %} {% set social_prefix = 'Login with' %} {% else %} {% set social_prefix = 'Link Account With' %} {% endif %}
<li class="uk-active"><a href="#">Active</a></li> {% if is_granted('IS_AUTHENTICATED_FULLY') %}
<li class="uk-parent"> <li class="uk-nav-header">{{ app.user.name }}</li>
<a href="#">Parent</a>
<ul class="uk-nav-sub">
<li><a href="#">Sub item</a></li>
<li><a href="#">Sub item</a></li>
</ul>
</li>
<li class="uk-nav-header">Header</li>
<li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: table"></span> Item</a></li>
<li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: thumbnails"></span> Item</a></li>
<li class="uk-nav-divider"></li> <li class="uk-nav-divider"></li>
<li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: trash"></span> Item</a></li> <li><a href="#"><span class="uk-margin-small-right" uk-icon="icon: user"></span> Profile</a></li>
<li><a><span class="uk-margin-small-right" uk-icon="icon: lock"></span> Change password</a></li>
<li><a><span class="uk-margin-small-right" uk-icon="icon: sign-out"></span> Logout</a></li>
{% else %}
<li class="uk-nav-header">User</li>
<li class="uk-nav-divider"></li>
<li><a href="{{ path('fos_user_security_login') }}" title="Login"><span class="uk-margin-small-right" uk-icon="icon: sign-in"></span> Login</a></li>
<li><a href="{{ path('fos_user_registration_register') }}" title="Register"><span class="uk-margin-small-right" uk-icon="icon: star"></span> Register / RSVP</a></li>
{% endif %}
<li>
<div class="uk-position-fixed uk-position-bottom uk-padding-small">
<p class="uk-text-meta uk-text-center uk-margin-small-bottom">{{ social_prefix }}</p>
<ul class="uk-iconnav">
<li><a><span class="uk-margin-small-right" uk-icon="icon: facebook"></span></a></li>
<li><a><span class="uk-margin-small-right" uk-icon="icon: google"></span></a></li>
<li><a><span class="uk-margin-small-right" uk-icon="icon: instagram"></span></a></li>
<li><a><span class="uk-margin-small-right" uk-icon="icon: twitter"></span></a></li>
<li><a><span class="uk-margin-small-right uk-icon-image uk-login uk-login-yahoo"><img height="20" width="20" src="{{ asset('images/yahoo.svg') }}" uk-svg></span></a></li>
<li><a><span class="uk-margin-small-right uk-icon-image uk-login uk-login-amazon"><img height="20" width="20" src="{{ asset('images/amazon.svg') }}" uk-svg></span></a></li>
</ul>
</div>
</li>
</ul> </ul>
</div> </div>

View File

@ -5,21 +5,21 @@
<div class="uk-home uk-child-width-1-3@s uk-grid-match uk-grid-small" uk-grid> <div class="uk-home uk-child-width-1-3@s uk-grid-match uk-grid-small" uk-grid>
<div> <div>
<div class="uk-background-cover uk-background-fade uk-our-story-home uk-height-large uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle"> <div class="uk-background-cover uk-background-fade uk-our-story-home uk-height-large uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle">
<a href="#" class="uk-position-cover"></a> <a href="{{ path('sikofitt_doughnutwedding_default_ourstory') }}" class="uk-position-cover"></a>
<div class="uk-light uk-width-1-1 uk-overlay uk-margin-large-top uk-position-center"> <div class="uk-light uk-width-1-1 uk-overlay uk-margin-large-top uk-position-center">
<h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">our story</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">our story</a></h3>
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div class="uk-background-cover uk-doughnut-rsvp uk-margin-small-bottom uk-height-small uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle"> <div class="uk-background-cover uk-background-fade uk-doughnut-rsvp uk-margin-small-bottom uk-height-small uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle">
<a href="#" class="uk-position-cover"></a> <a href="{{ path('fos_user_profile_edit') }}" class="uk-position-cover"></a>
<div class="uk-light uk-width-1-1 uk-overlay uk-margin-small-top uk-position-center"> <div class="uk-light uk-width-1-1 uk-overlay uk-margin-small-top uk-position-center">
<h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">RSVP</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">RSVP</a></h3>
</div> </div>
</div> </div>
<div class="uk-height-medium uk-background-cover uk-photo-home uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle"> <div class="uk-height-medium uk-background-cover uk-photo-home uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle">
<a href="#" class="uk-position-cover"></a> <a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" class="uk-position-cover"></a>
<div class="uk-light uk-width-1-1 uk-overlay uk-margin-small-top uk-position-center"> <div class="uk-light uk-width-1-1 uk-overlay uk-margin-small-top uk-position-center">
<h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">photo gallery</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">photo gallery</a></h3>
</div> </div>
@ -32,7 +32,7 @@
<h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">location</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">location</a></h3>
</div> </div>
</div> </div>
<div class="uk-height-small uk-background-cover uk-doughnut-get-in-touch-home uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle"> <div class="uk-height-small uk-background-cover uk-background-fade uk-doughnut-get-in-touch-home uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle">
<a href="#" class="uk-position-cover"></a> <a href="#" class="uk-position-cover"></a>
<div class="uk-light uk-width-1-1 uk-overlay uk-position-center uk-margin-small-top"> <div class="uk-light uk-width-1-1 uk-overlay uk-position-center uk-margin-small-top">
<h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">get in touch</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="#" class="uk-position-cover uk-box-shadow-small">get in touch</a></h3>
@ -49,7 +49,7 @@
</p> </p>
</div> </div>
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<p class="uk-text-center"><a href="#" class="uk-width-1-5@m uk-width-1-1@s uk-button uk-button-primary">Join Group</a></p></div> <p class="uk-text-center"><a href="https://www.facebook.com/groups/doughnutwedding" class="uk-width-1-5@m uk-width-1-1@s uk-button uk-button-primary">Join Group</a></p></div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,8 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ 'Hello World!' }}
{% for key, request in app.request_stack %}
{{ dump(key) }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block body %}
<h1 class="uk-text-center" style="letter-spacing: .15rem">Our Story</h1>
<div class="uk-column-1-2@m uk-column-divider">
<p>Eric and Katrina first met online in 2014. After texting back and forth for a week they finally met in
persion at a little coffee shop in Oakland on July 23, 2014. Eric was shy and Katrina was nervous, but somehow they found enough
to talk about to agree to a second date where they continued to bond over coffee, cigarettes, and zombie movies.</p>
<p>Ollie (Katrina's dog) loved Eric instantly, and Buddy and Mayu (Eric's cats) never murdered Katrina in her sleep, so they tolerated her.</p>
<p class="uk-column-span uk-text-lead uk-text-center">This was a good sign.</p>
<p>In August 2016 they packed everything into a couple of crates and moved up north to Portland, Oregon. After six months of the both of them working from home,
they realized that they were still madly in love (despite seeing each other all day, every day.) So on February 6, 2017 Eric proposed to Katrina.</p>
<p class="uk-column-span uk-text-lead uk-text-center uk-text-primary">
On May 12, 2017 they will both say "yes" and live happily ever after til death do they part.
</p>
</div>
<div class="uk-width-1-1">
<p class="uk-text-center">
<a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" class="uk-button uk-button-primary">Check out some photos!</a>
</p>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@ imports:
- { resource: security.yml } - { resource: security.yml }
- { resource: services.yml } - { resource: services.yml }
- { resource: snc_redis.yml } - { resource: snc_redis.yml }
- { resource: easy_admin.yml }
# Put parameters here that don't need to change on each machine where the app is deployed # Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters: parameters:
@ -169,10 +169,10 @@ hwi_oauth:
instagram: instagramId instagram: instagramId
twitter: twitterId twitter: twitterId
yahoo: yahooId yahoo: yahooId
# if you want to use 'connect' and do not use the FOSUB integration, configure these separately # if you want to use 'connect' and do not use the FOSUB integration, configure these separately
connect: connect:
confirmation: false confirmation: false
failed_auth_path: fos_user_security_login
fos_user: fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb' db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: secured_area firewall_name: secured_area
@ -186,9 +186,21 @@ fos_user:
registration: registration:
form: form:
type: Sikofitt\DoughnutWeddingBundle\Form\RegistrationType type: Sikofitt\DoughnutWeddingBundle\Form\RegistrationType
change_password:
form:
type: Sikofitt\DoughnutWeddingBundle\Form\ChangePasswordFormType
knp_gaufrette: knp_gaufrette:
stream_wrapper: ~
adapters: adapters:
assets:
google_cloud_storage:
service_id: 'doughnutwedding.google_cloud_storage.service'
bucket_name: 'zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4'
options:
acl: 'public'
directory: 'assets'
gallery: gallery:
google_cloud_storage: google_cloud_storage:
service_id: 'doughnutwedding.google_cloud_storage.service' service_id: 'doughnutwedding.google_cloud_storage.service'
@ -200,7 +212,15 @@ knp_gaufrette:
cloud: cloud:
adapter: gallery adapter: gallery
alias: google_cloud alias: google_cloud
assets:
adapter: assets
alias: cloud_assets
vich_uploader: vich_uploader:
db_driver: orm db_driver: orm
storage: gaufrette
mappings:
gallery_image:
upload_destination: cloud
uri_prefix: /
sikofitt_doughnut_wedding: sikofitt_doughnut_wedding:
max_rsvps: ~ max_rsvps: ~

View File

@ -9,7 +9,7 @@ framework:
web_profiler: web_profiler:
toolbar: true toolbar: true
intercept_redirects: true intercept_redirects: false
monolog: monolog:
handlers: handlers:

49
app/config/easy_admin.yml Normal file
View File

@ -0,0 +1,49 @@
easy_admin:
design:
form_theme: 'vertical'
entities:
User:
class: Sikofitt\DoughnutWeddingBundle\Entity\User
list:
actions: ['show','edit','delete']
fields: ['name','username','email','enabled','lastLogin','rsvp']
show:
fields:
- name
- username
- email
- rsvp
- comment
- images
- enabled
- lastLogin
- passwordRequestedAt
- roles
- created
- updated
- facebookId
- googleId
- amazonId
- instagramId
- twitterId
- yahooId
Rsvp:
class: Sikofitt\DoughnutWeddingBundle\Entity\Rsvp
Image:
class: Sikofitt\DoughnutWeddingBundle\Entity\Image
image_base_path: 'https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/gallery/'
list:
actions: ['show','delete']
fields:
- { property: 'imageName', label: 'Image', type: 'image', base_path: 'https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/gallery/' }
- category
- tags
- user
form:
fields:
- { property: 'imageFile', type: 'vich_image', base_path: 'https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/gallery/' }
- { property: tags, type: 'collection'}
- category
- user

View File

@ -44,7 +44,12 @@ fos_user_resetting:
fos_user_change_password: fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /user/profile prefix: /user/profile
easy_admin_bundle:
resource: "@EasyAdminBundle/Controller/"
type: annotation
prefix: /admin
sikofitt_doughnut_wedding: sikofitt_doughnut_wedding:
resource: "@SikofittDoughnutWeddingBundle/Controller/" resource: "@SikofittDoughnutWeddingBundle/Controller/"
type: annotation type: annotation

View File

@ -5,9 +5,14 @@ security:
FOS\UserBundle\Model\UserInterface: FOS\UserBundle\Model\UserInterface:
algorithm: bcrypt algorithm: bcrypt
cost: 14 cost: 14
role_hierarchy:
ROLE_USER: ~
ROLE_ADMIN: [ROLE_USER]
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN]
providers: providers:
fos_userbundle: fos_userbundle:
id: fos_user.user_provider.username id: fos_user.user_provider.username_email
firewalls: firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs # disables authentication for assets and the profiler, adapt it according to your needs
dev: dev:
@ -31,17 +36,21 @@ security:
instagram: /login/callback/instagram instagram: /login/callback/instagram
amazon: /login/callback/amazon amazon: /login/callback/amazon
yahoo: /login/callback/yahoo yahoo: /login/callback/yahoo
login_path: /connect login_path: /login
use_forward: false use_forward: false
failure_path: /login failure_path: /connect
oauth_user_provider: oauth_user_provider:
service: hwi_oauth.user.provider.fosub_bridge service: hwi_oauth.user.provider.fosub_bridge
access_control: access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login/callback$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user$, role: ROLE_USER } - { path: ^/user, role: ROLE_USER }
- { path: ^/gallery/upload, role: ROLE_USER } - { path: ^/gallery/upload, role: ROLE_USER }
- { path: ^/gallery, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/gallery, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin$, role: ROLE_ADMIN } - { path: ^/admin$, role: ROLE_ADMIN }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

View File

@ -13,6 +13,11 @@ services:
arguments: ['@fos_user.user_manager'] arguments: ['@fos_user.user_manager']
tags: tags:
- { name: form.type, alias: app_user_registration } - { name: form.type, alias: app_user_registration }
doughnutwedding.form.profile:
class: Sikofitt\DoughnutWeddingBundle\Form\ProfileEditType
arguments: ['@fos_user.user_manager']
tags:
- { name: form.type, alias: app_user_profile_edit }
doughnutwedding.event.redirect_user_logged_in_event: doughnutwedding.event.redirect_user_logged_in_event:
class: Sikofitt\DoughnutWeddingBundle\EventListener\UserRedirectOnLoggedInListener class: Sikofitt\DoughnutWeddingBundle\EventListener\UserRedirectOnLoggedInListener
arguments: ['@security.token_storage', '@router'] arguments: ['@security.token_storage', '@router']

88166
app/logs/development.log Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
if(null === document.querySelector('select') && document.querySelector('select').length > 0) { if(null !== document.querySelector('select') && document.querySelector('select').length > 0) {
var selectPlaceholder = 'Choose an option.'; var selectPlaceholder = 'Choose an option.';
if(document.querySelector('select').hasAttribute('placeholder')) { if(document.querySelector('select').hasAttribute('placeholder')) {
selectPlaceholder = document.querySelector('select').getAttribute('placeholder'); selectPlaceholder = document.querySelector('select').getAttribute('placeholder');

View File

@ -45,4 +45,15 @@ class DefaultController extends Controller
} }
return $this->render('default/index.html.twig', $parameters); return $this->render('default/index.html.twig', $parameters);
} }
/**
* @Route("/our_story")
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return Response
*/
public function ourStoryAction(Request $request) {
return $this->render('our_story.html.twig');
}
} }

View File

@ -21,25 +21,25 @@
namespace Sikofitt\DoughnutWeddingBundle\Controller; namespace Sikofitt\DoughnutWeddingBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sikofitt\DoughnutWeddingBundle\Entity\Image;
use Sikofitt\DoughnutWeddingBundle\Form\GalleryUploadType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Vich\UploaderBundle\Form\Type\VichImageType;
/** /**
* Class ImageController. * Class ImageController.
* *
* @Route("/gallery") * @Route("/gallery")
*/ */
class ImageController extends Controller class GalleryController extends Controller
{ {
/** /**
* @Route("/") * @Route("/")
*/ */
public function indexAction() public function indexAction()
{ {
/** @var \Gaufrette\Filesystem $fileSystem */ $images = $this->get('doctrine.orm.default_entity_manager')->getRepository('SikofittDoughnutWeddingBundle:Image')->findAll();
$fileSystem = $this->get('knp_gaufrette.filesystem_map')->get('cloud'); return $this->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', ['images' => $images]);
dump($fileSystem->listKeys());
return $this->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', [
]);
} }
/** /**
@ -47,8 +47,10 @@ class ImageController extends Controller
*/ */
public function uploadAction() public function uploadAction()
{ {
$form = $this->get('form.factory')->create(GalleryUploadType::class, new Image());
return $this->render('SikofittDoughnutWeddingBundle:Image:upload.html.twig', [ return $this->render('SikofittDoughnutWeddingBundle:Image:upload.html.twig', [
// ... 'form' => $form->createView()
]); ]);
} }

View File

@ -1,43 +0,0 @@
<?php
/*
* doughnutwedding.com
* Copyright (C) 2017 http://doughnutwedding.com eric@doughnutwedding.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Sikofitt\DoughnutWeddingBundle\Controller;
class RouterCollector
{
/**
* @var \Kernel
*/
private $application;
public function setApplication(\Kernel $application)
{
$this->application = $application;
return $this;
}
public function buildRoutes()
{
$this->application->match('/login', DefaultController::class.'::loginAction')
->method('GET|POST')
->bind('login');
}
}

View File

@ -22,7 +22,9 @@ namespace Sikofitt\DoughnutWeddingBundle\Controller;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Sikofitt\DoughnutWeddingBundle\Form\RsvpType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Tests\Controller\ContainerAwareController;
use Symfony\Component\Form\FormFactory; use Symfony\Component\Form\FormFactory;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
@ -45,26 +47,13 @@ class RsvpController extends Controller
* @var UserRepository $userRepo * @var UserRepository $userRepo
*/ */
$em = $this->get('doctrine.orm.entity_manager'); $em = $this->get('doctrine.orm.entity_manager');
$rsvpRepo = $em->getRepository('Sikofitt:Rsvp'); $user = $this->getUser();
$count = (40 - $rsvpRepo->getRsvpCount()); $form = $this->get('form.factory')->create(RsvpType::class, $user);
$userRepo = $em->getRepository('Sikofitt:User');
$kCount = $userRepo->getKatrinaCount();
$eCount = $userRepo->getEricCount();
/**
* @var FormFactory $formFactory
*/
$formFactory = $app['form.factory'];
$user = new User();
$rsvp = new Rsvp();
$rsvp
->setCreated(new \DateTime('now'))
->setUpdated(new \DateTime('now'));
$user
->setRsvp($rsvp)
->setCreated(new \DateTime('now'))
->setUpdated(new \DateTime('now'));
$form = $formFactory->create(RsvpType::class, $user);
if ($request->isMethod('POST')) { if ($request->isMethod('POST')) {
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
@ -73,23 +62,16 @@ class RsvpController extends Controller
/** /**
* @var EntityManager $em * @var EntityManager $em
*/ */
$em = $app['orm.em'];
$em->persist($user); $em->persist($user);
$em->flush(); $em->flush();
return $app->redirect('/rsvp'); return $this->render('rsvp_form.html.twig', ['form' => $form->createView()]);
} }
} }
return $app->render( return $this->redirect($this->generateUrl('fos_user_profile_edit'));
'rsvp_form.html.twig',
[
'form' => $form->createView(),
'count' => $count,
'kCount' => $kCount,
'eCount' => $eCount,
]
);
} }
/** /**

View File

@ -3,10 +3,12 @@
namespace Sikofitt\DoughnutWeddingBundle\Entity; namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\File\File;
/** /**
* Image * Image
* * @Vich\Uploadable()
* @ORM\Table(name="image") * @ORM\Table(name="image")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageRepository") * @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageRepository")
*/ */
@ -22,57 +24,144 @@ class Image
private $id; private $id;
/** /**
* @var string * @var File
* *
* @ORM\Column(name="imageFile", type="string", length=255) * @Vich\UploadableField(mapping="gallery_image", fileNameProperty="imageName", size="imageSize")
*/ */
private $imageFile; private $imageFile;
/** /**
* @var string * @var string
* *
* @ORM\Column(name="imageName", type="string", length=255) * @ORM\Column(type="string", length=255)
*/ */
private $imageName; private $imageName;
/** /**
* @var int * @var \Sikofitt\DoughnutWeddingBundle\Entity\User
* *
* @ORM\Column(name="user", type="integer", nullable=true) * @ORM\ManyToOne(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\User", inversedBy="images")
*/ */
private $user; private $user;
/**
* @var string
*
* @ORM\Column(name="tags", type="json_array", nullable=true, unique=false)
*/
private $tags;
/** /**
* @var string
*
* @ORM\Column(name="category", type="string", length=255, nullable=true, unique=false)
*/
private $category;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true, unique=false)
*/
private $description;
/**
* @var bool
*
* @ORM\Column(name="is_published", type="boolean")
*/
private $isPublished = true;
/**
* @var \DateTimeImmutable
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* Get id * Get id
* *
* @return int * @return int
*/ */
public function getId() public function getId() : ?int
{ {
return $this->id; return $this->id;
} }
/**
* @return string
*/
public function getDescription(): ?string {
return $this->description;
}
/**
* @param string $description
*
* @return Image
*/
public function setDescription(?string $description): Image {
$this->description = $description;
return $this;
}
/**
* @return bool
*/
public function isIsPublished(): bool {
return $this->isPublished;
}
/**
* @param bool $isPublished
*
* @return Image
*/
public function setIsPublished(bool $isPublished): Image {
$this->isPublished = $isPublished;
return $this;
}
/**
* @return \DateTimeImmutable
*/
public function getUpdatedAt(): ?\DateTimeImmutable {
return $this->updatedAt;
}
/**
* @param \DateTimeImmutable $updatedAt
*
* @return Image
*/
public function setUpdatedAt(\DateTimeImmutable $updatedAt): Image {
$this->updatedAt = $updatedAt;
return $this;
}
/** /**
* Set imageFile * Set imageFile
* *
* @param string $imageFile * @param File|UploadedFile $imageFile
* *
* @return Image * @return Image
*/ */
public function setImageFile($imageFile) public function setImageFile(?File $imageFile) : Image
{ {
$this->imageFile = $imageFile; $this->imageFile = $imageFile;
if($imageFile) {
$this->updatedAt = new \DateTimeImmutable();
}
return $this; return $this;
} }
/** /**
* Get imageFile * Get imageFile
* *
* @return string * @return File|null
*/ */
public function getImageFile() public function getImageFile() : ?File
{ {
return $this->imageFile; return $this->imageFile;
} }
@ -84,7 +173,7 @@ class Image
* *
* @return Image * @return Image
*/ */
public function setImageName($imageName) public function setImageName(string $imageName) : Image
{ {
$this->imageName = $imageName; $this->imageName = $imageName;
@ -96,19 +185,24 @@ class Image
* *
* @return string * @return string
*/ */
public function getImageName() public function getImageName() : ?string
{ {
return $this->imageName; if(null === $this->imageName && null !== $this->imageFile) {
return $this->imageFile->getFilename();
}
return $this->imageName;
} }
/** /**
* Set user * Set user
* *
* @param integer $user * @param User $user
* *
* @return Image * @return Image
*/ */
public function setUser($user) public function setUser(?User $user) : Image
{ {
$this->user = $user; $this->user = $user;
@ -118,11 +212,62 @@ class Image
/** /**
* Get user * Get user
* *
* @return int * @return User
*/ */
public function getUser() public function getUser() : ?User
{ {
return $this->user; return $this->user;
} }
}
/**
* Set tags
*
* @param array $tags
*
* @return Image
*/
public function setTags($tags) : Image
{
$this->tags = $tags;
return $this;
}
/**
* Get tags
*
* @return array
*/
public function getTags()
{
return $this->tags;
}
/**
* Set category
*
* @param string $category
*
* @return Image
*/
public function setCategory($category)
{
$this->category = $category;
return $this;
}
/**
* Get category
*
* @return string
*/
public function getCategory()
{
return $this->category;
}
public function __toString() {
return $this->imageName;
//return sprintf('<img src="%s" alt="%s" />', $this->imageName, $this->imageName);
}
}

View File

@ -1,128 +0,0 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ImageCategory
*
* @ORM\Table(name="image_category")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageCategoryRepository")
*/
class ImageCategory
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="categoryName", type="string", length=255)
*/
private $categoryName;
/**
* @var string
*
* @ORM\Column(name="machineName", type="string", length=255, unique=true)
*/
private $machineName;
/**
* @var int
*
* @ORM\Column(name="image", type="integer")
*/
private $image;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set categoryName
*
* @param string $categoryName
*
* @return ImageCategory
*/
public function setCategoryName($categoryName)
{
$this->categoryName = $categoryName;
return $this;
}
/**
* Get categoryName
*
* @return string
*/
public function getCategoryName()
{
return $this->categoryName;
}
/**
* Set machineName
*
* @param string $machineName
*
* @return ImageCategory
*/
public function setMachineName($machineName)
{
$this->machineName = $machineName;
return $this;
}
/**
* Get machineName
*
* @return string
*/
public function getMachineName()
{
return $this->machineName;
}
/**
* Set image
*
* @param integer $image
*
* @return ImageCategory
*/
public function setImage($image)
{
$this->image = $image;
return $this;
}
/**
* Get image
*
* @return int
*/
public function getImage()
{
return $this->image;
}
}

View File

@ -1,128 +0,0 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ImageTag
*
* @ORM\Table(name="image_tag")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageTagRepository")
*/
class ImageTag
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="tagName", type="string", length=255)
*/
private $tagName;
/**
* @var string
*
* @ORM\Column(name="machineName", type="string", length=255, unique=true)
*/
private $machineName;
/**
* @var int
*
* @ORM\Column(name="image", type="integer", nullable=true)
*/
private $image;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set tagName
*
* @param string $tagName
*
* @return ImageTag
*/
public function setTagName($tagName)
{
$this->tagName = $tagName;
return $this;
}
/**
* Get tagName
*
* @return string
*/
public function getTagName()
{
return $this->tagName;
}
/**
* Set machineName
*
* @param string $machineName
*
* @return ImageTag
*/
public function setMachineName($machineName)
{
$this->machineName = $machineName;
return $this;
}
/**
* Get machineName
*
* @return string
*/
public function getMachineName()
{
return $this->machineName;
}
/**
* Set image
*
* @param integer $image
*
* @return ImageTag
*/
public function setImage($image)
{
$this->image = $image;
return $this;
}
/**
* Get image
*
* @return int
*/
public function getImage()
{
return $this->image;
}
}

View File

@ -180,4 +180,8 @@ class Rsvp
{ {
return $this->user; return $this->user;
} }
public function __toString() {
return sprintf('%d guests', $this->guests);
}
} }

View File

@ -20,158 +20,173 @@
namespace Sikofitt\DoughnutWeddingBundle\Entity; namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** @noinspection ClassOverridesFieldOfSuperClassInspection */
/** /**
* Class User. * Class User.
* *
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\UserRepository") * @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\UserRepository")
* @ORM\Table(name="users") * @ORM\Table(name="users")
*/ */
class User extends \FOS\UserBundle\Model\User class User extends \FOS\UserBundle\Model\User {
{
const KATRINA_SIDE = 'Katrina';
const ERIC_SIDE = 'Eric'; const KATRINA_SIDE = 'Katrina';
/** const ERIC_SIDE = 'Eric';
* @ORM\Id()
* @ORM\Column(name="id", type="integer", nullable=false, unique=true)
* @ORM\GeneratedValue(strategy="IDENTITY")
*
* @var int
*/
protected $id;
/** /**
* @ORM\Column(name="fullname", type="string", length=255, nullable=false) * @ORM\Id()
* @Assert\NotBlank() * @ORM\Column(name="id", type="integer", nullable=false, unique=true)
* @Assert\Regex(pattern="/\w+/") * @ORM\GeneratedValue(strategy="IDENTITY")
*/ *
private $name; * @var int
*/
protected $id;
/** /**
* @var string * @ORM\Column(name="fullname", type="string", length=255, nullable=false)
* @ORM\Column(name="reset_token", type="string", length=255, nullable=true) * @Assert\NotBlank()
*/ * @Assert\Regex(pattern="/\w+/")
private $resetToken; */
private $name;
/** /**
* @var string * @var \Sikofitt\DoughnutWeddingBundle\Entity\Rsvp
* @ORM\Column(name="user_token", type="string", length=255, nullable=true) * @ORM\OneToOne(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\Rsvp", inversedBy="user",
*/ * cascade={"persist"})
private $userToken; */
private $rsvp;
/** /**
* @var int * @ORM\Column(type="datetime", name="created")
* @ORM\OneToOne(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\Rsvp", inversedBy="user", cascade={"persist"}) */
*/ private $created;
private $rsvp;
/** /**
* @ORM\Column(type="datetime", name="created") * @ORM\Column(type="datetime", name="updated")
*/ */
private $created = null; private $updated;
/** /**
* @ORM\Column(type="datetime", name="updated") * @var \Doctrine\Common\Collections\ArrayCollection
*/ *
private $updated = null; * @ORM\OneToMany(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\Image", mappedBy="user")
*/
private $images;
/**
* @var string
*
* @ORM\Column(name="comments", type="text", nullable=true)
*/
private $comment;
/** /**
* @ORM\Column(name="facebook_id", type="string", length=255, nullable=true) * @ORM\Column(name="facebook_id", type="string", length=255, nullable=true)
*/ */
private $facebookId; private $facebookId;
private $facebookAccessToken; private $facebookAccessToken;
/** /**
* @ORM\Column(name="google_id", type="string", length=255, nullable=true) * @ORM\Column(name="google_id", type="string", length=255, nullable=true)
*/ */
private $googleId; private $googleId;
private $googleAccessToken; private $googleAccessToken;
/** /**
* @ORM\Column(name="amazon_id", type="string", length=255, nullable=true) * @ORM\Column(name="amazon_id", type="string", length=255, nullable=true)
*/ */
private $amazonId; private $amazonId;
private $amazonAccessToken; private $amazonAccessToken;
/** /**
* @ORM\Column(name="instagram_id", type="string", length=255, nullable=true) * @ORM\Column(name="instagram_id", type="string", length=255, nullable=true)
*/ */
private $instagramId; private $instagramId;
private $instagramAccessToken;
private $instagramAccessToken;
/** /**
* @ORM\Column(name="twitter_id", type="string", length=255, nullable=true) * @ORM\Column(name="twitter_id", type="string", length=255, nullable=true)
*/ */
private $twitterId; private $twitterId;
private $twitterAccessToken;
private $twitterAccessToken;
/** /**
* @ORM\Column(name="yahoo_id", type="string", length=255, nullable=true) * @ORM\Column(name="yahoo_id", type="string", length=255, nullable=true)
*/ */
private $yahooId; private $yahooId;
private $yahooAccessToken;
public function __construct() private $yahooAccessToken;
{
if (null === $this->created) { /**
$this->created = new \DateTime('now'); * User constructor.
} */
$this->updated = new \DateTime('now'); public function __construct() {
parent::__construct(); if (NULL === $this->created) {
$this->created = new \DateTime('now');
} }
$this->updated = new \DateTime('now');
parent::__construct();
}
public function getComment() : ?string {
return $this->comment;
}
public function setComment(?string $comment) : User {
$this->comment = $comment;
return $this;
}
/** /**
* @return mixed * @return mixed
*/ */
public function getAmazonId() public function getAmazonId() : ?string {
{ return $this->amazonId;
return $this->amazonId;
} }
/** /**
* @param mixed $amazonId * @param string $amazonId
* *
* @return User * @return User
*/ */
public function setAmazonId($amazonId) public function setAmazonId(?string $amazonId) : User {
{ $this->amazonId = $amazonId;
$this->amazonId = $amazonId;
return $this; return $this;
} }
/** /**
* @return mixed * @return string
*/ */
public function getAmazonAccessToken() public function getAmazonAccessToken() : ?string {
{ return $this->amazonAccessToken;
return $this->amazonAccessToken;
} }
/** /**
* @param mixed $amazonAccessToken * @param string $amazonAccessToken
* *
* @return User * @return User
*/ */
public function setAmazonAccessToken($amazonAccessToken) public function setAmazonAccessToken(?string $amazonAccessToken) : User {
{ $this->amazonAccessToken = $amazonAccessToken;
$this->amazonAccessToken = $amazonAccessToken;
return $this; return $this;
} }
/** /**
* @return mixed * @return string
*/ */
public function getFacebookId() public function getFacebookId() : ?string {
{ return $this->facebookId;
return $this->facebookId;
} }
/** /**
@ -179,411 +194,310 @@ class User extends \FOS\UserBundle\Model\User
* *
* @return User * @return User
*/ */
public function setFacebookId($facebookId) public function setFacebookId(string $facebookId) : User {
{ $this->facebookId = $facebookId;
$this->facebookId = $facebookId;
return $this; return $this;
}
/**
* @return string
*/
public function getFacebookAccessToken() : ?string {
return $this->facebookAccessToken;
}
/**
* @param string $facebookAccessToken
*
* @return User
*/
public function setFacebookAccessToken(?string $facebookAccessToken) : User {
$this->facebookAccessToken = $facebookAccessToken;
return $this;
}
/**
* @return string
*/
public function getGoogleId() : ?string {
return $this->googleId;
}
/**
* @param string $googleId
*
* @return User
*/
public function setGoogleId(?string $googleId) : User {
$this->googleId = $googleId;
return $this;
}
/**
* @return string
*/
public function getGoogleAccessToken() : ?string {
return $this->googleAccessToken;
}
/**
* @param string $googleAccessToken
*
* @return User
*/
public function setGoogleAccessToken(?string $googleAccessToken) : User {
$this->googleAccessToken = $googleAccessToken;
return $this;
}
/**
* @return string
*/
public function getInstagramId() : ?string{
return $this->instagramId;
}
/**
* @param string $instagramId
*
* @return User
*/
public function setInstagramId(?string $instagramId) : User {
$this->instagramId = $instagramId;
return $this;
} }
/** /**
* @return mixed * @return mixed
*/ */
public function getFacebookAccessToken() public function getInstagramAccessToken() : ?string {
{ return $this->instagramAccessToken;
return $this->facebookAccessToken;
} }
/** /**
* @param mixed $facebookAccessToken * @param string $instagramAccessToken
* *
* @return User * @return User
*/ */
public function setFacebookAccessToken($facebookAccessToken) public function setInstagramAccessToken(?string $instagramAccessToken) : User {
{ $this->instagramAccessToken = $instagramAccessToken;
$this->facebookAccessToken = $facebookAccessToken;
return $this; return $this;
}
/**
* @return string
*/
public function getTwitterId() : ?string {
return $this->twitterId;
}
/**
* @param string $twitterId
*
* @return User
*/
public function setTwitterId(?string $twitterId) : User {
$this->twitterId = $twitterId;
return $this;
} }
/** /**
* @return mixed * @return mixed
*/ */
public function getGoogleId() public function getTwitterAccessToken() {
{ return $this->twitterAccessToken;
return $this->googleId;
} }
/** /**
* @param mixed $googleId * @param string $twitterAccessToken
* *
* @return User * @return User
*/ */
public function setGoogleId($googleId) public function setTwitterAccessToken(?string $twitterAccessToken) : User {
{ $this->twitterAccessToken = $twitterAccessToken;
$this->googleId = $googleId;
return $this; return $this;
} }
/** /**
* @return mixed * @return string
*/ */
public function getGoogleAccessToken() public function getYahooId() : ?string {
{ return $this->yahooId;
return $this->googleAccessToken;
} }
/** /**
* @param mixed $googleAccessToken * @param string $yahooId
* *
* @return User * @return User
*/ */
public function setGoogleAccessToken($googleAccessToken) public function setYahooId(?string $yahooId) : User {
{ $this->yahooId = $yahooId;
$this->googleAccessToken = $googleAccessToken;
return $this; return $this;
} }
/** /**
* @return mixed * @return string
*/ */
public function getInstagramId() public function getYahooAccessToken() : ?string {
{ return $this->yahooAccessToken;
return $this->instagramId;
} }
/** /**
* @param mixed $instagramId * @param string $yahooAccessToken
* *
* @return User * @return User
*/ */
public function setInstagramId($instagramId) public function setYahooAccessToken(?string $yahooAccessToken): User {
{ $this->yahooAccessToken = $yahooAccessToken;
$this->instagramId = $instagramId;
return $this; return $this;
} }
/** /**
* @return mixed * Get Name.
*
* @return string
*/ */
public function getInstagramAccessToken() public function getName(): ?string {
{ return $this->name;
return $this->instagramAccessToken;
} }
/** /**
* @param mixed $instagramAccessToken * Set Name.
*
* @param string $name
* *
* @return User * @return User
*/ */
public function setInstagramAccessToken($instagramAccessToken) public function setName(string $name): User {
{ $this->name = $name;
$this->instagramAccessToken = $instagramAccessToken;
return $this; return $this;
} }
/** /**
* @return mixed * @param string $plainPassword
*/
public function getTwitterId()
{
return $this->twitterId;
}
/**
* @param mixed $twitterId
* *
* @return User * @return User
*/ */
public function setTwitterId($twitterId) public function setPlainPassword($plainPassword): User {
{ $this->plainPassword = $plainPassword;
$this->twitterId = $twitterId;
return $this; return $this;
} }
/** /**
* @return mixed * Get created.
*
* @return \DateTime
*/ */
public function getTwitterAccessToken() public function getCreated(): ?\DateTime {
{ return $this->created;
return $this->twitterAccessToken;
} }
/** /**
* @param mixed $twitterAccessToken * Set created.
*
* @param \DateTime $created
* *
* @return User * @return User
*/ */
public function setTwitterAccessToken($twitterAccessToken) public function setCreated(?\DateTime $created): User {
{ $this->created = $created;
$this->twitterAccessToken = $twitterAccessToken;
return $this; return $this;
} }
/** /**
* @return mixed * Get updated.
*
* @return \DateTime
*/ */
public function getYahooId() public function getUpdated(): ?\DateTime {
{ return $this->updated;
return $this->yahooId;
} }
/** /**
* @param mixed $yahooId * Set updated.
*
* @param \DateTime $updated
* *
* @return User * @return User
*/ */
public function setYahooId($yahooId) public function setUpdated(?\DateTime $updated): User {
{ $this->updated = $updated;
$this->yahooId = $yahooId;
return $this; return $this;
} }
/** /**
* @return mixed * Get rsvp.
*
* @return Rsvp
*/ */
public function getYahooAccessToken() public function getRsvp(): ?Rsvp {
{ return $this->rsvp;
return $this->yahooAccessToken;
} }
/** /**
* @param mixed $yahooAccessToken * Set rsvp.
*
* @param Rsvp $rsvp
* *
* @return User * @return User
*/ */
public function setYahooAccessToken($yahooAccessToken) public function setRsvp(Rsvp $rsvp = NULL) : User {
{ $this->rsvp = $rsvp;
$this->yahooAccessToken = $yahooAccessToken;
return $this; return $this;
} }
/** /**
* Get id. * Add image
* *
* @return int * @param \Sikofitt\DoughnutWeddingBundle\Entity\Image $image
*/ *
public function getId() * @return User
{ */
return $this->id; public function addImage(Image $image): User {
} $image->setUser($this);
/** $this->images[] = $image;
* Set Name.
*
* @param string $name
*
* @return User
*/
public function setName($name)
{
$this->name = $name;
return $this; return $this;
} }
/** /**
* Get Name. * Remove image
* *
* @return string * @param \Sikofitt\DoughnutWeddingBundle\Entity\Image $image
*/ *
public function getName() * @return Void
{ */
return $this->name; public function removeImage(Image $image): void {
} $image->setUser(NULL);
/** $this->images->removeElement($image);
* @return string }
*/
public function getUsername()
{
return $this->username;
}
/**
* Get images
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getImages() {
/** return $this->images;
* Set email. }
*
* @param string $email
*
* @return User
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* @param string $password
*
* @return $this
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* @return string
*/
public function getPlainPassword()
{
return $this->plainPassword;
}
/**
* @param string $plainPassword
*
* @return User
*/
public function setPlainPassword($plainPassword): User
{
$this->plainPassword = $plainPassword;
return $this;
}
/**
* @param string $userToken
*
* @return $this
*/
public function setUserToken($userToken)
{
$this->userToken = $userToken;
return $this;
}
/**
* @return string
*/
public function getUserToken()
{
return $this->userToken;
}
/**
* @param string $resetToken
*
* @return $this
*/
public function setResetToken($resetToken)
{
$this->resetToken = $resetToken;
return $this;
}
/**
* @return string
*/
public function getResetToken()
{
return $this->resetToken;
}
/**
* Set created.
*
* @param \DateTime $created
*
* @return User
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created.
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set updated.
*
* @param \DateTime $updated
*
* @return User
*/
public function setUpdated($updated)
{
$this->updated = $updated;
return $this;
}
/**
* Get updated.
*
* @return \DateTime
*/
public function getUpdated()
{
return $this->updated;
}
/**
* Set rsvp.
*
* @param Rsvp $rsvp
*
* @return User
*/
public function setRsvp(Rsvp $rsvp = null)
{
$this->rsvp = $rsvp;
return $this;
}
/**
* Get rsvp.
*
* @return Rsvp
*/
public function getRsvp()
{
return $this->rsvp;
}
} }

View File

@ -105,9 +105,10 @@ class UserRedirectOnLoggedInListener
private function getRedirectRoutes(): array private function getRedirectRoutes(): array
{ {
return [ return [
//'fos_user_security_login', 'fos_user_security_login',
// 'fos_user_registration_confirmed', 'fos_user_registration_confirmed',
//'hwi_oauth_connect' 'hwi_oauth_connect',
'fos_user_resetting_request'
]; ];
} }
} }

View File

@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/24/17
* Time: 6:38 PM
*/
namespace Sikofitt\DoughnutWeddingBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class ChangePasswordFormType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->remove('current_password');
}
public function getParent() {
return \FOS\UserBundle\Form\Type\ChangePasswordFormType::class;
}
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/24/17
* Time: 6:56 PM
*/
namespace Sikofitt\DoughnutWeddingBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Vich\UploaderBundle\Form\Type\VichImageType;
class GalleryUploadType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('imageFile', VichImageType::class, [
'label_attr' => [
'class' => 'uk-form-label'
],
'attr' => [
'class' => ''
]
])
->add('description')
->add('tags')
->add('category');
}
}

View File

@ -9,7 +9,9 @@
namespace Sikofitt\DoughnutWeddingBundle\Form; namespace Sikofitt\DoughnutWeddingBundle\Form;
use Symfony\Component\Form\FormEvent;
use FOS\UserBundle\Form\Type\ProfileFormType; use FOS\UserBundle\Form\Type\ProfileFormType;
use FOS\UserBundle\Model\UserManager;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse; use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
use Sikofitt\DoughnutWeddingBundle\Entity\Rsvp; use Sikofitt\DoughnutWeddingBundle\Entity\Rsvp;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
@ -18,17 +20,22 @@ use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
class ProfileEditType extends AbstractType class ProfileEditType extends AbstractType
{ {
private $userManager;
public function __construct(UserManager $userManager) {
$this->userManager = $userManager;
}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$emailOptions = $builder->get('email')->getOptions(); $emailOptions = $builder->get('email')->getOptions();
$builder->remove('current_password'); $builder->remove('current_password');
//$builder->remove('username'); $builder->remove('username');
$builder->remove('email'); $builder->remove('email');
$emailOptions['attr'] = [ $emailOptions['attr'] = [
'class' => 'uk-input uk-form-large uk-padding-small uk-box-shadow-hover-small', 'class' => 'uk-input uk-form-large uk-padding-small uk-box-shadow-hover-small',
@ -59,6 +66,12 @@ class ProfileEditType extends AbstractType
], ],
]); ]);
$builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) {
$user = $event->getData();
$user->setUsername($user->getEmail());
$this->userManager->updateCanonicalFields($user);
});
$builder->get('rsvp') $builder->get('rsvp')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (?Rsvp $rsvp) { function (?Rsvp $rsvp) {

View File

@ -21,6 +21,7 @@
namespace Sikofitt\DoughnutWeddingBundle\Form; namespace Sikofitt\DoughnutWeddingBundle\Form;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse; use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use FOS\UserBundle\Form\Type\RegistrationFormType; use FOS\UserBundle\Form\Type\RegistrationFormType;
use FOS\UserBundle\Model\UserManager; use FOS\UserBundle\Model\UserManager;
@ -40,11 +41,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class RegistrationType extends AbstractType class RegistrationType extends AbstractType
{ {
private $userManger; private $userManager;
public function __construct(UserManager $userManager) public function __construct(UserManager $userManager)
{ {
$this->userManger = $userManager; $this->userManager = $userManager;
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -59,13 +60,25 @@ class RegistrationType extends AbstractType
'label_attr' => [ 'label_attr' => [
'class' => 'uk-form-label uk-text-primary', 'class' => 'uk-form-label uk-text-primary',
], ],
])->remove('username'); ])
->add('comment', TextareaType::class, [
'required' => false,
'label' => 'Anything you would like to share with the Bride and Groom?',
'label_attr' => [
'class' => 'uk-form-label uk-visible@m',
],
'attr' => [
'class' => 'uk-textarea uk-form-large',
'placeholder' => 'Anything you would like to share with the Bride and Groom?'
]
])
->remove('username');
$builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) { $builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) {
$user = $event->getData(); $user = $event->getData();
$user->setUsername($user->getEmail()); $user->setUsername($user->getEmail());
$this->userManger->updateCanonicalFields($user); $this->userManager->updateCanonicalFields($user);
}); });
$builder->get('rsvp') $builder->get('rsvp')

View File

@ -18,10 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace Sikofitt\App\Form; namespace Sikofitt\DoughnutWeddingBundle\Form;
use Sikofitt\App\Entity\Rsvp; use Sikofitt\DoughnutWeddingBundle\Entity\Rsvp;
use Sikofitt\App\Entity\User; use Sikofitt\DoughnutWeddingBundle\Entity\User;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\{ use Symfony\Component\Form\Extension\Core\Type\{

View File

@ -3,5 +3,16 @@
{% block title %}SikofittDoughnutWeddingBundle:Image:upload{% endblock %} {% block title %}SikofittDoughnutWeddingBundle:Image:upload{% endblock %}
{% block body %} {% block body %}
<h1>Welcome to the Image:upload page</h1> {{ form_start(form, {'attr': { 'class': 'uk-form uk-form-horizontal'}}) }}
{{ form_label(form.imageFile, null, {'label_attr':{'class':'uk-hidden'}}) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_widget(form.imageFile) }}
</div>
<button class="uk-button uk-button-default">Submit</button>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %} {% endblock %}