337 lines
16 KiB
PHP
337 lines
16 KiB
PHP
<?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;
|
|
|
|
/* auth/views/profile.twig */
|
|
class __TwigTemplate_38fbd01991f543704d0382773ae4f2a0 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 "layouts/dashboard.twig";
|
|
}
|
|
|
|
protected function doDisplay(array $context, array $blocks = []): iterable
|
|
{
|
|
$macros = $this->macros;
|
|
$this->parent = $this->load("layouts/dashboard.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;
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.profile_title"), "html", null, true);
|
|
yield " - ";
|
|
yield from [];
|
|
}
|
|
|
|
// line 5
|
|
/**
|
|
* @return iterable<null|scalar|\Stringable>
|
|
*/
|
|
public function block_content(array $context, array $blocks = []): iterable
|
|
{
|
|
$macros = $this->macros;
|
|
// line 6
|
|
yield "<div class=\"row\">
|
|
<div class=\"col-lg-8\">
|
|
<div class=\"card shadow\">
|
|
<div class=\"card-header\">
|
|
<h3 class=\"card-title\">";
|
|
// line 10
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.profile_title"), "html", null, true);
|
|
yield "</h3>
|
|
</div>
|
|
<div class=\"card-body\">
|
|
";
|
|
// line 13
|
|
if ((($tmp = ($context["success"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
|
|
// line 14
|
|
yield " <div class=\"alert alert-success\" role=\"alert\">
|
|
";
|
|
// line 15
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.profile_updated"), "html", null, true);
|
|
yield "
|
|
</div>
|
|
";
|
|
}
|
|
// line 18
|
|
yield "
|
|
";
|
|
// line 19
|
|
if ((($tmp = ($context["error"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
|
|
// line 20
|
|
yield " <div class=\"alert alert-danger\" role=\"alert\">
|
|
";
|
|
// line 21
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["error"] ?? null), "html", null, true);
|
|
yield "
|
|
</div>
|
|
";
|
|
}
|
|
// line 24
|
|
yield "
|
|
<form method=\"POST\" action=\"";
|
|
// line 25
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("profile"), "html", null, true);
|
|
yield "\" enctype=\"multipart/form-data\">
|
|
";
|
|
// line 26
|
|
yield $this->env->getFunction('csrf_field')->getCallable()();
|
|
yield "
|
|
|
|
<div class=\"row\">
|
|
<div class=\"col-md-6 mb-3\">
|
|
<label for=\"name\" class=\"form-label\">";
|
|
// line 30
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.name"), "html", null, true);
|
|
yield "</label>
|
|
<input type=\"text\" class=\"form-control\" id=\"name\" name=\"name\" value=\"";
|
|
// line 31
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "name", [], "any", false, false, false, 31), "html", null, true);
|
|
yield "\" required>
|
|
</div>
|
|
|
|
<div class=\"col-md-6 mb-3\">
|
|
<label for=\"email\" class=\"form-label\">";
|
|
// line 35
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.email"), "html", null, true);
|
|
yield "</label>
|
|
<input type=\"email\" class=\"form-control\" id=\"email\" name=\"email\" value=\"";
|
|
// line 36
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "email", [], "any", false, false, false, 36), "html", null, true);
|
|
yield "\" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=\"row\">
|
|
<div class=\"col-md-6 mb-3\">
|
|
<label for=\"phone\" class=\"form-label\">";
|
|
// line 42
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.phone"), "html", null, true);
|
|
yield "</label>
|
|
<input type=\"text\" class=\"form-control\" id=\"phone\" name=\"phone\" value=\"";
|
|
// line 43
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "phone", [], "any", false, false, false, 43), "html", null, true);
|
|
yield "\">
|
|
</div>
|
|
|
|
<div class=\"col-md-12 mb-3\">
|
|
<label for=\"bio\" class=\"form-label\">";
|
|
// line 47
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.bio"), "html", null, true);
|
|
yield "</label>
|
|
<textarea class=\"form-control\" id=\"bio\" name=\"bio\" rows=\"4\">";
|
|
// line 48
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "bio", [], "any", false, false, false, 48), "html", null, true);
|
|
yield "</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=\"row\">
|
|
<div class=\"col-md-6 mb-3\">
|
|
<label for=\"avatar\" class=\"form-label\">";
|
|
// line 54
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.avatar"), "html", null, true);
|
|
yield "</label>
|
|
<input type=\"file\" class=\"form-control\" id=\"avatar\" name=\"avatar\" accept=\"image/*\">
|
|
<div id=\"avatarPreview\" class=\"mt-2\"></div>
|
|
";
|
|
// line 57
|
|
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "avatar", [], "any", false, false, false, 57)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
|
|
// line 58
|
|
yield " <div class=\"mt-2\">
|
|
<small class=\"form-text text-muted\">";
|
|
// line 59
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.current_avatar"), "html", null, true);
|
|
yield ":</small>
|
|
<img src=\"";
|
|
// line 60
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["user"] ?? null), "avatar_url", [], "any", false, false, false, 60), "html", null, true);
|
|
yield "\" alt=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.current_avatar"), "html", null, true);
|
|
yield "\" class=\"img-thumbnail\" style=\"max-width: 100px;\">
|
|
</div>
|
|
";
|
|
}
|
|
// line 63
|
|
yield " </div>
|
|
|
|
<div class=\"col-md-6 mb-3\" x-data=\"{ show: false }\">
|
|
<label for=\"current_password\" class=\"form-label\">";
|
|
// line 66
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.current_password"), "html", null, true);
|
|
yield "</label>
|
|
<div class=\"input-group\">
|
|
<input :type=\"show ? 'text' : 'password'\" class=\"form-control\" id=\"current_password\" name=\"current_password\" placeholder=\"";
|
|
// line 68
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.current_password_placeholder"), "html", null, true);
|
|
yield "\" autocomplete=\"new-password\" value=\"\">
|
|
<button class=\"btn btn-outline-secondary\" type=\"button\" @click=\"show = !show\">
|
|
<i :class=\"show ? 'bi bi-eye-slash' : 'bi bi-eye'\"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=\"row\">
|
|
<div class=\"col-md-6 mb-3\" x-data=\"{ show: false }\">
|
|
<label for=\"password\" class=\"form-label\">";
|
|
// line 78
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.new_password"), "html", null, true);
|
|
yield "</label>
|
|
<div class=\"input-group\">
|
|
<input :type=\"show ? 'text' : 'password'\" class=\"form-control\" id=\"password\" name=\"password\" placeholder=\"";
|
|
// line 80
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.new_password_placeholder"), "html", null, true);
|
|
yield "\" autocomplete=\"new-password\" value=\"\">
|
|
<button class=\"btn btn-outline-secondary\" type=\"button\" @click=\"show = !show\">
|
|
<i :class=\"show ? 'bi bi-eye-slash' : 'bi bi-eye'\"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=\"col-md-6 mb-3\" x-data=\"{ show: false }\">
|
|
<label for=\"password_confirmation\" class=\"form-label\">";
|
|
// line 88
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.password_confirmation"), "html", null, true);
|
|
yield "</label>
|
|
<div class=\"input-group\">
|
|
<input :type=\"show ? 'text' : 'password'\" class=\"form-control\" id=\"password_confirmation\" name=\"password_confirmation\" placeholder=\"";
|
|
// line 90
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.password_confirmation_placeholder"), "html", null, true);
|
|
yield "\" autocomplete=\"new-password\" value=\"\">
|
|
<button class=\"btn btn-outline-secondary\" type=\"button\" @click=\"show = !show\">
|
|
<i :class=\"show ? 'bi bi-eye-slash' : 'bi bi-eye'\"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=\"row\">
|
|
<div class=\"col-12\">
|
|
<button type=\"submit\" class=\"btn btn-primary\">";
|
|
// line 100
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.update_profile"), "html", null, true);
|
|
yield "</button>
|
|
<a href=\"";
|
|
// line 101
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("dashboard"), "html", null, true);
|
|
yield "\" class=\"btn btn-secondary\">";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.cancel"), "html", null, true);
|
|
yield "</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
";
|
|
yield from [];
|
|
}
|
|
|
|
// line 111
|
|
/**
|
|
* @return iterable<null|scalar|\Stringable>
|
|
*/
|
|
public function block_scripts(array $context, array $blocks = []): iterable
|
|
{
|
|
$macros = $this->macros;
|
|
// line 112
|
|
yield "<script>
|
|
// Preview avatar before upload
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const avatarInput = document.getElementById('avatar');
|
|
const avatarPreview = document.getElementById('avatarPreview');
|
|
|
|
if (avatarInput && avatarPreview) {
|
|
avatarInput.addEventListener('change', function(e) {
|
|
const file = e.target.files[0];
|
|
|
|
if (file && file.type.startsWith('image/')) {
|
|
const reader = new FileReader();
|
|
|
|
reader.onload = function(e) {
|
|
avatarPreview.innerHTML = `<img src=\"\${e.target.result}\" alt=\"";
|
|
// line 126
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("auth.preview"), "html", null, true);
|
|
yield "\" class=\"img-thumbnail\" style=\"max-width: 200px;\">`;
|
|
};
|
|
|
|
reader.readAsDataURL(file);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
";
|
|
yield from [];
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function getTemplateName(): string
|
|
{
|
|
return "auth/views/profile.twig";
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function isTraitable(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function getDebugInfo(): array
|
|
{
|
|
return array ( 294 => 126, 278 => 112, 271 => 111, 255 => 101, 251 => 100, 238 => 90, 233 => 88, 222 => 80, 217 => 78, 204 => 68, 199 => 66, 194 => 63, 186 => 60, 182 => 59, 179 => 58, 177 => 57, 171 => 54, 162 => 48, 158 => 47, 151 => 43, 147 => 42, 138 => 36, 134 => 35, 127 => 31, 123 => 30, 116 => 26, 112 => 25, 109 => 24, 103 => 21, 100 => 20, 98 => 19, 95 => 18, 89 => 15, 86 => 14, 84 => 13, 78 => 10, 72 => 6, 65 => 5, 53 => 3, 42 => 1,);
|
|
}
|
|
|
|
public function getSourceContext(): Source
|
|
{
|
|
return new Source("", "auth/views/profile.twig", "/app/modules/auth/views/profile.twig");
|
|
}
|
|
}
|