minor updates
This commit is contained in:
assets
composer.jsoncomposer.lockconfig
migrations
package.jsonsrc
Controller
Entity
Form
Repository
Security
templates
_header.html.twigbase.html.twig
webpack.config.jsyarn.lockblog
registration
security
check_email.html.twigconfirmation_email.html.twigemail.html.twiglogin.html.twigregister.html.twigrequest.html.twigreset.html.twig
user
@ -9,41 +9,46 @@
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="CollapsingNavbar">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item dropdown my-2 my-lg-0">
|
||||
<button type="button" id="navbar-dropdown" data-bs-target="#dropdown-menu" data-bs-toggle="dropdown"
|
||||
class="btn btn-primary dropdown-toggle ml-auto button-login">
|
||||
{{ app.user.username }}
|
||||
</button>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<form class="d-flex">
|
||||
<input class="form-control me-2 my-2" type="search" placeholder="Search" aria-label="Search">
|
||||
<button class="btn" type="submit">Search</button>
|
||||
</form>
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
<li class="nav-item dropdown me-auto my-2 my-lg-0">
|
||||
<button type="button" id="navbar-dropdown" data-bs-target="#dropdown-menu" data-bs-toggle="dropdown"
|
||||
class="btn btn-primary dropdown-toggle ml-auto button-login">
|
||||
{{ app.user.username }}
|
||||
</button>
|
||||
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
<div class="dropdown-menu dropdown-menu-dark dropdown-menu-end" id="dropdown-menu" aria-labelledby="navbar-dropdown">
|
||||
<a class="dropdown-item" href="{{ path('user') }}">
|
||||
<span class="fas fa-user" aria-hidden="true"></span>
|
||||
Profile</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<span class="fas fa-cog" aria-hidden="true"></span>
|
||||
Settings</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<a class="dropdown-item" href="{{ path('admin') }}">
|
||||
<span class="fas fa-cog" aria-hidden="true"></span>
|
||||
Administration
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-dark dropdown-menu-end" id="dropdown-menu"
|
||||
aria-labelledby="navbar-dropdown">
|
||||
<a class="dropdown-item" href="{{ path('user') }}">
|
||||
<span class="fas fa-user" aria-hidden="true"></span>
|
||||
Profile</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<span class="fas fa-wrench" aria-hidden="true"></span>
|
||||
Settings</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% endif %}
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<a class="dropdown-item" href="{{ path('admin') }}">
|
||||
<span class="fas fa-cog" aria-hidden="true"></span>
|
||||
Administration
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
{% endif %}
|
||||
|
||||
<a class="dropdown-item" href="{{ path('app_logout') }}">
|
||||
<span class="fas fa-sign-out-alt" aria-hidden="true"></span>
|
||||
Logout
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<a class="dropdown-item" href="{{ path('app_logout') }}">
|
||||
<span class="fas fa-sign-out-alt" aria-hidden="true"></span>
|
||||
Logout
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-primary button-login" href="{{ path('app_login') }}" role="button"
|
||||
id="buttonLogin">
|
||||
Login
|
||||
<span class="fas fa-sign-out-alt me-2" aria-hidden="true"></span>Sign In
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}Spookie{% endblock %}</title>
|
||||
|
||||
{% block stylesheets %}
|
||||
|
@ -1,12 +1,80 @@
|
||||
{# templates/blog/blog_show.html.twig #}
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
|
||||
{% endblock %}
|
||||
{% block title %} Blogpost {% endblock %}
|
||||
|
||||
{% block body %}
|
||||
Blogtest
|
||||
{{ blog.content }}
|
||||
|
||||
<div class="container box">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="show-article-container p-3 mt-4">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<img class="show-article-img" src="{{ asset('build/images/asteroid.jpeg') }}" alt="asteroid">
|
||||
<div class="show-article-title-container d-inline-block pl-3 align-middle">
|
||||
<span class="show-article-title ">{{ blog.title }}</span>
|
||||
<br>
|
||||
<span class="align-left article-details">
|
||||
<img class="article-author-img rounded-circle" src="{{ asset('build/images/alien-profile.png') }}" alt="profile">
|
||||
{{ blog.author }}
|
||||
</span>
|
||||
<span class="pl-2 article-details">{{ blog.createdAt | ago }} updated: {{ blog.editedAt | ago }} </span>
|
||||
<span class="pl-2 article-details">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="article-text">
|
||||
{{ blog.content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<p class="share-icons mb-5">
|
||||
<span class="pr-1">Share:</span>
|
||||
<i class="pr-1 fa-2x fab fa-facebook-square"></i>
|
||||
<i class="pr-1 fa-2x fab fa-twitter-square"></i>
|
||||
<i class="pr-1 fa-2x fab fa-reddit-square"></i>
|
||||
<i class="pr-1 fa-2x fa fa-share-alt-square"></i>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h3>
|
||||
|
||||
<!--
|
||||
<i class="pr-3 fa fa-comment"></i>Comments</h3>
|
||||
|
||||
-->
|
||||
<hr>
|
||||
|
||||
<div class="row mb-5">
|
||||
<div class="col-sm-12">
|
||||
<img class="comment-img rounded-circle" src="{{ asset('build/images/alien-profile.png') }}" alt="profile">
|
||||
<div class="comment-container d-inline-block pl-3 align-top">
|
||||
<span class="commenter-name">Amy Oort</span>
|
||||
<div class="form-group">
|
||||
<label for="articleText"></label>
|
||||
<textarea class="form-control comment-form" id="articleText" rows="1"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Comment</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Register{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% for flashError in app.flashes('verify_email_error') %}
|
||||
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
|
||||
{% endfor %}
|
||||
|
||||
<h1>Register</h1>
|
||||
|
||||
{{ form_start(registrationForm) }}
|
||||
{{ form_row(registrationForm.username) }}
|
||||
{{ form_row(registrationForm.plainPassword, {
|
||||
label: 'Password'
|
||||
}) }}
|
||||
{{ form_row(registrationForm.agreeTerms) }}
|
||||
|
||||
<button type="submit" class="btn">Register</button>
|
||||
{{ form_end(registrationForm) }}
|
||||
{% endblock %}
|
11
templates/security/check_email.html.twig
Normal file
11
templates/security/check_email.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Password Reset Email Sent{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<p>
|
||||
If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password.
|
||||
This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.
|
||||
</p>
|
||||
<p>If you don't receive an email please check your spam folder or <a href="{{ path('app_forgot_password_request') }}">try again</a>.</p>
|
||||
{% endblock %}
|
9
templates/security/email.html.twig
Normal file
9
templates/security/email.html.twig
Normal file
@ -0,0 +1,9 @@
|
||||
<h1>Hi!</h1>
|
||||
|
||||
<p>To reset your password, please visit the following link</p>
|
||||
|
||||
<a href="{{ url('app_reset_password', {token: resetToken.token}) }}">{{ url('app_reset_password', {token: resetToken.token}) }}</a>
|
||||
|
||||
<p>This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.</p>
|
||||
|
||||
<p>Cheers!</p>
|
@ -3,40 +3,71 @@
|
||||
{% block title %}Log in!{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
<div class="mb-3">
|
||||
You are logged in as {{ app.user.username }}, <a href="{{ path('app_logout') }}">Logout</a>
|
||||
{% for flashError in app.flashes('verify_email_error') %}
|
||||
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
|
||||
{% endfor %}
|
||||
|
||||
<form method="post">
|
||||
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-center h-100">
|
||||
<div class="card-header">
|
||||
<h3>Please Sign in</h3>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" value="{{ last_username }}" name="username" id="inputUsername"
|
||||
class="form-control" autocomplete="username" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-key"></i></span>
|
||||
</div>
|
||||
<input type="password" name="password" id="inputPassword" class="form-control"
|
||||
autocomplete="current-password" required>
|
||||
</div>
|
||||
|
||||
{#
|
||||
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||
See https://symfony.com/doc/current/security/remember_me.html
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<label>
|
||||
<input type="checkbox" name="_remember_me"> Remember me
|
||||
</label>
|
||||
</div>
|
||||
#}
|
||||
|
||||
<button type="submit" class="submit-button">Sign In</button>
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="d-flex justify-content-center links">
|
||||
Don't have an account yet? <a href=" {{ path('app_register') }}">Register!</a>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<a href="{{ path('app_forgot_password_request') }}">Forgot your password?</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="d-flex justify-content-center social_icon">
|
||||
<span><i class="fab fa-apple"></i></span>
|
||||
<span><i class="fab fa-facebook"></i></span>
|
||||
<span><i class="fab fa-google-plus"></i></span>
|
||||
<span><i class="fab fa-twitter"></i></span>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
||||
<label for="inputUsername">Username</label>
|
||||
<input type="text" value="{{ last_username }}" name="username" id="inputUsername" class="form-control" autocomplete="username" required autofocus>
|
||||
<label for="inputPassword">Password</label>
|
||||
<input type="password" name="password" id="inputPassword" class="form-control" autocomplete="current-password" required>
|
||||
|
||||
<input type="hidden" name="_csrf_token"
|
||||
value="{{ csrf_token('authenticate') }}"
|
||||
>
|
||||
|
||||
{#
|
||||
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||
See https://symfony.com/doc/current/security/remember_me.html
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<label>
|
||||
<input type="checkbox" name="_remember_me"> Remember me
|
||||
</label>
|
||||
</div>
|
||||
#}
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
Sign in
|
||||
</button>
|
||||
</form>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
81
templates/security/register.html.twig
Normal file
81
templates/security/register.html.twig
Normal file
@ -0,0 +1,81 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Register{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% for flashError in app.flashes('verify_email_error') %}
|
||||
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-center h-100">
|
||||
<div class="card-header">
|
||||
<h3>Register</h3>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ form_start(registrationForm) }}
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
||||
</div>
|
||||
{{ form_widget(registrationForm.username, {'attr': {'placeholder':'Username'}} ) }}
|
||||
</div>
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-key"></i></span>
|
||||
</div>
|
||||
{{ form_widget(registrationForm.plainPassword, {'attr': {'placeholder':'Password'}} ) }}
|
||||
</div>
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"></span>
|
||||
</div>
|
||||
{{ form_widget(registrationForm.firstName, {'attr': {'placeholder':'First Name'}} ) }}
|
||||
</div>
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"></span>
|
||||
</div>
|
||||
{{ form_widget(registrationForm.lastName, {'attr': {'placeholder':'Last Name'}} ) }}
|
||||
</div>
|
||||
|
||||
<div class="input-group form-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-envelope-square"></i></span>
|
||||
</div>
|
||||
{{ form_widget(registrationForm.email, {'attr': {'placeholder':'eMail'}} ) }}
|
||||
</div>
|
||||
|
||||
{{ form_row(registrationForm.agreeTerms) }}
|
||||
|
||||
<button type="submit" class="submit-button">Register</button>
|
||||
{{ form_end(registrationForm) }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="d-flex justify-content-center links">
|
||||
Already have an account? <a href=" {{ path('app_login') }}">Sign In!</a>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<a href="#">Forgot your password?</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="d-flex justify-content-center social_icon">
|
||||
<span><i class="fab fa-apple"></i></span>
|
||||
<span><i class="fab fa-facebook"></i></span>
|
||||
<span><i class="fab fa-google-plus"></i></span>
|
||||
<span><i class="fab fa-twitter"></i></span>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
22
templates/security/request.html.twig
Normal file
22
templates/security/request.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Reset your password{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% for flashError in app.flashes('reset_password_error') %}
|
||||
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
|
||||
{% endfor %}
|
||||
<h1>Reset your password</h1>
|
||||
|
||||
{{ form_start(requestForm) }}
|
||||
{{ form_row(requestForm.email) }}
|
||||
<div>
|
||||
<small>
|
||||
Enter your email address and we we will send you a
|
||||
link to reset your password.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary">Send password reset email</button>
|
||||
{{ form_end(requestForm) }}
|
||||
{% endblock %}
|
12
templates/security/reset.html.twig
Normal file
12
templates/security/reset.html.twig
Normal file
@ -0,0 +1,12 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Reset your password{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Reset your password</h1>
|
||||
|
||||
{{ form_start(resetForm) }}
|
||||
{{ form_row(resetForm.plainPassword) }}
|
||||
<button class="btn btn-primary">Reset password</button>
|
||||
{{ form_end(resetForm) }}
|
||||
{% endblock %}
|
20
templates/user/index.html.twig
Normal file
20
templates/user/index.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello UserController!{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<h1>Hello {{ controller_name }}! ✅</h1>
|
||||
|
||||
This friendly message is coming from:
|
||||
<ul>
|
||||
<li>Your controller at <code><a href="{{ '/Users/tracer/Projects/24unix.net/24unix.net_web/24unix/src/Controller/UserController.php'|file_link(0) }}">src/Controller/UserController.php</a></code></li>
|
||||
<li>Your template at <code><a href="{{ '/Users/tracer/Projects/24unix.net/24unix.net_web/24unix/templates/user/index.html.twig'|file_link(0) }}">templates/user/index.html.twig</a></code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user