This commit is contained in:
Thomas 2025-01-17 20:58:53 +01:00
parent 0e4e9d0a51
commit 5ba102ec56
2 changed files with 69 additions and 52 deletions

View File

@ -1,59 +1,58 @@
{% extends 'backend_base.html.twig' %}
{% extends 'backend_tailwind_base.html.twig' %}
{% trans_default_domain 'core_news_list' %}
{% block body %}
<div class="header">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h3>
<i class="fa-fw fa fa-newspaper"></i>
{{'News'|trans}} <span>>
{{'List'|trans}} </span>
</h3>
</div>
</div>
{% block header %}
<div>
<h1 class="text-2xl font-bold tracking-tight">{{ 'News'|trans }} {{ 'List'|trans }}</h1>
</div>
<div class="body">
<div class="panel">
<div class="body">
<a class="btn btn-info btn-sm" href="{{ path("psc_shop_news_backend_create") }}">{{'Addnews'|trans}}</a>
</div>
</div>
<div class="panel">
<div class="body">
<table class="table">
<thead class="thead-dark">
<tr>
<th>{{ knp_pagination_sortable(pagination, 'Uid'|trans, 'news.uid') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'active'|trans, 'news.enable') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Name'|trans, 'news.title') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Introduction'|trans, 'news.introduction') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Sortdate'|trans, 'news.sortDate') }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for news in pagination %}
<tr {% if loop.index is odd %}class="color"{% endif %}>
<td>{{ news.uid }}</td>
<td>{% if news.enable %}<span class="badge bg-success">{{'yes'|trans}}</span>{% else %}<span
class="badge bg-warning">{{'no'|trans}}</span>{% endif %}</td>
<td>{{ news.title }}</td>
<td>{{ news.introduction }}</td>
<td>{{ news.sortDate|date('d.m.Y') }}</td>
<td class="text-end">
<a href="{{ path("psc_shop_news_backend_edit", {uid: news.uid}) }}"
class="btn btn-info btn-sm"><span class="fa fa-edit"></span></a>
<a href="{{ path("psc_shop_news_backend_delete", {uid: news.uid}) }}"
class="btn btn-danger btn-sm"><span class="fa fa-trash"></span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="navigation">
{{ knp_pagination_render(pagination) }}
</div>
</div>
</div>
<div class="flex flex-wrap items-center gap-4 justify-start shrink-0">
<a href="{{ path("psc_shop_news_backend_create") }}" class="inline-flex items-center justify-center py-1 gap-1 font-medium rounded-lg border transition-colors outline-none focus:ring-offset-2 focus:ring-2 focus:ring-inset min-h-[2.25rem] px-4 text-sm text-white shadow focus:ring-white border-transparent bg-psc-500 hover:bg-psc-600 focus:bg-psc-600 focus:ring-offset-psc-600"><span class="fa fa-edit"></span> {{ 'Addnews'|trans }}</a>
</div>
{% endblock %}
{% block body %}
<div class="border border-gray-300 shadow-sm bg-white rounded-xl filament-tables-container dark:bg-gray-800 dark:border-gray-700">
<div class="flex items-center justify-between p-2 h-14">
<div class="flex items-center gap-2"></div>
<div class="flex items-center justify-end w-full gap-2 md:max-w-md">
<div class="filament-tables-search-container flex items-center justify-end flex-1">
</div>
</div>
</div>
<div class="overflow-x-auto relative dark:border-gray-700 border-t">
<table class="filament-tables-table w-full text-start divide-y table-auto dark:divide-gray-700">
<thead>
<tr class="bg-gray-500/5">
<th class="p-0"><span class="items-center gap-x-1 w-full px-4 py-2 whitespace-nowrap font-medium text-sm text-gray-600 dark:text-gray-300">{{ knp_pagination_sortable(pagination, 'Uid'|trans, 'news.uid') }}</div></th>
<th>{{ knp_pagination_sortable(pagination, 'active'|trans, 'news.enable') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Name'|trans, 'news.title') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Introduction'|trans, 'news.introduction') }}</th>
<th>{{ knp_pagination_sortable(pagination, 'Sortdate'|trans, 'news.sortDate') }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for news in pagination %}
<tr {% if loop.index is odd %}class="color"{% endif %}>
<td>{{ news.uid }}</td>
<td>{% if news.enable %}<span class="badge bg-success">{{'yes'|trans}}</span>{% else %}<span
class="badge bg-warning">{{'no'|trans}}</span>{% endif %}</td>
<td>{{ news.title }}</td>
<td>{{ news.introduction }}</td>
<td>{{ news.sortDate|date('d.m.Y') }}</td>
<td class="text-end">
<a href="{{ path("psc_shop_news_backend_edit", {uid: news.uid}) }}"
class="btn btn-info btn-sm"><span class="fa fa-edit"></span></a>
<a href="{{ path("psc_shop_news_backend_delete", {uid: news.uid}) }}"
class="btn btn-danger btn-sm"><span class="fa fa-trash"></span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="navigation">
{{ knp_pagination_render(pagination) }}
</div>
</div>
</div>
{% endblock %}

View File

@ -394,9 +394,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
if ($html) {
$message->html($html->render($params));
}
$this->_logService->createLogEntry($shop, new Contact(), LogEntry::INFO, PSCShopQueueBundle::class, $queue->getName(), "Mail send", [
'message' => $message->getTextBody(),
'from' => $from->render($params),
'to' => $to->render($params),
'subject' => $subject->render($params)
]);
$this->_mailer->send($message);
} catch (\Exception $e) {
$this->_logService->createLogEntry($shop, new Contact(), LogEntry::ERROR, PSCShopQueueBundle::class, $queue->getName(), "Request Mail error", [
'error' => $e->getMessage()
]);
$this->_error = $e->getMessage();
return false;
}
@ -441,8 +450,17 @@ class Mail implements QueueInterface, ConfigurableElementInterface
$message->html($html->render($params));
}
$this->_logService->createLogEntry($shop, new Contact(), LogEntry::INFO, PSCShopQueueBundle::class, $queue->getName(), "Mail send", [
'message' => "Nicht verfügbar da Passwort enhalten",
'from' => $from->render($params),
'to' => $to->render($params),
'subject' => $subject->render($params)
]);
$this->_mailer->send($message);
} catch (\Exception $e) {
$this->_logService->createLogEntry($shop, new Contact(), LogEntry::ERROR, PSCShopQueueBundle::class, $queue->getName(), "Request Mail error", [
'error' => $e->getMessage()
]);
$this->_error = $e->getMessage();
return false;
}