svg
This commit is contained in:
parent
1289b22a93
commit
0729b81d06
|
@ -3,6 +3,7 @@ import './bootstrap.js';
|
|||
// jQuery
|
||||
import $ from 'jquery';
|
||||
window.$ = $;
|
||||
window.jQuery = $;
|
||||
|
||||
// Bootstrap
|
||||
import 'bootstrap'
|
||||
|
|
|
@ -56,8 +56,9 @@ class InitCommand extends Command
|
|||
$user->setUsername("admin");
|
||||
$user->setPassword($hashedPassword);
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
}
|
||||
$user->setRoles(["ROLE_ADMIN"]);
|
||||
$this->em->flush();
|
||||
|
||||
// Création d'un company par defaut
|
||||
$io->text("> Création d'un company par defaut");
|
||||
|
|
|
@ -12,7 +12,8 @@ class HomeController extends AbstractController
|
|||
public function index(): Response
|
||||
{
|
||||
return $this->render('home/index.html.twig', [
|
||||
'controller_name' => 'HomeController',
|
||||
'usemenu' => true,
|
||||
'usesidebar' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,87 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<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><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
{% block stylesheets %}
|
||||
{% endblock %}
|
||||
<title>{{appName}}{% block title %}{% endblock %}</title>
|
||||
<link rel="icon" href="">
|
||||
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height:100%
|
||||
}
|
||||
|
||||
body {
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
main {
|
||||
display:flex;
|
||||
flex-grow:1;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
sidebar {
|
||||
width:300px;
|
||||
padding:15px;
|
||||
background-color:rgba(var(--bs-dark-rgb));
|
||||
display: flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
|
||||
sidebar div {
|
||||
display: flex;
|
||||
flex-direction:column;
|
||||
border-bottom:1px solid var(--bs-body-color);
|
||||
padding-bottom:10px;
|
||||
}
|
||||
|
||||
sidebar a {
|
||||
text-decoration: none;
|
||||
color: var(--bs-body-color);;
|
||||
opacity:0.6;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
sidebar a:hover {
|
||||
text-decoration: none;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
content {
|
||||
flex-grow:1;
|
||||
align-items: stretch;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
sidebar {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
sidebar i {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
sidebar span {
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom:5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark">
|
||||
{% if usemenu is defined and usemenu %}
|
||||
<nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
|
||||
<a class="navbar-brand" href="#"><img src="{{asset("medias/logo/logo.png")}}"> {{appName}}</a>
|
||||
|
@ -47,13 +117,44 @@
|
|||
</div>
|
||||
|
||||
<div class="navbar-nav ms-auto ps-3 d-flex flex-row position-absolute" style="right: 15px; top:15px">
|
||||
<a class="nav-link px-2" href="#"><i class="fa-solid fa-user fa-2x"></i></a>
|
||||
{% if app.user %}
|
||||
<a class="nav-link px-2" href="{{path('app_logout')}}"><i class="fa-solid fa-right-from-bracket fa-2x"></i></a>
|
||||
{% else %}
|
||||
<a class="nav-link px-2" href="{{path('app_login')}}"><i class="fa-solid fa-right-to-bracket fa-2x"></i></a>
|
||||
{% endif %}
|
||||
<a class="navbar-toggler nav-link px-2" href="#" data-bs-toggle="collapse" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"><i class="fa-solid fa-bars fa-2x"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
<main>
|
||||
{% if usesidebar is defined and usesidebar %}
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<sidebar>
|
||||
<div>
|
||||
<span>GENERALE</span>
|
||||
<a href="" title="Configurations">
|
||||
<i class="fas fa-cog fa-fw"></i>
|
||||
<span>Configurations</span>
|
||||
</a>
|
||||
|
||||
<a href="" title="Utilisateurs">
|
||||
<i class="fas fa-user fa-fw"></i>
|
||||
<span>Utilisateurs</span>
|
||||
</a>
|
||||
</div>
|
||||
</sidebar>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<content>
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</content>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
{% block localscript %}
|
||||
{% endblock %}
|
||||
</html>
|
||||
|
|
|
@ -3,18 +3,5 @@
|
|||
{% block title %}Hello HomeController!{% 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>/home/afornerot/cadoles/nine-project/ninecompta/src/Controller/HomeController.php</code></li>
|
||||
<li>Your template at <code>/home/afornerot/cadoles/nine-project/ninecompta/templates/home/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
Pouet
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,41 +1,46 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% 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 %}
|
||||
<img src="{{asset("/medias/logo/logo.png")}}" style="margin: 15px auto 15px auto; width:100px; display:block;">
|
||||
<center style="font-size:200%;margin-bottom:30px;">{{appName}}</center>
|
||||
<div class="card card-body m-auto" style="width:300px">
|
||||
{% 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.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
|
||||
{% if app.user %}
|
||||
<div class="mb-3">
|
||||
Vous êtes déjà connecté avec le login {{ app.user.userIdentifier }} = <a href="{{ path('app_logout') }}">Logout</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username">Login</label>
|
||||
<input class="form-control" type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
||||
<label for="username">Username</label>
|
||||
<input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="_password" id="password" 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">
|
||||
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||
<label for="_remember_me">Remember me</label>
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input class="form-control" type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||
</div>
|
||||
#}
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
Sign in
|
||||
</button>
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
Valider
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#password").focus();
|
||||
console.log('DOM ready');
|
||||
console.log($); // Vérifiez ici que $ est bien défini
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue