Finished Social logins..almost

This commit is contained in:
R. Eric Wheeler 2017-04-26 21:32:43 -07:00
parent 2d025468cb
commit 574525c0a4
51 changed files with 1266 additions and 147 deletions

4
.gitattributes vendored
View File

@ -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_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_location.jpg filter=lfs diff=lfs merge=lfs -text
build/images/home_photo.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

View File

@ -18,7 +18,6 @@
* 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;
@ -40,7 +39,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 JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(), new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(),
]; ];

View File

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

View File

@ -1,8 +1,20 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }} <h2 class="uk-heading-line"><span>Change your password</span></h2>
{{ form_widget(form) }} {{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'uk-form uk-form-horizontal fos_user_resetting_reset' } }) }}
<div>
<input type="submit" value="{{ 'change_password.submit'|trans }}" /> {{ form_label(form.plainPassword.first, 'New password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_errors(form.plainPassword.first) }}
{{ form_widget(form.plainPassword.first, {'attr':{'class':'uk-input uk-form-large','placeholder':'New 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">
{{ form_errors(form.plainPassword.second) }}
{{ form_widget(form.plainPassword.second, {'attr':{'class':'uk-input uk-form-large','placeholder':'Repeat password'}}) }}
</div>
<div class="uk-margin-medium-top uk-width-1-1 uk-text-right@m">
<input type="submit" class="uk-button uk-width-1-1@s uk-width-1-2@m uk-button-large uk-button-primary" value="{{ 'resetting.reset.submit'|trans }}" />
</div> </div>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -1,5 +1,5 @@
{% extends "base.html.twig" %} {% extends "base.html.twig" %}
{% block title %}Register{% endblock title %}
{% block body %} {% block body %}
{% include "@FOSUser/Registration/register_content.html.twig" %} {% include "@FOSUser/Registration/register_content.html.twig" %}
{% endblock body %} {% endblock body %}

View File

@ -2,7 +2,7 @@
<div class="uk-width-1-1"> <div class="uk-width-1-1">
{{ form_errors(form) }} {{ form_errors(form) }}
</div> </div>
{{ dump(app.session) }}
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register uk-form'}}) }} {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register uk-form'}}) }}
<fieldset class="uk-fieldset"> <fieldset class="uk-fieldset">
<legend class="uk-legend"> <legend class="uk-legend">
@ -17,6 +17,7 @@
<div class="uk-margin"> <div class="uk-margin">
<div hidden>{{ form_label(form.name, 'Name', { 'label_attr':{'class':'uk-form-label'}}) }}</div> <div hidden>{{ form_label(form.name, 'Name', { 'label_attr':{'class':'uk-form-label'}}) }}</div>
<div class="uk-form-controls uk-form-controls-text"> <div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.name) }}
{{ form_widget(form.name, { 'attr': {'placeholder':'Name', 'class':'uk-input uk-form-large uk-padding-small'} }) }} {{ form_widget(form.name, { 'attr': {'placeholder':'Name', 'class':'uk-input uk-form-large uk-padding-small'} }) }}
</div> </div>
</div> </div>
@ -24,14 +25,23 @@
<div class="uk-margin"> <div class="uk-margin">
<div hidden>{{ form_label(form.rsvp) }}</div> <div hidden>{{ form_label(form.rsvp) }}</div>
<div class="uk-form-controls uk-form-controls-text"> <div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.rsvp) }}
{{ form_widget(form.rsvp) }} {{ form_widget(form.rsvp) }}
</div> </div>
<div class="uk-margin">
<div hidden>{{ form_label(form.comment, null, { 'label_attr':{'class':'uk-form-label'}}) }}</div>
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.comment) }}
{{ form_widget(form.comment) }}
</div>
</div>
<div class="uk-margin"> <div class="uk-margin">
<div hidden>{{ form_label(form.plainPassword.first, 'Password', { 'label_attr':{'class':'uk-form-label'}}) }}</div> <div hidden>{{ form_label(form.plainPassword.first, 'Password', { 'label_attr':{'class':'uk-form-label'}}) }}</div>
<div class="uk-form-controls uk-form-controls-text"> <div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.plainPassword) }}
{{ form_widget(form.plainPassword.first, { 'attr': {'placeholder':'Password', 'class':'uk-input uk-form-large uk-padding-small'} }) }} {{ form_widget(form.plainPassword.first, { 'attr': {'placeholder':'Password', 'class':'uk-input uk-form-large uk-padding-small'} }) }}
</div> </div>
</> </div>
<div class="uk-margin"> <div class="uk-margin">
<div hidden>{{ form_label(form.plainPassword.second, 'Repeat ', { 'label_attr':{'class':'uk-form-label'}}) }}</div> <div hidden>{{ form_label(form.plainPassword.second, 'Repeat ', { 'label_attr':{'class':'uk-form-label'}}) }}</div>
<div class="uk-form-controls uk-form-controls-text"> <div class="uk-form-controls uk-form-controls-text">

View File

@ -1,9 +1,8 @@
{% extends "@FOSUser/layout.html.twig" %} {% extends "base.html.twig" %}
{% block title %}Check Email{% endblock title %}
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{% block body %}
{% block fos_user_content %} <p class="uk-width-1-1 uk-text-center uk-text-lead">
<p>
{{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime})|nl2br }} {{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime})|nl2br }}
</p> </p>
{% endblock %} {% endblock %}

View File

@ -1,13 +1,24 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{% block subject %} {% block subject %}
{%- autoescape false -%} {%- autoescape false -%}
{{ 'resetting.email.subject'|trans({'%username%': user.username}) }} [Doughnut Wedding] Password reset requested
{%- endautoescape -%} {%- endautoescape -%}
{% endblock %} {% endblock %}
{% block body_text %} {% block body_text %}
{% autoescape false %} {% 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 %} {% endautoescape %}
{% endblock %} {% endblock %}
{% block body_html %}{% endblock %} {% block body_html %}{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "base.html.twig" %} {% extends "base.html.twig" %}
{% block title %}Reset Password{% endblock title %}
{% block body %} {% block body %}
{% include "@FOSUser/Resetting/request_content.html.twig" %} {% include "@FOSUser/Resetting/request_content.html.twig" %}
{% endblock body %} {% endblock body %}

View File

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

View File

@ -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" %} {% include "@FOSUser/Resetting/reset_content.html.twig" %}
{% endblock fos_user_content %} {% endblock body %}

View File

@ -1,8 +1,19 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
<h2 class="uk-heading-line"><span>Reset your password</span></h2>
{{ 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_label(form.plainPassword.first, 'New password', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
{{ form_widget(form) }} <div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
<div> {{ form_errors(form.plainPassword.first) }}
<input type="submit" value="{{ 'resetting.reset.submit'|trans }}" /> {{ form_widget(form.plainPassword.first, {'attr':{'class':'uk-input uk-form-large','placeholder':'New 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">
{{ form_errors(form.plainPassword.second) }}
{{ form_widget(form.plainPassword.second, {'attr':{'class':'uk-input uk-form-large','placeholder':'Repeat password'}}) }}
</div>
<div class="uk-margin-medium-top uk-width-1-1 uk-text-right@m">
<input type="submit" class="uk-button uk-width-1-1@s uk-width-1-2@m uk-button-large uk-button-primary" value="{{ 'resetting.reset.submit'|trans }}" />
</div> </div>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -1,5 +1,5 @@
{% extends "base.html.twig" %} {% extends "base.html.twig" %}
{% block title %}Login{% endblock title %}
{% block body %} {% block body %}
{{ include('@FOSUser/Security/login_content.html.twig') }} {{ include('@FOSUser/Security/login_content.html.twig') }}
{% endblock body %} {% endblock body %}

View File

@ -1,7 +1,7 @@
{% trans_default_domain 'FOSUserBundle' %} {% trans_default_domain 'FOSUserBundle' %}
{% if error %} {% if error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div> <div class="uk-alert uk-width-1-1">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %} {% endif %}
<form action="{{ path("fos_user_security_check") }}" method="post" class="uk-login-form uk-form uk-form-stacked"> <form action="{{ path("fos_user_security_check") }}" method="post" class="uk-login-form uk-form uk-form-stacked">
@ -20,15 +20,20 @@
<label class="uk-form-label uk-hidden" for="password">{{ 'security.login.password'|trans }}</label> <label class="uk-form-label uk-hidden" for="password">{{ 'security.login.password'|trans }}</label>
<div class="uk-inline uk-width-1-1 uk-form-controls uk-form-controls-text"> <div class="uk-inline uk-width-1-1 uk-form-controls uk-form-controls-text">
<span class="uk-form-icon" uk-icon="icon: lock"></span> <span class="uk-form-icon" uk-icon="icon: lock"></span>
<input class="uk-input uk-form-large" placeholder="Password" type="password" id="password" name="_password" required="required" /> <input class="uk-input uk-form-large" placeholder="Password" type="password" id="password" name="_password" required="required" />
</div> </div>
</div> </div>
<div class="uk-form-controls uk-child-width-1-2@m uk-child-width-1-1@s uk-padding-remove-horizontal uk-padding-small uk-grid-collapse" uk-grid> <div class="uk-form-controls uk-child-width-1-2@m uk-child-width-1-1@s uk-padding-remove-horizontal uk-padding-small uk-grid-collapse" uk-grid>
<div><input type="submit" class="uk-button uk-button-large uk-button-primary uk-width-1-1@s uk-align-left@m" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" /></div> <div>
<input type="submit" class="uk-button uk-button-large uk-button-primary uk-width-1-1@s uk-align-left@m" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
</div>
<div class="uk-text-right uk-margin-small-top uk-form-controls"> <div class="uk-text-right uk-margin-small-top uk-form-controls">
<label for="remember_me">{{ 'security.login.remember_me'|trans }}</label> <label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>
<input type="checkbox" class="uk-checkbox uk-margin-medium-left" id="remember_me" name="_remember_me" value="on" /></div> <input type="checkbox" class="uk-checkbox uk-margin-medium-left" id="remember_me" name="_remember_me" value="on" />
</div>
</div>
<div class="uk-width-1-1 uk-text-center">
<p>Forgot your password? <a href="{{ path('fos_user_resetting_request') }}">Click here</a></p>
</div> </div>
</div> </div>

View File

@ -1,7 +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,20 +1,43 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Register with {{ userInformation.resourceOwner.name|capitalize }}{% endblock title %}
{% block body %} {% block body %}
<div class="uk-width-1-1">
{% if userInformation.resourceOwner.name == 'yahoo' %} <div class="uk-width-1-1">
{% 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 %} {% set name = userInformation.nickname %}
{% else %} {% else %}
{% set name = userInformation.email %} {% set name = userInformation.email %}
{% endif %} {% endif %}
<h3>{{ 'header.register' | trans({'%name%': name }, 'HWIOAuthBundle') }}</h3>
<div class="uk-card uk-card-default uk-margin-small-bottom uk-width-1-1">
<div class="uk-card-header">
<div class="uk-grid-small uk-flex-middle" uk-grid>
<div class="uk-width-auto">
{% if userInformation.profilePicture is not empty %}
<img class="" width="40" height="40" src="{{ userInformation.profilePicture }}">
{% endif %}
</div>
<div class="uk-width-expand">
<p class="uk-text-large uk-card-title uk-margin-remove-bottom">Register with {{ userInformation.resourceOwner.name|capitalize }} account?</p>
</div>
</div>
</div>
<div class="uk-card-footer">
<p class="uk-margin-remove-top">
{{ 'header.register' | trans({'%name%': name }, 'HWIOAuthBundle') }}?
</p>
</div>
</div>
{{ 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_label(form.name, 'Name', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} {{ form_label(form.name, 'Name', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom"> <div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ 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'}}) }}
</div> </div>
{{ form_label(form.email, 'Email address', {'label_attr':{'class':'uk-form-label uk-visible@m'}}) }} {{ 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"> <div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
@ -48,11 +71,6 @@
</div> </div>
{{ form_end(form) }} {{ form_end(form) }}
{% if userInformation.profilePicture is not empty %}
<img src="{{ userInformation.profilePicture }}"/>
{% endif %}
</div> </div>
{% endblock body %} {% endblock body %}

View File

@ -2,25 +2,48 @@
{% form_theme form with [_self, 'form_errors.html.twig'] %} {% form_theme form with [_self, 'form_errors.html.twig'] %}
{% endif %} {% endif %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en-us">
<head> <head>
<meta charset="UTF-8"> <meta charset="utf-8">
<title>Title</title> <title>{% block title %}{% endblock title %}{% if app.request.requestUri != '/' %} | {% endif %}&hearts; Doughnut Wedding</title>
<meta name="viewport" id="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=10.0,initial-scale=1.0"> <meta name="viewport" id="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=10.0,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{{ asset('css/doughnutwedding.min.css') }}" /> <link rel="stylesheet" type="text/css" href="{{ asset('css/doughnutwedding.min.css') }}" />
<link href="https://fonts.googleapis.com/css?family=Raleway:200,300" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Raleway:200,300" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/select2.min.css') }}" /> <link rel="stylesheet" type="text/css" href="{{ asset('css/select2.min.css') }}" />
<link rel="shortcut icon" type="image/png" href="{{ asset('/images/favicon.png') }}" />
<link rel="apple-touch-icon-precomposed" href="{{ asset('/images/favicon.png') }}" />
{% block stylesheets %}{% endblock %}
<script src="{{ asset('js/vendor.min.js') }}" type="text/javascript"></script> <script src="{{ asset('js/vendor.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/doughnutwedding.min.js') }}" type="text/javascript"></script> <script src="{{ asset('js/doughnutwedding.min.js') }}" type="text/javascript"></script>
{% block javascripts %}{% endblock %}
</head> </head>
<body> <body>
{% block debug %}{% endblock %} {% block debug %}
{% if app.request.requestUri != '/' %}
{# dump(app.request.requestUri) #}
{% endif %}
{% endblock %}
<div class="uk-offcanvas-content"> <div class="uk-offcanvas-content">
<div class="uk-login-container uk-container uk-container-expand uk-visible@m uk-position-top-right">
<nav class="uk-navbar uk-navbar-container uk-navbar-transparent" uk-navbar>
<div class="uk-navbar-right uk-responsive-width">
<ul class="uk-navbar-nav">
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<li><a href="{{ path('fos_user_profile_show') }}">{{ app.user.name }}</a></li>
<div class="uk-navbar-item">|</div>
<li><a class="" href="{{ path('fos_user_security_logout') }}" title="Logout">Logout</a></li>
{% else %}
<li><a class="" href="{{ path('fos_user_security_login') }}" title="Login">Login</a></li>
{% endif %}
</ul>
</div>
</nav>
</div>
<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 class="uk-transform-origin-center-left uk-animation-scale-up" href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ asset('images/logo.png') }}" /></a> <a class="uk-transform-origin-center-left {% if app.request.requestUri == '/' %}uk-animation-scale-up{% endif %}" 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> <a uk-navbar-toggle-icon="" href="#offcanvas" uk-toggle="" class="uk-navbar-toggle uk-hidden@m uk-navbar-toggle-icon uk-icon"></a>
@ -30,64 +53,21 @@
<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-bottom-center"> <div class="uk-logo {% if app.request.requestUri == '/' %}uk-animation-scale-up{% endif %} 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 class="uk-logo" 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>
</div> </div>
</div> </div>
{% include 'flash_messages.html.twig' %} {% include 'flash_messages.html.twig' %}
{% include 'off_canvas.html.twig' %}
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% 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; mode:reveal"> {% include 'off_canvas.html.twig' %}
<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>
{% if not is_granted('IS_AUTHENTICATED_FULLY') %} {% set social_prefix = 'Login with' %} {% else %} {% set social_prefix = 'Link Account With' %} {% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<li class="uk-nav-header">{{ app.user.name }}</li>
<li class="uk-nav-divider"></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>
</div>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -4,10 +4,12 @@
{% block body %} {% block body %}
<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-animation-fade 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="{{ path('sikofitt_doughnutwedding_default_ourstory') }}" 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">our story</a>
</h3>
</div> </div>
</div> </div>
</div> </div>
@ -15,27 +17,27 @@
<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"> <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="{{ path('fos_user_profile_edit') }}" 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="{{ path('fos_user_profile_edit') }}" class="uk-position-cover">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-background-fade uk-photo-home uk-card uk-card-default uk-card-body uk-flex uk-flex-center uk-flex-middle">
<a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" 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="{{ path('sikofitt_doughnutwedding_gallery_index') }}" class="uk-position-cover">photo gallery</a></h3>
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div class="uk-height-medium uk-background-cover uk-margin-small-bottom uk-location-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-margin-small-bottom uk-location-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_default_location') }}" 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">location</a></h3> <h3 class="uk-position-cover uk-text-center"><a href="{{ path('sikofitt_doughnutwedding_default_location') }}" class="uk-position-cover">location</a></h3>
</div> </div>
</div> </div>
<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"> <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="{{ path('sikofitt_doughnutwedding_default_contact') }}" 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="{{ path('sikofitt_doughnutwedding_default_contact') }}" class="uk-position-cover">get in touch</a></h3>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,59 @@
{% extends 'base.html.twig' %}
{% block title %}Get in touch{% endblock title %}
{% block body %}
<h2 class="uk-text-center">Get in touch</h2>
<p class="uk-margin-small uk-text-center uk-text-lead">
We'd LOVE to hear from you! Send us your wishes, thoughts, advice or questions.
</p>
{% if(form is defined) %}
{{ form_errors(form) }}
{{ form_start(form) }}
{{ form_label(form.name) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.name) }}
{{ form_widget(form.name) }}
</div>
{{ form_label(form.email) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.email) }}
{{ form_widget(form.email) }}
</div>
{{ form_label(form.subject) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.subject) }}
{{ form_widget(form.subject) }}
</div>
{{ form_label(form.comment) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.comment) }}
{{ form_widget(form.comment) }}
</div>
<div class="uk-width-1-2@m uk-width-1-1@s">
{{ form_widget(form.submit) }}
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% else %}
<div class="uk-width-1-1 uk-text-center">
<p class="uk-text-lead">
{{ message|first }}
</p>
{% if message|length > 1 %}
<p class="uk-text-center">{{ message|last }}</p>
{% endif %}
<p class="uk-text-center">
<a class="uk-button uk-button-primary uk-button-large" href="{{ path('sikofitt_doughnutwedding_default_index') }}" title="Home">
Go to the home page
</a>
</p>
</div>
{% endif %}
<p class="uk-text-lead uk-text-center">
#doughnutwedding
</p>
<p class="uk-text-center">
Follow us on Instagram and Facebook for wedding updates!
</p>
{% endblock %}

View File

@ -0,0 +1,72 @@
{% extends 'base.html.twig' %}
{% block title %}Location{% endblock title %}
{% block stylesheets %}
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">
<link href="https://cdn.mapkit.io/v1/infobox.css" rel="stylesheet" >
<style>
#mapkit-9468 {
padding-bottom: 45%;
height: 0;
}
</style>
{% endblock %}
{% block javascripts %}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDvLrOMB0SW_fTNrIvZF3bS1xtpg6JRRHs&extension=.js"></script>
<script src="https://cdn.mapkit.io/v1/infobox.js"></script>
{% include 'map.html.twig' %}
{% endblock %}
{% block body %}
<div class="uk-grid-small uk-flex-center uk-grid-divider uk-child-width-1-1" uk-grid>
<h2 class="uk-margin-medium-top uk-text-center">Our Doughnut Wedding</h2>
<div>
<div class="uk-overflow-hidden uk-height-medium">
<img class="uk-transform-origin-top-right uk-animation-reverse uk-animation-kenburns" src="{{ asset('/images/location.jpg') }}" />
</div>
</div>
<div class="uk-margin-medium-bottom">
<p class="uk-text-large uk-text-center">
The ceremony will begin at 2pm at Voodoo Doughnut Too -- located where Sandy,
Davis and 15th meet. The shop is just across the street from Portland's famous
Sandy Hut. You can't miss the pink box building! There is limited parking at the venue,
but street parking is easy to find.
We'll be serving Voodoo Doughnuts and coffee immediately after the ceremony.
</p>
<p class="uk-h3 uk-text-center">Voodoo Doughnut Too</p>
<p class="uk-text-center">1501 NE Davis St.<br />Portland, Oregon</p>
<p class="uk-text-center uk-align-center">
<a href="http://www.voodoodoughnut.com/doughnuts" target="_blank" title="Voodoo Doughnuts" class="uk-button uk-button-primary">CHECK OUT THE DOUGHNUTS</a>
</p>
</div>
<div>
<h2 class="uk-text-center">Directions</h2>
<h4 class="uk-text-center">From I-5 N</h4>
<p class="uk-text-center">
Use the right lane to take exit 300 for I-84 E/US-30 E toward Portland Airport/The Dalles
</p>
<p class="uk-text-center">
Keep right, follow signs for Central Eastside Industrial District
</p>
<p class="uk-text-center">
Continue on SE Water Ave. Take SE Stark St. and SE Sandy Blvd to NE Davis St
</p>
<h4 class="uk-text-center">From I-5 S</h4>
<p class="uk-text-center">
Continue on OR-99E N/SE Grand Ave. Drive to NE Davis St.
</p>
<p class="uk-text-center uk-text-large">
<a href="https://goo.gl/maps/bk4FpLdpud92" title="Google maps" target="_blank">Open in Google Maps</a>
</p>
</div>
<div class="">
<div id='mapkit-9468'></div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,168 @@
<script>
google.maps.event.addDomListener(window, 'load', init);
var map, markersArray = [];
function bindInfoWindow(marker, map, location) {
google.maps.event.addListener(marker, 'click', function() {
function close(location) {
location.ib.close();
location.infoWindowVisible = false;
location.ib = null;
}
if (location.infoWindowVisible === true) {
close(location);
} else {
markersArray.forEach(function(loc, index){
if (loc.ib && loc.ib !== null) {
close(loc);
}
});
var boxText = document.createElement('div');
boxText.style.cssText = 'background: #fff;';
boxText.classList.add('md-whiteframe-2dp');
function buildPieces(location, el, part, icon) {
if (location[part] === '') {
return '';
} else if (location.iw[part]) {
switch(el){
case 'photo':
if (location.photo){
return '<div class="iw-photo" style="background-image: url(' + location.photo + ');"></div>';
} else {
return '';
}
break;
case 'iw-toolbar':
return '<div class="iw-toolbar"><h3 class="md-subhead">' + location.title + '</h3></div>';
break;
case 'div':
switch(part){
case 'email':
return '<div class="iw-details"><i class="material-icons" style="color:#4285f4;"><img src="//cdn.mapkit.io/v1/icons/' + icon + '.svg"/></i><span><a href="mailto:' + location.email + '" target="_blank">' + location.email + '</a></span></div>';
break;
case 'web':
return '<div class="iw-details"><i class="material-icons" style="color:#4285f4;"><img src="//cdn.mapkit.io/v1/icons/' + icon + '.svg"/></i><span><a href="' + location.web + '" target="_blank">' + location.web_formatted + '</a></span></div>';
break;
case 'desc':
return '<label class="iw-desc" for="cb_details"><input type="checkbox" id="cb_details"/><h3 class="iw-x-details">Details</h3><i class="material-icons toggle-open-details"><img src="//cdn.mapkit.io/v1/icons/' + icon + '.svg"/></i><p class="iw-x-details">' + location.desc + '</p></label>';
break;
default:
return '<div class="iw-details"><i class="material-icons"><img src="//cdn.mapkit.io/v1/icons/' + icon + '.svg"/></i><span>' + location[part] + '</span></div>';
break;
}
break;
case 'open_hours':
var items = '';
if (location.open_hours.length > 0){
for (var i = 0; i < location.open_hours.length; ++i) {
if (i !== 0){
items += '<li><strong>' + location.open_hours[i].day + '</strong><strong>' + location.open_hours[i].hours +'</strong></li>';
}
var first = '<li><label for="cb_hours"><input type="checkbox" id="cb_hours"/><strong>' + location.open_hours[0].day + '</strong><strong>' + location.open_hours[0].hours +'</strong><i class="material-icons toggle-open-hours"><img src="//cdn.mapkit.io/v1/icons/keyboard_arrow_down.svg"/></i><ul>' + items + '</ul></label></li>';
}
return '<div class="iw-list"><i class="material-icons first-material-icons" style="color:#4285f4;"><img src="//cdn.mapkit.io/v1/icons/' + icon + '.svg"/></i><ul>' + first + '</ul></div>';
} else {
return '';
}
break;
}
} else {
return '';
}
}
boxText.innerHTML =
buildPieces(location, 'photo', 'photo', '') +
buildPieces(location, 'iw-toolbar', 'title', '') +
buildPieces(location, 'div', 'address', 'location_on') +
buildPieces(location, 'div', 'web', 'public') +
buildPieces(location, 'div', 'email', 'email') +
buildPieces(location, 'div', 'tel', 'phone') +
buildPieces(location, 'div', 'int_tel', 'phone') +
buildPieces(location, 'open_hours', 'open_hours', 'access_time') +
buildPieces(location, 'div', 'desc', 'keyboard_arrow_down');
var myOptions = {
alignBottom: true,
content: boxText,
disableAutoPan: true,
maxWidth: 0,
pixelOffset: new google.maps.Size(-140, -40),
zIndex: null,
boxStyle: {
opacity: 1,
width: '280px'
},
closeBoxMargin: '0px 0px 0px 0px',
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: 'floatPane',
enableEventPropagation: false
};
location.ib = new InfoBox(myOptions);
location.ib.open(map, marker);
location.infoWindowVisible = true;
}
});
}
function init() {
var mapOptions = {
center: new google.maps.LatLng(45.52464731651513, -122.65028208095099),
zoom: 16,
gestureHandling: 'auto',
fullscreenControl: false,
zoomControl: true,
disableDoubleClickZoom: true,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
},
scaleControl: true,
scrollwheel: true,
streetViewControl: true,
draggable : true,
clickableIcons: false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{"featureType":"administrative","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"simplified"}]},{"featureType":"water","stylers":[{"visibility":"simplified"}]},{"featureType":"transit","stylers":[{"visibility":"simplified"}]},{"featureType":"landscape","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"visibility":"off"}]},{"featureType":"road.local","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"water","stylers":[{"color":"#84afa3"},{"lightness":52}]},{"stylers":[{"saturation":-17},{"gamma":0.36}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#3f518c"}]}]
}
var mapElement = document.getElementById('mapkit-9468');
var map = new google.maps.Map(mapElement, mapOptions);
var locations = [
{"title":"Voodoo Doughnut Too","address":"1501 NE Davis St, Portland, OR 97232, USA","desc":"","tel":"(503) 235-2666","int_tel":"+1 503-235-2666","email":"","web":"http://voodoodoughnuts.com","web_formatted":"voodoodoughnuts.com","open":"","time":"0742","lat":45.5244594,"lng":-122.65047520000002,"vicinity":"1501 Northeast Davis Street, Portland","open_hours":[{"day":"Monday","hours":"open24hours","$$hashKey":"object:1722"},{"day":"Tuesday","hours":"open24hours","$$hashKey":"object:1723"},{"day":"Wednesday","hours":"open24hours","$$hashKey":"object:1724"},{"day":"Thursday","hours":"open24hours","$$hashKey":"object:1725"},{"day":"Friday","hours":"open24hours","$$hashKey":"object:1726"},{"day":"Saturday","hours":"open24hours","$$hashKey":"object:1727"},{"day":"Sunday","hours":"open24hours","$$hashKey":"object:1728"}],"marker":{"fillColor":"#4CAF50","fillOpacity":1,"strokeWeight":0,"scale":1.5,"path":"M10.2,0C4.6,0,0,4.6,0,10.2c0,6.9,7.8,6.3,10.2,26.4c2.5-20.1,10.2-19.5,10.2-26.4C20.4,4.6,15.9,0,10.2,0z M10.2,13.9c-2.4,0-4.3-1.9-4.3-4.3s1.9-4.3,4.3-4.3s4.3,1.9,4.3,4.3C14.6,12,12.6,13.9,10.2,13.9z","anchor":{"x":10,"y":30},"origin":{"x":0,"y":0},"style":3},"iw":{"address":true,"desc":true,"email":true,"enable":true,"int_tel":true,"open":true,"open_hours":true,"photo":true,"tel":true,"title":true,"web":true}}
];
var layer = new google.maps.TrafficLayer();
layer.setMap(map);
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
icon: locations[i].marker,
position: new google.maps.LatLng(locations[i].lat, locations[i].lng),
map: map,
title: locations[i].title,
address: locations[i].address,
desc: locations[i].desc,
tel: locations[i].tel,
int_tel: locations[i].int_tel,
vicinity: locations[i].vicinity,
open: locations[i].open,
open_hours: locations[i].open_hours,
photo: locations[i].photo,
time: locations[i].time,
email: locations[i].email,
web: locations[i].web,
iw: locations[i].iw
});
markersArray.push(marker);
if (locations[i].iw.enable === true){
bindInfoWindow(marker, map, locations[i]);
}
}
}
</script>

View File

@ -0,0 +1,44 @@
<div id="offcanvas" uk-offcanvas="overlay: true; mode:reveal">
<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="{{ path('sikofitt_doughnutwedding_default_location') }}"><span class="uk-margin-small-right" uk-icon="icon: location"></span> Location</a></li>
<li><a href="{{ path('sikofitt_doughnutwedding_default_contact') }}"><span class="uk-margin-small-right" uk-icon="icon: mail"></span> Get In Touch</a></li>
{% if not is_granted('IS_AUTHENTICATED_FULLY') %} {% set social_prefix = 'Login with' %} {% else %} {% set social_prefix = 'Link Account With' %} {% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<li class="uk-nav-header">{{ app.user.name }}</li>
<li class="uk-nav-divider"></li>
<li><a href="{{ path('fos_user_profile_show') }}"><span class="uk-margin-small-right" uk-icon="icon: user"></span> Profile</a></li>
<li><a href="{{ path('fos_user_change_password') }}"><span class="uk-margin-small-right" uk-icon="icon: lock"></span> Change password</a></li>
<li><a href="{{ path('fos_user_security_logout') }}"><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>
</div>
</div>

View File

@ -1,21 +1,25 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Our Story{% endblock title %}
{% block body %} {% block body %}
<h1 class="uk-text-center" style="letter-spacing: .15rem">Our Story</h1> <h2 class="uk-text-center" style="letter-spacing: .15rem">Our Story</h2>
<div class="uk-column-1-2@m uk-column-divider"> <div class="uk-column-1-1@m uk-column-divider">
<hr class="uk-divider-icon" />
<p>Eric and Katrina first met online in 2014. After texting back and forth for a week they finally met in <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 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> 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>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> <h2 class="uk-heading-line uk-text-center uk-text-capitalize"><span>This was a good sign.</span></h2>
<p class="uk-column-span uk-text-lead uk-text-center"></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, <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> 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>
<hr class="uk-divider-icon" />
<p class="uk-column-span uk-text-lead uk-text-center uk-text-primary"> <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. On May 12, 2017 they will both say "yes" and live happily ever after til death do they part.
</p> </p>
</div> </div>
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<p class="uk-text-center"> <p class="uk-text-center">
<a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" class="uk-button uk-button-primary">Check out some photos!</a> <a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" class="uk-button uk-button-large uk-button-primary">Check out some photos!</a>
</p> </p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,22 @@
{% block body_text %}
{% autoescape false %}
Heyo!,
{{ user.name }} has registered a new account.
Info,
Email : {{ user.email }}
Guests: {{ user.rsvp.guests }}
{% if user.comment is not null %}
Comment :
{{ user.comment }}
{% endif %}
Love,
Your website ❤
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}

View File

@ -11,6 +11,8 @@ parameters:
google.credentials_file: '%kernel.root_dir%/config/google-storage-key.json' google.credentials_file: '%kernel.root_dir%/config/google-storage-key.json'
google.client_id: '100826355104373784827' google.client_id: '100826355104373784827'
google.application_name: 'doughnut-wedding' google.application_name: 'doughnut-wedding'
katrina.email: katrina.a.johnson@gmail.com
eric.email: sikofitt@gmail.com
framework: framework:
cache: cache:
app: cache.adapter.redis app: cache.adapter.redis
@ -119,6 +121,8 @@ swiftmailer:
transport: '%mailer_transport%' transport: '%mailer_transport%'
host: '%mailer_host%' host: '%mailer_host%'
port: '%mailer_port%' port: '%mailer_port%'
encryption: ssl
auth_mode: login
username: '%mailer_user%' username: '%mailer_user%'
password: '%mailer_password%' password: '%mailer_password%'
spool: { type: memory } spool: { type: memory }

View File

@ -37,7 +37,8 @@ monolog:
# type: chromephp # type: chromephp
# level: info # level: info
#swiftmailer: swiftmailer:
transport: null
# disable_delivery: true # disable_delivery: true
# transport: smtp # transport: smtp
# delivery_addresses: ['info@doughnutwedding.com'] # delivery_addresses: ['info@doughnutwedding.com']

View File

@ -2,6 +2,11 @@ easy_admin:
design: design:
form_theme: 'vertical' form_theme: 'vertical'
entities: entities:
Contact:
class: Sikofitt\DoughnutWeddingBundle\Entity\Contact
list:
actions: ['show','edit','delete']
fields: ['userid','email','name','comment','createdAt']
User: User:
class: Sikofitt\DoughnutWeddingBundle\Entity\User class: Sikofitt\DoughnutWeddingBundle\Entity\User
list: list:

View File

@ -19,6 +19,8 @@ security:
pattern: ^/(_(profiler|wdt)|css|images|js)/ pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false security: false
secured_area: secured_area:
access_denied_handler: doughnutwedding.security.access_denied_handler
pattern: ^/ pattern: ^/
form_login: form_login:
provider: fos_userbundle provider: fos_userbundle
@ -44,7 +46,7 @@ security:
access_control: access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login/callback$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login/callback, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
@ -52,5 +54,5 @@ security:
- { 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 } - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

View File

@ -25,7 +25,7 @@ services:
- { name: kernel.event_listener, event: kernel.request } - { name: kernel.event_listener, event: kernel.request }
doughnutwedding.event.redirect_user_after_register_event: doughnutwedding.event.redirect_user_after_register_event:
class: Sikofitt\DoughnutWeddingBundle\EventListener\RedirectOnUserRegisterListener class: Sikofitt\DoughnutWeddingBundle\EventListener\RedirectOnUserRegisterListener
arguments: ['@router'] arguments: ['@service_container']
tags: tags:
- { name: kernel.event_listener, event: fos_user.registration.confirmed } - { name: kernel.event_listener, event: fos_user.registration.confirmed }
- { name: kernel.event_listener, event: fos_user.registration.completed } - { name: kernel.event_listener, event: fos_user.registration.completed }
@ -34,3 +34,15 @@ services:
factory: ['Sikofitt\DoughnutWeddingBundle\Factory\GoogleCloudStorageServiceFactory', createGoogleCloudService] factory: ['Sikofitt\DoughnutWeddingBundle\Factory\GoogleCloudStorageServiceFactory', createGoogleCloudService]
arguments: ['%google.credentials_file%', '%google.client_id%', '%google.application_name%'] arguments: ['%google.credentials_file%', '%google.client_id%', '%google.application_name%']
doughnutwedding.event.check_email_on_reset_event:
class: Sikofitt\DoughnutWeddingBundle\EventListener\CheckThatEmailAndUserNameExistOnResetRequest
arguments: ['@router', '@templating.engine.twig']
tags:
- { name: kernel.event_listener, event: fos_user.resetting.send_email.initialize }
doughnutwedding.event.need_to_authenticate_listener_event:
class: Sikofitt\DoughnutWeddingBundle\EventListener\NeedToAuthenticateListenerEvent
tags:
- { name: kernel.event_listener, event: kernel.response }
doughnutwedding.security.access_denied_handler:
class: Sikofitt\DoughnutWeddingBundle\Security\AccessDeniedHandler
arguments: ['@router', '@monolog.logger']

3
build/images/favicon.png Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7226428a1b7a936b5bebfa5234fdeaf23cc6ba4c2c95c30bb882431d93c50b58
size 19799

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:772a9388ccc9a749836cf6e15b4bf32f20cd008649f98e4f1961d6ab89f38805
size 274984

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b439362aa5029f855ee1f72ff94552d8246ad46c303e04796465687656a7a86d
size 139466

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:482cb918c7bc3ea0998759a60abc237cd350651ddf5a09707fe52df2dae1afeb
size 129353

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e7ad0693c08599150ecae7ff1dabccb18792c1d10cc96a95129938b08a3cf4d6
size 271299

View File

@ -3,11 +3,42 @@
//@global-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; //@global-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
//@global-font-size: 16px; //@global-font-size: 16px;
@global-font-family: 'Raleway', sans-serif;
@base-body-font-family: 'Raleway', sans-serif; @base-body-font-family: 'Raleway', sans-serif;
@base-heading-font-family: 'Raleway', sans-serif; @base-heading-font-family: 'Raleway', sans-serif;
@base-heading-text-transform: uppercase;
@base-body-font-weight: 200; @base-body-font-weight: 200;
@base-heading-font-weight: 300; @base-heading-font-weight: 300;
@form-background: #ffffff; @form-background: #ffffff;
@global-link-color: #90d5c1;
@base-link-color: @global-link-color;
@base-link-hover-color: darken(@base-link-color, 20%);
@button-primary-background: #90d5c1;
@button-primary-color: #333;
@button-primary-hover-color: darken(@button-primary-color, 10%);
@button-primary-hover-background: darken(@button-primary-background, 10%);
.uk-login-container {
.uk-navbar {
.uk-navbar-nav {
li {
a {
font-weight:bold !important;
}
}
}
}
}
label.required:after {
content: "*";
text-align:right;
float:right;
color: @form-danger-color;
font-size: @global-large-font-size;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-weight: bol
}
.uk-home { .uk-home {
@ -26,8 +57,8 @@
} }
.uk-background-fade { .uk-background-fade {
transition-duration: .3s; transition-duration: .3s;
transition-timing-function: ease-out; transition-timing-function: ease-in-out;
transition-property: background-image,transform,filter; transition-property: background-image;
} }
.uk-our-story-home { .uk-our-story-home {
@ -40,15 +71,20 @@
// photo // photo
// location // location
.uk-photo-home { .uk-photo-home {
background-image: url('/images/home_photo.jpg'); background-image: url('/images/home_photo_2.jpg');
&:hover { &:hover {
background-image: url('/images/home_photo_1.jpg');
} }
} }
.uk-location-home { .uk-location-home {
margin-bottom:15px !important; margin-bottom:15px !important;
background-image: url('/images/home_location.jpg'); background-image: url('/images/home_location.jpg');
transition-duration: .3s;
transition-timing-function: ease-out;
transition-property: filter;
&:hover { &:hover {
filter: hue-rotate(90deg);
background-blend-mode: darken;
} }
} }

View File

@ -18,6 +18,7 @@
"doctrine/doctrine-cache-bundle": "^1.3", "doctrine/doctrine-cache-bundle": "^1.3",
"doctrine/orm": "^2.5", "doctrine/orm": "^2.5",
"egulias/email-validator": "^2.1", "egulias/email-validator": "^2.1",
"excelwebzone/recaptcha-bundle": "^1.4",
"friendsofsymfony/user-bundle": "^2.0", "friendsofsymfony/user-bundle": "^2.0",
"google/apiclient": "^2.1", "google/apiclient": "^2.1",
"google/recaptcha": "^1.1", "google/recaptcha": "^1.1",

View File

@ -21,6 +21,8 @@
namespace Sikofitt\DoughnutWeddingBundle\Controller; namespace Sikofitt\DoughnutWeddingBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sikofitt\DoughnutWeddingBundle\Entity\Contact;
use Sikofitt\DoughnutWeddingBundle\Form\ContactFormType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -56,4 +58,77 @@ class DefaultController extends Controller
public function ourStoryAction(Request $request) { public function ourStoryAction(Request $request) {
return $this->render('our_story.html.twig'); return $this->render('our_story.html.twig');
} }
/**
* @Route("/location")
*
* @param Request $request
*
* @return Response
*/
public function locationAction(Request $request) {
return $this->render('location.html.twig');
}
/**
* @Route("/get_in_touch")
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function contactAction(Request $request) : Response {
$contact = new Contact();
if(null !== $this->getUser()) {
$contact
->setName($this->getUser()->getName())
->setEmail($this->getUser()->getEmail())
->setUserId($this->getUser()->getId())
;
}
$form = $this->get('form.factory')->create(ContactFormType::class, $contact);
if($request->isMethod('POST')) {
$form->handleRequest($request);
if($form->isValid() && $form->isSubmitted()) {
$em = $this->get('doctrine.orm.entity_manager');
/** @var Contact $data */
$data = $form->getData();
$data->setCreatedAt(new \DateTime('now'));
$em->persist($data);
$em->flush();
$responseMessage[] = 'Thank you for your message ' . $data->getName() . '!';
$email = $data->getEmail();
if( null !== $email ) {
$responseMessage[] = sprintf('We will respond to you at %s as soon as possible.', $email);
} else {
$email = 'no-reply@doughnutwedding.com';
}
$message = new \Swift_Message();
$message->setSubject($data->getSubject());
$message->setFrom($email);
$message->setTo([
$this->getParameter('katrina.email') => 'Katrina Johnson',
$this->getParameter('eric.email') => 'R. Eric Wheeler',
]);
$message->setBody($data->getComment());
$this->get('swiftmailer.mailer')->send($message);
return $this->render('form/contact.html.twig',
['message' => $responseMessage]);
}
}
return $this->render('form/contact.html.twig', ['form' => $form->createView()]);
}
} }

View File

@ -47,7 +47,9 @@ class GalleryController extends Controller
*/ */
public function uploadAction() public function uploadAction()
{ {
if(false === $this->isGranted('IS_AUTHENTICATED_FULLY')) {
$this->addFlash('error', 'You must be logged in to upload photos.');
}
$form = $this->get('form.factory')->create(GalleryUploadType::class, new Image()); $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() 'form' => $form->createView()

View File

@ -0,0 +1,220 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Contact
*
* @ORM\Table(name="contact")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ContactRepository")
*/
class Contact
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer", nullable=true, unique=false)
*/
private $userId;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="subject", type="string", length=255, nullable=true)
*/
private $subject;
/**
* @var string
*
* @ORM\Column(name="comment", type="text")
*/
private $comment;
/**
* @var \DateTime
*
* @ORM\Column(name="createdAt", type="datetime")
*/
private $createdAt;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param int $userId
*
* @return Contact
*/
public function setUserId($userId)
{
$this->userId = $userId;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Set name
*
* @param string $name
*
* @return Contact
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set Email
*
* @param null|string $email
*
* @return \Sikofitt\DoughnutWeddingBundle\Entity\Contact
*/
public function setEmail(?string $email) : Contact {
$this->email = $email;
return $this;
}
/**
* Get Email
*
* @return null|string
*/
public function getEmail() : ?string {
return $this->email;
}
/**
* Set subject
*
* @param string $subject
*
* @return Contact
*/
public function setSubject($subject)
{
$this->subject = $subject;
return $this;
}
/**
* Get subject
*
* @return string
*/
public function getSubject()
{
return $this->subject;
}
/**
* Set comment
*
* @param string $comment
*
* @return Contact
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Contact
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
}

View File

@ -0,0 +1,43 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/26/17
* Time: 1:39 PM
*/
namespace Sikofitt\DoughnutWeddingBundle\EventListener;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use FOS\UserBundle\FOSUserEvents;
use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class CheckThatEmailAndUserNameExistOnResetRequest
{
private $router;
private $twig;
public function __construct(UrlGeneratorInterface $router, TwigEngine $twig)
{
$this->router = $router;
$this->twig = $twig;
}
public function onFosuserResettingSendemailInitialize(GetResponseUserEvent $event) {
if(null === $event->getUser()) {
$email = $event->getRequest()->request->get('username');
$event->getRequest()->getSession()->getFlashBag()->add('error',sprintf('Invalid email %s.', $email));
$event->setResponse(new RedirectResponse($this->router->generate('fos_user_resetting_request')));
}
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/**
* Adds a flash message for login redirects.
*
* Class NeedToAuthenticateListenerEvent
*/
class NeedToAuthenticateListenerEvent
{
/**
* Adds a flash message for login redirects.
*
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
*/
public function onKernelResponse(FilterResponseEvent $event): void
{
if (
true === $event
->getResponse()
->headers
->has('location') &&
false !== strpos($event->getResponse()->headers->get('location'),
'/login') &&
true === $event
->getRequest()
->getSession()
->has('_security.secured_area.target_path')
) {
$targetPath = $event
->getRequest()
->getSession()
->get('_security.secured_area.target_path');
$message = sprintf('You need to login to view %s', $targetPath);
$event
->getRequest()
->getSession()
->getFlashBag()
->add('warning', $message);
}
}
}

View File

@ -9,18 +9,39 @@
namespace Sikofitt\DoughnutWeddingBundle\EventListener; namespace Sikofitt\DoughnutWeddingBundle\EventListener;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\FOSUserEvents;
use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class RedirectOnUserRegisterListener class RedirectOnUserRegisterListener
{ {
private $router;
public function __construct(UrlGeneratorInterface $router) private $container;
public function __construct(ContainerInterface $container)
{ {
$this->router = $router; $this->container = $container;
}
public function onFosuserRegistrationCompleted(FilterUserResponseEvent $event) {
$user = $event->getUser();
$message = new \Swift_Message('[Doughnut Wedding] User registered');
$body = $this->container->get('twig')->render('user_registered.txt.twig.html.twig', ['user' => $user]);
$message
->setFrom(['no-reply@doughnutwedding.com' => '[Doughnut Wedding]'])
->setTo([
'katrina.a.johnson@gmail.com' => 'Katrina Johnson',
'sikofitt@gmail.com' => 'R. Eric Wheeler'
])->setBody($body);
$this->container->get('swiftmailer.mailer')->send($message);
$url = $this->container->get('router')->generate('sikofitt_doughnutwedding_default_index');
return new RedirectResponse($url);
} }
public function onKernelRequest(FormEvent $event) public function onKernelRequest(FormEvent $event)

View File

@ -108,7 +108,8 @@ class UserRedirectOnLoggedInListener
'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' 'fos_user_resetting_request',
'fos_user_registration_register'
]; ];
} }
} }

View File

@ -0,0 +1,128 @@
<?php declare(strict_types=1);
namespace Sikofitt\DoughnutWeddingBundle\Form;
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
use ReCaptcha\ReCaptcha;
use Sikofitt\DoughnutWeddingBundle\Entity\Contact;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaTrue;
/**
* Class ContactFormType
*/
class ContactFormType extends AbstractType {
/**
* @inheritdoc
*/
public function buildForm(FormBuilderInterface $builder, array $options) : void {
$builder
->add('name', TextType::class, [
'label_attr' => [
'class' => 'uk-form-label uk-visible@m',
],
'label' => 'Name',
'attr' => [
'class' => 'uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Enter your name',
],
'required' => true,
'trim' => true,
'constraints' => [
new NotBlank(),
new NotNull(),
new Length(['max' => 255, 'min' => 5])
]
])
->add('email', EmailType::class, [
'label_attr' => [
'class' => 'uk-form-label uk-visible@m',
],
'label' => 'Email (Not required)',
'attr' => [
'class' => 'uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Email address (not required)',
'autocomplete' => 'off',
'autocorrect' => 'off',
'autocapitalize' => 'off',
'spellcheck' => 'false',
],
'required' => false,
'trim' => true,
'constraints' => [
new Email([
'checkMX' => true,
'checkHost' => true,
'strict' => true,
])
]
])
->add('subject', TextType::class, [
'label_attr' => [
'class' => 'uk-form-label uk-visible@m',
],
'label' => 'Subject',
'attr' => [
'class' => 'uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Enter a subject for our comment.',
],
'required' => true,
'trim' => true,
'constraints' => [
new NotBlank(),
new NotNull(),
new Length(['max' => 255, 'min' => 5])
]
])
->add('comment', TextareaType::class, [
'label_attr' => [
'class' => 'uk-form-label uk-visible@m',
],
'label' => 'Comment',
'attr' => [
'rows' => 4,
'class' => 'uk-padding-small uk-textarea uk-form-large uk-margin-medium-bottom',
'placeholder' => 'Enter your Comment',
],
'required' => true,
'constraints' => [
new NotBlank(),
new NotNull(),
]
])
->add('submit', SubmitType::class, [
'label' => 'Send',
'attr' => [
'class' => 'uk-button uk-button-primary uk-button-large uk-width-1-1@s uk-width-1-3@m'
]
]);
}
/**
* @inheritdoc
*
* @throws \Symfony\Component\OptionsResolver\Exception\AccessException
*/
public function configureOptions(OptionsResolver $resolver) : void {
$resolver->setDefault('data_class', Contact::class);
$resolver->setDefault('attr', ['class' => 'uk-form uk-form-horizontal']);
}
/**
* @inheritdoc
*/
public function getBlockPrefix() : ?string {
return 'sikofitt_doughnut_wedding_contact';
}
}

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\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; 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;
@ -51,7 +52,9 @@ class RegistrationType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->add('name', TextType::class) $builder->add('name', TextType::class)
->add('rsvp', IntegerType::class, [ ->add('rsvp', NumberType::class, [
'required' => false,
'empty_data' => '0',
'attr' => [ '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',
'placeholder' => 'Number of Guests (including yourself)', 'placeholder' => 'Number of Guests (including yourself)',
@ -68,7 +71,8 @@ class RegistrationType extends AbstractType
'class' => 'uk-form-label uk-visible@m', 'class' => 'uk-form-label uk-visible@m',
], ],
'attr' => [ 'attr' => [
'class' => 'uk-textarea uk-form-large', 'rows' => 5,
'class' => 'uk-textarea uk-form-large uk-padding-small',
'placeholder' => 'Anything you would like to share with the Bride and Groom?' 'placeholder' => 'Anything you would like to share with the Bride and Groom?'
] ]
]) ])

View File

@ -0,0 +1,13 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\Repository;
/**
* ContactRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ContactRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -1,7 +1,7 @@
{% extends "::base.html.twig" %} {% extends "::base.html.twig" %}
{% block title %}SikofittDoughnutWeddingBundle:Image:category{% endblock %} {% block title %}Gallery {{ categoryName|capitalize }}{% endblock %}
{% block body %} {% block body %}
<h1>Welcome to the Image:category page</h1> <h2>Photos categorized as '{{ categoryName|capitalize }}'</h2>
{% endblock %} {% endblock %}

View File

@ -1,7 +1,8 @@
{% extends "::base.html.twig" %} {% extends "::base.html.twig" %}
{% block title %}SikofittDoughnutWeddingBundle:Image:index{% endblock %} {% block title %}Gallery{% endblock %}
{% block body %} {% block body %}
<h1>Welcome to the Image:index page</h1> <h2>Gallery</h2>
{% endblock %} {% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "::base.html.twig" %} {% extends "::base.html.twig" %}
{% block title %}SikofittDoughnutWeddingBundle:Image:tag{% endblock %} {% block title %}Gallery | {{ tagName|capitalize }}{% endblock %}
{% block body %} {% block body %}
<h1>Welcome to the Image:tag page</h1> <h2>Photos tagged with '{{ tagName|capitalize }}'</h2>
{% endblock %} {% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "::base.html.twig" %} {% extends "::base.html.twig" %}
{% block title %}SikofittDoughnutWeddingBundle:Image:upload{% endblock %} {% block title %}Gallery Upload{% endblock %}
{% block body %} {% block body %}
{{ form_start(form, {'attr': { 'class': 'uk-form uk-form-horizontal'}}) }} {{ form_start(form, {'attr': { 'class': 'uk-form uk-form-horizontal'}}) }}

View File

@ -0,0 +1,67 @@
<?php
namespace Sikofitt\DoughnutWeddingBundle\Security;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface;
/**
* Class AccessDeniedHandler
*
* @package Sikofitt\DoughnutWeddingBundle\Security
*/
class AccessDeniedHandler implements AccessDeniedHandlerInterface
{
/**
* @var UrlGeneratorInterface
*/
private $router;
/**
* @var LoggerInterface
*/
private $logger;
/**
* Sets up the router
*
* @param UrlGeneratorInterface $router
* @param LoggerInterface $logger
*/
public function __construct(UrlGeneratorInterface $router, LoggerInterface $logger)
{
$this->router = $router;
$this->logger = $logger;
}
/**
* Redirects to the login page on access denied failure.
*
* @param Request $request
* @param AccessDeniedException $accessDeniedException
*
* @return RedirectResponse
*/
public function handle(Request $request, AccessDeniedException $accessDeniedException) : RedirectResponse {
$request->getSession()->getFlashBag()->add('error', $accessDeniedException->getMessage());
$url = $this->router->generate('fos_user_security_login');
$this->logger->alert($accessDeniedException->getMessage(), [
'code' => $accessDeniedException->getCode(),
'attributes' => $accessDeniedException->getAttributes(),
'subject' => $accessDeniedException->getSubject(),
]);
return new RedirectResponse($url, 302, [
'X-Denied-Message' => $accessDeniedException->getMessage(),
'X-Denied-Status-Code' => $accessDeniedException->getCode(),
]);
}
}