Lots, sorry I forgot

This commit is contained in:
R. Eric Wheeler 2017-05-05 22:49:54 -07:00
parent 574525c0a4
commit 24a0e52f38
81 changed files with 2761 additions and 1219 deletions

1
.gitattributes vendored
View File

@ -27,3 +27,4 @@ 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
build/images/yahoo2.svg filter=lfs diff=lfs merge=lfs -text

View File

@ -41,6 +41,7 @@ class AppKernel extends Kernel
new Vich\UploaderBundle\VichUploaderBundle(),
new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
new Sikofitt\DoughnutWeddingBundle\SikofittDoughnutWeddingBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

View File

@ -1,5 +0,0 @@
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/edit_content.html.twig" %}
{% endblock fos_user_content %}

View File

@ -1,8 +0,0 @@
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_group_edit', {'groupName': group_name}), 'attr': { 'class': 'fos_user_group_edit' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.edit.submit'|trans }}" />
</div>
{{ form_end(form) }}

View File

@ -1,5 +0,0 @@
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/list_content.html.twig" %}
{% endblock fos_user_content %}

View File

@ -1,7 +0,0 @@
<div class="fos_user_group_list">
<ul>
{% for group in groups %}
<li><a href="{{ path('fos_user_group_show', {'groupName': group.getName()} ) }}">{{ group.getName() }}</a></li>
{% endfor %}
</ul>
</div>

View File

@ -1,5 +0,0 @@
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/new_content.html.twig" %}
{% endblock fos_user_content %}

View File

@ -1,8 +0,0 @@
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_group_new'), 'attr': { 'class': 'fos_user_group_new' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.new.submit'|trans }}" />
</div>
{{ form_end(form) }}

View File

@ -1,5 +0,0 @@
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/show_content.html.twig" %}
{% endblock fos_user_content %}

View File

@ -1,5 +0,0 @@
{% trans_default_domain 'FOSUserBundle' %}
<div class="fos_user_group_show">
<p>{{ 'group.show.name'|trans }}: {{ group.getName() }}</p>
</div>

View File

@ -1,5 +1,5 @@
{% extends "base.html.twig" %}
{% block title %}Edit Profile{% endblock title %}
{% block body %}
{% include "@FOSUser/Profile/edit_content.html.twig" %}
{% endblock body %}

View File

@ -1,26 +1,28 @@
{% trans_default_domain 'FOSUserBundle' %}
{% if form.vars.errors is not empty %}
<div class="uk-alert uk-alert-danger">
{{ form_errors(form) }}
</div>
{% endif %}
{{ form_errors(form) }}
{{ form_start(form, { 'action': path('fos_user_profile_edit'), 'attr': { 'class': 'uk-form-horizontal fos_user_profile_edit' } }) }}
{{ 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.name) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.name) }}
{{ form_widget(form.name) }}
</div>
{{ form_label(form.rsvp) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_widget(form.rsvp) }}
</div>
{{ form_label(form.rsvp) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.rsvp) }}
{{ form_widget(form.rsvp) }}
</div>
<div class="uk-form-controls uk-margin-medium-top">
<input type="submit" class="uk-button uk-button-large uk-width-1-1@s uk-width-1-3@m uk-align-right uk-button-primary" value="{{ 'profile.edit.submit'|trans }}" />
<div class="uk-margin-medium-top">
<button type="submit" class="uk-button uk-button-large uk-width-1-1@s uk-width-1-3@m uk-align-right uk-button-primary" value="{{ 'profile.edit.submit'|trans }}">{{ 'profile.edit.submit'|trans }}</button>
</div>
<div class="uk-form-controls">
<a href="{{ url('fos_user_profile_show') }}" title="Cancel" class="uk-width-1-1@s uk-width-1-3@m uk-button uk-button-large uk-button-danger uk-align-right">Cancel</a>

View File

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

View File

@ -1,5 +1,6 @@
{% 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-margin-remove-top uk-text-center">User Information</h2>
<div class="uk-width-1-1 uk-text-center uk-child-width-1-2" uk-grid>
@ -19,18 +20,25 @@
<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-bottom@s uk-position-bottom-right">
<ul class="uk-iconnav uk-iconnav-vertical">
<li>
<a {% if user.facebookid is not null %} style="color:#0b97c4;" {% endif %}class="uk-align-left uk-text-center uk-login uk-login-facebook" href="{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}" uk-icon="icon: facebook; ratio:1.5"></a>
</li>
<li><a class="uk-align-left uk-text-center uk-login uk-login-google" href="{{ url("hwi_oauth_service_redirect", {service: "google"}) }}" uk-icon="icon: google; ratio:1.5"></a></li>
<li><a class="uk-align-left uk-text-center uk-login uk-login-twitter" href="{{ url("hwi_oauth_service_redirect", {service: "twitter"}) }}" uk-icon="icon: twitter; ratio:1.5"></a></li>
<li><a href="{{ url("hwi_oauth_service_redirect", {service: "yahoo"}) }}" class="uk-align-left uk-icon-image uk-align-center uk-login uk-login-yahoo"><img height="30" width="30" src="{{ asset('images/yahoo.svg') }}" uk-svg></a></li>
<li><a href="{{ url("hwi_oauth_service_redirect", {service: "amazon"}) }}" class="uk-align-left uk-icon-image uk-align-center uk-login uk-login-amazon"><img height="30" width="30" src="{{ asset('images/amazon.svg') }}" uk-svg></a></li>
<li><a class="uk-align-left uk-text-center uk-login uk-login-instagram" href="{{ url("hwi_oauth_service_redirect", {service: "instagram"}) }}" uk-icon="icon: instagram; ratio:1.5"></a></li>
<li>{% set serviceActiveClass ='' %}
{% if user.facebookid is not null %}{% set serviceActiveClass ='uk-icon-facebook' %}{% endif %}
<a class="{{ serviceActiveClass }} uk-align-left uk-text-center uk-login uk-login-facebook" href="{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}" uk-icon="icon: facebook; ratio:1.5"></a>
</li>{% set serviceActiveClass='' %}
<li>{% if user.googleid is not null %}{% set serviceActiveClass ='uk-icon-google' %}{% endif %}
<a class="{{ serviceActiveClass }} uk-align-left uk-text-center uk-login uk-login-google" href="{{ url("hwi_oauth_service_redirect", {service: "google"}) }}" uk-icon="icon: google; ratio:1.5"></a>
</li>{% set serviceActiveClass='' %}
<li>{% if user.twitterid is not null %}{% set serviceActiveClass ='uk-icon-twitter' %}{% endif %}
<a class="{{ serviceActiveClass }} uk-align-left uk-text-center uk-login uk-login-twitter" href="{{ url("hwi_oauth_service_redirect", {service: "twitter"}) }}" uk-icon="icon: twitter; ratio:1.5"></a>
</li>{% set serviceActiveClass='' %}
<li>{% if user.yahooid is not null %}{% set serviceActiveClass = 'uk-icon-yahoo' %}{% endif %}
<a class="{{ serviceActiveClass }} uk-align-left uk-text-center uk-login uk-login-yahoo" href="{{ url("hwi_oauth_service_redirect", {service: "yahoo"}) }}" uk-icon="icon: yahoo; ratio:1.5"></a>
</li>{% set serviceActiveClass='' %}
<li>{% if user.amazonid is not null %}{% set serviceActiveClass = 'uk-icon-amazon' %}{% endif %}
<a class="{{ serviceActiveClass }} uk-align-left uk-login uk-login-amazon" href="{{ url("hwi_oauth_service_redirect", {service: "amazon"}) }}" uk-icon="icon: amazon; ratio:1.5"></a>
</li>{% set serviceActiveClass='' %}
</ul>
</div>
<div class="uk-margin-medium uk-width-1-1 uk-text-center">{{ 'profile.member_since'|trans({'%date%':user.created|date('l F jS, Y (h:i a)')}) }}</div>

View File

@ -1,7 +0,0 @@
{% extends "@FOSUser/layout.html.twig" %}
{% trans_default_domain 'FOSUserBundle' %}
{% block fos_user_content %}
<p>{{ 'registration.check_email'|trans({'%email%': user.email}) }}</p>
{% endblock fos_user_content %}

View File

@ -1,13 +0,0 @@
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{%- autoescape false -%}
{{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{%- endautoescape -%}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}

View File

@ -1,6 +1,19 @@
{% trans_default_domain 'FOSUserBundle' %}
<div class="uk-width-1-1">
{% set show_social = false %}
{{ form_errors(form) }}
{% set ownerCount = hwi_oauth_resource_owners()|length %}
<div class="uk-margin-medium-bottom uk-child-width-1-{{ ownerCount +1 }} uk-visible@m uk-grid-small uk-grid-divider" uk-grid>
<div class="uk-text-center">
Connect with :
</div>
{% for owner in hwi_oauth_resource_owners() %}
<div class="uk-text-center uk-registration-connect">
<a href="{{ hwi_oauth_login_url(owner) }}">{{ owner | trans({}, 'HWIOAuthBundle')|capitalize }}</a>
</div>
{% endfor %}
</div>
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register uk-form'}}) }}
@ -11,9 +24,10 @@
<div class="uk-margin">
<div hidden>{{ form_label(form.email) }}</div>
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.email) }}
{{ form_widget(form.email, { 'attr': {'placeholder':'Email address', 'class':'uk-input uk-form-large uk-padding-small'} }) }}
</div>
</div>
</div>
<div class="uk-margin">
<div hidden>{{ form_label(form.name, 'Name', { 'label_attr':{'class':'uk-form-label'}}) }}</div>
<div class="uk-form-controls uk-form-controls-text">
@ -28,6 +42,7 @@
{{ form_errors(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">
@ -50,8 +65,8 @@
</div>
<div class="uk-margin uk-grid" uk-grid>
<div class="uk-form-controls uk-width-1-2">
<input type="submit" value="{{ 'registration.submit'|trans }}" class="uk-button uk-button-primary uk-button-large" />
<div class="uk-width-1-2">
<button type="submit" value="Register" class="uk-button uk-button-primary uk-button-large">Register</button>
</div>
<div class="uk-form-controls-text uk-text-muted uk-margin-small-top uk-width-1-2">
<div class="uk-text-large uk-visible@m">Already have an account? Login <a href="{{ path('fos_user_security_login') }}">here</a>.</div>

View File

@ -21,4 +21,5 @@ Katrina and Eric ❤
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}
{% block body_html %}
{% endblock %}

View File

@ -8,6 +8,9 @@
{% if csrf_token %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
{% endif %}
<div class="uk-width-1-1 uk-text-center">
<a href="{{ path('fos_user_registration_register') }}" class="uk-text-large" title="Create an account">Create an account</a>
</div>
<div class="uk-child-width-1-1@s uk-width-1-2@m uk-align-center uk-grid-collapse uk-grid uk-grid-stack" uk-grid>
<div>
<label class="uk-form-label uk-hidden" for="username">{{ 'security.login.username'|trans }}</label>
@ -23,9 +26,9 @@
<input class="uk-input uk-form-large" placeholder="Password" type="password" id="password" name="_password" required="required" />
</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-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 }}" />
<button 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 }}">{{ 'security.login.submit'|trans }}</button>
</div>
<div class="uk-text-right uk-margin-small-top uk-form-controls">
<label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>

View File

@ -1,5 +1,5 @@
{% extends 'base.html.twig' %}
{% block title %}Register with {{ service }}{% endblock title %}
{% block body %}
<h3>{{ 'header.connecting' | trans({}, 'HWIOAuthBundle')}}</h3>
<div class="uk-width-1-1">

View File

@ -1,5 +1,9 @@
{% extends 'HWIOAuthBundle::layout.html.twig' %}
{% extends 'base.html.twig' %}
{% block hwi_oauth_content %}
<h3>{{ 'header.success' | trans({'%name%': userInformation.realName}, 'HWIOAuthBundle') }}</h3>
{% endblock hwi_oauth_content %}
{% block title %}Connected account with {{ userInformation.resourceOwner.name }}{% endblock title %}
{% block body %}
<p class="uk-text-center uk-text-lead">Connected account with {{ userInformation.resourceOwner.name }}</p>
<p class="uk-text-center">
<a href="{{ path('fos_user_profile_show') }}" title="Go to profile">Go to your profile</a>
</p>
{% endblock body %}

View File

@ -1,11 +1,17 @@
{% extends 'HWIOAuthBundle::layout.html.twig' %}
{% block hwi_oauth_content %}
{% extends 'base.html.twig' %}
{% block title %}Connect with your social media accounts{% endblock title %}
{% block body %}
{% if error is defined and error %}
<span>{{ error }}</span>
<div class="uk-alert uk-alert-danger" data-uk-alert>
<a href="#" class="uk-alert-close uk-close"></a>
<p>{{ error }}</p>
</div>
{% endif %}
<div class="uk-text-center uk-child-width-1-1@s uk-child-width-1-5@m" uk-grid>
{% for owner in hwi_oauth_resource_owners() %}
<a href="{{ hwi_oauth_login_url(owner) }}">{{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
<div class="uk-text-center">
<a href="{{ hwi_oauth_login_url(owner) }}">{{ owner | trans({}, 'HWIOAuthBundle') }}</a>
</div>
{% endfor %}
{% endblock hwi_oauth_content %}
</div>
{% endblock body %}

View File

@ -37,27 +37,33 @@
{{ 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'}}) }}
<div class="uk-form-controls uk-form-controls-text uk-margin-small-bottom">
{{ form_widget(form.name, {'value': name,'attr':{'class':'uk-input uk-form-large', 'placeholder':'Your name'}}) }}
{{ form_errors(form.name) }}
{{ form_widget(form.name, {'value': name,'attr':{'class':'uk-input uk-form-large', 'placeholder':'Your name'}}) }}
</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'}}) }}
{{ form_errors(form.email) }}
{{ 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'}}) }}
{{ form_errors(form.plainPassword.first) }}
{{ 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_errors(form.plainPassword.second) }}
{{ 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.'}}) }}
{{ form_errors(form.rsvp) }}
{{ form_widget(form.rsvp, {'attr':{'placeholder':'Number of guests including yourself.'}}) }}
</div>
{{ form_label(form.comment) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_widget(form.comment) }}
{{ form_errors(form.comment) }}
{{ 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>

View File

@ -1,5 +1,8 @@
{% extends 'HWIOAuthBundle::layout.html.twig' %}
{% block hwi_oauth_content %}
<h3>{{ 'header.registration_success' | trans({'%username%': app.user.username}, 'HWIOAuthBundle') }}</h3>
{% endblock hwi_oauth_content %}
{% extends 'base.html.twig' %}
{% block title %}Successfully Registered with {{ userInformation.resourceOwner.name }}.{% endblock title %}
{% block body %}
<p class="uk-text-lead uk-text-center">{{ 'header.registration_success' | trans({'%username%': app.user.username}, 'HWIOAuthBundle') }}</p>
<p class="uk-text-center">
<a href="{{ path('fos_user_profile_show') }}" title="Go to profile">Go to your profile</a>
</p>
{% endblock body %}

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<div>
{% block hwi_oauth_content %}
{% endblock hwi_oauth_content %}
</div>
</body>
</html>

View File

@ -0,0 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Error {{ status_code }} {{ status_text }}{% endblock title %}
{% block debug %}{{ dump() }}{% endblock debug %}
{% block body %}
<p class="uk-margin-remove-top uk-text-center uk-404 uk-doughnut">
{{ status_code|replace({0:'<span class="uk-spin uk-background-cover uk-inline"></span>'})|raw }}
</p>
<div class="uk-width-1-1">
<hr class="uk-divider-icon" />
<p class="uk-text-center uk-text-lead">{{ status_text }}</p>
<p class="uk-text-center uk-text-large">
Sorry about that. I tried to get the page <span class="uk-text-bold">{{ app.request.requestUri }}</span> but it told me <span class="uk-text-bold">{{ status_text }}</span>.
</p>
<p class="uk-text-center uk-text-large">
I don't know what this means because it's not a 1 or a 0, but I sent an email with the error details to my owner and I'm sure they'll get right on it.
</p>
<p class="uk-text-center uk-text-large">The best I can do right now is redirect you to the <a href="{{ path('sikofitt_doughnutwedding_default_index') }}" title="Home page">home</a> page.</p>
</div>
{% endblock body %}

View File

@ -0,0 +1,16 @@
{% extends 'base.html.twig' %}
{% block title %}Error {{ status_code }} {{ status_text }}{% endblock title %}
{% block body %}
<p class="uk-margin-remove-top uk-text-center uk-404 uk-doughnut">
4<span class="uk-spin uk-background-cover uk-inline"></span>3
</p>
<div class="uk-width-1-1">
<hr class="uk-divider-icon" />
<p class="uk-text-center uk-text-lead">
So it turns out I can't give you access to this page. Sorry about that.
</p>
<p class="uk-text-center uk-text-large">The best I can do is redirect you to the <a href="{{ path('sikofitt_doughnutwedding_default_index') }}" title="Home page">home</a> page.</p>
</div>
{% endblock body %}

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}Error {{ status_code }} {{ status_text }}{% endblock title %}
{% block body %}
<p class="uk-margin-remove-top uk-text-center uk-404 uk-doughnut">
4<span class="uk-spin uk-background-cover uk-inline"></span>4
</p>
<div class="uk-width-1-1">
<hr class="uk-divider-icon" />
<p class="uk-text-center uk-text-lead">I wish the page <span class="uk-text-bold">'{{ app.request.requestUri }}'</span> existed, I really do. Unfortunately it does not.</p>
<p class="uk-text-center uk-text-large">The best I can do is redirect you to the <a href="{{ path('sikofitt_doughnutwedding_default_index') }}" title="Home page">home</a> page.</p>
</div>
{% endblock body %}

View File

@ -0,0 +1,31 @@
{% extends 'base.html.twig' %}
{% block title %}Error {{ status_code }} {{ status_text }}{% endblock title %}
{% block body %}
<h2 class="uk-text-center uk-text-lead uk-text-danger uk-margin-remove-top">
What did you do!! <small>Just kidding ..</small>
</h2>
<p class="uk-margin-remove-top uk-text-center uk-404 uk-doughnut">
5<span class="uk-spin uk-background-cover uk-inline"></span><span class="uk-spin uk-background-cover uk-inline"></span>
</p>
<p class="uk-margin-remove-top uk-text-center uk-404 uk-doughnut">
</p>
<hr class="uk-divider-icon" />
<blockquote cite="#">
<p class="uk-margin-small-bottom uk-text-center">
Nothing is more intolerable than to have to admit to yourself your own errors.
</p>
<footer class="uk-text-center">Ludwig van Beethoven</footer>
</blockquote>
<p class="uk-text-center uk-text-lead">
A message has been sent with the details of the error.<br />
We will fix it as soon as possible.
</p>
<p class="uk-text-center uk-text-large">
Sorry for any inconvenience caused.
</p>
<p class="uk-text-center">
<a href="{{ path('sikofitt_doughnutwedding_default_index') }}" class="uk-width-1-1@s uk-width-1-2@s uk-button uk-button-primary" title="Home page">Go to the home page</a>
</p>
{% endblock body %}

View File

@ -1,27 +1,38 @@
{% if form is defined %}
{% form_theme form with [_self, 'form_errors.html.twig'] %}
{% endif %}
{% set bucket = 'https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4' %}
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<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">
<link rel="stylesheet" type="text/css" href="{{ asset('css/doughnutwedding.min.css') }}" />
<!-- Android -->
<meta name="theme-color" content="#f7a59d" />
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#9dd3d5" />
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#9dd3d5" />
<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 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') }}" />
<link rel="shortcut icon" type="image/png" href="{{ bucket }}/assets/favicon.png" />
<link rel="apple-touch-icon-precomposed" href="{{ bucket }}/assets/favicon.png" />
{% block stylesheets %}{% endblock %}
<script src="{{ asset('js/vendor.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/doughnutwedding.min.js') }}" type="text/javascript"></script>
{% block javascripts %}{% endblock %}
</head>
<body>
{% if app.request.requestUri == path('sikofitt_doughnutwedding_default_index') %}
<div class="uk-preload">
<div class="our-story"></div>
<div class="photo-gallery"></div>
</div>
{% endif %}
{% block debug %}
{% if app.request.requestUri != '/' %}
{# dump(app.request.requestUri) #}
{% endif %}
{% endblock %}
<div class="uk-offcanvas-content">
@ -32,6 +43,8 @@
{% 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('sikofitt_doughnutwedding_gallery_upload') }}" title="Upload a wedding photo">Upload a photo</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>
@ -41,9 +54,9 @@
</nav>
</div>
<div class="uk-container uk-container-expand uk-hidden@m">
<nav class="uk-navbar">
<div class="uk-navbar-left uk-responsive-width">
<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>
<nav class="uk-navbar uk-margin-small-top">
<div class="uk-navbar-left uk-width-medium">
<a class="{% if app.request.requestUri == path('sikofitt_doughnutwedding_default_index') %}uk-animation-slide-left{% endif %}" href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img src="{{ bucket }}/assets/logo.png" /></a>
</div>
<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>
@ -54,11 +67,40 @@
<div class="uk-visible@m uk-responsive-width uk-width-3-4 uk-align-center">
<div class="uk-logo {% if app.request.requestUri == '/' %}uk-animation-scale-up{% endif %} uk-transform-origin-bottom-center">
{% if app.request.requestUri == '/' %}
<h2 class="uk-text-center">ERIC + KATRINA'S</h2>
<a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img class="uk-logo" src="{{ asset('images/logo.png') }}" /></a>
{% endif %}
<a href="{{ path('sikofitt_doughnutwedding_default_index') }}"><img class="uk-logo" src="{{ bucket }}/assets/logo.png" /></a>
{% if app.request.requestUri == '/' %}
<h3 class="uk-margin-small-top uk-text-center">MAY 12TH, 2017</h3>
{% endif %}
</div>
</div>
</div>{% set currentUrl = app.request.requestUri %}
{% if currentUrl != path('sikofitt_doughnutwedding_default_index') %}
<div class="uk-navigation-container uk-container uk-container-expand uk-visible@m">
<nav class="uk-navbar uk-navbar-container uk-navbar-transparent" uk-navbar>
<div class="uk-navbar-center uk-width-expand uk-margin-medium-bottom">
<ul class="uk-navbar-nav uk-doughnut-main-nav uk-child-width-1-5 uk-width-1-1">
<li class="{% if currentUrl == path('sikofitt_doughnutwedding_default_ourstory') %}uk-active{% endif %}">
<a href="{{ path('sikofitt_doughnutwedding_default_ourstory') }}" title="Our Story">Our Story</a>
</li>
<li class="{% if currentUrl == path('fos_user_profile_edit') %}uk-active{% endif %}">
<a href="{{ path('fos_user_profile_edit') }}" title="RSVP">RSVP</a>
</li>
<li class="{% if currentUrl == path('sikofitt_doughnutwedding_gallery_index') %}uk-active{% endif %}">
<a href="{{ path('sikofitt_doughnutwedding_gallery_index') }}" title="Photos!">Photo Gallery</a>
</li>
<li class="{% if currentUrl == path('sikofitt_doughnutwedding_default_location') %}uk-active{% endif %}">
<a href="{{ path('sikofitt_doughnutwedding_default_location') }}" title="Location">Location</a>
</li>
<li class="{% if currentUrl == path('sikofitt_doughnutwedding_default_contact') %}uk-active{% endif %}">
<a href="{{ path('sikofitt_doughnutwedding_default_contact') }}" title="Get In Touch">Get In Touch</a>
</li>
</ul>
</div>
</nav>
</div>
{% endif %}
{% include 'flash_messages.html.twig' %}
@ -69,5 +111,15 @@
</div>
{% include 'off_canvas.html.twig' %}
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-98404954-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

View File

@ -8,7 +8,7 @@
<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">
<h3 class="uk-position-cover uk-text-center">
<a href="#" class="uk-position-cover">our story</a>
<a href="{{ path('sikofitt_doughnutwedding_default_ourstory') }}" class="uk-position-cover">our story</a>
</h3>
</div>
</div>
@ -47,11 +47,16 @@
</div>
<div class="uk-width-1-2@m uk-width-1-1@s">
<p class="uk-text-meta">
Watch us tie the knot on Facebook! We know many of you wont be here in person. so we'll be broadcasting the ceremony live. Join our wedding group on Facebook and you'll be able to see the doughnut festivities as they happen!
Watch us tie the knot on Facebook or Instagram! We know many of you wont be here in person. so we'll be broadcasting the ceremony live. Join our wedding group on Facebook or follow us on Instagram and you'll be able to see the doughnut festivities as they happen!
</p>
</div>
<div class="uk-width-1-1">
<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 class="uk-width-1-1 uk-grid-match uk-grid-small">
<div class="uk-text-center uk-width-1-2@m uk-width-1-1@s uk-margin-small-bottom"><a href="https://www.facebook.com/groups/doughnutwedding" class="uk-width-1-1 uk-button uk-button-primary" target="_blank" title="Join Facebook Group">Join Facebook Group</a></div>
<div class="uk-text-center uk-width-1-2@m uk-width-1-1@s uk-margin-small-bottom"><a href="https://instagram.com/doughnutwedding" class="uk-width-1-1 uk-button uk-button-primary" target="_blank" title="Follow on Instagram">Follow on Instagram</a></div>
</div>
</div>
</div>
{% endblock %}

View File

@ -2,8 +2,8 @@
{% 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 class="uk-margin-medium uk-text-center uk-text-lead">
We'd LOVE to hear from you!<br /> Send us your wishes, thoughts, advice, stories or questions.
</p>
{% if(form is defined) %}
{{ form_errors(form) }}
@ -30,9 +30,19 @@
{{ form_errors(form.comment) }}
{{ form_widget(form.comment) }}
</div>
<div class="uk-width-1-2@m uk-width-1-1@s">
<div class="" uk-grid>
<div class="uk-width-1-3@m uk-width-1-1@s">
{{ form_widget(form.submit) }}
</div>
<div class="uk-width-2-3@m uk-width-1-1@s">
<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>
</div>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% else %}
@ -43,17 +53,19 @@
{% if message|length > 1 %}
<p class="uk-text-center">{{ message|last }}</p>
{% 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>
<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

@ -1,33 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ dump(app.session.get('user')) }}
{{ form_start(form) }}
<fieldset class="uk-fieldset uk-margin-small-bottom">
<legend class="uk-legend">Enter Token</legend>
</fieldset>
<div class="uk-grid-small" uk-grid>
<div class="uk-form-controls uk-form-controls-text uk-width-2-3@m">
{{ form_row(form.user_token) }}
</div>
<div class="uk-form-controls uk-width-1-3@m">
{{ form_row(form.submit) }}
</div>
</div>
<div class="uk-grid" uk-grid>
<div class="uk-width-1-1">
<p class="uk-text-center uk-text-lead">
You can also send a new auto login link to your email.
</p>
</div>
<div class="uk-form-controls uk-width-1-1 uk-text-center">
{{ form_row(form.email) }}
</div>
<div class="uk-form-controls uk-width-1-1 uk-text-center">
{{ form_row(form.update_token) }}
</div>
</div>
<div class="form-controls uk-form-blank">
{{ form_rest(form) }}
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -0,0 +1,15 @@
<li class="uk-margin-small-top uk-animation-fade">
<article class="uk-comment">
<header class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-expand">
<h4 class="uk-comment-title uk-text-capitalize">{{ comment.user.name }} <small class="uk-text-meta" title="{{ comment.created|date('l F jS, Y') }} at {{ comment.created|date('g:ia') }}" uk-tooltip> | {{ comment.created|date('m/d/y') }} at {{ comment.created|date('g:ia') }}</small></h4>
</div>
</header>
<div class="uk-comment-body">
<p>{{ comment.comment }}</p>
</div>
</article>
</li>
<li class="uk-margin-small">
<p class="uk-heading-line uk-text-center"><span uk-icon="icon: heart;"></span></p>
</li>

View File

@ -23,14 +23,16 @@
{% 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>
<h2 class="uk-margin-remove-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') }}" />
<img class="uk-transform-origin-top-right uk-animation-reverse uk-animation-kenburns" src="{{ bucket }}/assets/location.jpg" />
</div>
</div>
<div class="uk-margin-medium-bottom">
<h2 class="uk-text-center">Wedding</h2>
<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
@ -38,11 +40,33 @@
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>
<h2 class="uk-text-center">Reception</h2>
<p class="uk-text-large uk-text-center">
A reception will be held at the Bar Bar patio from 4pm to 7pm. Street parking is available.
</p>
<div class="uk-width-1-1">
<h2 class="uk-text-center uk-heading-line"><span uk-icon="icon: heart;"></span></h2>
</div>
<div class="uk-child-width-1-1@s uk-child-width-1-2@m" uk-grid>
<div>
<p class="uk-h3 uk-text-center">Voodoo Doughnut Too</p>
<p class="uk-text-center">1501 NE Davis St.<br />Portland, Oregon
(<a href="https://goo.gl/maps/bk4FpLdpud92" target="_blank" title="Voodoo Too on Google Maps">Map</a>)
</p>
<p class="uk-text-center uk-align-center">
<a href="http://www.voodoodoughnut.com/doughnuts" target="_blank" title="Voodoo Doughnuts" class="uk-width-1-1@s uk-width-auto@m uk-button uk-button-primary">Check Out The Doughnuts!</a>
</p>
</div>
<div>
<p class="uk-h3 uk-text-center">Bar Bar</p>
<p class="uk-text-center">3939 N. Mississippi Ave.<br />Portland, Oregon
(<a href="https://goo.gl/maps/sBmLBeKr72q" target="_blank" title="Bar Bar on Google Maps">Map</a>)
</p>
<p class="uk-text-center uk-align-center">
<a href="http://www.mississippistudios.com/bar-bar/" target="_blank" title="Mississippi Studios - Bar Bar" class="uk-width-1-1@s uk-width-auto@m uk-button uk-button-primary">Check Out Bar Bar!</a>
</p>
</div>
</div>
</div>
<div>
<h2 class="uk-text-center">Directions</h2>
@ -61,7 +85,7 @@
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>
<a href="https://goo.gl/maps/bk4FpLdpud92" class="uk-width-1-1@s uk-width-1-3@m uk-button uk-button-primary" title="Google maps" target="_blank">Open in Google Maps</a>
</p>
</div>
<div class="">

View File

@ -1,12 +1,12 @@
<div id="offcanvas" uk-offcanvas="overlay: true; mode:reveal">
<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>
<button class="uk-offcanvas-close uk-align-right" 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('fos_user_profile_edit') }}"><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>
@ -16,7 +16,7 @@
<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_change_password') }}"><span class="uk-margin-small-right" uk-icon="icon: lock"></span> Change <span class="uk-display-inline-block uk-margin-medium-left">Password</span></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>
@ -28,13 +28,32 @@
<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 class="uk-iconnav uk-text-center uk-child-width-1-5">
<li>
<a href="{{ path("hwi_oauth_service_redirect", {service: "facebook"}) }}">
<span class="uk-margin-small-right" uk-icon="icon: facebook"></span>
</a>
</li>
<li>
<a href="{{ path("hwi_oauth_service_redirect", {service: "google"}) }}">
<span class="uk-margin-small-right" uk-icon="icon: google"></span>
</a>
</li>
<li>
<a href="{{ path("hwi_oauth_service_redirect", {service: "twitter"}) }}">
<span class="uk-margin-small-right" uk-icon="icon: twitter"></span>
</a>
</li>
<li>
<a href="{{ path("hwi_oauth_service_redirect", {service: "yahoo"}) }}">
<span class="uk-margin-small-right" uk-icon="icon: yahoo"></span>
</a>
</li>
<li>
<a href="{{ path("hwi_oauth_service_redirect", {service: "amazon"}) }}">
<span class="uk-margin-small-right" uk-icon="icon: amazon"></span>
</a>
</li>
</ul>
</div>
</li>

View File

@ -1,9 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Our Story{% endblock title %}
{% block body %}
<h2 class="uk-text-center" style="letter-spacing: .15rem">Our Story</h2>
<h2 class="uk-text-center uk-margin-remove-top" style="letter-spacing: .15rem">Our Story</h2>
<hr class="uk-margin-small-bottom" />
<div class="uk-overflow-hidden uk-margin-top-remove uk-margin-small-bottom">
<img class="uk-responsive-width" src="{{ bucket }}/assets/our-story-hero.jpg" />
</div>
<div class="uk-column-1-1@m uk-column-divider">
<hr class="uk-divider-icon" />
<hr class="uk-margin-small-bottom" />
<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>
@ -12,7 +16,7 @@
<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,
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" />
<h2 class="uk-heading-line uk-text-center"><span><span uk-icon="icon: heart"></span></span></h2>
<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>

View File

@ -1,21 +1,22 @@
{% if(not is_granted('IS_AUTHENTICATED_FULLY')) %}
<div class="uk-width-1-1 uk-padding-small uk-align-center">
{% if not is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="uk-width-1-1 uk-padding-small uk-align-center">
<h4 class="uk-heading-line uk-text-center">
<span>
<a href="{{ url('fos_user_security_login') }}" title="Login">Login</a> <span class="uk-margin-small-left uk-margin-small-right" uk-icon="icon: social"></span> <a href="{{ url('fos_user_registration_register') }}" title="Register">Register</a>
</span>
</h4>
<ul class="uk-iconnav uk-grid uk-child-width-1-6" uk-grid>
<ul class="uk-iconnav uk-grid uk-child-width-1-5" uk-grid>
<li>
<a class="uk-text-center uk-login uk-login-facebook" href="{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}" uk-icon="icon: facebook; ratio:1.5"></a>
</li>
<li><a class="uk-text-center uk-login uk-login-google" href="{{ url("hwi_oauth_service_redirect", {service: "google"}) }}" uk-icon="icon: google; ratio:1.5"></a></li>
<li><a class="uk-text-center uk-login uk-login-twitter" href="{{ url("hwi_oauth_service_redirect", {service: "twitter"}) }}" uk-icon="icon: twitter; ratio:1.5"></a></li>
<li><a href="{{ url("hwi_oauth_service_redirect", {service: "yahoo"}) }}" class="uk-icon-image uk-align-center uk-login uk-login-yahoo"><img height="30" width="30" src="{{ asset('images/yahoo.svg') }}" uk-svg></a></li>
<li><a href="{{ url("hwi_oauth_service_redirect", {service: "amazon"}) }}" class="uk-icon-image uk-align-center uk-login uk-login-amazon"><img height="30" width="30" src="{{ asset('images/amazon.svg') }}" uk-svg></a></li>
<li><a class="uk-text-center uk-login uk-login-yahoo" href="{{ url("hwi_oauth_service_redirect", {service: "yahoo"}) }}" uk-icon="icon: yahoo; ratio:1.5"></a></li>
<li><a class="uk-text-center uk-login uk-login-amazon" href="{{ url("hwi_oauth_service_redirect", {service: "amazon"}) }}" uk-icon="icon: amazon; ratio:1.5"></a></li>
<li><a class="uk-text-center uk-login uk-login-instagram" href="{{ url("hwi_oauth_service_redirect", {service: "instagram"}) }}" uk-icon="icon: instagram; ratio:1.5"></a></li>
</ul>
</div>
{% endif %}

View File

@ -1,4 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ dump(app.session.get('user')) }}
{% endblock %}

View File

@ -1,7 +0,0 @@
{% extends 'base.html.twig' %}
{% block body %}
<h2 class="uk-text-center">You have been successfully logged out.</h2>
<p class="uk-text-center">
You can log in again by going to the <a href="/login">login</a> page.
</p>
{% endblock %}

View File

@ -1,19 +1,19 @@
{% block body_text %}
{% autoescape false %}
Heyo!,
Heyo!
{{ user.name }} has registered a new account.
{{ user.name }} has registered a new account with the email {{ user.email }} and is bringing {% if user.rsvp.guests != 0 %}{{ user.rsvp.guests - 1 }}{% else %}0{% endif %} guests with them.
Info,
Email : {{ user.email }}
Guests: {{ user.rsvp.guests }}
{% if user.comment is not null %}
Comment :
{{ user.name }} wants you to know -
{{ user.comment }}
{% endif %}
{% if resourceOwner is defined and resourceOwner is not null %}
{{ user.name }} connected with {{ resourceOwner|capitalize }}
{% endif %}
Love,
Your website ❤

View File

@ -49,6 +49,9 @@ framework:
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
form_themes:
# other form themes
- 'VichUploaderBundle:Form:fields.html.twig'
# Doctrine Configuration
doctrine:
@ -126,7 +129,6 @@ swiftmailer:
username: '%mailer_user%'
password: '%mailer_password%'
spool: { type: memory }
delivery_addresses: ['eric@rewiv.com']
sender_address: 'noreply@doughnutwedding.com'
hwi_oauth:
@ -148,10 +150,6 @@ hwi_oauth:
type: amazon
client_id: 'amzn1.application-oa2-client.15f87b8a4f23465b9022ba0a3f55610d'
client_secret: '84d6f402c53386ae0f196062945f217dcc56e7b7122cffb76c95b6a5775d22e0'
instagram:
type: instagram
client_id: '70e7edd280834c429d49f985ff308230'
client_secret: '9c405020a3ef412086032a4514909705'
twitter:
type: twitter
client_id: 'YmXGQN2Az0eTlkwJrnaO2wR9r'
@ -170,7 +168,6 @@ hwi_oauth:
google: googleId
facebook: facebookId
amazon: amazonId
instagram: instagramId
twitter: twitterId
yahoo: yahooId
# if you want to use 'connect' and do not use the FOSUB integration, configure these separately
@ -219,12 +216,23 @@ knp_gaufrette:
assets:
adapter: assets
alias: cloud_assets
vich_uploader:
db_driver: orm
storage: gaufrette
mappings:
gallery_image:
upload_destination: cloud
uri_prefix: /
namer:
service: vich_uploader.namer_hash
options:
length: 32
algorithm: 'sha3-512'
delete_on_update: true
delete_on_remove: true
sikofitt_doughnut_wedding:
max_rsvps: ~
white_october_pagerfanta:
exceptions_strategy:
out_of_range_page: ~
not_valid_current_page: ~

View File

@ -36,6 +36,17 @@ monolog:
#chromephp:
# type: chromephp
# level: info
vich_uploader:
storage: gaufrette
mappings:
gallery_image:
upload_destination: cloud
uri_prefix: /
#storage: file_system
#mappings:
# gallery_image:
# uri_prefix: /images/gallery
# upload_destination: '%kernel.root_dir%/../web/images/gallery'
swiftmailer:
transport: null

View File

@ -5,11 +5,41 @@ monolog:
handlers:
main:
type: fingers_crossed
action_level: error
action_level: notice
handler: redis
console:
type: console
redis:
type: service
id: snc_redis.monolog.handler
level: debug
level: notice
mail:
type: fingers_crossed
# 500 errors are logged at the critical level
action_level: error
excluded_404s:
- ^/
# to also log 400 level errors (but not 404's):
# action_level: error
#excluded_404s:
# - ^/
handler: deduplicated
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: 'action@doughnutwedding.com'
to_email: ['sikofitt@gmail.com','katrina.a.johnson@gmail.com']
# or list of recipients
# to_email: ['dev1@example.com', 'dev2@example.com', ...]
subject: 'An Error Occurred! %%message%%'
level: error
formatter: monolog.formatter.html
content_type: text/html
vich_uploader:
storage: gaufrette
mappings:
gallery_image:
upload_destination: cloud
uri_prefix: /

View File

@ -1,17 +1,37 @@
easy_admin:
site_name: Doughnut Wedding
design:
form_theme: 'vertical'
form_theme: 'horizontal'
entities:
Contact:
class: Sikofitt\DoughnutWeddingBundle\Entity\Contact
list:
actions: ['show','edit','delete']
fields: ['userid','email','name','comment','createdAt']
ImageComments:
class: Sikofitt\DoughnutWeddingBundle\Entity\ImageComment
disabled_actions: ['new']
User:
class: Sikofitt\DoughnutWeddingBundle\Entity\User
list:
actions: ['show','edit','delete']
fields: ['name','username','email','enabled','lastLogin','rsvp']
edit:
fields:
- name
- username
- email
- { property: rsvp, type_options: { disabled: true } }
- comment
- images
- enabled
- lastLogin
- confirmationToken
- passwordRequestedAt
- roles
- created
- updated
- facebookId
- googleId
- amazonId
- instagramId
- twitterId
- yahooId
show:
fields:
- name
@ -34,20 +54,26 @@ easy_admin:
- yahooId
Rsvp:
class: Sikofitt\DoughnutWeddingBundle\Entity\Rsvp
Image:
Contact:
class: Sikofitt\DoughnutWeddingBundle\Entity\Contact
list:
actions: ['show','edit','delete']
fields: ['userid','email','name','comment','createdAt']
Images:
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/' }
- description
- category
- tags
- user
form:
fields:
- { property: 'imageFile', type: 'vich_image', base_path: 'https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/gallery/' }
- description
- { property: tags, type: 'collection'}
- category
- user

View File

@ -2,54 +2,63 @@ hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_connect:
resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /connect
facebook_login:
path: /login/callback/facebook
google_login:
path: /login/callback/google
twitter_login:
path: /login/callback/twitter
instagram_login:
path: /login/callback/instagram
amazon_login:
path: /login/callback/amazon
yahoo_login:
path: /login/callback/yahoo
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
#paths
# /login
# /login_check
# /logout
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /user/profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /user/profile
easy_admin_bundle:
resource: "@EasyAdminBundle/Controller/"
type: annotation
prefix: /admin
sikofitt_doughnut_wedding:
resource: "@SikofittDoughnutWeddingBundle/Controller/"
type: annotation

View File

@ -35,7 +35,6 @@ security:
facebook: /login/callback/facebook
google: /login/callback/google
twitter: /login/callback/twitter
instagram: /login/callback/instagram
amazon: /login/callback/amazon
yahoo: /login/callback/yahoo
login_path: /login

View File

@ -23,12 +23,17 @@ services:
arguments: ['@security.token_storage', '@router']
tags:
- { name: kernel.event_listener, event: kernel.request }
doughnutwedding.event.redirect_from_hwi_connect_page:
class: Sikofitt\DoughnutWeddingBundle\EventListener\RedirectFromHwiConnectPageEvent
arguments: ['@router', '@service_container']
tags:
- { name: kernel.event_listener, event: kernel.request }
doughnutwedding.event.redirect_user_after_register_event:
class: Sikofitt\DoughnutWeddingBundle\EventListener\RedirectOnUserRegisterListener
arguments: ['@service_container']
tags:
- { name: kernel.event_listener, event: fos_user.registration.confirmed }
- { name: kernel.event_listener, event: fos_user.registration.completed }
- { name: kernel.event_listener, event: security.interactive_login }
doughnutwedding.google_cloud_storage.service:
class: \Google_Service_Storage
factory: ['Sikofitt\DoughnutWeddingBundle\Factory\GoogleCloudStorageServiceFactory', createGoogleCloudService]
@ -45,4 +50,11 @@ services:
- { name: kernel.event_listener, event: kernel.response }
doughnutwedding.security.access_denied_handler:
class: Sikofitt\DoughnutWeddingBundle\Security\AccessDeniedHandler
arguments: ['@router', '@monolog.logger']
arguments: ['@router', '@monolog.logger']
doughnutwedding.uikit.template:
class: Sikofitt\DoughnutWeddingBundle\Pager\View\UIkitTemplate
pagerfanta.view.default:
class: Pagerfanta\View\DefaultView
arguments: ['@doughnutwedding.uikit.template']
public: false
tags: [{ name: pagerfanta.view, alias: default }]

3
build/images/yahoo2.svg Normal file
View File

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

View File

@ -1,6 +1,6 @@
@import "../../vendor/bower/uikit/src/less/uikit.less";
@import "../../vendor/bower/uikit/src/less/components/variables.less";
@import url('https://fonts.googleapis.com/css?family=Sigmar+One');
//@global-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
//@global-font-size: 16px;
@global-font-family: 'Raleway', sans-serif;
@ -8,18 +8,69 @@
@base-body-font-family: 'Raleway', sans-serif;
@base-heading-font-family: 'Raleway', sans-serif;
@base-heading-text-transform: uppercase;
@button-text-transform:capitalize;
@base-body-font-weight: 200;
@base-heading-font-weight: 300;
@form-background: #ffffff;
@global-link-color: #90d5c1;
@global-link-color: #5fbabd;
@base-link-color: @global-link-color;
@base-link-hover-color: darken(@base-link-color, 20%);
@button-primary-background: #90d5c1;
@button-primary-background: #9dd3d5;
@button-primary-color: #333;
@text-primary-color: @button-primary-background;
@button-primary-hover-color: darken(@button-primary-color, 10%);
@button-primary-hover-background: darken(@button-primary-background, 10%);
.uk-login-container {
@button-danger-background: #fa6581;
@button-danger-color: #333;
@button-danger-hover-color: darken(@button-danger-color, 10%);
@button-danger-hover-background: darken(@button-danger-background, 10%);
blockquote p {
}
blockquote footer:before {
content: "— ";
}
.uk-404 {
font-family: 'Sigmar One', cursive;
line-height:0;
&.uk-doughnut {
@media(min-width: @breakpoint-small-max) {
font-size: 10rem;
}
@media(max-width: @breakpoint-small) {
font-size: 5rem;
}
.uk-spin {
@media(min-width: @breakpoint-small-max) {
width: 128px;
height: 128px;
}
@media(max-width: @breakpoint-small) {
width: 64px;
height:64px;
}
background-image:url(https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/doughnut_404.png)
}
}
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
.uk-spin {
position: relative;
top: 0%;
left: 0%;
margin:0px 12px;
-webkit-animation:spin 1.5s linear infinite;
-moz-animation:spin 1.5s linear infinite;
animation:spin 1.5s linear infinite;
}
.uk-login-container {
.uk-navbar {
.uk-navbar-nav {
li {
@ -37,7 +88,7 @@ label.required:after {
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
font-weight: bold
}
.uk-home {
@ -63,22 +114,22 @@ label.required:after {
.uk-our-story-home {
height:465px !important;
background-image: url('/images/home_our_story_1.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_our_story_1.jpg');
&:hover {
background-image: url('/images/home_our_story_2.jpg')
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_our_story_2.jpg')
}
}
// photo
// location
.uk-photo-home {
background-image: url('/images/home_photo_2.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_photo_2.jpg');
&:hover {
background-image: url('/images/home_photo_1.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_photo_1.jpg');
}
}
.uk-location-home {
margin-bottom:15px !important;
background-image: url('/images/home_location.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_location.jpg');
transition-duration: .3s;
transition-timing-function: ease-out;
transition-property: filter;
@ -90,15 +141,15 @@ label.required:after {
}
.uk-doughnut-rsvp {
margin-bottom:15px !important;
background-image: url('/images/home_doughnut_1.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_doughnut_1.jpg');
&:hover {
background-image: url('/images/home_doughnut_2.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_doughnut_2.jpg');
}
}
.uk-doughnut-get-in-touch-home {
background-image: url('/images/home_doughnut_2.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_doughnut_2.jpg');
&:hover {
background-image: url('/images/home_doughnut_1.jpg');
background-image: url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_doughnut_1.jpg');
}
}
@ -106,7 +157,39 @@ label.required:after {
}
}
.uk-icon.uk-icon-facebook {
color: #3b5998;
}
.uk-icon.uk-icon-google {
color: #d50f25;
}
.uk-icon.uk-icon-twitter {
color: #1da1f2;
}
.uk-icon.uk-icon-yahoo {
color: #7b0099;
/*color: #720e9e;*/
}
.uk-icon.uk-icon-amazon {
color: #ff9900;
}
.uk-preload {
background-repeat: no-repeat;
background-position-x: -9999px;
background-position-y: -9999px;
.our-story {
background-image:url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_our_story_2.jpg');
}
.photo-gallery {
background-image:url('https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/home_photo_1.jpg');
}
}
.uk-registration-connect a,
.uk-doughnut-main-nav li a {
font-weight:bold !important;
}
.uk-input,
.uk-select,
.uk-textarea {

View File

@ -55,7 +55,8 @@
"tedivm/stash-bundle": "^0.6.2",
"twig/extensions": "^1.4",
"twig/twig": "^1.0||^2.0",
"vich/uploader-bundle": "^1.5"
"vich/uploader-bundle": "^1.5",
"white-october/pagerfanta-bundle": "^1.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^2.3",

View File

@ -1,248 +1,377 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Eric and Katrina's Doughnut Wedding!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0 " />
<meta name="format-detection" content="telephone=no"/>
<!--[if !mso]><!-->
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700' rel='stylesheet' type='text/css'/>
<!--<![endif]-->
<style type="text/css">
body {
-webkit-text-size-adjust: 100% !important;
-ms-text-size-adjust: 100% !important;
-webkit-font-smoothing: antialiased !important;
}
img {
border: 0 !important;
outline: none !important;
}
p {
Margin: 0px !important;
padding: 0px !important;
}
table {
border-collapse: collapse;
mso-table-lspace: 0px;
mso-table-rspace: 0px;
}
td, a, span {
border-collapse: collapse;
mso-line-height-rule: exactly;
}
.ExternalClass * {
line-height: 100%;
}
span.MsoHyperlink {
mso-style-priority: 99;
color: inherit;
}
span.MsoHyperlinkFollowed {
mso-style-priority: 99;
color: inherit;
}
center table {
width: 100% !important;
}
.em_white1 a {
color: #f3f4f6 !important;
text-decoration: none !important;
}
.em_blue a {
color:#34a8ff !important;
text-decoration:none !important;
}
.em_white a {
color: #ffffff !important;
text-decoration: none !important;
}
/*Stylesheet for the devices width between 481px to 599px*/
@media only screen and (min-width:481px) and (max-width:599px) {
table[class=em_main_table] {
width: 480px !important;
}
table[class=em_wrapper] {
width: 100% !important;
}
td[class=em_aside] {
padding: 0px 0px !important; /*Update the values as required*/
}
td[class=em_hide], table[class=em_hide], span[class=em_hide], br[class=em_hide] {
display: none !important;
}
img[class=em_full_img] {
width: 100% !important;
height: auto !important;
}
td[class=em_center] {
text-align: center !important;
}
td[class=em_width10] {
width: 10px !important;
}
td[class=em_height] {
height: 20px !important;
font-size: 1px !important;
line-height: 1px !important;
}
td[class=em_pad_top] {
padding-top: 20px !important;
}
br[class=br] {
display: none !important;
}
}
/*Stylesheet for the devices width between 0px to 480px*/
@media only screen and (max-width:480px) {
.em_white {
font-size:16px !important;
}
table[class=em_main_table] {
width: 100% !important;
}
table[class=em_wrapper] {
width: 100% !important;
}
td[class=em_aside] {
padding: 0px 0px !important; /*Update the ualves as required*/
}
td[class=em_hide], table[class=em_hide], span[class=em_hide], br[class=em_hide] {
display: none !important;
}
img[class=em_full_img] {
width: 100% !important;
height: auto !important;
}
td[class=em_center] {
text-align: center !important;
}
td[class=em_width10] {
width: 10px !important;
}
td[class=em_height] {
height: 20px !important;
font-size: 1px !important;
line-height: 1px !important;
}
td[class=em_pad_top] {
padding-top: 15px !important;
}
br[class=br] {
display: none !important;
}
}
</style>
<title>Eric and Katrina's Doughnut Wedding!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0 "/>
<meta name="format-detection" content="telephone=no"/>
<!--[if !mso]><!-->
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700'
rel='stylesheet' type='text/css'/>
<!--<![endif]-->
<style type="text/css">
body {
-webkit-text-size-adjust: 100% !important;
-ms-text-size-adjust: 100% !important;
-webkit-font-smoothing: antialiased !important;
}
img {
border: 0 !important;
outline: none !important;
}
p {
Margin: 0px !important;
padding: 0px !important;
}
table {
border-collapse: collapse;
mso-table-lspace: 0px;
mso-table-rspace: 0px;
}
td, a, span {
border-collapse: collapse;
mso-line-height-rule: exactly;
}
.ExternalClass * {
line-height: 100%;
}
span.MsoHyperlink {
mso-style-priority: 99;
color: inherit;
}
span.MsoHyperlinkFollowed {
mso-style-priority: 99;
color: inherit;
}
center table {
width: 100% !important;
}
.em_white1 a {
color: #f3f4f6 !important;
text-decoration: none !important;
}
.em_blue a {
color: #34a8ff !important;
text-decoration: none !important;
}
.em_white a {
color: #ffffff !important;
text-decoration: none !important;
}
/*Stylesheet for the devices width between 481px to 599px*/
@media only screen and (min-width: 481px) and (max-width: 599px) {
table[class=em_main_table] {
width: 480px !important;
}
table[class=em_wrapper] {
width: 100% !important;
}
td[class=em_aside] {
padding: 0px 0px !important; /*Update the values as required*/
}
td[class=em_hide], table[class=em_hide], span[class=em_hide], br[class=em_hide] {
display: none !important;
}
img[class=em_full_img] {
width: 100% !important;
height: auto !important;
}
td[class=em_center] {
text-align: center !important;
}
td[class=em_width10] {
width: 10px !important;
}
td[class=em_height] {
height: 20px !important;
font-size: 1px !important;
line-height: 1px !important;
}
td[class=em_pad_top] {
padding-top: 20px !important;
}
br[class=br] {
display: none !important;
}
}
/*Stylesheet for the devices width between 0px to 480px*/
@media only screen and (max-width: 480px) {
.em_white {
font-size: 16px !important;
}
table[class=em_main_table] {
width: 100% !important;
}
table[class=em_wrapper] {
width: 100% !important;
}
td[class=em_aside] {
padding: 0px 0px !important; /*Update the ualves as required*/
}
td[class=em_hide], table[class=em_hide], span[class=em_hide], br[class=em_hide] {
display: none !important;
}
img[class=em_full_img] {
width: 100% !important;
height: auto !important;
}
td[class=em_center] {
text-align: center !important;
}
td[class=em_width10] {
width: 10px !important;
}
td[class=em_height] {
height: 20px !important;
font-size: 1px !important;
line-height: 1px !important;
}
td[class=em_pad_top] {
padding-top: 15px !important;
}
br[class=br] {
display: none !important;
}
}
</style>
</head>
<body style="margin:0px; padding:0px;" bgcolor="#ffffff">
<!--Full width table start-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
<tr>
<td align="center" valign="top"><table width="680" border="0" align="center" class="em_wrapper" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
<tr>
<td class="em_hide" height="1" style="line-height:0px; font-size:0px;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif" height="1" alt="" width="680" style="display:block; width:680px; min-width:680px;" border="0" /></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<!--=== HEADER SECTION === -->
<tr>
<td align="center" valign="top">
<table width="680" border="0" align="center" class="em_wrapper" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
<tr>
<td class="em_hide" height="1" style="line-height:0px; font-size:0px;">
<img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif"
height="1" alt="" width="680"
style="display:block; width:680px; min-width:680px;"
border="0"/>
</td>
</tr>
<tr>
<td width="20" class="em_width10"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif"
width="1" height="1" alt=""
style="display:block; border:none;"/></td>
</tr>
</table>
</td>
</tr>
<!--=== //HEADER SECTION === -->
</tr>
<!--=== BODY SECTION === -->
<tr>
<td valign="top" bgcolor="#f9f9f9">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<!--=== HERO SECTION === -->
<tr>
<td valign="top">
<table width="680" border="0" cellspacing="0"
cellpadding="0" align="center"
class="em_wrapper">
<tr>
<td valign="top">
<table width="100%" border="0"
cellspacing="0" cellpadding="0"
align="center">
<tr>
<td valign="top" align="center"><a
href="https://www.doughnutwedding.com"
target="_blank"
style="text-decoration:none;"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_1.jpg"
alt="Please join us for ERIC + KATRINA'S"
width="640"
class="em_full_img"
style="display:block; max-width:640px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--=== //HERO SECTION === -->
<!--=== 1 SECTION === -->
<tr>
<td valign="top">
<table width="680" border="0" cellspacing="0"
cellpadding="0" align="center"
class="em_wrapper">
<tr>
<td valign="top">
<table width="100%" border="0"
cellspacing="0" cellpadding="0"
align="center">
<tr>
<td valign="top" align="center">
<a
href="https://www.doughnutwedding.com"
target="_blank"
style="text-decoration:none;">
<img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_2.jpg"
alt="DOUGHNUT WEDDING"
width="640"
class="em_full_img"
style="display:block; max-width:680px; border:none; line-height:62px;" />
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--=== //1 SECTION === -->
<!--=== 2 SECTION === -->
<tr>
<td valign="top">
<table width="680" border="0" cellspacing="0"
cellpadding="0" align="center"
class="em_wrapper">
<tr>
<td valign="top">
<table width="100%" border="0"
cellspacing="0" cellpadding="0"
align="center">
<tr>
<td valign="top" align="center"><a
href="https://www.doughnutwedding.com"
target="_blank"
style="text-decoration:none;"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_3.jpg"
alt="Friday, May 12, 2017<br>Two O'Clock"
width="640"
class="em_full_img"
style="display:block; max-width:680px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--=== //2 SECTION === -->
<!--=== 3 SECTION === -->
<tr>
<td valign="top">
<table width="680" border="0" cellspacing="0"
cellpadding="0" align="center"
class="em_wrapper">
<tr>
<td valign="top">
<table width="100%" border="0"
cellspacing="0" cellpadding="0"
align="center">
<tr>
<td valign="top" align="center"><a
href="https://www.doughnutwedding.com"
target="_blank"
style="text-decoration:none;"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_4.jpg"
alt="RSVP Online"
width="640"
class="em_full_img"
style="display:block; max-width:680px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--=== //3 SECTION === -->
<!--=== 4 SECTION === -->
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0"
cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a
href="https://www.doughnutwedding.com"
target="_blank"
style="text-decoration:none;">
<img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_5.jpg"
alt="doughnutwedding.com" width="640"
class="em_full_img"
style="display:block; max-width:680px; border:none; line-height:62px;"/></a>
</td>
</tr>
</table>
</td>
<td width="15" class="em_width10"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif"
width="1" height="1" alt=""
style="display:block; border:none;"/></td>
</tr>
</table>
</td>
</tr>
<!--=== //4 SECTION === -->
<!--=== 5 SECTION === -->
<tr>
<td valign="top">
<table width="680" border="0" cellspacing="0" cellpadding="0"
align="center" class="em_wrapper">
<tr>
<td width="15" class="em_width10"><img
src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif"
width="1" height="1" alt=""
style="display:block; border:none;"/></td>
</tr>
<!--=== //5 SECTION === -->
</table>
</td>
</tr>
<!--=== //BODY SECTION === -->
</tr>
<tr> </tr>
</table></td>
<td width="20" class="em_width10"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif" width="1" height="1" alt="" style="display:block; border:none;"/></td>
</tr>
</table></td>
</tr>
<!--=== //HEADER SECTION === -->
<!--=== BODY SECTION === -->
<tr>
<td valign="top" bgcolor="#f9f9f9"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<!--=== HERO SECTION === -->
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" align="center" class="em_wrapper">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a href="https://www.doughnutwedding.com" target="_blank" style="text-decoration:none;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_1.jpg" alt="Please join us for ERIC + KATRINA'S" width="640" class="em_full_img" style="display:block; max-width:640px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a></td>
</tr>
</table></td>
</table>
</td>
</tr>
</table></td>
</tr>
<!--=== //HERO SECTION === -->
<!--=== 1 SECTION === -->
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" align="center" class="em_wrapper">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a href="https://www.doughnutwedding.com" target="_blank" style="text-decoration:none;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_2.jpg" alt="DOUGHNUT WEDDING" width="640" class="em_full_img" style="display:block; max-width:680px; border:none; font-famil y:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a></td>
</tr>
</table></td>
</table></td>
</tr>
</table></td>
</tr>
<!--=== //1 SECTION === -->
<!--=== 2 SECTION === -->
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" align="center" class="em_wrapper">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a href="https://www.doughnutwedding.com" target="_blank" style="text-decoration:none;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_3.jpg" alt="Friday, May 12, 2017<br>Two O'Clock" width="640" class="em_full_img" style="display:block; max-width:680px; border:none; font-famil y:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--=== //2 SECTION === -->
<!--=== 3 SECTION === -->
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" align="center" class="em_wrapper">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a href="https://www.doughnutwedding.com" target="_blank" style="text-decoration:none;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_4.jpg" alt="RSVP Online" width="640" class="em_full_img" style="display:block; max-width:680px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--=== //3 SECTION === -->
<!--=== 4 SECTION === -->
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="center"><a href="https://www.doughnutwedding.com" target="_blank" style="text-decoration:none;"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/doughnut_wedding_5.jpg" alt="doughnutwedding.com" width="640" class="em_full_img" style="display:block; max-width:680px; border:none; font-family:Variable, Tahoma, Geneva, sans-serif; font-size:35px; line-height:62px; color:#ff4b55; font-style:italic;"/></a></td>
</tr>
</table></td>
<td width="15" class="em_width10"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif" width="1" height="1" alt="" style="display:block; border:none;"/></td>
</tr>
</table></td>
</tr>
<!--=== //4 SECTION === -->
<!--=== 5 SECTION === -->
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" align="center" class="em_wrapper">
<tr>
<td width="15" class="em_width10"><img src="https://storage.googleapis.com/zgluzzkwodfky2m0ytbhmjhmmzqzntq2ngy3ndjmntyxmzg4/assets/email/1450138002_spacer.gif" width="1" height="1" alt="" style="display:block; border:none;"/></td>
<!--=== //5 SECTION === -->
</table></td>
</tr>
<!--=== //BODY SECTION === -->
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

View File

@ -45,18 +45,20 @@ class DefaultController extends Controller
if (null !== $this->getUser()) {
$parameters['hide_social'] = true;
}
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');
/**
* @Route("/our_story")
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return Response
*/
public function ourStoryAction(Request $request): Response
{
return $this->render('our_story.html.twig');
}
/**
@ -66,19 +68,22 @@ class DefaultController extends Controller
*
* @return Response
*/
public function locationAction(Request $request) {
public function locationAction(Request $request): Response
{
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 {
public function contactAction(Request $request): Response
{
$contact = new Contact();
if(null !== $this->getUser()) {
if (null !== $this->getUser()) {
$contact
->setName($this->getUser()->getName())
->setEmail($this->getUser()->getEmail())
@ -88,13 +93,11 @@ class DefaultController extends Controller
$form = $this->get('form.factory')->create(ContactFormType::class, $contact);
if($request->isMethod('POST')) {
if ($request->isMethod('POST')) {
$form->handleRequest($request);
if($form->isValid() && $form->isSubmitted()) {
if ($form->isValid() && $form->isSubmitted()) {
$em = $this->get('doctrine.orm.entity_manager');
/** @var Contact $data */
$data = $form->getData();
$data->setCreatedAt(new \DateTime('now'));
@ -102,11 +105,11 @@ class DefaultController extends Controller
$em->persist($data);
$em->flush();
$responseMessage[] = 'Thank you for your message ' . $data->getName() . '!';
$responseMessage[] = 'Thank you for your message '.$data->getName().'!';
$email = $data->getEmail();
if( null !== $email ) {
if (null !== $email) {
$responseMessage[] = sprintf('We will respond to you at %s as soon as possible.', $email);
} else {
$email = 'no-reply@doughnutwedding.com';
@ -129,6 +132,5 @@ class DefaultController extends Controller
}
return $this->render('form/contact.html.twig', ['form' => $form->createView()]);
}
}

View File

@ -20,11 +20,21 @@
namespace Sikofitt\DoughnutWeddingBundle\Controller;
use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sikofitt\DoughnutWeddingBundle\Entity\Image;
use Sikofitt\DoughnutWeddingBundle\Entity\ImageComment;
use Sikofitt\DoughnutWeddingBundle\Form\GalleryUploadType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Vich\UploaderBundle\Form\Type\VichImageType;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Csrf\CsrfToken;
/**
* Class ImageController.
@ -35,44 +45,213 @@ class GalleryController extends Controller
{
/**
* @Route("/")
* @Method({"GET"})
*/
public function indexAction()
public function indexAction(Request $request) : Response
{
$images = $this->get('doctrine.orm.default_entity_manager')->getRepository('SikofittDoughnutWeddingBundle:Image')->findAll();
return $this->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', ['images' => $images]);
$images = $this->get('doctrine.orm.default_entity_manager')->getRepository('SikofittDoughnutWeddingBundle:Image')->findAll();
$chunks = array_chunk($images, 12);
$adapter = new ArrayAdapter($images);
$pager = new Pagerfanta($adapter);
$pager->setMaxPerPage(12);
return $this->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', [
'images' => $chunks[0] ?? $images,
'pager' => $pager,
]);
}
/**
* @Route("/page/{number}", defaults={"number":1}, name="gallery_page_view", requirements={"number":"\d+"})
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $number
*
* @return Response
*/
public function pageAction(Request $request, int $number)
{
$images = $this->get('doctrine.orm.default_entity_manager')->getRepository('SikofittDoughnutWeddingBundle:Image')->findAll();
$adapter = new ArrayAdapter($images);
$pager = new Pagerfanta($adapter);
$chunks = array_chunk($images, 12);
$pager->setMaxPerPage(12);
$pager->setCurrentPage($number);
return $this->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', ['images' => $chunks[$number - 1], 'pager' => $pager]);
}
/**
* @Route("/upload")
*/
public function uploadAction()
public function uploadAction(Request $request, Response $response = null)
{
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());
if (false === $this->isGranted('IS_AUTHENTICATED_FULLY')) {
$this->addFlash('error', 'You must be logged in to upload photos.');
}
$image = new Image();
$image->setUser($request->getSession()->get('user'));
$form = $this->get('form.factory')->create(GalleryUploadType::class, $image);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
/** @var \Sikofitt\DoughnutWeddingBundle\Entity\User $user */
$user = $this->getUser();
$image->setUser($user);
$em = $this->get('doctrine.orm.entity_manager');
$em->persist($image);
$em->flush();
$baseName = $image->getImageFile()->getBasename('.'.$image->getImageFile()->getExtension());
return new RedirectResponse($this->get('router')->generate('view_gallery_image_by_hash', ['imageHash' => $baseName]));
}
return $this->render('SikofittDoughnutWeddingBundle:Image:upload.html.twig', [
'form' => $form->createView()
'form' => $form->createView(),
]);
}
/**
* @Route("/tag")
* @Route("/ajax")
* @Method({"POST"})
*/
public function tagAction()
public function ajaxCommentAction(Request $request): JsonResponse
{
return $this->render('SikofittDoughnutWeddingBundle:Image:tag.html.twig', [
// ...
if (false === $request->getSession()->has('_security_secured_area')) {
return new JsonResponse(['status' => 403, 'message' => 'You must be logged in to post a comment'], 403);
}
/** @var \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $data */
$data = unserialize($request->getSession()->get('_security_secured_area'), [TokenInterface::class]);
$tokenManager = $this->get('security.csrf.token_manager');
$fileName = $request->request->get('file');
$token = $request->request->get('_token');
$csrfToken = new CsrfToken($fileName, $token);
if (false === $tokenManager->isTokenValid($csrfToken)) {
return new JsonResponse(['status' => Response::HTTP_EXPECTATION_FAILED, 'message' => 'Invalid Token'], Response::HTTP_EXPECTATION_FAILED);
}
$em = $this->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('SikofittDoughnutWeddingBundle:User')
->findOneBy(['id' => $data->getUser()->getId()]);
$comment = $request->request->get('comment');
$fileId = $request->request->get('id');
$image = $em
->getRepository('SikofittDoughnutWeddingBundle:Image')
->findOneBy(['id' => $fileId]);
$newComment = new ImageComment();
$newComment->setUser($user)
->setComment($comment)
->setImage($image)
->setIsChild(false)
->setCreated(new \DateTime('now'))
->setChildComments(null);
$em->persist($newComment);
$em->flush();
$commentHtml = $this->renderView('gallery_comment.html.twig', ['comment' => $newComment]);
return new JsonResponse([
'id' => $user->getId(),
'name' => $user->getName(),
'date_short' => date('m/d/y').' at '.date('g:ia'),
'date_long' => date('l F jS, Y').' at '.date('g:ia'),
'status' => Response::HTTP_OK,
'html' => $commentHtml,
]);
}
/**
* @Route("/category")
* @Route("/{imageHash}", name="view_gallery_image_by_hash", requirements={"imageHash":"\w{32,32}"})
* @Method({"GET","HEAD"})
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param string $imageHash
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*
* @return Response
*/
public function categoryAction()
public function viewImageAction(Request $request, string $imageHash): ?Response
{
return $this->render('SikofittDoughnutWeddingBundle:Image:category.html.twig', [
// ...
]);
$image = $this
->get('doctrine.orm.entity_manager')
->createQueryBuilder()
->select('i')
->from('Sikofitt\DoughnutWeddingBundle\Entity\Image', 'i')
->where('i.imageName LIKE :imageHash')
->setParameter('imageHash', $imageHash.'%')
->getQuery()->getOneOrNullResult();
if (null !== $image) {
return $this->render('@SikofittDoughnutWedding/Image/view_image.html.twig',
['image' => $image]);
}
throw new NotFoundHttpException();
}
/**
* @Route("/tag/{tag}/{number}", name="gallery_tag_action", defaults={"number":1}, requirements={"number":"\d+"})
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param string $tag
* @param int $number
*
* @return Response
*/
public function tagAction(Request $request, string $tag, int $number): Response
{
$images = $this
->get('doctrine.orm.entity_manager')
->getRepository('SikofittDoughnutWeddingBundle:Image')
->findImageByTag($tag);
$adapter = new ArrayAdapter($images);
$pager = new Pagerfanta($adapter);
$pager->setMaxPerPage(12);
$chunks = array_chunk($images, 12);
return $this
->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', [
'pager' => $pager,
'tag' => $tag,
'images' => $chunks[$number - 1] ?? $images,
]);
}
/**
* @Route("/category/{category}/{number}", name="gallery_category_action", defaults={"number":1}, requirements={"number":"\d+"})
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param string $category
*
* @return Response
*/
public function categoryAction(Request $request, string $category, int $number): Response
{
$images = $this
->get('doctrine.orm.entity_manager')
->getRepository('SikofittDoughnutWeddingBundle:Image')
->findImageByCategory($category);
$adapter = new ArrayAdapter($images);
$pager = new Pagerfanta($adapter);
$pager->setMaxPerPage(12);
$chunks = array_chunk($images, 12);
return $this
->render('SikofittDoughnutWeddingBundle:Image:index.html.twig', [
'pager' => $pager,
'category' => $category,
'images' => $chunks[$number - 1] ?? $images,
]);
}
}

View File

@ -1,163 +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;
use Doctrine\ORM\EntityManager;
use Sikofitt\DoughnutWeddingBundle\Form\RsvpType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Tests\Controller\ContainerAwareController;
use Symfony\Component\Form\FormFactory;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\ConstraintViolationList;
class RsvpController extends Controller
{
/**
* @Route("/rsvp")
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function indexAction(Request $request)
{
/**
* @var EntityManager $em
* @var RsvpRepository $rsvpRepo
* @var UserRepository $userRepo
*/
$em = $this->get('doctrine.orm.entity_manager');
$user = $this->getUser();
$form = $this->get('form.factory')->create(RsvpType::class, $user);
if ($request->isMethod('POST')) {
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$user = $form->getData();
$user->setPassword($user->getPlainPassword());
/**
* @var EntityManager $em
*/
$em->persist($user);
$em->flush();
return $this->render('rsvp_form.html.twig', ['form' => $form->createView()]);
}
}
return $this->redirect($this->generateUrl('fos_user_profile_edit'));
}
/**
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Kernel $app
* @param string $token
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function resetAction(Request $request, \Kernel $app)
{
$formFactory = $app->getFormFactory();
$passwordResetForm = $formFactory
->createBuilder(ResetType::class)
->getForm();
$update = false;
if ($request->isMethod('POST')) {
$passwordResetForm->handleRequest($request);
if ($passwordResetForm->isSubmitted() && $passwordResetForm->isValid()) {
$data = $passwordResetForm->get('email')->getData();
$update = $app['orm.em']->getRepository('Sikofitt\App\Entity\User')
->setResetToken($data);
} else {
$data = null;
}
} else {
$data = null;
}
/**
* @var UserRepository $userRepo
*/
$userRepo = $app['orm.em']->getRepository('Sikofitt\App\Entity\User');
//$emailResult = $userRepo->getEmail($passwordResetForm->get('email'));
/*if(null === $emailResult) {
return $app->render('reset_password_confirm.html.twig', [
'message' => 'Email was not found in database',
]);
} elseif($emailResult instanceof ConstraintViolationList) {
return $app->render(
'reset_password.html.twig',
[
'form' => $passwordResetForm->createView(),
'data' => $data,
'email' => $emailResult,
'message' => $emailResult,
]
);
} else {
return $app->render('reset_password_confirm.html.twig', [
'message' => 'Please check your email. A reset request has been sent.',
]);
}*/
$app->addInfo('Message', 'message 2');
return $app->render(
'reset_password.html.twig',
[
'form' => $passwordResetForm->createView(),
'data' => $data,
//'email' => $emailResult,
]
);
}
public function tokenAction(Request $request, \Kernel $app, string $token = null)
{
$user = $app['orm.em']->getRepository('Sikofitt\App\Entity\User')->getUserByToken($token);
if (null === $user) {
return $app->render('reset_password_token.html.twig', ['token' => ['valid' => false, 'value' => $token]]);
} else {
$passwordForm = $app->getFormFactory()->create(ResetPasswordType::class);
if ($request->isMethod('POST')) {
$passwordForm->handleRequest($request);
if ($passwordForm->isValid() && $passwordForm->isSubmitted()) {
$hash = $app->encodePassword($user, $passwordForm->get('password')->getData());
$user->setPassword($hash);
$app['orm.em']->getRepository('Sikofitt\App\Entity\User')->updatePassword($user);
$app->addSuccess('Successfully changed your password!');
return $app->redirect($app->url('rsvp'));
}
}
return $app->render('reset_password_token.html.twig', ['token' => ['valid' => true, 'value' => $token], 'form' => $passwordForm->createView(), 'user' => $user]);
}
}
}

View File

@ -1,11 +1,29 @@
<?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\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Contact
* Contact.
*
* @ORM\Table(name="contact")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ContactRepository")
@ -35,11 +53,11 @@ class Contact
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
@ -55,7 +73,6 @@ class Contact
* @ORM\Column(name="comment", type="text")
*/
private $comment;
/**
* @var \DateTime
@ -64,9 +81,8 @@ class Contact
*/
private $createdAt;
/**
* Get id
* Get id.
*
* @return int
*/
@ -76,7 +92,7 @@ class Contact
}
/**
* Set name
* Set name.
*
* @param int $userId
*
@ -90,7 +106,7 @@ class Contact
}
/**
* Get name
* Get name.
*
* @return string
*/
@ -100,7 +116,7 @@ class Contact
}
/**
* Set name
* Set name.
*
* @param string $name
*
@ -114,7 +130,7 @@ class Contact
}
/**
* Get name
* Get name.
*
* @return string
*/
@ -123,30 +139,32 @@ class Contact
return $this->name;
}
/**
* Set Email
*
* @param null|string $email
*
* @return \Sikofitt\DoughnutWeddingBundle\Entity\Contact
*/
public function setEmail(?string $email) : Contact {
$this->email = $email;
/**
* Set Email.
*
* @param null|string $email
*
* @return \Sikofitt\DoughnutWeddingBundle\Entity\Contact
*/
public function setEmail(?string $email): Contact
{
$this->email = $email;
return $this;
return $this;
}
/**
* Get Email
*
* @return null|string
*/
public function getEmail() : ?string {
return $this->email;
* Get Email.
*
* @return null|string
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* Set subject
* Set subject.
*
* @param string $subject
*
@ -160,7 +178,7 @@ class Contact
}
/**
* Get subject
* Get subject.
*
* @return string
*/
@ -170,7 +188,7 @@ class Contact
}
/**
* Set comment
* Set comment.
*
* @param string $comment
*
@ -184,7 +202,7 @@ class Contact
}
/**
* Get comment
* Get comment.
*
* @return string
*/
@ -193,9 +211,8 @@ class Contact
return $this->comment;
}
/**
* Set createdAt
* Set createdAt.
*
* @param \DateTime $createdAt
*
@ -209,7 +226,7 @@ class Contact
}
/**
* Get createdAt
* Get createdAt.
*
* @return \DateTime
*/

View File

@ -1,13 +1,35 @@
<?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\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
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;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* Image
* Image.
*
* @Vich\Uploadable()
* @ORM\Table(name="image")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageRepository")
@ -24,7 +46,7 @@ class Image
private $id;
/**
* @var File
* @var UploadedFile
*
* @Vich\UploadableField(mapping="gallery_image", fileNameProperty="imageName", size="imageSize")
*/
@ -44,46 +66,64 @@ class Image
*/
private $user;
/**
* @var string
*
* @ORM\Column(name="tags", type="json_array", nullable=true, unique=false)
*/
/**
* @var \Sikofitt\DoughnutWeddingBundle\Entity\ImageComment
*
* @ORM\OneToMany(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\ImageComment", mappedBy="image", cascade={"remove"})
*/
private $comments;
/**
* @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)
*/
/**
* @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)
*/
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true, unique=false)
*/
private $description;
/**
* @var bool
*
* @ORM\Column(name="is_published", type="boolean")
*/
/**
* @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
* @var \DateTimeImmutable
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
public function __construct()
{
$this->comments = new ArrayCollection();
}
public function __toString()
{
return $this->imageName;
}
/**
* Get id.
*
* @return int
*/
public function getId() : ?int
public function getId(): ?int
{
return $this->id;
}
@ -91,8 +131,9 @@ class Image
/**
* @return string
*/
public function getDescription(): ?string {
return $this->description;
public function getDescription(): ?string
{
return $this->description;
}
/**
@ -100,16 +141,56 @@ class Image
*
* @return Image
*/
public function setDescription(?string $description): Image {
$this->description = $description;
return $this;
public function setDescription(?string $description): Image
{
$this->description = $description;
return $this;
}
public function getComments(): ?Collection
{
return $this->comments;
}
/**
* @param \Doctrine\Common\Collections\ArrayCollection|null $comments
*
* @return \Sikofitt\DoughnutWeddingBundle\Entity\Image
*/
public function setComments(?ArrayCollection $comments): Image
{
$this->comments = $comments;
return $this;
}
/**
* @param \Sikofitt\DoughnutWeddingBundle\Entity\ImageComment|null $comment
*/
public function addComment(ImageComment $comment = null): void
{
$this->comments[] = $comment;
}
/**
* @param \Sikofitt\DoughnutWeddingBundle\Entity\ImageComment|null $comment
*
* @return \Sikofitt\DoughnutWeddingBundle\Entity\Image
*/
public function removeComment(ImageComment $comment = null): Image
{
$this->comments->removeElement($comment);
return $this;
}
/**
* @return bool
*/
public function isIsPublished(): bool {
return $this->isPublished;
public function isIsPublished(): bool
{
return $this->isPublished;
}
/**
@ -117,63 +198,68 @@ class Image
*
* @return Image
*/
public function setIsPublished(bool $isPublished): Image {
$this->isPublished = $isPublished;
return $this;
public function setIsPublished(bool $isPublished): Image
{
$this->isPublished = $isPublished;
return $this;
}
/**
* @return \DateTimeImmutable
* @return \DateTimeInterface
*/
public function getUpdatedAt(): ?\DateTimeImmutable {
return $this->updatedAt;
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
/**
* @param \DateTimeImmutable $updatedAt
* @param \DateTimeInterface $updatedAt
*
* @return Image
*/
public function setUpdatedAt(\DateTimeImmutable $updatedAt): Image {
$this->updatedAt = $updatedAt;
return $this;
public function setUpdatedAt(\DateTimeInterface $updatedAt): Image
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Set imageFile
* Set imageFile.
*
* @param File|UploadedFile $imageFile
*
* @return Image
*/
public function setImageFile(?File $imageFile) : Image
public function setImageFile(?File $imageFile): Image
{
$this->imageFile = $imageFile;
if($imageFile) {
$this->updatedAt = new \DateTimeImmutable();
if ($imageFile) {
$this->updatedAt = new \DateTimeImmutable();
}
return $this;
}
/**
* Get imageFile
* Get imageFile.
*
* @return File|null
*/
public function getImageFile() : ?File
public function getImageFile(): ?File
{
return $this->imageFile;
}
/**
* Set imageName
* Set imageName.
*
* @param string $imageName
*
* @return Image
*/
public function setImageName(string $imageName) : Image
public function setImageName(?string $imageName): Image
{
$this->imageName = $imageName;
@ -181,28 +267,27 @@ class Image
}
/**
* Get imageName
* Get imageName.
*
* @return string
*/
public function getImageName() : ?string
public function getImageName(): ?string
{
if(null === $this->imageName && null !== $this->imageFile) {
return $this->imageFile->getFilename();
}
return $this->imageName;
if (null === $this->imageName && null !== $this->imageFile) {
return $this->imageFile->getFilename();
}
return $this->imageName;
}
/**
* Set user
* Set user.
*
* @param User $user
*
* @return Image
*/
public function setUser(?User $user) : Image
public function setUser(?User $user): Image
{
$this->user = $user;
@ -210,23 +295,23 @@ class Image
}
/**
* Get user
* Get user.
*
* @return User
*/
public function getUser() : ?User
public function getUser(): ?User
{
return $this->user;
}
/**
* Set tags
* Set tags.
*
* @param array $tags
*
* @return Image
*/
public function setTags($tags) : Image
public function setTags($tags): Image
{
$this->tags = $tags;
@ -234,7 +319,7 @@ class Image
}
/**
* Get tags
* Get tags.
*
* @return array
*/
@ -244,7 +329,7 @@ class Image
}
/**
* Set category
* Set category.
*
* @param string $category
*
@ -258,7 +343,7 @@ class Image
}
/**
* Get category
* Get category.
*
* @return string
*/
@ -266,8 +351,4 @@ class Image
{
return $this->category;
}
public function __toString() {
return $this->imageName;
//return sprintf('<img src="%s" alt="%s" />', $this->imageName, $this->imageName);
}
}

View File

@ -1,11 +1,29 @@
<?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\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ImageComment
* ImageComment.
*
* @ORM\Table(name="image_comment")
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\ImageCommentRepository")
@ -22,16 +40,23 @@ class ImageComment
private $id;
/**
* @var int
* @var \Sikofitt\DoughnutWeddingBundle\Entity\User
*
* @ORM\Column(name="user", type="integer")
* @ORM\ManyToOne(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\User", inversedBy="imageComment")
*/
private $user;
/**
* @var int
*
* @ORM\ManyToOne(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\Image", inversedBy="comments", cascade={"persist"})
*/
private $image;
/**
* @var string
*
* @ORM\Column(name="comment", type="text")
* @ORM\Column(type="text", name="comment", nullable=false, unique=false)
*/
private $comment;
@ -49,13 +74,6 @@ class ImageComment
*/
private $created;
/**
* @var int
*
* @ORM\Column(name="image", type="integer")
*/
private $image;
/**
* @var bool
*
@ -63,9 +81,8 @@ class ImageComment
*/
private $isChild;
/**
* Get id
* Get id.
*
* @return int
*/
@ -75,13 +92,13 @@ class ImageComment
}
/**
* Set user
* Set user.
*
* @param integer $user
* @param \Sikofitt\DoughnutWeddingBundle\Entity\User|null $user
*
* @return ImageComment
*/
public function setUser($user)
public function setUser(?User $user): ImageComment
{
$this->user = $user;
@ -89,17 +106,17 @@ class ImageComment
}
/**
* Get user
* Get user.
*
* @return int
* @return \Sikofitt\DoughnutWeddingBundle\Entity\User
*/
public function getUser()
public function getUser(): ?User
{
return $this->user;
}
/**
* Set comment
* Set comment.
*
* @param string $comment
*
@ -113,7 +130,7 @@ class ImageComment
}
/**
* Get comment
* Get comment.
*
* @return string
*/
@ -123,9 +140,9 @@ class ImageComment
}
/**
* Set childComments
* Set childComments.
*
* @param integer $childComments
* @param int $childComments
*
* @return ImageComment
*/
@ -137,7 +154,7 @@ class ImageComment
}
/**
* Get childComments
* Get childComments.
*
* @return int
*/
@ -147,7 +164,7 @@ class ImageComment
}
/**
* Set created
* Set created.
*
* @param \DateTime $created
*
@ -161,7 +178,7 @@ class ImageComment
}
/**
* Get created
* Get created.
*
* @return \DateTime
*/
@ -171,9 +188,9 @@ class ImageComment
}
/**
* Set image
* Set image.
*
* @param integer $image
* @param int $image
*
* @return ImageComment
*/
@ -185,7 +202,7 @@ class ImageComment
}
/**
* Get image
* Get image.
*
* @return int
*/
@ -195,9 +212,9 @@ class ImageComment
}
/**
* Set isChild
* Set isChild.
*
* @param boolean $isChild
* @param bool $isChild
*
* @return ImageComment
*/
@ -209,7 +226,7 @@ class ImageComment
}
/**
* Get isChild
* Get isChild.
*
* @return bool
*/
@ -218,4 +235,3 @@ class ImageComment
return $this->isChild;
}
}

View File

@ -75,6 +75,11 @@ class Rsvp
$this->updated = new \DateTime('now');
}
public function __toString()
{
return sprintf('%d guests', $this->guests);
}
/**
* Get id.
*
@ -180,8 +185,4 @@ class Rsvp
{
return $this->user;
}
public function __toString() {
return sprintf('%d guests', $this->guests);
}
}

View File

@ -22,7 +22,6 @@ namespace Sikofitt\DoughnutWeddingBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use Symfony\Component\Validator\Constraints as Assert;
/** @noinspection ClassOverridesFieldOfSuperClassInspection */
@ -33,11 +32,11 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity(repositoryClass="Sikofitt\DoughnutWeddingBundle\Repository\UserRepository")
* @ORM\Table(name="users")
*/
class User extends \FOS\UserBundle\Model\User {
class User extends \FOS\UserBundle\Model\User
{
const KATRINA_SIDE = 'Katrina';
const KATRINA_SIDE = 'Katrina';
const ERIC_SIDE = 'Eric';
const ERIC_SIDE = 'Eric';
/**
* @ORM\Id()
@ -79,6 +78,13 @@ class User extends \FOS\UserBundle\Model\User {
*/
private $images;
/**
* @var \Sikofitt\DoughnutWeddingBundle\Entity\ImageComment
*
* @ORM\OneToMany(targetEntity="Sikofitt\DoughnutWeddingBundle\Entity\ImageComment", mappedBy="user")
*/
private $imageComment;
/**
* @var string
*
@ -91,66 +97,100 @@ class User extends \FOS\UserBundle\Model\User {
*/
private $facebookId;
private $facebookAccessToken;
private $facebookAccessToken;
/**
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
*/
private $googleId;
private $googleAccessToken;
private $googleAccessToken;
/**
* @ORM\Column(name="amazon_id", type="string", length=255, nullable=true)
*/
private $amazonId;
private $amazonAccessToken;
private $amazonAccessToken;
/**
* @ORM\Column(name="instagram_id", type="string", length=255, nullable=true)
*/
private $instagramId;
private $instagramAccessToken;
private $instagramAccessToken;
/**
* @ORM\Column(name="twitter_id", type="string", length=255, nullable=true)
*/
private $twitterId;
private $twitterAccessToken;
private $twitterAccessToken;
/**
* @ORM\Column(name="yahoo_id", type="string", length=255, nullable=true)
*/
private $yahooId;
private $yahooAccessToken;
private $yahooAccessToken;
/**
* User constructor.
*/
public function __construct() {
if (NULL === $this->created) {
$this->created = new \DateTime('now');
}
$this->updated = new \DateTime('now');
parent::__construct();
public function __construct()
{
$this->imageComment = new ArrayCollection();
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;
}
public function setImageComment($imageComment)
{
$this->imageComment = $imageComment;
return $this;
}
public function getImageComment()
{
return $this->imageComment;
}
public function addImageComment(ImageComment $imageComment)
{
$imageComment->setUser($this);
$this->imageComment[] = $imageComment;
return $this;
}
public function removeImageComment(ImageComment $imageComment)
{
$imageComment->setUser(null);
$this->imageComment->removeElement($imageComment);
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): User
{
$this->comment = $comment;
return $this;
}
/**
* @return mixed
*/
public function getAmazonId() : ?string {
return $this->amazonId;
public function getAmazonId(): ?string
{
return $this->amazonId;
}
/**
@ -158,17 +198,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setAmazonId(?string $amazonId) : User {
$this->amazonId = $amazonId;
public function setAmazonId(?string $amazonId): User
{
$this->amazonId = $amazonId;
return $this;
return $this;
}
/**
* @return string
*/
public function getAmazonAccessToken() : ?string {
return $this->amazonAccessToken;
public function getAmazonAccessToken(): ?string
{
return $this->amazonAccessToken;
}
/**
@ -176,17 +218,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setAmazonAccessToken(?string $amazonAccessToken) : User {
$this->amazonAccessToken = $amazonAccessToken;
public function setAmazonAccessToken(?string $amazonAccessToken): User
{
$this->amazonAccessToken = $amazonAccessToken;
return $this;
return $this;
}
/**
* @return string
*/
public function getFacebookId() : ?string {
return $this->facebookId;
public function getFacebookId(): ?string
{
return $this->facebookId;
}
/**
@ -194,17 +238,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setFacebookId(string $facebookId) : User {
$this->facebookId = $facebookId;
public function setFacebookId(string $facebookId): User
{
$this->facebookId = $facebookId;
return $this;
return $this;
}
/**
* @return string
*/
public function getFacebookAccessToken() : ?string {
return $this->facebookAccessToken;
public function getFacebookAccessToken(): ?string
{
return $this->facebookAccessToken;
}
/**
@ -212,17 +258,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setFacebookAccessToken(?string $facebookAccessToken) : User {
$this->facebookAccessToken = $facebookAccessToken;
public function setFacebookAccessToken(?string $facebookAccessToken): User
{
$this->facebookAccessToken = $facebookAccessToken;
return $this;
return $this;
}
/**
* @return string
*/
public function getGoogleId() : ?string {
return $this->googleId;
public function getGoogleId(): ?string
{
return $this->googleId;
}
/**
@ -230,17 +278,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setGoogleId(?string $googleId) : User {
$this->googleId = $googleId;
public function setGoogleId(?string $googleId): User
{
$this->googleId = $googleId;
return $this;
return $this;
}
/**
* @return string
*/
public function getGoogleAccessToken() : ?string {
return $this->googleAccessToken;
public function getGoogleAccessToken(): ?string
{
return $this->googleAccessToken;
}
/**
@ -248,17 +298,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setGoogleAccessToken(?string $googleAccessToken) : User {
$this->googleAccessToken = $googleAccessToken;
public function setGoogleAccessToken(?string $googleAccessToken): User
{
$this->googleAccessToken = $googleAccessToken;
return $this;
return $this;
}
/**
* @return string
*/
public function getInstagramId() : ?string{
return $this->instagramId;
public function getInstagramId(): ?string
{
return $this->instagramId;
}
/**
@ -266,17 +318,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setInstagramId(?string $instagramId) : User {
$this->instagramId = $instagramId;
public function setInstagramId(?string $instagramId): User
{
$this->instagramId = $instagramId;
return $this;
return $this;
}
/**
* @return mixed
*/
public function getInstagramAccessToken() : ?string {
return $this->instagramAccessToken;
public function getInstagramAccessToken(): ?string
{
return $this->instagramAccessToken;
}
/**
@ -284,17 +338,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setInstagramAccessToken(?string $instagramAccessToken) : User {
$this->instagramAccessToken = $instagramAccessToken;
public function setInstagramAccessToken(?string $instagramAccessToken): User
{
$this->instagramAccessToken = $instagramAccessToken;
return $this;
return $this;
}
/**
* @return string
*/
public function getTwitterId() : ?string {
return $this->twitterId;
public function getTwitterId(): ?string
{
return $this->twitterId;
}
/**
@ -302,17 +358,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setTwitterId(?string $twitterId) : User {
$this->twitterId = $twitterId;
public function setTwitterId(?string $twitterId): User
{
$this->twitterId = $twitterId;
return $this;
return $this;
}
/**
* @return mixed
*/
public function getTwitterAccessToken() {
return $this->twitterAccessToken;
public function getTwitterAccessToken()
{
return $this->twitterAccessToken;
}
/**
@ -320,18 +378,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setTwitterAccessToken(?string $twitterAccessToken) : User {
$this->twitterAccessToken = $twitterAccessToken;
public function setTwitterAccessToken(?string $twitterAccessToken): User
{
$this->twitterAccessToken = $twitterAccessToken;
return $this;
return $this;
}
/**
* @return string
*/
public function getYahooId() : ?string {
return $this->yahooId;
public function getYahooId(): ?string
{
return $this->yahooId;
}
/**
@ -339,17 +398,19 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setYahooId(?string $yahooId) : User {
$this->yahooId = $yahooId;
public function setYahooId(?string $yahooId): User
{
$this->yahooId = $yahooId;
return $this;
return $this;
}
/**
* @return string
*/
public function getYahooAccessToken() : ?string {
return $this->yahooAccessToken;
public function getYahooAccessToken(): ?string
{
return $this->yahooAccessToken;
}
/**
@ -357,10 +418,11 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setYahooAccessToken(?string $yahooAccessToken): User {
$this->yahooAccessToken = $yahooAccessToken;
public function setYahooAccessToken(?string $yahooAccessToken): User
{
$this->yahooAccessToken = $yahooAccessToken;
return $this;
return $this;
}
/**
@ -368,8 +430,9 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return string
*/
public function getName(): ?string {
return $this->name;
public function getName(): ?string
{
return $this->name;
}
/**
@ -379,31 +442,33 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setName(string $name): User {
$this->name = $name;
public function setName(string $name): User
{
$this->name = $name;
return $this;
return $this;
}
/**
/**
* @param string $plainPassword
*
* @return User
*/
public function setPlainPassword($plainPassword): User {
$this->plainPassword = $plainPassword;
public function setPlainPassword($plainPassword): User
{
$this->plainPassword = $plainPassword;
return $this;
return $this;
}
/**
* Get created.
*
* @return \DateTime
*/
public function getCreated(): ?\DateTime {
return $this->created;
public function getCreated(): ?\DateTime
{
return $this->created;
}
/**
@ -413,10 +478,11 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setCreated(?\DateTime $created): User {
$this->created = $created;
public function setCreated(?\DateTime $created): User
{
$this->created = $created;
return $this;
return $this;
}
/**
@ -424,8 +490,9 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return \DateTime
*/
public function getUpdated(): ?\DateTime {
return $this->updated;
public function getUpdated(): ?\DateTime
{
return $this->updated;
}
/**
@ -435,10 +502,11 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setUpdated(?\DateTime $updated): User {
$this->updated = $updated;
public function setUpdated(?\DateTime $updated): User
{
$this->updated = $updated;
return $this;
return $this;
}
/**
@ -446,8 +514,9 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return Rsvp
*/
public function getRsvp(): ?Rsvp {
return $this->rsvp;
public function getRsvp(): ?Rsvp
{
return $this->rsvp;
}
/**
@ -457,47 +526,48 @@ class User extends \FOS\UserBundle\Model\User {
*
* @return User
*/
public function setRsvp(Rsvp $rsvp = NULL) : User {
$this->rsvp = $rsvp;
public function setRsvp(Rsvp $rsvp = null): User
{
$this->rsvp = $rsvp;
return $this;
return $this;
}
/**
* Add image
* Add image.
*
* @param \Sikofitt\DoughnutWeddingBundle\Entity\Image $image
*
* @return User
*/
public function addImage(Image $image): User {
$image->setUser($this);
public function addImage(Image $image): User
{
$image->setUser($this);
$this->images[] = $image;
$this->images[] = $image;
return $this;
return $this;
}
/**
* Remove image
* Remove image.
*
* @param \Sikofitt\DoughnutWeddingBundle\Entity\Image $image
*
* @return Void
*/
public function removeImage(Image $image): void {
$image->setUser(NULL);
public function removeImage(Image $image): void
{
$image->setUser(null);
$this->images->removeElement($image);
$this->images->removeElement($image);
}
/**
* Get images
* Get images.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getImages() {
return $this->images;
public function getImages()
{
return $this->images;
}
}

View File

@ -1,26 +1,32 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/26/17
* Time: 1:39 PM
/*
* 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\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;
@ -30,14 +36,12 @@ class CheckThatEmailAndUserNameExistOnResetRequest
$this->twig = $twig;
}
public function onFosuserResettingSendemailInitialize(GetResponseUserEvent $event) {
if(null === $event->getUser()) {
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->getRequest()->getSession()->getFlashBag()->add('error', sprintf('Invalid email %s.', $email));
$event->setResponse(new RedirectResponse($this->router->generate('fos_user_resetting_request')));
}
}
}
}

View File

@ -1,9 +1,25 @@
<?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\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/**
@ -13,7 +29,6 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
*/
class NeedToAuthenticateListenerEvent
{
/**
* Adds a flash message for login redirects.
*
@ -21,29 +36,31 @@ class NeedToAuthenticateListenerEvent
*/
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);
}
if (null !== $event->getRequest()->getUser()) {
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

@ -0,0 +1,74 @@
<?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\EventListener;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* Event listener to redirect /connect to /login.
*
* Class RedirectFromHwiConnectPageEvent
*/
class RedirectFromHwiConnectPageEvent
{
/**
* @var \Symfony\Component\Routing\Generator\UrlGeneratorInterface
*/
private $router;
/**
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
private $container;
/**
* RedirectFromHwiConnectPageEvent constructor.
*
* @param \Symfony\Component\Routing\Generator\UrlGeneratorInterface $router
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
*/
public function __construct(UrlGeneratorInterface $router, ContainerInterface $container)
{
$this->router = $router;
$this->container = $container;
}
/**
* Since there doesn't seem to be an option to prevent this.
* Redirect users to the /login page if they hit /connect.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
*/
public function onKernelRequest(GetResponseEvent $event): void
{/*
$uri = $this->container->get('request_stack')->getCurrentRequest()->getRequestUri();
$loginUri = $this->router->generate('fos_user_security_login');
$connectRoute = $this->router->generate('hwi_oauth_connect');
if(0 === (int) strcmp($uri, $connectRoute)) {
$event->setResponse(new RedirectResponse($loginUri, 301));
}
*/
}
}

View File

@ -1,52 +1,109 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/21/17
* Time: 7:37 PM
/*
* 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\EventListener;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\FOSUserEvents;
use Symfony\Bridge\Twig\TwigEngine;
use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
/**
* Class RedirectOnUserRegisterListener.
*/
class RedirectOnUserRegisterListener
{
/**
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
private $container;
/**
* RedirectOnUserRegisterListener constructor.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
*/
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function onFosuserRegistrationCompleted(FilterUserResponseEvent $event) {
/**
* @param \FOS\UserBundle\Event\FilterUserResponseEvent $event
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function onFosuserRegistrationCompleted(FilterUserResponseEvent $event): ?RedirectResponse
{
$user = $event->getUser();
$this->sendRegistrationEmail($user, 'the Default Sign up form');
$url = $this
->container
->get('router')
->generate('sikofitt_doughnutwedding_default_index');
return new RedirectResponse($url);
}
/**
* Sends an email if the user has registered with a OAuth
* Unfortunately HWIOAuthBundle does not have events, and does not call
* the FOSUserBundle register events if using the bridge, so we have to
* do it here in the InteractiveLoginEvent listener because it's the only
* event HWIOAuthBundle calls.
*
* @param \Symfony\Component\Security\Http\Event\InteractiveLoginEvent $event
*/
public function onSecurityInteractivelogin(InteractiveLoginEvent $event): void
{
// Match the registration path so we don't call this on all logins.
if (preg_match('/(connect\/registration\/\d+)/', $event->getRequest()->getRequestUri())) {
$user = $event->getAuthenticationToken()->getUser();
$resourceOwnerName = null;
if ($event->getAuthenticationToken() instanceof OAuthToken) {
/** @var OAuthToken $token */
$token = $event->getAuthenticationToken();
$resourceOwnerName = $token->getResourceOwnerName();
}
$this->sendRegistrationEmail($user, $resourceOwnerName);
}
}
/**
* @param \Symfony\Component\Security\Core\User\UserInterface $user
* @param null|string $resourceOwner
*/
public function sendRegistrationEmail(UserInterface $user, string $resourceOwner = null): void
{
$message = new \Swift_Message('[Doughnut Wedding] User registered');
$body = $this->container->get('twig')->render('user_registered.txt.twig.html.twig', ['user' => $user]);
$body = $this->container->get('twig')->render('user_registered.txt.twig.html.twig', ['user' => $user, 'resourceOwner' => $resourceOwner]);
$message
->setFrom(['no-reply@doughnutwedding.com' => '[Doughnut Wedding]'])
->setTo([
'katrina.a.johnson@gmail.com' => 'Katrina Johnson',
'sikofitt@gmail.com' => 'R. Eric Wheeler'
$this->container->getParameter('katrina.email') => 'Katrina Johnson',
$this->container->getParameter('eric.email') => '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)
{
$url = $this->router->generate('sikofitt_doughnutwedding_default_index');
$event->setResponse(new RedirectResponse($url));
$this->container->get('swiftmailer.mailer')->send($message);
}
}
}

View File

@ -62,7 +62,6 @@ class UserRedirectOnLoggedInListener
*/
public function onKernelRequest(GetResponseEvent $event): void
{
$token = $this->tokenStorage->getToken();
if (null !== $token) {
@ -90,7 +89,6 @@ class UserRedirectOnLoggedInListener
*/
private function shouldRedirectRoute(array $routeInformation): bool
{
return true === in_array(
$routeInformation['_route'],
$this->getRedirectRoutes(),
@ -107,9 +105,8 @@ class UserRedirectOnLoggedInListener
return [
'fos_user_security_login',
'fos_user_registration_confirmed',
'hwi_oauth_connect',
'fos_user_resetting_request',
'fos_user_registration_register'
'fos_user_registration_register',
];
}
}

View File

@ -1,51 +1,65 @@
<?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\Factory;
use Gaufrette\Exception\FileNotFound;
use Google\Auth\Credentials\ServiceAccountCredentials;
use Google_Service_Storage;
class GoogleCloudStorageServiceFactory {
/**
class GoogleCloudStorageServiceFactory
{
/**
* @param string $credentialFile
* @param string $clientId
* @param string $applicationName
*
* @return \Google_Service_Storage
* @throws \ErrorException
* @throws \InvalidArgumentException
*
* @return \Google_Service_Storage
*/
public static function createGoogleCloudService(string $credentialFile, string $clientId, string $applicationName) : \Google_Service_Storage
public static function createGoogleCloudService(string $credentialFile, string $clientId, string $applicationName): \Google_Service_Storage
{
if(false === file_exists($credentialFile)) {
throw new \ErrorException(sprintf('File %s does not exist.', $credentialFile));
}
if(false === is_readable($credentialFile)) {
throw new \ErrorException(sprintf('File %s is not readable. Check permissions.', $credentialFile));
}
if (false === file_exists($credentialFile)) {
throw new \ErrorException(sprintf('File %s does not exist.', $credentialFile));
}
if (false === is_readable($credentialFile)) {
throw new \ErrorException(sprintf('File %s is not readable. Check permissions.', $credentialFile));
}
$jsonStr = file_get_contents($credentialFile);
if( null === $credentials = json_decode($jsonStr, true)) {
throw new \ErrorException('Could not decode google json credentials');
}
$jsonStr = file_get_contents($credentialFile);
if (null === $credentials = json_decode($jsonStr, true)) {
throw new \ErrorException('Could not decode google json credentials');
}
$client = new \Google_Client();
$client->setClientId($clientId);
$client->setApplicationName($applicationName);
$client = new \Google_Client();
$client->setClientId($clientId);
$client->setApplicationName($applicationName);
$cred = ServiceAccountCredentials::makeCredentials(
$cred = ServiceAccountCredentials::makeCredentials(
Google_Service_Storage::DEVSTORAGE_FULL_CONTROL,
$credentials
);
$token = $cred->fetchAuthToken();
$client->setAccessToken($token);
$token = $cred->fetchAuthToken();
$client->setAccessToken($token);
return new \Google_Service_Storage($client);
return new \Google_Service_Storage($client);
}
}
}

View File

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

View File

@ -1,10 +1,27 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
/*
* 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\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;
@ -17,24 +34,25 @@ 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
/**
* Class ContactFormType.
*/
class ContactFormType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options) : void {
$builder
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',
'class' => 'uk-padding-small uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Enter your name',
],
'required' => true,
@ -42,8 +60,8 @@ class ContactFormType extends AbstractType {
'constraints' => [
new NotBlank(),
new NotNull(),
new Length(['max' => 255, 'min' => 5])
]
new Length(['max' => 255, 'min' => 5]),
],
])
->add('email', EmailType::class, [
'label_attr' => [
@ -51,7 +69,7 @@ class ContactFormType extends AbstractType {
],
'label' => 'Email (Not required)',
'attr' => [
'class' => 'uk-input uk-form-large uk-margin-small-bottom',
'class' => 'uk-padding-small uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Email address (not required)',
'autocomplete' => 'off',
'autocorrect' => 'off',
@ -65,8 +83,8 @@ class ContactFormType extends AbstractType {
'checkMX' => true,
'checkHost' => true,
'strict' => true,
])
]
]),
],
])
->add('subject', TextType::class, [
'label_attr' => [
@ -74,16 +92,16 @@ class ContactFormType extends AbstractType {
],
'label' => 'Subject',
'attr' => [
'class' => 'uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Enter a subject for our comment.',
'class' => 'uk-padding-small uk-input uk-form-large uk-margin-small-bottom',
'placeholder' => 'Enter a subject for your comment.',
],
'required' => true,
'trim' => true,
'constraints' => [
new NotBlank(),
new NotNull(),
new Length(['max' => 255, 'min' => 5])
]
new Length(['max' => 255, 'min' => 5]),
],
])
->add('comment', TextareaType::class, [
'label_attr' => [
@ -93,36 +111,38 @@ class ContactFormType extends AbstractType {
'attr' => [
'rows' => 4,
'class' => 'uk-padding-small uk-textarea uk-form-large uk-margin-medium-bottom',
'placeholder' => 'Enter your Comment',
'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'
]
'class' => 'uk-button uk-button-primary uk-button-large uk-width-1-1',
],
]);
}
/**
* @inheritdoc
* {@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']);
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefault('data_class', Contact::class);
$resolver->setDefault('attr', ['class' => 'uk-form uk-form-horizontal']);
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getBlockPrefix() : ?string {
return 'sikofitt_doughnut_wedding_contact';
public function getBlockPrefix(): ?string
{
return 'sikofitt_doughnut_wedding_contact';
}
}
}

View File

@ -1,31 +1,80 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/24/17
* Time: 6:56 PM
/*
* 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\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
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, [
class GalleryUploadType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('imageFile', VichImageType::class, [
'label_attr' => [
'class' => 'uk-form-label'
'class' => 'uk-form-label uk-hidden',
],
'attr' => [
'class' => ''
]
'class' => 'uk-padding-small',
],
])
->add('description')
->add('tags')
->add('category');
}
}
->add('description', TextareaType::class, [
'required' => false,
'label' => 'Description of image.',
'attr' => [
'rows' => 4,
'class' => 'uk-textarea uk-form-large uk-padding-small',
],
'label_attr' => [
'class' => 'uk-form-label',
],
])
->add('tags', CollectionType::class, [
'required' => false,
'entry_type' => TextType::class,
'entry_options' => [
'attr' => [
'class' => 'uk-input uk-form-large uk-width-medium',
],
],
'allow_add' => true,
'allow_delete' => true,
'label_attr' => [
'class' => 'uk-form-label',
],
'attr' => [
'class' => 'uk-input uk-form-large uk-padding-small',
],
])
->add('category', TextType::class, [
'required' => false,
'label_attr' => [
'class' => 'uk-form-label',
],
'attr' => [
'class' => 'uk-input uk-form-large uk-padding-small',
],
]);
}
}

View File

@ -1,18 +1,27 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 4/21/17
* Time: 9:11 PM
/*
* 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\Form;
use Symfony\Component\Form\FormEvent;
use FOS\UserBundle\Form\Type\ProfileFormType;
use FOS\UserBundle\Model\UserManager;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
use Sikofitt\DoughnutWeddingBundle\Entity\Rsvp;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
@ -20,17 +29,19 @@ use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ProfileEditType extends AbstractType
{
private $userManager;
public function __construct(UserManager $userManager) {
$this->userManager = $userManager;
}
private $userManager;
public function buildForm(FormBuilderInterface $builder, array $options)
public function __construct(UserManager $userManager)
{
$this->userManager = $userManager;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$emailOptions = $builder->get('email')->getOptions();
@ -66,12 +77,11 @@ private $userManager;
],
]);
$builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) {
$user = $event->getData();
$user->setUsername($user->getEmail());
$this->userManager->updateCanonicalFields($user);
});
$builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
$user = $event->getData();
$user->setUsername($user->getEmail());
$this->userManager->updateCanonicalFields($user);
});
$builder->get('rsvp')
->addModelTransformer(new CallbackTransformer(
function (?Rsvp $rsvp) {
@ -94,4 +104,4 @@ private $userManager;
{
return ProfileFormType::class;
}
}
}

View File

@ -20,21 +20,17 @@
namespace Sikofitt\DoughnutWeddingBundle\Form;
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\FormEvent;
use FOS\UserBundle\Form\Type\RegistrationFormType;
use FOS\UserBundle\Model\UserManager;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
use Sikofitt\DoughnutWeddingBundle\Entity\Rsvp;
use Sikofitt\DoughnutWeddingBundle\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
@ -73,13 +69,12 @@ class RegistrationType extends AbstractType
'attr' => [
'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?',
],
])
->remove('username');
$builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) {
$builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
$user = $event->getData();
$user->setUsername($user->getEmail());
$this->userManager->updateCanonicalFields($user);

View File

@ -0,0 +1,174 @@
<?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\Pager\View;
use Pagerfanta\View\Template\Template;
class UIkitTemplate extends Template
{
protected static $defaultOptions = [
'prev_message' => '&larr; Previous',
'next_message' => 'Next &rarr;',
'dots_message' => '&hellip;',
'active_suffix' => '',
'css_container_class' => 'uk-pagination uk-flex-center',
'css_prev_class' => 'prev',
'css_next_class' => 'next',
'css_disabled_class' => 'disabled',
'css_dots_class' => 'disabled',
'css_active_class' => 'active',
'rel_previous' => 'prev',
'rel_next' => 'next',
];
/**
* Renders the container for the pagination.
*
* The %pages% placeholder will be replaced by the rendering of pages
*
* @return string
*/
public function container()
{
return sprintf('<ul class="%s" uk-margin>%s</ul>', static::$defaultOptions['css_container_class'], '%pages%');
}
/**
* Renders a given page.
*
* @param int $page
*
* @return string
*/
public function page($page)
{
if (1 === (int) $page) {
return '<li><a href="/gallery">'.$page.'</a></li>';
}
return '<li><a href="/gallery/page/'.$page.'">'.$page.'</a></li>';
}
/**
* Renders a given page with a specified text.
*
* @param int $page
* @param string $text
*
* @return string
*/
public function pageWithText($page, $text)
{
return $this->page($page);
}
/**
* Renders the disabled state of the previous page.
*
* @return string
*/
public function previousDisabled()
{
return '';
}
/**
* Renders the enabled state of the previous page.
*
* @param int $page
*
* @return string
*/
public function previousEnabled($page)
{
if (1 === (int) $page) {
return '<li><a href="/gallery"><span class="uk-margin-small-right" uk-pagination-previous></span> Previous</a></li>';
}
return '<li><a href="/gallery/page/'.$page.'"><span class="uk-margin-small-right" uk-pagination-previous></span> Previous</a></li>';
}
/**
* Renders the disabled state of the next page.
*
* @return string
*/
public function nextDisabled()
{
return '';
}
/**
* Renders the enabled state of the next page.
*
* @param int $page
*
* @return string
*/
public function nextEnabled($page)
{
return '<li class=""><a href="/gallery/page/'.$page.'">Next <span class="uk-margin-small-left" uk-pagination-next></span></a></li>';
}
/**
* Renders the first page.
*
* @return string
*/
public function first()
{
return '';
}
/**
* Renders the last page.
*
* @param int $page
*
* @return string
*/
public function last($page)
{
return '';
}
/**
* Renders the current page.
*
* @param int $page
*
* @return string
*/
public function current($page)
{
return '<li class="uk-active"><span>'.$page.'</span></li>';
}
/**
* Renders the separator between pages.
*
* @return string
*/
public function separator()
{
return '<li class="uk-disabled"><span> ... </span></li>';
}
}

View File

@ -1,9 +1,27 @@
<?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\Repository;
/**
* ContactRepository
* ContactRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.

View File

@ -1,9 +1,27 @@
<?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\Repository;
/**
* ImageCategoryRepository
* ImageCategoryRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.

View File

@ -1,9 +1,27 @@
<?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\Repository;
/**
* ImageCommentRepository
* ImageCommentRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.

View File

@ -1,13 +1,72 @@
<?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\Repository;
use Doctrine\ORM\EntityRepository;
use Sikofitt\DoughnutWeddingBundle\Entity\Image;
/**
* ImageRepository
* ImageRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ImageRepository extends \Doctrine\ORM\EntityRepository
class ImageRepository extends EntityRepository
{
/**
* @param string $tag
*
* @return array
*/
public function findImageByTag(string $tag): array
{
$images = $this->getEntityManager()
->createQueryBuilder()
->select('i')
->from(Image::class, 'i')
->where('i.tags LIKE :tag')
->setParameter('tag', '%'.$tag.'%')
->getQuery()->getResult();
/**
* @var int $key
* @var Image $image
*/
foreach ($images as $key => $image) {
if (false === in_array($tag, $image->getTags(), true)) {
unset($images[$key]);
}
}
return $images;
}
public function findImageByCategory(string $category): array
{
return $this
->getEntityManager()
->createQueryBuilder()
->select('i')
->from(Image::class, 'i')
->where('i.category =:category')
->setParameter('category', $category)
->getQuery()->getResult();
}
}

View File

@ -1,9 +1,27 @@
<?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\Repository;
/**
* ImageTagRepository
* ImageTagRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.

View File

@ -1,8 +1,151 @@
{% extends "::base.html.twig" %}
{% block title %}Gallery{% endblock %}
{% block title %}{% if category is defined %}{{ category|capitalize }} | {% elseif tag is defined %}{{ tag|capitalize }} | {% endif %}Gallery{% endblock %}
{% block body %}
<h2>Gallery</h2>
<h2 class="uk-text-center uk-margin-remove-top">Gallery</h2>
<p class="uk-margin-remove-top uk-text-center uk-text-large uk-margin-medium-bottom">
{% if category is defined %}
Viewing images from the category {{ category|capitalize }}
{% elseif tag is defined %}
Viewing images tagged with {{ tag|capitalize }}
{% endif %}
</p>
<div class="uk-child-width-1-2@s uk-child-width-1-4@m uk-grid-small uk-grid-match uk-flex-middle" uk-grid>
{% if images is not null and images is not empty %}
{% for image in images %}
{% set imageUrl = bucket ~ '/gallery/' ~ vich_uploader_asset(image, 'imageFile')|trim('/', 'left') %}
<div class=" uk-height-small uk-overflow-hidden uk-cover-container">
<a class="uk-inline-clip uk-background-cover" style="background-image:url({{ imageUrl }})" href="#modal-full-{{ image.id }}" uk-cover uk-toggle></a>
<div id="modal-full-{{ image.id }}" class="uk-modal-full" uk-modal>
<div class="uk-modal-dialog">
<button class="uk-padding uk-modal-close-full uk-close-large" type="button" uk-close></button>
<div class="uk-grid-collapse uk-child-width-1-2@s uk-flex" uk-grid>
<div class="uk-background-cover" style="background-image: url({{ imageUrl }});" uk-height-viewport></div>
<div id="comment-panel-{{ image.id }}" class="uk-margin-large-bottom@s uk-padding-large uk-overflow-auto" style="max-height:100vh">
<div class="uk-overflow-auto" >
<div class="uk-width-1-1">
<p class="uk-text-large">{{ image.description }}</p>
<p class="uk-text-meta">
Uploaded on {{ image.updatedAt|date('l F jS, Y') }} at {{ image.updatedAt|date('g:ia') }} by <span class="uk-text-bold">{{ image.user.name }}</span>.
</p>
<p class="">
{% if image.category is not null %}
<ul class="uk-comment-meta uk-subnav uk-subnav-divider uk-margin-remove-top">
<li class="uk-subnav-divider">Category</li>
<li><a style="text-decoration:underline;" href="{{ path('gallery_category_action', {'category':image.category}) }}">{{ image.category|capitalize }}</a></li>
</ul>
{% endif %}
{% if image.tags is not null and image.tags is not empty %}
<ul class="uk-comment-meta uk-subnav uk-subnav-divider uk-margin-remove-top">
<li class="uk-subnav-divider">View more like this</li>
{% for tag in image.tags %}
<a style="text-decoration:underline;" href="{{ path('gallery_tag_action', {'tag':tag}) }}">{{ tag|capitalize }}</a>
{% endfor %}
</ul>
{% endif %}
</p>
<hr />
</div>
<ul id="comment-list-{{ image.id }}" class="uk-comment-list">
{% if image.comments is not empty %}
{% for comment in image.comments %}
{% include 'gallery_comment.html.twig' %}
{% endfor %}
{% else %}
<li class="uk-no-comments">No Comments yet!</li>
<li class="uk-margin-small uk-no-comments">
<p class="uk-heading-line uk-text-center"><span uk-icon="icon: heart;"></span></p>
</li>
{% endif %}
</ul>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<form id="comment-form-{{ image.id }}" class="uk-form" uk-grid>
<label for="comment-form-{{ image.id }}" class="required uk-form-label uk-hidden">Add comment</label>
<div class="uk-form-controls uk-form-controls-text uk-width-1-1">
<textarea uk-scroll required="requred" placeholder="Add comment" name="comment" cols="1" class="uk-form-large uk-textarea uk-padding-small"></textarea>
</div>
<input type="hidden" name="_token" value="{{ csrf_token(image.imageName) }}" />
<input type="hidden" name="id" value="{{ image.id }}" />
<input type="hidden" name="file" value="{{ image.imageName }}" />
<div class="uk-width-1-1 uk-margin-small-top">
<button type="submit" onclick="return false;" class="uk-button uk-button-small uk-button-primary uk-image-comment" name="submit" data-image-filename="{{ image.imageName }}" data-image-id="{{ image.id }}" id="submit-{{ image.id }}">Post</button>
</div>
</form>
{% else %}
<p class="">You need to <a href="{{ path('fos_user_security_login') }}">Login</a> or <a href="{{ path('fos_user_registration_register') }}">Register</a> to leave a comment.</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<p class="uk-text-center uk-align-center uk-width-1-1 uk-text-lead">
There are currently no images{% if category is defined %} for category <span class="uk-text-bold">{{ category }}</span>{% elseif tag is defined %} for tag <span class="uk-text-bold">{{ tag }}</span>{% endif %}!</p>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<p class="uk-align-center uk-text-center uk-width-1-1 uk-text-lead uk-first-column">
Why don't you <a title="Upload images" href="{{ path('sikofitt_doughnutwedding_gallery_upload') }}">upload one</a>?
</p>
{% else %}
<p class="uk-align-center uk-text-center uk-width-1-1 uk-text-large">
If you login or register you can upload one!
</p>
{% endif %}
{% endif %}
</div>
{% if pager.count > 12 %}
{{ pagerfanta(pager, 'default', { 'omitFirstPage': true}) }}
{% endif %}
{% endblock %}
{% block javascripts %}
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.uk-image-comment').on('click', function(event) {
event.preventDefault();
comment = jQuery(this).closest('form').find('textarea');
if('' === comment.val()) {
UIkit.notification("<span uk-icon='icon: warning; ratio: 1.5'></span> Comment cannot be blank", {status: 'warning'})
jQuery(this).closest('form').find('textarea').addClass('uk-form-danger');
return false;
}
$form = $(this).closest('form');
$data = $form.serialize();
$.ajax({
type: 'POST',
url: '{{ path('sikofitt_doughnutwedding_gallery_ajaxcomment') }}',
data: $data,
success: function(responseData, responseText, responseObject) {
postComment(responseData);
},
error: function(responseObject, responseText, responseReason) {
UIkit.notification("<span uk-icon='icon: warning; ratio: 1.5'></span> There was an error posting your comment. (" + responseReason + ")", {status: 'error'})
}
})
postComment = function(data) {
if(jQuery('.uk-no-comments').length > 0) {
jQuery('.uk-no-comments').remove();
}
jQuery('#comment-list-'+$form.find('input[name=id]').val()).append(data.html);
comment.val('');
jQuery('#comment-panel-'+$form.find('input[name=id]').val()).animate({scrollTop: jQuery('#comment-form-'+$form.find('input[name=id]').val()+ ' button').offset().top}, 1000);
}
});
});
</script>
{% endblock javascripts %}

View File

@ -1,18 +1,70 @@
{% extends "::base.html.twig" %}
{% block title %}Gallery Upload{% endblock %}
{% block title %}Gallery Upload{% endblock title %}
{% block body %}
<h2 class="uk-text-center">Upload an Image to the Gallery</h2>
{{ form_start(form, {'attr': { 'class': 'uk-form uk-form-horizontal'}}) }}
{{ form_label(form.imageFile, null, {'label_attr':{'class':'uk-hidden'}}) }}
{{ form_label(form.imageFile) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.imageFile) }}
{{ form_widget(form.imageFile) }}
</div>
<button class="uk-button uk-button-default">Submit</button>
{{ form_label(form.description) }}
<div class="uk-form-controls">
{{ form_errors(form.description) }}
{{ form_widget(form.description) }}
</div>
{{ form_label(form.category) }}
<div class="uk-form-controls uk-form-controls-text">
{{ form_errors(form.category) }}
{{ form_widget(form.category) }}
</div>
{{ form_label(form.tags) }}
<div class="uk-form-controls uk-form-controls-text">
<ul class="uk-list" id="tag-list"
data-prototype="{{ form_widget(form.tags.vars.prototype)|e }}">
{% for tagField in form.tags %}
<li>
{{ form_errors(tagField) }}
{{ form_widget(tagField) }}
</li>
{% endfor %}
{% do form.tags.setRendered %}
</ul>
<a href="#" class="uk-inline uk-align-right uk-button uk-button-default" id="add-tag">Add Tag</a>
</div>
<button class="uk-button uk-button-large uk-button-primary" name="submit" id="gallery_image_upload">Upload</button>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}
{% endblock body %}
{% block javascripts %}
<script type="text/javascript">
// keep track of how many email fields have been rendered
var tagCount = '{{ form.tags|length }}';
jQuery(document).ready(function() {
jQuery('#add-tag').click(function(e) {
e.preventDefault();
var tagList = jQuery('#tag-list');
// grab the prototype template
var newWidget = tagList.attr('data-prototype');
// replace the "__name__" used in the id and name of the prototype
// with a number that's unique to your emails
// end name attribute looks like name="contact[emails][2]"
newWidget = newWidget.replace(/__name__/g, tagCount);
tagCount++;
// create a new list element and add it to the list
var newLi = jQuery('<li></li>').html(newWidget);
newLi.appendTo(tagList);
});
})
</script>
{% endblock javascripts %}

View File

@ -0,0 +1,123 @@
{% extends 'base.html.twig' %}
{% block body %}
{% set imageUrl = bucket ~ '/gallery/' ~ vich_uploader_asset(image, 'imageFile')|trim('/', 'left') %}
<div class="uk-inline">
<a class="uk-width-1-1" href="#modal-full" uk-toggle>
<img class="uk-align-center uk-margin-remove-bottom" src="{{ imageUrl }}" />
</a>
<div class="uk-text-center uk-overlay uk-overlay-primary uk-light uk-position-bottom uk-text-large">
{{ image.description }}
</div>
</div>
<div id="modal-full" class="uk-modal-full" uk-modal>
<div class="uk-modal-dialog">
<button class="uk-padding uk-modal-close-full uk-close-large" type="button" uk-close></button>
<div class="uk-grid-collapse uk-child-width-1-2@s uk-flex" uk-grid>
<div class="uk-background-cover" style="background-image: url({{ imageUrl }});" uk-height-viewport></div>
<div id="comment-panel-{{ image.id }}" class="uk-margin-large-bottom@s uk-padding-large uk-overflow-auto" style="max-height:100vh">
<div class="uk-overflow-auto" >
<div class="uk-width-1-1">
<p class="uk-text-large">{{ image.description }}</p>
<p class="uk-text-meta">
Uploaded on {{ image.updatedAt|date('l F jS, Y') }} at {{ image.updatedAt|date('g:ia') }} by <span class="uk-text-bold">{{ image.user.name }}</span>.
</p>
<p class="">
{% if image.category is not null %}
<ul class="uk-comment-meta uk-subnav uk-subnav-divider uk-margin-remove-top">
<li class="uk-subnav-divider">Category</li>
<li><a style="text-decoration:underline;" href="{{ path('gallery_category_action', {'category':image.category}) }}">{{ image.category|capitalize }}</a></li>
</ul>
{% endif %}
{% if image.tags is not null and image.tags is not empty %}
<ul class="uk-comment-meta uk-subnav uk-subnav-divider uk-margin-remove-top">
<li class="uk-subnav-divider">View more like this</li>
{% for tag in image.tags %}
<a style="text-decoration:underline;" href="{{ path('gallery_tag_action', {'tag':tag}) }}">{{ tag|capitalize }}</a>
{% endfor %}
</ul>
{% endif %}
</p>
<hr />
</div>
<ul id="comment-list-{{ image.id }}" class="uk-comment-list">
{% if image.comments is not empty %}
{% for comment in image.comments %}
{% include 'gallery_comment.html.twig' %}
{% endfor %}
{% else %}
<li class="uk-no-comments">No Comments yet!</li>
<li class="uk-margin-small uk-no-comments">
<p class="uk-heading-line uk-text-center"><span uk-icon="icon: heart;"></span></p>
</li>
{% endif %}
</ul>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<form id="comment-form-{{ image.id }}" class="uk-form" uk-grid>
<label for="comment-form-{{ image.id }}" class="required uk-form-label uk-hidden">Add comment</label>
<div class="uk-form-controls uk-form-controls-text uk-width-1-1">
<textarea uk-scroll required="requred" placeholder="Add comment" name="comment" cols="1" class="uk-form-large uk-textarea uk-padding-small"></textarea>
</div>
<input type="hidden" name="_token" value="{{ csrf_token(image.imageName) }}" />
<input type="hidden" name="id" value="{{ image.id }}" />
<input type="hidden" name="file" value="{{ image.imageName }}" />
<div class="uk-width-1-1 uk-margin-small-top">
<button type="submit" onclick="return false;" class="uk-button uk-button-small uk-button-primary uk-image-comment" name="submit" data-image-filename="{{ image.imageName }}" data-image-id="{{ image.id }}" id="submit-{{ image.id }}">Post</button>
</div>
</form>
{% else %}
<p class="">You need to <a href="{{ path('fos_user_security_login') }}">Login</a> or <a href="{{ path('fos_user_registration_register') }}">Register</a> to leave a comment.</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.uk-image-comment').on('click', function(event) {
event.preventDefault();
comment = jQuery(this).closest('form').find('textarea');
if('' === comment.val()) {
UIkit.notification("<span uk-icon='icon: warning; ratio: 1.5'></span> Comment cannot be blank", {status: 'warning'})
jQuery(this).closest('form').find('textarea').addClass('uk-form-danger');
return false;
}
$form = $(this).closest('form');
$data = $form.serialize();
$.ajax({
type: 'POST',
url: '{{ path('sikofitt_doughnutwedding_gallery_ajaxcomment') }}',
data: $data,
success: function(responseData, responseText, responseObject) {
postComment(responseData);
},
error: function(responseObject, responseText, responseReason) {
UIkit.notification("<span uk-icon='icon: warning; ratio: 1.5'></span> There was an error posting your comment. (" + responseReason + ")", {status: 'error'})
}
})
postComment = function(data) {
if(jQuery('.uk-no-comments').length > 0) {
jQuery('.uk-no-comments').remove();
}
jQuery('#comment-list-'+$form.find('input[name=id]').val()).append(data.html);
comment.val('');
jQuery('#comment-panel-'+$form.find('input[name=id]').val()).animate({scrollTop: jQuery('#comment-form-'+$form.find('input[name=id]').val()+ ' button').offset().top}, 1000);
}
});
});
</script>
{% endblock javascripts %}

View File

@ -1,24 +1,37 @@
<?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\Security;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
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.
*/
class AccessDeniedHandler implements AccessDeniedHandlerInterface
{
/**
* @var UrlGeneratorInterface
*/
@ -30,10 +43,10 @@ class AccessDeniedHandler implements AccessDeniedHandlerInterface
private $logger;
/**
* Sets up the router
* Sets up the router.
*
* @param UrlGeneratorInterface $router
* @param LoggerInterface $logger
* @param LoggerInterface $logger
*/
public function __construct(UrlGeneratorInterface $router, LoggerInterface $logger)
{
@ -44,13 +57,16 @@ class AccessDeniedHandler implements AccessDeniedHandlerInterface
/**
* Redirects to the login page on access denied failure.
*
* @param Request $request
* @param Request $request
* @param AccessDeniedException $accessDeniedException
*
* @return RedirectResponse
*/
public function handle(Request $request, AccessDeniedException $accessDeniedException) : RedirectResponse {
$request->getSession()->getFlashBag()->add('error', $accessDeniedException->getMessage());
public function handle(Request $request, AccessDeniedException $accessDeniedException): RedirectResponse
{
/** @var \Symfony\Component\HttpFoundation\Session\Session $session */
$session = $request->getSession();
$session->getFlashBag()->add('error', $accessDeniedException->getMessage());
$url = $this->router->generate('fos_user_security_login');
$this->logger->alert($accessDeniedException->getMessage(), [
'code' => $accessDeniedException->getCode(),
@ -62,6 +78,5 @@ class AccessDeniedHandler implements AccessDeniedHandlerInterface
'X-Denied-Message' => $accessDeniedException->getMessage(),
'X-Denied-Status-Code' => $accessDeniedException->getCode(),
]);
}
}
}