Home page (empty except “home”)
+ Add AssertMapper (“import”) + Load bootstrap (SASS) and popper + Base twig templatemaster
parent
20b0f9669d
commit
af44fc426b
@ -0,0 +1,6 @@
|
|||||||
|
//region CSS
|
||||||
|
import './styles/app.scss';
|
||||||
|
//endregion
|
||||||
|
//region Bootstrap
|
||||||
|
import 'bootstrap';
|
||||||
|
//endregion
|
@ -0,0 +1,76 @@
|
|||||||
|
//region Fonctions de base de Bootstrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/functions';
|
||||||
|
//endregion
|
||||||
|
//region Color theme
|
||||||
|
//$primary : rgb(0, 0, 0);
|
||||||
|
//$secondary : rgb(102, 102, 102);
|
||||||
|
|
||||||
|
$alert-padding-y : 0.25rem;
|
||||||
|
$alert-padding-x : 0.25rem;
|
||||||
|
$alert-margin-bottom : 0.5rem;
|
||||||
|
//endregion
|
||||||
|
//region Autres variables Bootstrap
|
||||||
|
$enable-rounded : false;
|
||||||
|
$nav-link-padding-y : 0;
|
||||||
|
|
||||||
|
$box-shadow : 0px 3px 15px 0 rgba(0, 0, 0, .8);
|
||||||
|
//endregion
|
||||||
|
//region Les autres variables de Boostrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/variables';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/variables-dark';
|
||||||
|
//endregion
|
||||||
|
//region Maps personnalisés
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
//region Reste de la configuration de Bootstrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/maps';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/mixins';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/utilities';
|
||||||
|
//endregion
|
||||||
|
//region Layout & components de Bootstrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/root';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/reboot';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/type';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/images';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/containers';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/grid';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/tables';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/forms';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/buttons';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/transitions';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/dropdown';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/button-group';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/nav';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/navbar';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/card';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/accordion';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/breadcrumb';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/pagination';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/badge';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/alert';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/progress';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/list-group';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/close';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/toasts';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/modal';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/tooltip';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/popover';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/carousel';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/spinners';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/offcanvas';
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/placeholders';
|
||||||
|
//endregion
|
||||||
|
//region Helpers de Boostrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/helpers';
|
||||||
|
//endregion
|
||||||
|
//region API de Bootstrap
|
||||||
|
@import '../../vendor/twbs/bootstrap/scss/utilities/api';
|
||||||
|
//endregion
|
||||||
|
//region Classes complémentaires
|
||||||
|
.text-smallCaps {
|
||||||
|
font-variant : small-caps;
|
||||||
|
}
|
||||||
|
.text-overflow-ellipsis {
|
||||||
|
text-overflow : '…';
|
||||||
|
}
|
||||||
|
//endregion
|
@ -0,0 +1,3 @@
|
|||||||
|
#flashes {
|
||||||
|
font-size : 0.75rem;
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
@import 'bootstrap';
|
||||||
|
@import 'flahses';
|
@ -1,15 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
|
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
|
||||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||||
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
|
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
|
||||||
|
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
|
||||||
];
|
];
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
framework:
|
||||||
|
asset_mapper:
|
||||||
|
# The paths to make available to the asset mapper.
|
||||||
|
paths:
|
||||||
|
- assets/
|
||||||
|
excluded_patterns:
|
||||||
|
- '*/assets/styles/_*.scss'
|
||||||
|
- '*/assets/styles/**/_*.scss'
|
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the importmap for this application.
|
||||||
|
*
|
||||||
|
* - "path" is a path inside the asset mapper system. Use the
|
||||||
|
* "debug:asset-map" command to see the full list of paths.
|
||||||
|
*
|
||||||
|
* - "entrypoint" (JavaScript only) set to true for any module that will
|
||||||
|
* be used as an "entrypoint" (and passed to the importmap() Twig function).
|
||||||
|
*
|
||||||
|
* The "importmap:require" command can be used to add new entries to this file.
|
||||||
|
*/
|
||||||
|
return [
|
||||||
|
'app' => [
|
||||||
|
'path' => './assets/app.js',
|
||||||
|
'entrypoint' => true,
|
||||||
|
],
|
||||||
|
'bootstrap' => [
|
||||||
|
'version' => '5.3.3',
|
||||||
|
],
|
||||||
|
'@popperjs/core' => [
|
||||||
|
'version' => '2.11.8',
|
||||||
|
],
|
||||||
|
];
|
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controller for core page : home, etc.
|
||||||
|
*/
|
||||||
|
class CoreController extends AbstractController {
|
||||||
|
#[Route('/', name: 'core_main')]
|
||||||
|
public function main (): Response {
|
||||||
|
$this->addFlash('danger', 'This is a dangerous looking message');
|
||||||
|
$this->addFlash('success', 'All is fine !');
|
||||||
|
|
||||||
|
return $this->render('core/main.html.twig');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
{% block flashTag %}
|
||||||
|
<section id="flashes" class="d-flex flex-column">
|
||||||
|
{% endblock %}
|
||||||
|
{% for flashType, flashMessages in app.flashes %}
|
||||||
|
{% for flashMessage in flashMessages %}
|
||||||
|
<div class="alert alert-{{ flashType }} alert-dismissible fade show" role="{{ flashType }}">
|
||||||
|
{{ flashMessage }}
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
</section>
|
@ -1,19 +1,63 @@
|
|||||||
<!DOCTYPE html>
|
{% extends "/html.html.twig" %}
|
||||||
<html>
|
|
||||||
<head>
|
{% block headContent %}
|
||||||
<meta charset="UTF-8">
|
{% block headContentMeta %}
|
||||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
<meta charset="utf-8">
|
||||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
|
{% endblock %}
|
||||||
{% block stylesheets %}
|
|
||||||
{{ encore_entry_link_tags('app') }}
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
|
||||||
|
{% block CSS %}{% endblock %}
|
||||||
|
|
||||||
|
{% block JS_head %}{% endblock %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block bodyTag %}
|
||||||
|
<body id="page-{{ app.current_route }}">
|
||||||
|
{% endblock %}
|
||||||
|
{% block bodyContent %}
|
||||||
|
{% block headerTag %}
|
||||||
|
<header>
|
||||||
|
{% endblock %}
|
||||||
|
{% block headerContent %}{% endblock %}
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{% block divBodyTag %}
|
||||||
|
<div id="div-body" class="d-flex flex-row">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block asideLeft %}{% endblock %}
|
||||||
|
|
||||||
|
{% block centerDivBodyTag %}
|
||||||
|
<div id="div-body-center" class="d-flex flex-column flex-grow-1">
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sectionTop %}{% endblock %}
|
||||||
|
|
||||||
|
{% include '/_flashes.html.twig' %}
|
||||||
|
|
||||||
|
{% block sectionBefore %}{% endblock %}
|
||||||
|
{% block mainTag %}
|
||||||
|
<main>
|
||||||
|
{% endblock %}
|
||||||
|
{% block mainContent %}{% endblock %}
|
||||||
|
</main>
|
||||||
|
{% block sectionAfter %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
{% block asideRight %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% block footerTag %}
|
||||||
|
<footer>
|
||||||
|
{% endblock %}
|
||||||
|
{% block footerContent %}{% endblock %}
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<div class="d-none">
|
||||||
|
{% block bodyHidden %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% block javascripts %}
|
{% block JS %}
|
||||||
{{ encore_entry_script_tags('app') }}
|
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
{% endblock %}
|
||||||
<body>
|
|
||||||
{% block body %}{% endblock %}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{% extends '/base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Home{% endblock %}
|
||||||
|
|
||||||
|
{% block mainContent %}
|
||||||
|
Home
|
||||||
|
{% endblock %}
|
@ -0,0 +1,21 @@
|
|||||||
|
{% extends "/root.twig" %}
|
||||||
|
|
||||||
|
{% block pageContent %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
{% block htmlTag %}
|
||||||
|
<html lang="{{ app.request.getLocale() }}">
|
||||||
|
{% endblock %}
|
||||||
|
{% block headTag %}
|
||||||
|
<!--suppress HtmlRequiredTitleElement -->
|
||||||
|
<head>
|
||||||
|
{% endblock %}
|
||||||
|
{% block headContent %}{% endblock %}
|
||||||
|
</head>
|
||||||
|
{% block bodyTag %}
|
||||||
|
<body>
|
||||||
|
{% endblock %}
|
||||||
|
{% block bodyContent %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{% endblock %}
|
@ -0,0 +1 @@
|
|||||||
|
{% block pageContent %}{% endblock %}
|
Loading…
Reference in New Issue