Simplified
This commit is contained in:
@@ -109,68 +109,67 @@ class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template
|
||||
|
||||
<p>
|
||||
<label for=\"editor\">Contenu<br>
|
||||
<textarea id=\"editor\" name=\"content\" rows=\"6\" required>";
|
||||
// line 31
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "content", [], "any", true, true, false, 31)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "content", [], "any", false, false, false, 31), "")) : ("")), "html", null, true);
|
||||
yield "</textarea>
|
||||
";
|
||||
// line 32
|
||||
yield " <textarea id=\"editor\" name=\"content\" rows=\"6\" required></textarea>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button type=\"submit\" class=\"btn btn-primary\">
|
||||
";
|
||||
// line 37
|
||||
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 37) > 0))) {
|
||||
// line 38
|
||||
// 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 40
|
||||
// line 41
|
||||
yield " Enregistrer
|
||||
";
|
||||
}
|
||||
// line 42
|
||||
// line 43
|
||||
yield " </button>
|
||||
<a href=\"/admin\" class=\"btn btn-secondary\">Annuler</a>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
";
|
||||
// line 47
|
||||
if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 47) > 0))) {
|
||||
// line 48
|
||||
// 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 50
|
||||
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, 50), "d/m/Y à H:i"), "html", null, true);
|
||||
// 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 51
|
||||
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, 51), "d/m/Y à H:i"), "html", null, true);
|
||||
// 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 54
|
||||
// line 55
|
||||
yield "
|
||||
";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
// line 57
|
||||
// line 58
|
||||
/**
|
||||
* @return iterable<null|scalar|\Stringable>
|
||||
*/
|
||||
public function block_scripts(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 58
|
||||
// line 59
|
||||
yield "<script src=\"/js/tinymce/tinymce.min.js\" referrerpolicy=\"origin\" crossorigin=\"anonymous\"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#editor',
|
||||
base_url: '/js/tinymce', // assure le bon chemin relatif
|
||||
base_url: '/js/tinymce',
|
||||
license_key: 'gpl',
|
||||
height: 400,
|
||||
menubar: false,
|
||||
@@ -189,6 +188,11 @@ class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template
|
||||
].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 [];
|
||||
@@ -215,7 +219,7 @@ class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 169 => 58, 162 => 57, 156 => 54, 150 => 51, 146 => 50, 142 => 48, 140 => 47, 133 => 42, 129 => 40, 125 => 38, 123 => 37, 114 => 31, 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,);
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user