Even more UI improvements

This commit is contained in:
Pinga 2025-04-03 13:36:21 +03:00
parent 3a5e3388e3
commit 4e3e788952
6 changed files with 199 additions and 114 deletions

View file

@ -320,104 +320,6 @@
</div>
</form>
<div class="card">
<div class="card-header">
<h5 class="card-title">{{ __('Manage Launch Phases') }}</h5>
</div>
<div class="card-body">
<div class="table-responsive mb-3">
<table class="table">
<thead>
<tr>
<th>{{ __('Phase Type') }}</th>
<th>{{ __('Phase Name') }}</th>
<th>{{ __('Phase Category') }}</th>
<th>{{ __('Phase Description') }}</th>
<th>{{ __('Start Date') }}</th>
<th>{{ __('End Date') }}</th>
</tr>
</thead>
<tbody>
{% for phase in launch_phases %}
<tr>
<td>{{ phase.phase_type|capitalize }}</td>
<td>{{ phase.phase_name|default('N/A') }}</td>
<td>{{ phase.phase_category }}</td>
<td>{{ phase.phase_description }}</td>
<td>{{ phase.start_date }}</td>
<td>{{ phase.end_date|default('N/A') }}</td>
</tr>
{% else %}
<tr>
<td colspan="7">{{ __('No launch phases found.') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<h5 class="card-title mb-3">{{ __('Create New Phase') }}</h5>
<form action="/registry/phases" method="post">
{{ csrf.field | raw }}
<div class="mb-3">
<label for="phaseType" class="form-label required">{{ __('Phase Type') }}</label>
<select class="form-select" id="phaseType" name="phaseType" required>
<option value="sunrise">Sunrise</option>
<option value="landrush">Landrush</option>
<option value="claims">Claims</option>
<option value="open">Open</option>
<option value="custom">Custom</option>
</select>
</div>
<div class="mb-3">
<label for="phaseName" class="form-label">{{ __('Phase Name') }}</label>
<input type="text" class="form-control" id="phaseName" name="phaseName" placeholder="Enter phase name">
<small class="form-hint">The "Phase Name" field is required only if the "Type" is set to "Custom".</small>
</div>
<div class="mb-3">
<div class="form-label">{{ __('Phase Category') }}</div>
<div>
<label class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="phaseCategory" id="First-Come-First-Serve" value="First-Come-First-Serve" checked>
<span class="form-check-label">First-Come-First-Serve</span>
<small class="form-hint">{{ __('Single application only.') }}</small>
</label>
<label class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="phaseCategory" id="Application" value="Application">
<span class="form-check-label">Application</span>
<small class="form-hint">{{ __('Multiple applications allowed.') }}</small>
</label>
</div>
</div>
<div class="mb-3">
<label for="phaseDescription" class="form-label required">{{ __('Phase Description') }}</label>
<textarea class="form-control" id="phaseDescription" name="phaseDescription" rows="3" placeholder="{{ __('Enter phase description') }}" required></textarea>
</div>
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="mb-3">
<label for="phaseStart" class="form-label required">{{ __('Phase Start Date') }}</label>
<input type="datetime-local" class="form-control" placeholder="e.g., 01/01/2023" id="phaseStart" name="phaseStart" required>
<small class="form-text text-muted"><strong>{{ __('Please Note:') }}</strong> {{ __('All times displayed are in') }} <strong>Coordinated Universal Time (UTC)</strong></small>
</div>
</div>
<div class="col-sm-6 col-md-6">
<div class="mb-3">
<label for="phaseEnd" class="form-label">{{ __('Phase End Date') }}</label>
<input type="datetime-local" class="form-control" placeholder="e.g., 01/01/2023" id="phaseEnd" name="phaseEnd">
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col-auto">
<button type="submit" class="btn btn-primary">{{ __('Update Phases') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% include 'partials/footer.twig' %}

View file

@ -0,0 +1,131 @@
{% extends "layouts/app.twig" %}
{% block title %}{{ __('Manage Launch Phases') }} {{ __('for') }} {{ tld_u }}{% 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">
{{ __('Manage Launch Phases') }} {{ __('for') }} {{ tld_u }}
</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-header">
<h5 class="card-title">{{ __('Manage Launch Phases') }}</h5>
</div>
<div class="card-body">
<div class="table-responsive mb-3">
<table class="table">
<thead>
<tr>
<th>{{ __('Phase Type') }}</th>
<th>{{ __('Phase Name') }}</th>
<th>{{ __('Phase Category') }}</th>
<th>{{ __('Phase Description') }}</th>
<th>{{ __('Start Date') }}</th>
<th>{{ __('End Date') }}</th>
</tr>
</thead>
<tbody>
{% for phase in launch_phases %}
<tr>
<td>{{ phase.phase_type|capitalize }}</td>
<td>{{ phase.phase_name|default('N/A') }}</td>
<td>{{ phase.phase_category }}</td>
<td>{{ phase.phase_description }}</td>
<td>{{ phase.start_date }}</td>
<td>{{ phase.end_date|default('N/A') }}</td>
</tr>
{% else %}
<tr>
<td colspan="7">{{ __('No launch phases found.') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<h5 class="card-title mb-3">{{ __('Create New Phase') }}</h5>
<form action="/registry/phases" method="post">
{{ csrf.field | raw }}
<div class="mb-3">
<label for="phaseType" class="form-label required">{{ __('Phase Type') }}</label>
<select class="form-select" id="phaseType" name="phaseType" required>
<option value="sunrise">Sunrise</option>
<option value="landrush">Landrush</option>
<option value="claims">Claims</option>
<option value="open">Open</option>
<option value="custom">Custom</option>
</select>
</div>
<div class="mb-3">
<label for="phaseName" class="form-label">{{ __('Phase Name') }}</label>
<input type="text" class="form-control" id="phaseName" name="phaseName" placeholder="Enter phase name">
<small class="form-hint">The "Phase Name" field is required only if the "Type" is set to "Custom".</small>
</div>
<div class="mb-3">
<div class="form-label">{{ __('Phase Category') }}</div>
<div>
<label class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="phaseCategory" id="First-Come-First-Serve" value="First-Come-First-Serve" checked>
<span class="form-check-label">First-Come-First-Serve</span>
<small class="form-hint">{{ __('Single application only.') }}</small>
</label>
<label class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="phaseCategory" id="Application" value="Application">
<span class="form-check-label">Application</span>
<small class="form-hint">{{ __('Multiple applications allowed.') }}</small>
</label>
</div>
</div>
<div class="mb-3">
<label for="phaseDescription" class="form-label required">{{ __('Phase Description') }}</label>
<textarea class="form-control" id="phaseDescription" name="phaseDescription" rows="3" placeholder="{{ __('Enter phase description') }}" required></textarea>
</div>
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="mb-3">
<label for="phaseStart" class="form-label required">{{ __('Phase Start Date') }}</label>
<input type="datetime-local" class="form-control" placeholder="e.g., 01/01/2023" id="phaseStart" name="phaseStart" required>
<small class="form-text text-muted"><strong>{{ __('Please Note:') }}</strong> {{ __('All times displayed are in') }} <strong>Coordinated Universal Time (UTC)</strong></small>
</div>
</div>
<div class="col-sm-6 col-md-6">
<div class="mb-3">
<label for="phaseEnd" class="form-label">{{ __('Phase End Date') }}</label>
<input type="datetime-local" class="form-control" placeholder="e.g., 01/01/2023" id="phaseEnd" name="phaseEnd">
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col-auto">
<button type="submit" class="btn btn-primary">{{ __('Update Phases') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% include 'partials/footer.twig' %}
</div>
{% endblock %}

View file

@ -26,7 +26,7 @@
<div class="col-12">
{% include 'partials/flash.twig' %}
<div class="card mb-3">
<div class="card">
<div class="card-header">
<h5 class="card-title">{{ __('Manage Promotions') }} {{ __('for') }} {{ tld_u }}</h5>
</div>

View file

@ -24,7 +24,7 @@
}
function actionsFormatter(cell, formatterParams, onRendered) {
return `<a class="btn btn-icon btn-outline-primary" href="/registry/tld/${cell.getRow().getData().tld_o}" title="{{ __('Manage Settings') }}"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5" /></svg></a> <a class="btn btn-icon btn-outline-green" href="/registry/promotion/${cell.getRow().getData().tld_o}" title="{{ __('Manage Promotions') }}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 17m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M7 7m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M6 18l12 -12" /></svg></a> <a class="btn btn-icon btn-outline-orange" href="/registry/idnexport/${cell.getRow().getData().tld_o}" title="{{ __('Export IDN Table') }}" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3" /></svg></a>`;
return `<a class="btn btn-icon btn-outline-primary" href="/registry/tld/${cell.getRow().getData().tld_o}" title="{{ __('Manage Settings') }}"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5" /></svg></a> <a class="btn btn-icon btn-outline-green" href="/registry/promotion/${cell.getRow().getData().tld_o}" title="{{ __('Manage Promotions') }}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 17m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M7 7m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M6 18l12 -12" /></svg></a> <a class="btn btn-icon btn-outline-indigo" href="/registry/phases/${cell.getRow().getData().tld_o}" title="{{ __('Manage Launch Phases') }}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M16 2c.183 0 .355 .05 .502 .135l.033 .02c.28 .177 .465 .49 .465 .845v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 .514 -.874l.093 -.046l.066 -.025l.1 -.029l.107 -.019l.12 -.007q .083 0 .161 .013l.122 .029l.04 .012l.06 .023c.328 .135 .568 .44 .61 .806l.007 .117v1h6v-1a1 1 0 0 1 1 -1m3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16z" /><path d="M9.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1" /><path d="M13.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1" /><path d="M17.02 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1" /><path d="M12.02 15a1 1 0 0 1 0 2a1.001 1.001 0 1 1 -.005 -2z" /><path d="M9.015 16a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1" /></svg></a> <a class="btn btn-icon btn-outline-orange" href="/registry/idnexport/${cell.getRow().getData().tld_o}" title="{{ __('Export IDN Table') }}" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3" /></svg></a>`;
}
// Mapping of database string values to script names
@ -76,7 +76,7 @@
{title:"TLD", field:"tld", minWidth:50, headerSort:true, resizable:false, formatter: tldLinkFormatter, responsive:0},
{ title: "{{ __('Script') }}", field: "idn_table", width:300, minWidth:80, headerSort:true, resizable:false, formatter: scriptNameFormatter, responsive:2},
{title:"DNSSEC", field:"secure", width:250, minWidth:80, headerSort:true, resizable:false, formatter: secureFormatter, responsive:2},
{title: "{{ __('Actions') }}", formatter: actionsFormatter, headerSort: false, resizable:false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }},
{title: "{{ __('Actions') }}", formatter: actionsFormatter, minWidth:200, headerSort: false, resizable:false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }},
]
});
var searchInput = document.getElementById("search-input");