mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-21 10:06:05 +02:00
Small UI improvements
This commit is contained in:
parent
fe0eaf5fdc
commit
9af773eb37
2 changed files with 20 additions and 27 deletions
|
@ -28,17 +28,18 @@ class SupportController extends Controller
|
||||||
$message = $data['message'] ?? null;
|
$message = $data['message'] ?? null;
|
||||||
|
|
||||||
if (!$subject) {
|
if (!$subject) {
|
||||||
return view($response, 'admin/support/newticket.twig', [
|
$this->container->get('flash')->addMessage('error', 'Please enter a subject');
|
||||||
'error' => 'Please enter a subject',
|
return $response->withHeader('Location', '/support/new')->withStatus(302);
|
||||||
'categories' => $categories,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$message) {
|
if (!$message) {
|
||||||
return view($response, 'admin/support/newticket.twig', [
|
$this->container->get('flash')->addMessage('error', 'Please enter a message');
|
||||||
'error' => 'Please enter a message',
|
return $response->withHeader('Location', '/support/new')->withStatus(302);
|
||||||
'categories' => $categories,
|
}
|
||||||
]);
|
|
||||||
|
if (mb_strlen($message, 'UTF-8') > 5000) {
|
||||||
|
$this->container->get('flash')->addMessage('error', 'The provided message exceeds the 5,000 character limit');
|
||||||
|
return $response->withHeader('Location', '/support/new')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -82,10 +83,9 @@ class SupportController extends Controller
|
||||||
Mail::send($mailsubject, $message, $from, $to);
|
Mail::send($mailsubject, $message, $from, $to);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$db->rollBack();
|
$db->rollBack();
|
||||||
return view($response, 'admin/support/newticket.twig', [
|
|
||||||
'error' => $e->getMessage(),
|
$this->container->get('flash')->addMessage('error', 'Database error: ' . $e->getMessage());
|
||||||
'categories' => $categories
|
return $response->withHeader('Location', '/support/new')->withStatus(302);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->container->get('flash')->addMessage('success', 'Support ticket ' . $subject . ' has been created successfully!');
|
$this->container->get('flash')->addMessage('success', 'Support ticket ' . $subject . ' has been created successfully!');
|
||||||
|
@ -167,6 +167,11 @@ class SupportController extends Controller
|
||||||
}
|
}
|
||||||
$responseText = $data['responseText'] ?? null;
|
$responseText = $data['responseText'] ?? null;
|
||||||
|
|
||||||
|
if (mb_strlen($responseText, 'UTF-8') > 5000) {
|
||||||
|
$this->container->get('flash')->addMessage('error', 'The provided message exceeds the 5,000 character limit');
|
||||||
|
return $response->withHeader('Location', '/ticket/'.$ticket_id)->withStatus(302);
|
||||||
|
}
|
||||||
|
|
||||||
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
||||||
$clid = $_SESSION["auth_roles"] != 0 ? $result['registrar_id'] : $_SESSION['auth_user_id'];
|
$clid = $_SESSION["auth_roles"] != 0 ? $result['registrar_id'] : $_SESSION['auth_user_id'];
|
||||||
$ticket_owner = $db->selectValue('SELECT user_id FROM support_tickets WHERE id = ?', [$ticket_id]);
|
$ticket_owner = $db->selectValue('SELECT user_id FROM support_tickets WHERE id = ?', [$ticket_id]);
|
||||||
|
|
|
@ -24,19 +24,7 @@
|
||||||
<div class="page-body">
|
<div class="page-body">
|
||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{% if error is defined %}
|
{% include 'partials/flash.twig' %}
|
||||||
<div class="alert alert-important alert-danger alert-dismissible" role="alert">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" /><path d="M12 8v4" /><path d="M12 16h.01" /></svg>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{{ __('Support ticket can not be created') }}: <strong>{{ error }}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="/support/new" method="post">
|
<form action="/support/new" method="post">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue