mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-20 17:46:03 +02:00
299 lines
No EOL
19 KiB
Twig
299 lines
No EOL
19 KiB
Twig
{% extends "layouts/app.twig" %}
|
|
|
|
{% block title %}{{ __('Create Contact') }}{% 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 Contact') }}
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Page body -->
|
|
<div class="page-body">
|
|
<div class="container-xl">
|
|
<div class="col-12">
|
|
{% include 'partials/flash.twig' %}
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<form action="/contact/create" method="post">
|
|
{{ csrf.field | raw }}
|
|
<div class="row">
|
|
<!-- First Column: General & Internationalized Info -->
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">{{ __('General & Internationalized Info') }}</h6>
|
|
|
|
<!-- Internationalized Name -->
|
|
<div class="mb-3">
|
|
<label for="intName" class="form-label required">{{ __('Name') }}</label>
|
|
<input type="text" class="form-control" id="intName" name="intName" required="required">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseNameInt" name="disclose_name_int">
|
|
<span class="form-check-label" for="discloseNameInt">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
{% if registrars and not registrar %}
|
|
<div class="form-group mb-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 %}
|
|
|
|
<!-- Internationalized Organization -->
|
|
<div class="mb-3">
|
|
<label for="intOrg" class="form-label required">{{ __('Organization') }}</label>
|
|
<input type="text" class="form-control" id="intOrg" name="org" required="required">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseOrgInt" name="disclose_org_int">
|
|
<span class="form-check-label" for="discloseOrgInt">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Internationalized Address: Street Details -->
|
|
<div class="mb-3">
|
|
<label for="street1" class="form-label required">{{ __('Street') }} 1</label>
|
|
<input type="text" class="form-control" id="street1" name="street1" required="required">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="street2" class="form-label">{{ __('Street') }} 2</label>
|
|
<input type="text" class="form-control" id="street2" name="street2">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="street3" class="form-label">{{ __('Street') }} 3</label>
|
|
<input type="text" class="form-control" id="street3" name="street3">
|
|
</div>
|
|
|
|
<!-- Internationalized Address: City, SP, PC, CC -->
|
|
<div class="mb-3">
|
|
<label for="city" class="form-label required">{{ __('City') }}</label>
|
|
<input type="text" class="form-control" id="city" name="city" required="required">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="sp" class="form-label">{{ __('State/Province') }}</label>
|
|
<input type="text" class="form-control" id="sp" name="sp">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="pc" class="form-label">{{ __('Postal Code') }}</label>
|
|
<input type="text" class="form-control" id="pc" name="pc">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="cc" class="form-label required">{{ __('Country') }}</label>
|
|
<select class="form-select" id="cc" name="cc" required="required">
|
|
{% for country in countries %}
|
|
<option value="{{ country.alpha2|lower }}">{{ country.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseAddrInt" name="disclose_addr_int">
|
|
<span class="form-check-label" for="discloseAddrInt">{{ __('Disclose Address in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Second Column: Voice, Fax, Email, and other details -->
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">{{ __('Contact Details') }}</h6>
|
|
|
|
<!-- Contact ID -->
|
|
<div class="mb-3">
|
|
<label for="contactid" class="form-label required">{{ __('Contact ID') }}</label>
|
|
<input type="text" class="form-control" id="contactid" name="contactid" required="required">
|
|
</div>
|
|
|
|
<!-- Voice -->
|
|
<div class="mb-3">
|
|
<label for="voice" class="form-label required">{{ __('Voice') }}</label>
|
|
<input type="tel" class="form-control" id="voice" name="voice" required="required">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseVoice" name="disclose_voice">
|
|
<span class="form-check-label" for="discloseVoice">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Fax -->
|
|
<div class="mb-3">
|
|
<label for="fax" class="form-label">{{ __('Fax') }}</label>
|
|
<input type="tel" class="form-control" id="fax" name="fax">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseFax" name="disclose_fax">
|
|
<span class="form-check-label" for="discloseFax">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Email -->
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label required">{{ __('Email') }}</label>
|
|
<input type="email" class="form-control" id="email" name="email" required="required" autocapitalize="none">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseEmail" name="disclose_email">
|
|
<span class="form-check-label" for="discloseEmail">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- AuthInfo for Contact -->
|
|
<div class="mb-3">
|
|
<label for="authInfo" class="form-label required">{{ __('Contact AuthInfo') }}</label>
|
|
<input type="text" class="form-control" id="authInfo" name="authInfo" readonly>
|
|
<small class="form-text text-muted">{{ __('Auto-generated authentication information for the contact') }}.</small>
|
|
</div>
|
|
|
|
<!-- NIN - National Identification Number -->
|
|
<div class="mb-3">
|
|
<label for="nin" class="form-label">{{ __('NIN - National Identification Number') }}</label>
|
|
<input type="text" class="form-control" id="nin" name="nin">
|
|
</div>
|
|
|
|
<!-- Personal or Business Checkbox -->
|
|
<div class="mb-3">
|
|
<div class="form-check">
|
|
<input type="checkbox" class="form-check-input" id="isBusiness" name="isBusiness">
|
|
<label class="form-check-label" for="isBusiness">{{ __('This is a Business Contact') }}</label>
|
|
</div>
|
|
<!-- You can invert the logic if you prefer the default to be 'Personal' instead of 'Business' -->
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Localized Info Checkbox -->
|
|
<div class="mb-3">
|
|
<label class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" id="toggleLoc">
|
|
<span class="form-check-label" for="toggleLoc">{{ __('Include Localized Info') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Hidden Localized Info Rows -->
|
|
<div class="row" id="localizedInfo" style="display: none;">
|
|
<!-- Localized Postal Info: First Column -->
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">{{ __('Localized Postal Info: Personal Details') }}</h6>
|
|
|
|
<!-- Localized Name -->
|
|
<div class="mb-3">
|
|
<label for="locName" class="form-label">{{ __('Name') }}</label>
|
|
<input type="text" class="form-control" id="locName" name="locName">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseNameLoc" name="disclose_name_loc">
|
|
<span class="form-check-label" for="discloseNameLoc">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Localized Organization -->
|
|
<div class="mb-3">
|
|
<label for="locOrg" class="form-label">{{ __('Organization') }}</label>
|
|
<input type="text" class="form-control" id="locOrg" name="locOrg">
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseOrgLoc" name="disclose_org_loc">
|
|
<span class="form-check-label" for="discloseOrgLoc">{{ __('Disclose in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Localized Street Details -->
|
|
<div class="mb-3">
|
|
<label for="locStreet1" class="form-label">{{ __('Street') }} 1</label>
|
|
<input type="text" class="form-control" id="locStreet1" name="locStreet1">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="locStreet2" class="form-label">{{ __('Street') }} 2</label>
|
|
<input type="text" class="form-control" id="locStreet2" name="locStreet2">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Localized Postal Info: Second Column -->
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">{{ __('Localized Postal Info: Address Details') }}</h6>
|
|
|
|
<!-- Continued Localized Street Detail -->
|
|
<div class="mb-3">
|
|
<label for="locStreet3" class="form-label">{{ __('Street') }} 3</label>
|
|
<input type="text" class="form-control" id="locStreet3" name="locStreet3">
|
|
</div>
|
|
|
|
<!-- Localized City, SP, PC, CC -->
|
|
<div class="mb-3">
|
|
<label for="locCity" class="form-label">{{ __('City') }}</label>
|
|
<input type="text" class="form-control" id="locCity" name="locCity">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="locSP" class="form-label">{{ __('State/Province') }}</label>
|
|
<input type="text" class="form-control" id="locSP" name="locSP">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="locPC" class="form-label">{{ __('Postal Code') }}</label>
|
|
<input type="text" class="form-control" id="locPC" name="locPC">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="locCC" class="form-label">{{ __('Country') }}</label>
|
|
<select class="form-select" id="locCC" name="locCC">
|
|
{% for country in countries %}
|
|
<option value="{{ country.alpha2|lower }}">{{ country.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<label class="form-check form-switch mt-1">
|
|
<input class="form-check-input" type="checkbox" id="discloseAddrLoc" name="disclose_addr_loc">
|
|
<span class="form-check-label" for="discloseAddrLoc">{{ __('Disclose Address in WHOIS') }}</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer">
|
|
<div class="row align-items-center">
|
|
<div class="col-auto">
|
|
<button type="submit" class="btn btn-primary">{{ __('Create Contact') }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% include 'partials/footer.twig' %}
|
|
</div>
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
const toggleLocCheckbox = document.getElementById('toggleLoc');
|
|
const localizedSection = document.getElementById('localizedInfo');
|
|
|
|
toggleLocCheckbox.addEventListener('change', function() {
|
|
if (toggleLocCheckbox.checked) {
|
|
localizedSection.style.display = "flex";
|
|
} else {
|
|
localizedSection.style.display = "none";
|
|
}
|
|
});
|
|
|
|
// Generate authInfo for Contact
|
|
const authInfoInput = document.getElementById('authInfo');
|
|
authInfoInput.value = generateAuthInfo();
|
|
|
|
function generateAuthInfo() {
|
|
const length = 16;
|
|
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
let retVal = "";
|
|
for (let i = 0; i < length; i++) {
|
|
const randomIndex = Math.floor(Math.random() * charset.length);
|
|
retVal += charset.charAt(randomIndex);
|
|
}
|
|
return retVal;
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %} |