Browse Source

apdatation sov

master
Charly 3 years ago
parent
commit
7c5d0b62c0
55 changed files with 3523 additions and 1561 deletions
  1. +5
    -0
      .env
  2. +2
    -4
      assets/backend/common/app.common.js
  3. +0
    -0
      assets/backend/common/common.js
  4. +0
    -0
      assets/backend/common/common.scss
  5. +0
    -11
      assets/bootstrap.js
  6. +0
    -16
      assets/controllers/hello_controller.js
  7. +10
    -0
      assets/frontend/app/app.common.js
  8. +3
    -0
      assets/frontend/app/app.js
  9. +10
    -0
      assets/frontend/app/app.scss
  10. +3
    -0
      assets/frontend/js/script.js
  11. +62
    -0
      assets/frontend/scss/base.scss
  12. +114
    -0
      assets/frontend/scss/cookies.scss
  13. +0
    -0
      assets/frontend/scss/footer.scss
  14. +0
    -0
      assets/frontend/scss/header.scss
  15. +0
    -0
      assets/frontend/scss/home.scss
  16. +24
    -0
      assets/frontend/scss/mixin_responsive.scss
  17. +0
    -0
      assets/frontend/scss/page.scss
  18. +27
    -0
      assets/frontend/scss/vars.scss
  19. +0
    -3
      assets/styles/app.css
  20. +105
    -100
      composer.json
  21. +2546
    -1089
      composer.lock
  22. +3
    -0
      config/bundles.php
  23. +7
    -0
      config/packages/ch_cookie_consent.yaml
  24. +4
    -0
      config/packages/mailjet.yaml
  25. +10
    -14
      config/packages/security.yaml
  26. +2
    -0
      config/routes/ch_cookie_consent.yaml
  27. +13
    -0
      config/services.yaml
  28. +0
    -51
      migrations/Version20210524094036.php
  29. +0
    -35
      migrations/Version20210524124412.php
  30. +5
    -0
      phpunit.xml.dist
  31. +18
    -22
      src/Controller/Admin/DashboardController.php
  32. +18
    -15
      src/Controller/Admin/PageCrudController.php
  33. +10
    -5
      src/Controller/Admin/UserCrudController.php
  34. +0
    -30
      src/Controller/DefaultController.php
  35. +25
    -0
      src/Controller/Frontend/HomeController.php
  36. +14
    -14
      src/Entity/File/File.php
  37. +25
    -0
      src/Entity/Reminder/Reminder.php
  38. +25
    -0
      src/Entity/Setting/SiteSetting.php
  39. +80
    -80
      src/Entity/Site/Page.php
  40. +25
    -0
      src/Entity/Site/Site.php
  41. +25
    -0
      src/Entity/Ticket/Ticket.php
  42. +25
    -0
      src/Entity/Ticket/TicketMessage.php
  43. +26
    -0
      src/Entity/User/GroupUser.php
  44. +15
    -11
      src/Entity/User/User.php
  45. +0
    -21
      src/Repository/PageRepository.php
  46. +88
    -0
      symfony.lock
  47. +0
    -19
      templates/base.html.twig
  48. +58
    -0
      templates/frontend/layout/base.html.twig
  49. +5
    -0
      templates/frontend/layout/footer.html.twig
  50. +3
    -0
      templates/frontend/layout/header.html.twig
  51. +17
    -0
      templates/frontend/layout/macro.html.twig
  52. +12
    -0
      templates/frontend/site/home.html.twig
  53. +0
    -17
      templates/index.html.twig
  54. +29
    -0
      translations/CHCookieConsentBundle.fr.yml
  55. +25
    -4
      webpack.config.js

+ 5
- 0
.env View File

@@ -30,3 +30,8 @@ APP_SECRET=555bc2aee588a05641d07ab10b081636
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

###> mailjet/mailjet-bundle ###
MAILJET_APIKEY_PUBLIC=your-api_key
MAILJET_APIKEY_PRIVATE=@@your-secret_key
###< mailjet/mailjet-bundle ###

assets/app.js → assets/backend/common/app.common.js View File

@@ -6,7 +6,5 @@
*/

// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';

// start the Stimulus application
import './bootstrap';
import './common.scss';
import './common.js';

+ 0
- 0
assets/backend/common/common.js View File


+ 0
- 0
assets/backend/common/common.scss View File


+ 0
- 11
assets/bootstrap.js View File

@@ -1,11 +0,0 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.(j|t)sx?$/
));

// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

+ 0
- 16
assets/controllers/hello_controller.js View File

@@ -1,16 +0,0 @@
import { Controller } from 'stimulus';

/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}

+ 10
- 0
assets/frontend/app/app.common.js View File

@@ -0,0 +1,10 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './app.scss';
import './app.js';

+ 3
- 0
assets/frontend/app/app.js View File

@@ -0,0 +1,3 @@
import 'bootstrap';

import "../js/script";

+ 10
- 0
assets/frontend/app/app.scss View File

@@ -0,0 +1,10 @@
@import "./node_modules/bootstrap/scss/bootstrap";

@import "../scss/vars";
@import "../scss/mixin_responsive";
@import "../scss/base";
@import "../scss/home";
@import "../scss/page";
@import "../scss/header";
@import "../scss/footer";
@import "../scss/cookies";

+ 3
- 0
assets/frontend/js/script.js View File

@@ -0,0 +1,3 @@
$(document).ready(function () {

});

+ 62
- 0
assets/frontend/scss/base.scss View File

@@ -0,0 +1,62 @@
html {
font-size: 62.5%;

@include large-only {
font-size: 60%;
}

@include desktop-only {
font-size: 55%;
}

@include tablet-only {
font-size: 50%;
}

@include mobile-only {
font-size: 45%;
}
}

img {
max-width: 100%;
max-height: 100%;
}

h1, h2, h3, h4, h5, h6 {
}

li, p, a, select, option {
}

p {
font-size: 2.0rem;
}

.bold {
font-weight: bold;
}

a:hover {
text-decoration: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}

.hidden {
display: none;
}

.success-post {
color: $green;
border: 2px solid $green;
text-align: center;
padding: 15px;
margin-top: 50px;
margin-bottom: 50px;
}

+ 114
- 0
assets/frontend/scss/cookies.scss View File

@@ -0,0 +1,114 @@
/* Cookies */

$color-primary-cookies: $orange;
$font-family-cookies-title: 'FranklinGothic';
$font-family-cookies-text: 'dinbold';

.ch-cookie-consent {
position: fixed;
width: 500px;
bottom: 20px !important;
left: 20px !important;
z-index: 100;
padding: 30px;
background-color: white;
border: solid 1px #e0e0e0;

&.ch-cookie-consent--bottom {
//display: none;
}

.ch-cookie-consent__title {
font-family: $font-family-cookies-title;
color: $color-primary-cookies;
font-size: 25px;
font-weight: normal;
margin-bottom: 7px;
}
.ch-cookie-consent__intro {
margin-bottom: 5px;
line-height: 20px;
font-size: 20px;
}
.ch-cookie-consent__read-more {
color: $color-primary-cookies;
display: none;
}
form.ch-cookie-consent__form {
margin-top: 20px;

.ch-cookie-consent__category-group {
.ch-cookie-consent__category {
display: -ms-flexbox;
display: flex;
padding-top: 7px;
padding-bottom: 7px;
border: 0px none;

.ch-cookie-consent__category-toggle {
input {
display: none;
}
label {
cursor: pointer;
text-align: center;
padding: 3px 10px 3px 10px;
text-transform: uppercase;
border: solid 1px $color-primary-cookies;
color: $color-primary-cookies;
font-size: 13px;
font-family: $font-family-cookies-text;
}
input:checked + label,
label:hover {
background: none;
background-color: $color-primary-cookies;
color: white;
}
}
.ch-cookie-consent__category-information {
position: relative;
top: -2px;
margin-left: 20px;
.ch-cookie-consent__category-title {
color: $color-primary-cookies;
font-family: $font-family-cookies-text;
margin-bottom: 5px;
}
.ch-cookie-consent__category-description {
color: gray;
margin-top: 0px;
font-weight: normal;
font-family: $font-family-cookies-text;
font-size: 15px;
}
}
}
}
.ch-cookie-consent__btn-group {
margin-top: 15px;
text-align: left;

button {
display: block;
margin: 0px;
padding: 10px 0px 10px 0px;
cursor: pointer;
background: none;
background-color: $color-primary-cookies;
color: white;
text-transform: uppercase;
font-family: $font-family-cookies-title;
font-weight: normal;
font-size: 15px;
border: solid 1px #e0e0e0;
width: 100%;

&:hover {
background-color: white;
color: $color-primary-cookies !important;
}
}
}
}
}

+ 0
- 0
assets/frontend/scss/footer.scss View File


+ 0
- 0
assets/frontend/scss/header.scss View File


+ 0
- 0
assets/frontend/scss/home.scss View File


+ 24
- 0
assets/frontend/scss/mixin_responsive.scss View File

@@ -0,0 +1,24 @@
//576px
@mixin mobile-only {
@media screen and (max-width: $sm) {
@content;
}
}
//768px
@mixin tablet-only {
@media screen and (max-width: $md) {
@content;
}
}
//992px
@mixin desktop-only {
@media screen and (max-width: $lg) {
@content;
}
}
//1200px
@mixin large-only {
@media screen and (max-width: $xl) {
@content;
}
}

+ 0
- 0
assets/frontend/scss/page.scss View File


+ 27
- 0
assets/frontend/scss/vars.scss View File

@@ -0,0 +1,27 @@
$dir-fonts: '/public/assets/fonts/';
$dir-img: '/public/assets/img/';

$sm: 576px;
$md: 768px;
$lg: 992px;
$xl: 1200px;

$orange: #dc5b2f;
$green: #568b6f;

//Bootstrap
$grid-columns: 12;
$grid-gutter-width: 30px;

$grid-breakpoints: (
// Extra small screen / phone
xs: 0,
// Small screen / phone
sm: $sm,
// Medium screen / tablet
md: $md,
// Large screen / desktop
lg: $lg,
// Extra large screen / wide desktop
xl: $xl
);

+ 0
- 3
assets/styles/app.css View File

@@ -1,3 +0,0 @@
body {
background-color: lightgray;
}

+ 105
- 100
composer.json View File

@@ -1,105 +1,110 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"artgris/filemanager-bundle": "^2.2",
"composer/package-versions-deprecated": "1.11.99.2",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.8",
"easycorp/easyadmin-bundle": "^3.3",
"friendsofsymfony/ckeditor-bundle": "^2.3",
"liip/imagine-bundle": "^2.6",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "5.2.*",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/expression-language": "5.2.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.2.*",
"symfony/framework-bundle": "5.2.*",
"symfony/http-client": "5.2.*",
"symfony/intl": "5.2.*",
"symfony/mailer": "5.2.*",
"symfony/mime": "5.2.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.2.*",
"symfony/process": "5.2.*",
"symfony/property-access": "5.2.*",
"symfony/property-info": "5.2.*",
"symfony/proxy-manager-bridge": "5.2.*",
"symfony/security-bundle": "5.2.*",
"symfony/serializer": "5.2.*",
"symfony/string": "5.2.*",
"symfony/translation": "5.2.*",
"symfony/twig-bundle": "^5.2",
"symfony/validator": "5.2.*",
"symfony/web-link": "5.2.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.2.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"artgris/filemanager-bundle": "^2.2",
"composer/package-versions-deprecated": "1.11.99.2",
"connectholland/cookie-consent-bundle": "^0.9.10",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.8",
"dompdf/dompdf": "^1.0",
"easycorp/easyadmin-bundle": "^3.3",
"friendsofsymfony/ckeditor-bundle": "^2.3",
"knplabs/knp-paginator-bundle": "^5.6",
"liip/imagine-bundle": "^2.6",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "5.3.*",
"symfony/console": "5.3.*",
"symfony/dotenv": "5.3.*",
"symfony/expression-language": "5.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.3.*",
"symfony/framework-bundle": "5.3.*",
"symfony/http-client": "5.3.*",
"symfony/intl": "5.3.*",
"symfony/mailer": "5.3.*",
"symfony/mime": "5.3.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.3.*",
"symfony/process": "5.3.*",
"symfony/property-access": "5.3.*",
"symfony/property-info": "5.3.*",
"symfony/proxy-manager-bridge": "5.3.*",
"symfony/security-bundle": "5.3.*",
"symfony/serializer": "5.3.*",
"symfony/string": "5.3.*",
"symfony/translation": "5.3.*",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "5.3.*",
"symfony/web-link": "5.3.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.3.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"mailjet/mailjet-bundle": "^2.0",
"mailjet/mailjet-swiftmailer": "1.0.6"
},
"require-dev": {
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"require-dev": {
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Lc\\": "Lc/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Lc\\": "Lc/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.2.*"
}
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.3.*"
}
}
}

+ 2546
- 1089
composer.lock
File diff suppressed because it is too large
View File


+ 3
- 0
config/bundles.php View File

@@ -19,4 +19,7 @@ return [
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
Lc\SovBundle\LcSovBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
ConnectHolland\CookieConsentBundle\CHCookieConsentBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
Mailjet\MailjetBundle\MailjetBundle::class => ['all' => true],
];

+ 7
- 0
config/packages/ch_cookie_consent.yaml View File

@@ -0,0 +1,7 @@
ch_cookie_consent:
theme: 'light' # light, dark
categories: # Below are the default supported categories
- 'piwik'
use_logger: true # Logs user actions to database
position: 'bottom' # top, bottom
simplified: false # When set to true the user can only deny or accept all cookies at once

+ 4
- 0
config/packages/mailjet.yaml View File

@@ -0,0 +1,4 @@
mailjet:
api_key: "%env(MAILJET_APIKEY_PUBLIC)%"
secret_key: "%env(MAILJET_APIKEY_PRIVATE)%"


+ 10
- 14
config/packages/security.yaml View File

@@ -1,4 +1,5 @@
security:
enable_authenticator_manager: true
encoders:
App\Entity\User\User:
algorithm: auto
@@ -15,24 +16,19 @@ security:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

main:
pattern: ^/
anonymous: true
admin:
pattern: ^/(admin|login|logout)
lazy: true
form_login:
login_path: sov_login
check_path: sov_login
http_basic: ~
entry_point: form_login
provider: app_user_provider
guard:
authenticators:
- Lc\SovBundle\Authenticator\LoginFormAuthenticator
custom_authenticator: Lc\SovBundle\Authenticator\LoginFormAuthenticator
logout:
path: sov_logout
# where to redirect after logout
# target: app_any_route

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication

# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
target: sov_login

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used

+ 2
- 0
config/routes/ch_cookie_consent.yaml View File

@@ -0,0 +1,2 @@
ch_cookie_consent:
resource: "@CHCookieConsentBundle/Resources/config/routing.yaml"

+ 13
- 0
config/services.yaml View File

@@ -7,6 +7,9 @@ parameters:
app.locales: ["fr"]
app.default_locale: "fr"
app.path_uploads: '/uploads'
app.admin.logo: 'laclic.png'
app.reminder.route_render_modal: 'sov_admin_reminder_render_modal'
app.assets_directory: '%kernel.project_dir%/public/assets/'

services:
# default configuration for services in *this* file
@@ -30,3 +33,13 @@ services:
resource: '../src/Controller/'
tags: ['controller.service_arguments']

Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport: '@swiftmailer.mailer.transport.mailjet'

app.form.extension.type.cookie_consent:
class: App\Form\CookieConsentTypeExtension
tags:
- { name: form.type_extension, extended_type: ConnectHolland\CookieConsentBundle\Form\CookieConsentType }
arguments:
- '@ConnectHolland\CookieConsentBundle\Cookie\CookieChecker'
- '%ch_cookie_consent.categories%'
- '%ch_cookie_consent.simplified%'

+ 0
- 51
migrations/Version20210524094036.php View File

@@ -1,51 +0,0 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210524094036 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, path VARCHAR(255) DEFAULT NULL, legend VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', position DOUBLE PRECISION NOT NULL, INDEX IDX_8C9F3610B03A8386 (created_by_id), INDEX IDX_8C9F3610896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page_file (page_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_B5B2ACAC4663E4 (page_id), INDEX IDX_B5B2ACA93CB796C (file_id), PRIMARY KEY(page_id, file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, lastname VARCHAR(255) DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, is_verified TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6203DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACAC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACA93CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610B03A8386');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610896DBBDE');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE page_file');
$this->addSql('DROP TABLE user');
}
}

+ 0
- 35
migrations/Version20210524124412.php View File

@@ -1,35 +0,0 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210524124412 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page ADD file_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB62093CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('CREATE INDEX IDX_140AB62093CB796C ON page (file_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB62093CB796C');
$this->addSql('DROP INDEX IDX_140AB62093CB796C ON page');
$this->addSql('ALTER TABLE page DROP file_id');
}
}

+ 5
- 0
phpunit.xml.dist View File

@@ -13,6 +13,11 @@
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="8.5" />

<!-- ###+ mailjet/mailjet-bundle ### -->
<env name="MAILJET_APIKEY_PUBLIC" value="your-api_key"/>
<env name="MAILJET_APIKEY_PRIVATE" value="@@your-secret_key"/>
<!-- ###- mailjet/mailjet-bundle ### -->
</php>

<testsuites>

+ 18
- 22
src/Controller/Admin/DashboardController.php View File

@@ -3,35 +3,31 @@
namespace App\Controller\Admin;


use App\Entity\Common\TaxRate;
use App\Entity\Site\Page;
use App\Entity\User\GroupUser;
use App\Entity\User\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use Lc\SovBundle\Controller\Admin\DashboardController as SovDashboardController;
use Lc\SovBundle\Controller\Dashboard\DashboardAdminController as SovDashboardController;

class DashboardController extends SovDashboardController
{

public function configureMenuItems(): iterable
{
yield MenuItem::linkToDashboard('dashboard', 'circle');

yield MenuItem::linkToCrud('page', 'copy', Page::class);

yield MenuItem::subMenu('user', 'user')->setSubItems(
[
MenuItem::linkToCrud('user_index', '', User::class),
]
);

yield MenuItem::subMenu('account', 'user')->setSubItems(
[
MenuItem::linkToRoute('account_profile', '', 'sov_admin_account_profile'),
MenuItem::linkToRoute('account_password', '', 'sov_admin_account_password'),
]
);
$menuItems = [
MenuItem::linkToDashboard('dashboard', 'far fa-circle'),

MenuItem::linkToCrud('page', 'far fa-copy', Page::class),

MenuItem::subMenu('account', 'fas fa-user')
->setSubItems(
[
MenuItem::linkToRoute('account_profile', 'fas fa-user-cog', 'sov_admin_account_profile'),
MenuItem::linkToRoute('account_password', 'fas fa-key', 'sov_admin_account_password'),
]
),

MenuItem::linkToCrud('user', 'fas fa-users', User::class),
];

return $menuItems;
}
}

+ 18
- 15
src/Controller/Admin/PageCrudController.php View File

@@ -6,14 +6,12 @@ use App\Entity\Site\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\Admin\AbstractCrudController;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\FileManagerField;
use Lc\SovBundle\Field\GalleryManagerField;
use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Field\StatusField;
use Symfony\Component\Translation\TranslatableMessage;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class PageCrudController extends AbstractCrudController
{
@@ -22,22 +20,27 @@ class PageCrudController extends AbstractCrudController
return Page::class;
}

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getPageContainer()->getRepositoryQuery();
}

public function configureFields(string $pageName): iterable
{
$panel = parent::configureFields($pageName);

return array_merge(
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
CKEditorField::new('description'),
FileManagerField::new('file'),
StatusField::new('status'),
FormField::addPanel('gallery'),
GalleryManagerField::new('gallery')
],
$panel
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
CKEditorField::new('description'),
FileManagerField::new('file'),
StatusField::new('status'),
FormField::addPanel('gallery'),
GalleryManagerField::new('gallery')
],
$panel
);
}


+ 10
- 5
src/Controller/Admin/UserCrudController.php View File

@@ -3,13 +3,18 @@
namespace App\Controller\Admin;

use App\Entity\User\User;
use Lc\SovBundle\Controller\Admin\UserCrudController as AbstractUserCrudController;
use Lc\SovBundle\Controller\User\UserAdminController as AbstractUserCrudController;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class UserCrudController extends AbstractUserCrudController
{
public static function getEntityFqcn(): string
{
return User::class;
}
public static function getEntityFqcn(): string
{
return User::class;
}

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getUserContainer()->getRepositoryQuery();
}
}

+ 0
- 30
src/Controller/DefaultController.php View File

@@ -1,30 +0,0 @@
<?php

namespace App\Controller;

use App\Entity\Site\Page;
use Lc\SovBundle\Doctrine\EntityManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;


class DefaultController extends AbstractController
{
protected $em;
protected $mailer;

public function __construct(EntityManager $em)
{
$this->em = $em;
}

public function index(): Response
{
$pageRepository = $this->em->getRepository(Page::class);
$pages = $pageRepository->findAll();

return $this->render('index.html.twig', [
'pages' => $pages
]);
}
}

+ 25
- 0
src/Controller/Frontend/HomeController.php View File

@@ -0,0 +1,25 @@
<?php

namespace App\Controller\Frontend;


use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class HomeController extends AbstractController
{

protected EntityManagerInterface $em;

public function __construct(
EntityManagerInterface $em
) {
$this->em = $em;
}

public function index(): Response
{
return $this->render('frontend/site/home.html.twig');
}
}

+ 14
- 14
src/Entity/File/File.php View File

@@ -12,20 +12,20 @@ use Lc\SovBundle\Repository\File\FileRepository;
*/
class File extends FileModel implements FileInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
public function getId(): ?int
{
return $this->id;
}

public function __toString()
{
return ''.$this->getLegend() ;
}
public function __toString()
{
return '' . $this->getLegend();
}
}

+ 25
- 0
src/Entity/Reminder/Reminder.php View File

@@ -0,0 +1,25 @@
<?php


namespace App\Entity\Reminder;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Reminder\ReminderModel;

/**
* @ORM\Entity(repositoryClass=ReminderRepository::class)
*/
class Reminder extends ReminderModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Setting/SiteSetting.php View File

@@ -0,0 +1,25 @@
<?php

namespace App\Entity\Setting;

use Lc\SovBundle\Repository\Setting\SiteSettingRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Setting\SiteSettingModel;

/**
* @ORM\Entity(repositoryClass=SiteSettingRepository::class)
*/
class SiteSetting extends SiteSettingModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 80
- 80
src/Entity/Site/Page.php View File

@@ -6,98 +6,98 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use App\Entity\File\File ;
use App\Repository\PageRepository;
use App\Entity\File\File;
use Lc\SovBundle\Repository\Site\PageRepository;

/**
* @ORM\Entity(repositoryClass=PageRepository::class)
*/
class Page extends AbstractFullEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist", "remove"})
*/
private $image;

/**
* @ORM\ManyToMany(targetEntity=File::class, cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"position" = "ASC"})
*/
private $gallery;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist"})
*/
private $file;

public function __construct()
{
$this->gallery = new ArrayCollection();
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist", "remove"})
*/
private $image;

/**
* @ORM\ManyToMany(targetEntity=File::class, cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"position" = "ASC"})
*/
private $gallery;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist"})
*/
private $file;

public function __construct()
{
$this->gallery = new ArrayCollection();
}

public function __toString()
{
return $this->title;
}

public function getId(): ?int
{
return $this->id;
}

public function getImage(): ?File
{
return $this->image;
}

public function setImage(?File $image): self
{
$this->image = $image;

return $this;
}

/**
* @return Collection|File[]
*/
public function getGallery(): Collection
{
return $this->gallery;
}

public function addGallery(File $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}

public function __toString()
{
return $this->getTitle() ;
}

public function getId(): ?int
{
return $this->id;
}

public function getImage(): ?File
{
return $this->image;
}

public function setImage(?File $image): self
{
$this->image = $image;

return $this;
}
return $this;
}

/**
* @return Collection|File[]
*/
public function getGallery(): Collection
{
return $this->gallery;
}

public function addGallery(File $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}

return $this;
}
public function removeGallery(File $gallery): self
{
$this->gallery->removeElement($gallery);

public function removeGallery(File $gallery): self
{
$this->gallery->removeElement($gallery);
return $this;
}

return $this;
}

public function getFile(): ?File
{
return $this->file;
}
public function getFile(): ?File
{
return $this->file;
}

public function setFile(?File $file): self
{
$this->file = $file;
public function setFile(?File $file): self
{
$this->file = $file;

return $this;
}
return $this;
}

}

+ 25
- 0
src/Entity/Site/Site.php View File

@@ -0,0 +1,25 @@
<?php

namespace App\Entity\Site;

use Lc\SovBundle\Repository\Site\SiteRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Site\SiteModel;

/**
* @ORM\Entity(repositoryClass=SiteRepository::class)
*/
class Site extends SiteModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Ticket/Ticket.php View File

@@ -0,0 +1,25 @@
<?php


namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketModel;

/**
* @ORM\Entity(repositoryClass=TicketRepository::class)
*/
class Ticket extends TicketModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Ticket/TicketMessage.php View File

@@ -0,0 +1,25 @@
<?php


namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketMessageModel;

/**
* @ORM\Entity(repositoryClass=TicketMessageRepository::class)
*/
class TicketMessage extends TicketMessageModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 26
- 0
src/Entity/User/GroupUser.php View File

@@ -0,0 +1,26 @@
<?php


namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\GroupUserModel;

/**
* @ORM\Entity(repositoryClass=GroupUserRepository::class)
*/
class GroupUser extends GroupUserModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}

}

+ 15
- 11
src/Entity/User/User.php View File

@@ -3,7 +3,7 @@
namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\User as SovUserModel;
use Lc\SovBundle\Model\User\UserModel as SovUserModel;
use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

@@ -13,16 +13,20 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
*/
class User extends SovUserModel implements UserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
public function __toString()
{
return $this->firstname . " " . $this->lastname;
}

public function getId(): ?int
{
return $this->id;
}
}

+ 0
- 21
src/Repository/PageRepository.php View File

@@ -1,21 +0,0 @@
<?php

namespace App\Repository;

use App\Entity\Site\Page;
use Lc\SovBundle\Repository\AbstractRepository;

/**
* @method Page|null find($id, $lockMode = null, $lockVersion = null)
* @method Page|null findOneBy(array $criteria, array $orderBy = null)
* @method Page[] findAll()
* @method Page[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PageRepository extends AbstractRepository
{
public function getInterfaceClass()
{
return Page::class;
}

}

+ 88
- 0
symfony.lock View File

@@ -11,6 +11,19 @@
"composer/package-versions-deprecated": {
"version": "1.11.99.2"
},
"connectholland/cookie-consent-bundle": {
"version": "0.4",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "0.4",
"ref": "9725d24dc996a1041f25b9e29fc1567a861f98e4"
},
"files": [
"config/packages/ch_cookie_consent.yaml",
"config/routes/ch_cookie_consent.yaml"
]
},
"doctrine/annotations": {
"version": "1.0",
"recipe": {
@@ -91,6 +104,9 @@
"doctrine/sql-formatter": {
"version": "1.1.1"
},
"dompdf/dompdf": {
"version": "v1.1.0"
},
"easycorp/easyadmin-bundle": {
"version": "3.0",
"recipe": {
@@ -121,9 +137,27 @@
"gedmo/doctrine-extensions": {
"version": "v3.0.5"
},
"guzzlehttp/guzzle": {
"version": "7.4.0"
},
"guzzlehttp/promises": {
"version": "1.5.1"
},
"guzzlehttp/psr7": {
"version": "2.1.0"
},
"hamcrest/hamcrest-php": {
"version": "v2.0.1"
},
"imagine/imagine": {
"version": "1.2.4"
},
"knplabs/knp-components": {
"version": "v3.3.0"
},
"knplabs/knp-paginator-bundle": {
"version": "v5.7.0"
},
"laminas/laminas-code": {
"version": "4.3.0"
},
@@ -142,6 +176,27 @@
"ref": "5a5bdc2d0e2533ed6935d5ae562f2b318a8fc1ee"
}
},
"mailjet/mailjet-apiv3-php": {
"version": "v1.5.5"
},
"mailjet/mailjet-bundle": {
"version": "2.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.0",
"ref": "48a7f92015372654b5056855da5e94d54bd8d948"
},
"files": [
"config/packages/mailjet.yaml"
]
},
"mailjet/mailjet-swiftmailer": {
"version": "1.0.6"
},
"mockery/mockery": {
"version": "1.4.4"
},
"monolog/monolog": {
"version": "2.2.0"
},
@@ -151,6 +206,12 @@
"oomphinc/composer-installers-extender": {
"version": "2.0.0"
},
"phenx/php-font-lib": {
"version": "0.5.2"
},
"phenx/php-svg-lib": {
"version": "0.3.4"
},
"phpdocumentor/reflection-common": {
"version": "2.2.0"
},
@@ -169,12 +230,27 @@
"psr/event-dispatcher": {
"version": "1.0.0"
},
"psr/http-client": {
"version": "1.0.1"
},
"psr/http-factory": {
"version": "1.0.1"
},
"psr/http-message": {
"version": "1.0.1"
},
"psr/link": {
"version": "1.0.0"
},
"psr/log": {
"version": "1.1.4"
},
"ralouphie/getallheaders": {
"version": "3.0.3"
},
"sabberworm/php-css-parser": {
"version": "8.3.1"
},
"sensio/framework-extra-bundle": {
"version": "5.2",
"recipe": {
@@ -199,6 +275,9 @@
"config/packages/stof_doctrine_extensions.yaml"
]
},
"swiftmailer/swiftmailer": {
"version": "v5.4.12"
},
"symfony/asset": {
"version": "v5.2.7"
},
@@ -387,6 +466,9 @@
"symfony/orm-pack": {
"version": "v2.1.0"
},
"symfony/password-hasher": {
"version": "v5.3.8"
},
"symfony/phpunit-bridge": {
"version": "5.1",
"recipe": {
@@ -423,6 +505,9 @@
"symfony/polyfill-php80": {
"version": "v1.22.1"
},
"symfony/polyfill-php81": {
"version": "v1.23.0"
},
"symfony/polyfill-uuid": {
"version": "v1.22.1"
},
@@ -494,6 +579,9 @@
"symfony/string": {
"version": "v5.2.8"
},
"symfony/templating": {
"version": "v5.3.7"
},
"symfony/test-pack": {
"version": "v1.0.7"
},

+ 0
- 19
templates/base.html.twig View File

@@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome !{% endblock %}</title>
{# Run `composer require symfony/webpack-encore-bundle`
and uncomment the following Encore helpers to start using Symfony UX #}
{% block stylesheets %}
{# {{ encore_entry_link_tags('app') }} #}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}

{% block javascripts %}
{# {{ encore_entry_script_tags('app') }} #}
{% endblock %}
</body>
</html>

+ 58
- 0
templates/frontend/layout/base.html.twig View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>{% block title %}Pietro{% endblock %}</title>

{% block meta %}{% endblock %}
<link rel="icon" type="image/png" href="{{ asset('assets/img/favicon.png') }}"/>
{{ encore_entry_link_tags('app-frontend') }}
{% block stylesheets %}{% endblock %}
</head>
{% set current_path = app.request.get('_route') %}
<body id="{{ current_path }}">
{% for message in app.flashes('success') %}
<div class="alert alert-success">
{{ message }}
</div>
{% endfor %}
{% block header %}
{% include 'frontend/layout/header.html.twig' %}
{% endblock %}
<div id="content">
{% block body %}{% endblock %}
</div>
{% block footer %}
{% include 'frontend/layout/footer.html.twig' %}
{% endblock %}
{{ encore_entry_script_tags('app-frontend') }}
{% block javascripts %}{% endblock %}

{% if chcookieconsent_isCookieConsentSavedByUser() == false %}
{{ render_esi(path('ch_cookie_consent.show')) }}
{% endif %}

{% if chcookieconsent_isCategoryAllowedByUser('piwik') == true %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//statistiques.laclic.fr/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '5']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
{% endif %}

</body>
</html>

+ 5
- 0
templates/frontend/layout/footer.html.twig View File

@@ -0,0 +1,5 @@
<footer>
<div class="bar-footer">
© 2021 par Pietro | Création <a href="https://www.laclic.fr/" title="La Clic !" target="_blank">LA CLIC !</a>
</div>
</footer>

+ 3
- 0
templates/frontend/layout/header.html.twig View File

@@ -0,0 +1,3 @@
<header>

</header>

+ 17
- 0
templates/frontend/layout/macro.html.twig View File

@@ -0,0 +1,17 @@
{% macro email_contact(text, subject) %}
{# rot13 : https://rot13.com/ #}
<script>
{% if text is empty %}
var text = "ntve@ynpbbcrengvirqrfpvgblraf.se";
{% else %}
var text = "{{ text|rot13 }}";
{% endif %}
var subject = "";
{% if subject is not empty %}
var subject = "?fhowrpg={{ subject|rot13 }}";
{% endif %}
document.write(("<n uers=\"znvygb:ntve@ynpbbcrengvirqrfpvgblraf.se" + subject + "\" ery=\"absbyybj\">" + text + "</n>").replace(/[a-zA-Z]/g, function (c) {
return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
}));
</script>
{% endmacro %}

+ 12
- 0
templates/frontend/site/home.html.twig View File

@@ -0,0 +1,12 @@
{% extends 'frontend/layout/base.html.twig' %}

{% block title %}Pietro Home{% endblock %}

{% block meta %}
<meta name="title" content=""/>
<meta name="description" content=""/>
{% endblock %}

{% block body %}
<h1>Hello Pietro</h1>
{% endblock %}

+ 0
- 17
templates/index.html.twig View File

@@ -1,17 +0,0 @@
{% extends 'base.html.twig' %}

{% block body %}
<h1>SovSkeleton</h1>
<ul>
{% for page in pages %}
<li>
<h2>{{ page.title }}</h2>
{% if page.gallery is defined %}
{% for image in page.gallery %}
<img src="{{ lc_liip(image.path, 'thumbnail') }}" alt="{{ image.legend }}" />
{% endfor %}
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock body %}

+ 29
- 0
translations/CHCookieConsentBundle.fr.yml View File

@@ -0,0 +1,29 @@
ch_cookie_consent:
title: 'Cookies'
intro: "Un cookie est un fichier texte qui enregistre des informations concernant votre navigation sur ce site internet. Nous en utilisons notamment pour réaliser des statistiques de visite."
read_more: 'En savoir plus'
analytics:
title: 'Google Analytics'
description: "Analyse d'audience du site web"
tracking:
title: 'Do you want tracking cookies?'
description: ''
marketing:
title: 'Do you want personalised ads?'
description: ''
social_media:
title: 'Do you want social media cookies?'
description: ''
site:
title: 'Site'
description: 'Fonctionnement du site'
piwik:
title: 'Piwik'
description: 'Statistiques du site'
no: 'Non'
yes: 'Oui'
save: 'Sauvegarder'
use_only_functional_cookies: 'Only use functional cookies'
use_all_cookies: 'Allow all cookies'
show_details: 'Show details'
hide_details: 'Hide details'

+ 25
- 4
webpack.config.js View File

@@ -19,12 +19,17 @@ Encore
.addAliases({
'core-js': path.join(__dirname, 'node_modules/core-js'),
'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery'),
'jquery-ui': path.join(__dirname, 'node_modules/jquery-ui-dist/jquery-ui'),
'jquery-ui-sortable': path.join(__dirname, 'node_modules/jquery-ui-sortable/jquery-ui.min.js'),
'adminlte-js': path.join(__dirname, 'node_modules/admin-lte/dist/js/adminlte.min.js'),
'adminlte-css': path.join(__dirname, 'node_modules/admin-lte/build/scss/adminlte.scss'),
'fontawesome-css': path.join(__dirname, 'node_modules/admin-lte/plugins/fontawesome-free/css/all.css'),
'adminlte-plugin': path.join(__dirname, 'node_modules/admin-lte/plugins/'),
'bootstrap': path.join(__dirname, 'node_modules/bootstrap/'),
'bootstrap-autocomplete': path.join(__dirname, 'node_modules/bootstrap-autocomplete/dist/latest/bootstrap-autocomplete.min.js'),
'select2': path.join(__dirname, 'node_modules/select2/dist/'),
'select2-bootstrap-theme': path.join(__dirname, 'node_modules/@ttskch/select2-bootstrap4-theme/dist/select2-bootstrap4.css'),
'toastr': path.join(__dirname, 'node_modules/toastr'),
'daterangepicker': path.join(__dirname, 'node_modules/bootstrap-daterangepicker'),
'moment': path.join(__dirname, 'node_modules/moment/dist/moment.js'),

/*'adminlte': path.resolve(__dirname, './node_modules/admin-lte/dist/js/adminlte.min.js'),
'adminltePlugin': path.resolve(__dirname, './node_modules/admin-lte/plugins/'),
@@ -42,12 +47,17 @@ Encore
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry('adminlte-common', './Lc/SovBundle/Resources/assets/app/adminlte/common/app.common.js')
.addEntry('adminlte-plugins', './Lc/SovBundle/Resources/assets/app/adminlte/plugins/app.plugins.js')
.addEntry('adminlte-index', './Lc/SovBundle/Resources/assets/app/adminlte/index/app.index.js')
.addEntry('adminlte-form', './Lc/SovBundle/Resources/assets/app/adminlte/form/app.form.js')
.addEntry('adminlte-sort', './Lc/SovBundle/Resources/assets/app/adminlte/sort/app.sort.js')
.addEntry('adminlte-field-filemanager', './Lc/SovBundle/Resources/assets/app/adminlte/field/filemanager/app.filemanager.js')
.addEntry('adminlte-field-collection', './Lc/SovBundle/Resources/assets/app/adminlte/field/collection/app.collection.js')
.addEntry('adminlte-main', './Lc/SovBundle/Resources/assets/app/adminlte/main/app.main.js')
.addEntry('sov-reminder', './Lc/SovBundle/Resources/assets/app/admin/reminder/app.reminder.js')
.addEntry('sov-ticket', './Lc/SovBundle/Resources/assets/app/admin/ticket/app.ticket.js')
.addEntry('app-backend', './assets/app/backend/common/app.common.js')
.addEntry('app-frontend', './assets/app/frontend/app/app.common.js')

// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
.enableStimulusBridge('./assets/controllers.json')
@@ -70,7 +80,8 @@ Encore
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
.enableVersioning()
// .enableVersioning(Encore.isProduction())

.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
@@ -82,6 +93,16 @@ Encore
config.corejs = 3;
})

//ckeditor config
.copyFiles([
{from: './node_modules/ckeditor/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
{from: './node_modules/ckeditor/adapters', to: 'ckeditor/adapters/[path][name].[ext]'},
{from: './node_modules/ckeditor/lang', to: 'ckeditor/lang/[path][name].[ext]'},
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'},
{from: './node_modules/ckeditor/vendor', to: 'ckeditor/vendor/[path][name].[ext]'}
])


// enables Sass/SCSS support
//.enableSassLoader()

Loading…
Cancel
Save