Files
dockerfluxodecaixapro/cache/twig/09/0954c36b7d2d0205a2077e68a699c76d.php
T
2026-09-01 10:46:29 -03:00

430 lines
22 KiB
PHP
Executable File

<?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;
/* contact/views/admin/index.twig */
class __TwigTemplate_1985e325c45fcfbb6e6030b7126ad8e3 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(($context["title"] ?? null), "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(($context["title"] ?? null), "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()("contact.admin.title"), "html", null, true);
yield "</li>
</ol>
<div class=\"mb-4\">
<div class=\"btn-group\" role=\"group\">
<a href=\"";
// line 15
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=all"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "all")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 16
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.all"), "html", null, true);
yield "
</a>
<a href=\"";
// line 18
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=unread"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "unread")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 19
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.unread"), "html", null, true);
yield "
</a>
<a href=\"";
// line 21
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=read"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "read")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 22
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.read"), "html", null, true);
yield "
</a>
<a href=\"";
// line 24
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=new"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "new")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 25
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.new"), "html", null, true);
yield "
</a>
<a href=\"";
// line 27
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=in_progress"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "in_progress")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 28
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.in_progress"), "html", null, true);
yield "
</a>
<a href=\"";
// line 30
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=resolved"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "resolved")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 31
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.resolved"), "html", null, true);
yield "
</a>
<a href=\"";
// line 33
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts?status=closed"), "html", null, true);
yield "\" class=\"btn ";
yield (((($context["current_status"] ?? null) == "closed")) ? ("btn-primary") : ("btn-outline-primary"));
yield "\">
";
// line 34
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.statuses.closed"), "html", null, true);
yield "
</a>
</div>
</div>
<div class=\"card mb-4\">
<div class=\"card-header\">
<i class=\"bi bi-envelope me-1\"></i>
";
// line 42
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.list_title"), "html", null, true);
yield "
</div>
<div class=\"card-body\">
<div class=\"table-responsive\">
<table class=\"table table-bordered\" id=\"dataTable\" width=\"100%\" cellspacing=\"0\">
<thead>
<tr>
<th>";
// line 49
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.name"), "html", null, true);
yield "</th>
<th>";
// line 50
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.email"), "html", null, true);
yield "</th>
<th>";
// line 51
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.subject"), "html", null, true);
yield "</th>
<th>";
// line 52
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.status"), "html", null, true);
yield "</th>
<th>";
// line 53
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.date"), "html", null, true);
yield "</th>
<th>";
// line 54
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.columns.actions"), "html", null, true);
yield "</th>
</tr>
</thead>
<tbody>
";
// line 58
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["contacts"] ?? null));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["contact"]) {
// line 59
yield " <tr class=\"";
yield (((($tmp = !CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "isRead", [], "method", false, false, false, 59)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("table-primary") : (""));
yield "\">
<td>
";
// line 61
if ((($tmp = !CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "isRead", [], "method", false, false, false, 61)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 62
yield " <i class=\"bi bi-envelope-fill text-primary me-1\"></i>
";
} else {
// line 64
yield " <i class=\"bi bi-envelope-open text-muted me-1\"></i>
";
}
// line 66
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_name", [], "any", false, false, false, 66), "html", null, true);
yield "
</td>
<td>";
// line 68
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_email", [], "any", false, false, false, 68), "html", null, true);
yield "</td>
<td>";
// line 69
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_subject", [], "any", false, false, false, 69), "html", null, true);
yield "</td>
<td>
";
// line 71
$context["statusColors"] = ["new" => "primary", "in_progress" => "warning", "resolved" => "success", "closed" => "secondary"];
// line 77
yield " <span class=\"badge bg-";
yield (((CoreExtension::getAttribute($this->env, $this->source, ($context["statusColors"] ?? null), CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_status", [], "any", false, false, false, 77), [], "array", true, true, false, 77) && !(null === (($_v0 = ($context["statusColors"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0[CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_status", [], "any", false, false, false, 77)] ?? null) : null)))) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v1 = ($context["statusColors"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1[CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_status", [], "any", false, false, false, 77)] ?? null) : null), "html", null, true)) : ("secondary"));
yield "\">
";
// line 78
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()(("contact.admin.statuses." . CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_status", [], "any", false, false, false, 78))), "html", null, true);
yield "
</span>
</td>
<td>";
// line 81
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "formatted_created_at", [], "any", false, false, false, 81), "html", null, true);
yield "</td>
<td>
<a href=\"";
// line 83
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()(("admin/contacts/" . CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_id", [], "any", false, false, false, 83))), "html", null, true);
yield "\" class=\"btn btn-info btn-sm\" title=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.actions.view"), "html", null, true);
yield "\">
<i class=\"bi bi-eye\"></i>
</a>
<button type=\"button\" class=\"btn btn-sm ";
// line 86
yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "isRead", [], "method", false, false, false, 86)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("btn-secondary") : ("btn-success"));
yield "\"
onclick=\"toggleReadStatus(";
// line 87
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_id", [], "any", false, false, false, 87), "html", null, true);
yield ")\"
title=\"";
// line 88
yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "isRead", [], "method", false, false, false, 88)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.actions.mark_unread"), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.actions.mark_read"), "html", null, true)));
yield "\">
<i class=\"bi ";
// line 89
yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "isRead", [], "method", false, false, false, 89)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("bi-envelope") : ("bi-envelope-check"));
yield "\"></i>
</button>
<button type=\"button\" class=\"btn btn-danger btn-sm\"
onclick=\"deleteContact(";
// line 92
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["contact"], "contacts_id", [], "any", false, false, false, 92), "html", null, true);
yield ")\"
title=\"";
// line 93
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.actions.delete"), "html", null, true);
yield "\">
<i class=\"bi bi-trash\"></i>
</button>
</td>
</tr>
";
$context['_iterated'] = true;
}
// line 98
if (!$context['_iterated']) {
// line 99
yield " <tr>
<td colspan=\"6\" class=\"text-center\">";
// line 100
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.no_messages"), "html", null, true);
yield "</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['contact'], $context['_parent'], $context['_iterated']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 103
yield " </tbody>
</table>
</div>
</div>
</div>
</div>
<script>
function toggleReadStatus(id) {
fetch(`";
// line 112
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts/"), "html", null, true);
yield "\${id}/toggle-read`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
location.reload();
} else {
alert(data.message || '";
// line 124
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.error_occurred"), "html", null, true);
yield "');
}
})
.catch(error => {
console.error('Error:', error);
alert('";
// line 129
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.error_occurred"), "html", null, true);
yield "');
});
}
function deleteContact(id) {
if (confirm(\"";
// line 134
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.confirm_delete"), "html", null, true);
yield "\")) {
fetch(`";
// line 135
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('url')->getCallable()("admin/contacts/"), "html", null, true);
yield "\${id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
location.reload();
} else {
alert(data.message || '";
// line 147
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.error_occurred"), "html", null, true);
yield "');
}
})
.catch(error => {
console.error('Error:', error);
alert('";
// line 152
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getFunction('__')->getCallable()("contact.admin.error_occurred"), "html", null, true);
yield "');
});
}
}
</script>
";
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "contact/views/admin/index.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 391 => 152, 383 => 147, 368 => 135, 364 => 134, 356 => 129, 348 => 124, 333 => 112, 322 => 103, 313 => 100, 310 => 99, 308 => 98, 298 => 93, 294 => 92, 288 => 89, 284 => 88, 280 => 87, 276 => 86, 268 => 83, 263 => 81, 257 => 78, 252 => 77, 250 => 71, 245 => 69, 241 => 68, 235 => 66, 231 => 64, 227 => 62, 225 => 61, 219 => 59, 214 => 58, 207 => 54, 203 => 53, 199 => 52, 195 => 51, 191 => 50, 187 => 49, 177 => 42, 166 => 34, 160 => 33, 155 => 31, 149 => 30, 144 => 28, 138 => 27, 133 => 25, 127 => 24, 122 => 22, 116 => 21, 111 => 19, 105 => 18, 100 => 16, 94 => 15, 86 => 10, 80 => 9, 75 => 7, 72 => 6, 65 => 5, 52 => 3, 41 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "contact/views/admin/index.twig", "/app/modules/contact/views/admin/index.twig");
}
}