More UI improvements

This commit is contained in:
Pinga 2023-12-18 21:44:27 +02:00
parent 7ecc347cc4
commit 58c8f8f01a
6 changed files with 103 additions and 19 deletions

View file

@ -11,7 +11,16 @@ class HomeController extends Controller
{
public function index(Request $request, Response $response)
{
return view($response,'index.twig');
$db = $this->container->get('db');
$whois_server = $db->selectValue("SELECT value FROM settings WHERE name = 'whois_server'");
$rdap_server = $db->selectValue("SELECT value FROM settings WHERE name = 'rdap_server'");
$company_name = $db->selectValue("SELECT value FROM settings WHERE name = 'company_name'");
return view($response, 'index.twig', [
'whois_server' => $whois_server,
'rdap_server' => $rdap_server,
'company_name' => $company_name,
]);
}
public function dashboard(Request $request, Response $response)

View file

@ -112,6 +112,36 @@ class SystemController extends Controller
'name' => "handle"
]
);
$db->update(
'settings',
[
'value' => $data['launchPhases']
],
[
'name' => "launch_phases"
]
);
$db->update(
'settings',
[
'value' => $data['whoisServer']
],
[
'name' => "whois_server"
]
);
$db->update(
'settings',
[
'value' => $data['rdapServer']
],
[
'name' => "rdap_server"
]
);
$db->commit();
} catch (Exception $e) {
@ -133,6 +163,9 @@ class SystemController extends Controller
$phone = $db->selectValue("SELECT value FROM settings WHERE name = 'phone'");
$email = $db->selectValue("SELECT value FROM settings WHERE name = 'email'");
$handle = $db->selectValue("SELECT value FROM settings WHERE name = 'handle'");
$launch_phases = $db->selectValue("SELECT value FROM settings WHERE name = 'launch_phases'");
$whois_server = $db->selectValue("SELECT value FROM settings WHERE name = 'whois_server'");
$rdap_server = $db->selectValue("SELECT value FROM settings WHERE name = 'rdap_server'");
return view($response,'admin/system/registry.twig', [
'company_name' => $company_name,
@ -141,7 +174,10 @@ class SystemController extends Controller
'address2' => $address2,
'phone' => $phone,
'email' => $email,
'handle' => $handle
'handle' => $handle,
'launch_phases' => $launch_phases,
'whois_server' => $whois_server,
'rdap_server' => $rdap_server
]);
}

View file

@ -31,11 +31,52 @@
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="mb-3">System Settings</h3>
<div class="mb-3">
<label for="registryOperator" class="form-label required">Registry Operator Name</label>
<input type="text" class="form-control" id="registryOperator" name="registryOperator" placeholder="Enter registry operator's name" value="{{ company_name }}" required>
<small class="form-hint">The official name of the organization operating the registry.</small>
</div>
<div class="mb-3">
<label for="registryHandle" class="form-label required">Registry Handle</label>
<input type="text" class="form-control" id="registryHandle" name="registryHandle" placeholder="Enter registry handle" value="{{ handle }}" required>
<small class="form-hint">A unique identifier for the registry which will be appended to each object handle.</small>
</div>
<div class="mb-3">
<label for="whoisServer" class="form-label required">WHOIS Server</label>
<input type="text" class="form-control" id="whoisServer" name="whoisServer" placeholder="Enter registry whois server" value="{{ whois_server }}" required>
<small class="form-hint">Enter the URL of the registry's WHOIS server. Example: whois.example.com</small>
</div>
<div class="mb-3">
<label for="rdapServer" class="form-label required">RDAP Server</label>
<input type="text" class="form-control" id="rdapServer" name="rdapServer" placeholder="Enter registry RDAP server" value="{{ rdap_server }}" required>
<small class="form-hint">Enter the URL of the registry's RDAP server. Example: https://rdap.example.com</small>
</div>
<div class="mb-3">
<label class="form-label">Features</label>
<div class="divide-y">
<div>
<label class="row">
<span class="col">Require Launch Phases</span>
<span class="col-auto">
<label class="form-check form-check-single form-switch">
<input class="form-check-input" type="checkbox" name="launchPhases" {% if launch_phases == 'on' %}checked{% endif %}>
</label>
</span>
</label>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<h3 class="mb-3">Operator Details</h3>
<div class="mb-3">
<label for="registryOperatorVat" class="form-label required">Registry VAT/Company Number</label>
@ -54,10 +95,7 @@
<input type="text" class="form-control" id="contactAddress2" name="contactAddress2" placeholder="Enter contact address" value="{{ address2 }}" required>
<small class="form-hint">The contact address of the registry. (Line 2)</small>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="contactEmail" class="form-label required">Contact Email</label>
<input type="email" class="form-control" id="contactEmail" name="contactEmail" placeholder="Enter contact email" value="{{ email }}" required>
@ -69,12 +107,7 @@
<input type="tel" class="form-control" id="contactPhone" name="contactPhone" placeholder="Enter contact phone" value="{{ phone }}" required>
<small class="form-hint">The phone number for general inquiries to the registry.</small>
</div>
<div class="mb-3">
<label for="registryHandle" class="form-label required">Registry Handle</label>
<input type="text" class="form-control" id="registryHandle" name="registryHandle" placeholder="Enter registry handle" value="{{ handle }}" required>
<small class="form-hint">A unique identifier for the registry which will be appended to each object handle.</small>
</div>
</div>
</div>

View file

@ -60,12 +60,12 @@
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#">
<a class="nav-link" href="https://{{ whois_server }}" target="_blank">
WHOIS
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<a class="nav-link" href="{{ rdap_server }}" target="_blank">
RDAP
</a>
</li>
@ -86,8 +86,8 @@
<p class="display-6 lead"><em>Access and manage your domain-related services here.</em></p>
<p class="lead">To get started:</p>
<ul class="custom-bullet">
<li><a href="#"><strong>Log in</strong></a> to access your registrar dashboard and manage domains.</li>
<li>Access our <a href="#"><strong>WHOIS</strong></a> and <a href="#"><strong>RDAP</strong></a> services for domain information lookup.</li>
<li>{% if auth.isLogin %}<a href="{{route('home')}}"><strong>Open panel</strong></a>{% else %}<a href="{{route('login')}}"><strong>Log in</strong></a>{% endif %} to access your registrar dashboard and manage domains.</li>
<li>Access our <a href="https://{{ whois_server }}" target="_blank"><strong>WHOIS</strong></a> and <a href="{{ rdap_server }}" target="_blank"><strong>RDAP</strong></a> services for domain information lookup.</li>
<li>Visit our <a href="#"><strong>Help Center</strong></a> for guides, FAQs, and support.</li>
<li>Interested in partnering with us? <a href="#"><strong>Apply</strong></a> to become an official registrar.</li>
</ul>
@ -97,7 +97,7 @@
</main>
<footer class="footer bg-dark mt-auto py-3">
<div class="container">
<span class="text-muted">&copy; {{ 'now' | date('Y') }}. All rights reserved.</span>
<span class="text-muted">&copy; {{ 'now' | date('Y') }} <strong>{{ company_name }}</strong>. All rights reserved.</span>
</div>
</footer>
{% include 'partials/js.twig' %}

View file

@ -832,7 +832,10 @@ INSERT INTO `registry`.`settings` (`name`, `value`) VALUES
('vat_number', '0'),
('phone', '+123456789'),
('handle', 'RXX'),
('email', 'contact@example.com');
('email', 'contact@example.com'),
('launch_phases', 'on'),
('whois_server', 'whois.example.com'),
('rdap_server', 'https://rdap.example.com');
CREATE DATABASE IF NOT EXISTS `registryTransaction`;

View file

@ -809,7 +809,10 @@ INSERT INTO registry.settings (name, value) VALUES
('vat_number', '0'),
('phone', '+123456789'),
('handle', 'RXX'),
('email', 'contact@example.com');
('email', 'contact@example.com'),
('launch_phases', 'on'),
('whois_server', 'whois.example.com'),
('rdap_server', 'https://rdap.example.com');
ALTER TABLE registry.domain_price ADD FOREIGN KEY ("tldid") REFERENCES registry.domain_tld ("id");
ALTER TABLE registry.domain_restore_price ADD FOREIGN KEY ("tldid") REFERENCES registry.domain_tld ("id");