getnamingo-registry/cp/resources/views/admin/hosts/create.twig
2023-09-01 13:49:04 +03:00

89 lines
No EOL
4.2 KiB
Twig

{% extends "layouts/app.twig" %}
{% block title %}{{ __('Create Host') }}{% endblock %}
{% block content %}
<div class="page-wrapper">
<!-- Page header -->
<div class="page-header d-print-none">
<div class="container-xl">
<div class="row g-2 align-items-center">
<div class="col">
<!-- Page pre-title -->
<div class="page-pretitle">
Overview
</div>
<h2 class="page-title">
{{ __('Create Host') }}
</h2>
</div>
</div>
</div>
</div>
<!-- Page body -->
<div class="page-body">
<div class="container-xl">
<div class="col-12">
<div class="card">
<div class="card-body border-bottom py-3">
<form action="/host/create" method="post">
{{ csrf.field | raw }}
<div class="form-group">
<label for="hostname" class="form-label required">{{ __('Host Name') }}:</label>
<input type="text" class="form-control" id="hostname" name="hostname" placeholder="ns1.example.com" required>
</div>
{% if registrars %}
<div class="form-group mt-3">
<label for="registrarDropdown" class="form-label required">{{ __('Select Registrar') }}:</label>
<select id="registrarDropdown" name="registrar" class="form-control">
{% for registrar in registrars %}
<option value="{{ registrar.id }}">{{ registrar.name }}</option>
{% endfor %}
</select>
</div>
{% endif %}
<div class="form-group mt-3">
<label for="ipv4" class="form-label">{{ __('IPv4 Address') }} ({{ __('Optional') }}):</label>
<input type="text" class="form-control" id="ipv4" name="ipv4" placeholder="192.168.1.1" pattern="^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$">
<small class="form-text text-muted">{{ __('Please enter a valid IPv4 address.') }}</small>
</div>
<div class="form-group mt-3">
<label for="ipv6" class="form-label">{{ __('IPv6 Address') }} ({{ __('Optional') }}):</label>
<input type="text" class="form-control" id="ipv6" name="ipv6" placeholder="2001:0db8:85a3:0000:0000:8a2e:0370:7334">
<small class="form-text text-muted">{{ __('Please enter a valid IPv6 address.') }}</small>
</div>
<button type="submit" class="btn btn-primary mt-3">{{ __('Create') }}</button>
</form>
{% if hostName is defined and crdate is defined %}
<div class="alert alert-success mt-3" role="alert">
{{ __('Host') }} <strong>{{ hostName }}</strong> {{ __('has been created successfully on') }} <strong>{{ crdate|date("Y-m-d H:i:s") }}!</strong>
</div>
{% elseif error is defined %}
<div class="alert alert-danger mt-3" role="alert">
{{ __('Host') }} <strong>{{ hostName }}</strong> {{ __('is not available') }}: <strong>{{ error }}</strong>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<footer class="footer footer-transparent d-print-none">
<div class="container-xl">
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
<ul class="list-inline list-inline-dots mb-0">
<li class="list-inline-item">
Copyright &copy; 2023
<a href="https://namingo.org" target="_blank" class="link-secondary">Namingo</a>.
</li>
</ul>
</div>
</div>
</div>
</footer>
</div>
{% endblock %}