Minor changes

This commit is contained in:
julien
2026-03-09 14:50:52 +01:00
parent baaa190f66
commit 50831ea83a
4 changed files with 0 additions and 543 deletions

View File

@@ -1,72 +0,0 @@
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* partials/_header.twig */
class __TwigTemplate_722bfa8935490dbfa02149909963bc2e extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 1
yield "<header>
<h1>
<a href=\"/\">Mon Blog</a> |
<a href=\"/admin\">Admin</a>
</h1>
</header>
";
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "partials/_header.twig";
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "partials/_header.twig", "/home/julien/Documents/Git/julien/blog-slim/views/partials/_header.twig");
}
}

View File

@@ -1,84 +0,0 @@
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* partials/_footer.twig */
class __TwigTemplate_f24e585e1ab9b18bf721f5ade85d5894 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 1
yield "<footer class=\"site-footer\">
<p>&copy; ";
// line 2
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("now", "Y"), "html", null, true);
yield " Mon Blog Tous droits réservés.</p>
<nav>
<a href=\"\">À propos</a> |
<a href=\"\">Contact</a>
</nav>
</footer>
";
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "partials/_footer.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 45 => 2, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "partials/_footer.twig", "/home/julien/Documents/Git/julien/blog-slim/views/partials/_footer.twig");
}
}

View File

@@ -1,158 +0,0 @@
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* layout.twig */
class __TwigTemplate_589a65738a57deabe1e7c4440aeb0288 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
'scripts' => [$this, 'block_scripts'],
];
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 1
yield "<!DOCTYPE html>
<html lang=\"fr\">
<head>
<meta charset=\"UTF-8\">
<title>";
// line 5
yield from $this->unwrap()->yieldBlock('title', $context, $blocks);
yield "</title>
";
// line 7
yield " <style>
body {font-family: Arial, sans-serif; margin: 2rem;}
.post {border-bottom: 1px solid #ccc; padding: 1rem 0;}
.admin-actions a,
.admin-actions form {margin-right: .5rem;}
</style>
</head>
<body>
";
// line 17
yield " ";
yield from $this->load("partials/_header.twig", 17)->unwrap()->yield($context);
// line 18
yield "
";
// line 20
yield " <main>
";
// line 21
yield from $this->unwrap()->yieldBlock('content', $context, $blocks);
// line 22
yield " </main>
";
// line 25
yield " ";
yield from $this->load("partials/_footer.twig", 25)->unwrap()->yield($context);
// line 26
yield "
";
// line 28
yield " ";
// line 29
yield " ";
yield from $this->unwrap()->yieldBlock('scripts', $context, $blocks);
// line 30
yield "</body>
</html>
";
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
yield "Mon Blog";
yield from [];
}
// line 21
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
yield from [];
}
// line 29
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_scripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "layout.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 121 => 29, 111 => 21, 100 => 5, 92 => 30, 89 => 29, 87 => 28, 84 => 26, 81 => 25, 77 => 22, 75 => 21, 72 => 20, 69 => 18, 66 => 17, 55 => 7, 51 => 5, 45 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "layout.twig", "/home/julien/Documents/Git/julien/blog-slim/views/layout.twig");
}
}

View File

@@ -1,229 +0,0 @@
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* pages/post_form.twig */
class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
'scripts' => [$this, 'block_scripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "layout.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$this->parent = $this->load("layout.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 4
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 4) > 0))) {
// line 5
yield "Éditer l'article
";
} else {
// line 7
yield "Créer un article
";
}
yield from [];
}
// line 11
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 12
yield "
<h2>
";
// line 14
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 14) > 0))) {
// line 15
yield " Éditer l'article
";
} else {
// line 17
yield " Créer un article
";
}
// line 19
yield "</h2>
";
// line 22
yield "<form id=\"articleForm\" method=\"post\" action=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["action"] ?? null), "html", null, true);
yield "\">
<p>
<label for=\"title\">Titre<br>
<input type=\"text\" id=\"title\" name=\"title\" value=\"";
// line 25
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "title", [], "any", true, true, false, 25)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "title", [], "any", false, false, false, 25), "")) : ("")), "html", null, true);
yield "\" required maxlength=\"255\">
</label>
</p>
<p>
<label for=\"editor\">Contenu<br>
";
// line 32
yield " <textarea id=\"editor\" name=\"content\" rows=\"6\" required></textarea>
</label>
</p>
<p>
<button type=\"submit\" class=\"btn btn-primary\">
";
// line 38
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 38) > 0))) {
// line 39
yield " Mettre à jour
";
} else {
// line 41
yield " Enregistrer
";
}
// line 43
yield " </button>
<a href=\"/admin\" class=\"btn btn-secondary\">Annuler</a>
</p>
</form>
";
// line 48
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 48) > 0))) {
// line 49
yield "<hr>
<small>
Créé le : ";
// line 51
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "createdAt", [], "any", false, false, false, 51), "d/m/Y à H:i"), "html", null, true);
yield "<br>
Modifié le : ";
// line 52
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "updatedAt", [], "any", false, false, false, 52), "d/m/Y à H:i"), "html", null, true);
yield "
</small>
";
}
// line 55
yield "
";
yield from [];
}
// line 58
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_scripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 59
yield "<script src=\"/js/tinymce/tinymce.min.js\" referrerpolicy=\"origin\" crossorigin=\"anonymous\"></script>
<script>
tinymce.init({
selector: '#editor',
base_url: '/js/tinymce',
license_key: 'gpl',
height: 400,
menubar: false,
plugins: [
'advlist', 'autolink', 'lists', 'link', 'image',
'charmap', 'preview', 'anchor', 'searchreplace',
'visualblocks', 'code', 'fullscreen',
'insertdatetime', 'media', 'table',
'help', 'wordcount'
],
toolbar: [
'undo redo | formatselect | bold italic underline |',
'alignleft aligncenter alignright alignjustify |',
'bullist numlist outdent indent | link image media |',
'removeformat | help'
].join(' '),
content_style: 'body {font-family:Helvetica,Arial,sans-serif;font-size:14px}'
});
// Synchroniser TinyMCE avant soumission du formulaire
document.getElementById('articleForm').addEventListener('submit', function (e) {
tinymce.triggerSave();
});
</script>
";
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "pages/post_form.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 168 => 59, 161 => 58, 155 => 55, 149 => 52, 145 => 51, 141 => 49, 139 => 48, 132 => 43, 128 => 41, 124 => 39, 122 => 38, 114 => 32, 105 => 25, 98 => 22, 94 => 19, 90 => 17, 86 => 15, 84 => 14, 80 => 12, 73 => 11, 66 => 7, 62 => 5, 60 => 4, 53 => 3, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "pages/post_form.twig", "/home/julien/Documents/Git/julien/blog-slim/views/pages/post_form.twig");
}
}