301 lines
15 KiB
PHP
301 lines
15 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;
|
|
|
|
/* users/views/admin/index.twig */
|
|
class __TwigTemplate_998a6923e68bc5cae9fddc4daebe3b7a 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'],
|
|
];
|
|
}
|
|
|
|
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()("users.titles.management"), "html", null, true);
|
|
yield " - ";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["platformName"] ?? null), "html", null, true);
|
|
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=\"container-fluid px-4\">
|
|
<h1 class=\"mt-4\">";
|
|
// line 7
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.titles.management"), "html", null, true);
|
|
yield "</h1>
|
|
<ol class=\"breadcrumb mb-4\">
|
|
<li class=\"breadcrumb-item\"><a href=\"";
|
|
// line 9
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/dashboard"), "html", null, true);
|
|
yield "\">";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("dashboard.title"), "html", null, true);
|
|
yield "</a></li>
|
|
<li class=\"breadcrumb-item active\">";
|
|
// line 10
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.breadcrumb.users"), "html", null, true);
|
|
yield "</li>
|
|
</ol>
|
|
|
|
";
|
|
// line 13
|
|
try {
|
|
$_v0 = $this->load("@users/admin/nav.twig", 13);
|
|
} catch (LoaderError $e) {
|
|
// ignore missing template
|
|
$_v0 = null;
|
|
}
|
|
if ($_v0) {
|
|
yield from $_v0->unwrap()->yield($context);
|
|
}
|
|
// line 14
|
|
yield "
|
|
<div class=\"card mb-4\">
|
|
<div class=\"card-header d-flex justify-content-between align-items-center\">
|
|
<div>
|
|
<i class=\"bi bi-people me-1\"></i>
|
|
";
|
|
// line 19
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.headers.all_users"), "html", null, true);
|
|
yield "
|
|
</div>
|
|
</div>
|
|
<div class=\"card-body\">
|
|
<table class=\"table table-striped table-hover\">
|
|
<thead>
|
|
<tr>
|
|
<th>";
|
|
// line 26
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.name"), "html", null, true);
|
|
yield "</th>
|
|
<th>";
|
|
// line 27
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.email"), "html", null, true);
|
|
yield "</th>
|
|
<th>";
|
|
// line 28
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.role"), "html", null, true);
|
|
yield "</th>
|
|
<th>";
|
|
// line 29
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.status"), "html", null, true);
|
|
yield "</th>
|
|
<th>";
|
|
// line 30
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.created_at"), "html", null, true);
|
|
yield "</th>
|
|
<th>";
|
|
// line 31
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.fields.actions"), "html", null, true);
|
|
yield "</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
";
|
|
// line 35
|
|
$context['_parent'] = $context;
|
|
$context['_seq'] = CoreExtension::ensureTraversable(($context["users"] ?? null));
|
|
$context['_iterated'] = false;
|
|
foreach ($context['_seq'] as $context["_key"] => $context["user"]) {
|
|
// line 36
|
|
yield " <tr>
|
|
<td>";
|
|
// line 37
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_name", [], "any", false, false, false, 37), "html", null, true);
|
|
yield "</td>
|
|
<td>";
|
|
// line 38
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_email", [], "any", false, false, false, 38), "html", null, true);
|
|
yield "</td>
|
|
<td>";
|
|
// line 39
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()(("users.roles." . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_role", [], "any", false, false, false, 39))), "html", null, true);
|
|
yield "</td>
|
|
<td>
|
|
";
|
|
// line 41
|
|
if ((CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_status", [], "any", false, false, false, 41) == "active")) {
|
|
// line 42
|
|
yield " <span class=\"badge bg-success\">";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.statuses.active"), "html", null, true);
|
|
yield "</span>
|
|
";
|
|
} else {
|
|
// line 44
|
|
yield " <span class=\"badge bg-secondary\">";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()(("users.statuses." . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_status", [], "any", false, false, false, 44))), "html", null, true);
|
|
yield "</span>
|
|
";
|
|
}
|
|
// line 46
|
|
yield " </td>
|
|
<td>";
|
|
// line 47
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["user"], "created_at", [], "any", false, false, false, 47), "Y-m-d"), "html", null, true);
|
|
yield "</td>
|
|
<td>
|
|
<a href=\"";
|
|
// line 49
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()(("admin/users/" . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_id", [], "any", false, false, false, 49))), "html", null, true);
|
|
yield "\" class=\"btn btn-sm btn-secondary\" title=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.actions.view"), "html", null, true);
|
|
yield "\">
|
|
<i class=\"bi bi-eye\"></i>
|
|
</a>
|
|
<a href=\"";
|
|
// line 52
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()((("admin/users/" . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_id", [], "any", false, false, false, 52)) . "/edit")), "html", null, true);
|
|
yield "\" class=\"btn btn-sm btn-info\" title=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.actions.edit"), "html", null, true);
|
|
yield "\">
|
|
<i class=\"bi bi-pencil\"></i>
|
|
</a>
|
|
|
|
";
|
|
// line 56
|
|
if (((($this->env->getFunction('session')->getCallable()("user_role") == "super_admin") || ($this->env->getFunction('session')->getCallable()("user_role") == "admin")) && ((CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_role", [], "any", false, false, false, 56) == "member") || (CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_role", [], "any", false, false, false, 56) == "user")))) {
|
|
// line 57
|
|
yield " <a href=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()((("admin/users/" . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_id", [], "any", false, false, false, 57)) . "/permissions")), "html", null, true);
|
|
yield "\" class=\"btn btn-sm btn-warning\" title=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.headers.user_permissions"), "html", null, true);
|
|
yield "\">
|
|
<i class=\"bi bi-shield-lock\"></i>
|
|
</a>
|
|
";
|
|
}
|
|
// line 61
|
|
yield "
|
|
";
|
|
// line 62
|
|
if ((CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_id", [], "any", false, false, false, 62) != $this->env->getFunction('session')->getCallable()("user_id"))) {
|
|
// line 63
|
|
yield " <form action=\"";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()(("admin/users/" . CoreExtension::getAttribute($this->env, $this->source, $context["user"], "users_id", [], "any", false, false, false, 63))), "html", null, true);
|
|
yield "\" method=\"POST\" class=\"d-inline\" onsubmit=\"return confirm('";
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.actions.confirm_delete"), "html", null, true);
|
|
yield "');\">
|
|
<input type=\"hidden\" name=\"_method\" value=\"DELETE\">
|
|
";
|
|
// line 65
|
|
yield $this->env->getFunction('csrf_field')->getCallable()();
|
|
yield "
|
|
<button type=\"submit\" class=\"btn btn-sm btn-danger\" title=\"";
|
|
// line 66
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.actions.delete"), "html", null, true);
|
|
yield "\">
|
|
<i class=\"bi bi-trash\"></i>
|
|
</button>
|
|
</form>
|
|
";
|
|
}
|
|
// line 71
|
|
yield " </td>
|
|
</tr>
|
|
";
|
|
$context['_iterated'] = true;
|
|
}
|
|
// line 73
|
|
if (!$context['_iterated']) {
|
|
// line 74
|
|
yield " <tr>
|
|
<td colspan=\"6\" class=\"text-center\">";
|
|
// line 75
|
|
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("users.messages.no_users_found"), "html", null, true);
|
|
yield "</td>
|
|
</tr>
|
|
";
|
|
}
|
|
$_parent = $context['_parent'];
|
|
unset($context['_seq'], $context['_key'], $context['user'], $context['_parent'], $context['_iterated']);
|
|
$context = array_intersect_key($context, $_parent) + $_parent;
|
|
// line 78
|
|
yield " </tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
";
|
|
yield from [];
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function getTemplateName(): string
|
|
{
|
|
return "users/views/admin/index.twig";
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function isTraitable(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function getDebugInfo(): array
|
|
{
|
|
return array ( 263 => 78, 254 => 75, 251 => 74, 249 => 73, 243 => 71, 235 => 66, 231 => 65, 223 => 63, 221 => 62, 218 => 61, 208 => 57, 206 => 56, 197 => 52, 189 => 49, 184 => 47, 181 => 46, 175 => 44, 169 => 42, 167 => 41, 162 => 39, 158 => 38, 154 => 37, 151 => 36, 146 => 35, 139 => 31, 135 => 30, 131 => 29, 127 => 28, 123 => 27, 119 => 26, 109 => 19, 102 => 14, 92 => 13, 86 => 10, 80 => 9, 75 => 7, 72 => 6, 65 => 5, 52 => 3, 41 => 1,);
|
|
}
|
|
|
|
public function getSourceContext(): Source
|
|
{
|
|
return new Source("", "users/views/admin/index.twig", "/app/modules/users/views/admin/index.twig");
|
|
}
|
|
}
|