View contact interface improvement

This commit is contained in:
Pinga 2024-02-20 00:17:30 +02:00
parent 5b7bb13434
commit c8300c3bec
2 changed files with 36 additions and 1 deletions

View file

@ -390,7 +390,7 @@ class ContactsController extends Controller
return $response->withHeader('Location', '/contacts')->withStatus(302); return $response->withHeader('Location', '/contacts')->withStatus(302);
} }
$contact = $db->selectRow('SELECT id, identifier, voice, fax, email, nin, nin_type, crdate, clid, disclose_voice, disclose_fax, disclose_email FROM contact WHERE identifier = ?', $contact = $db->selectRow('SELECT id, identifier, voice, fax, email, nin, nin_type, crdate, lastupdate, clid, disclose_voice, disclose_fax, disclose_email FROM contact WHERE identifier = ?',
[ $args ]); [ $args ]);
if ($contact) { if ($contact) {

View file

@ -51,10 +51,28 @@
<div class="datagrid-title">{{ __('Phone') }}</div> <div class="datagrid-title">{{ __('Phone') }}</div>
<div class="datagrid-content">{{ contact.voice }} {% if contact.disclose_voice == '1' %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-green" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><title>{{ __('Visible in Public') }}</title><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" /></svg>{% else %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-orange" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><title>{{ __('Hidden from Public') }}</title><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828" /><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87" /><path d="M3 3l18 18" /></svg>{% endif %}</div> <div class="datagrid-content">{{ contact.voice }} {% if contact.disclose_voice == '1' %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-green" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><title>{{ __('Visible in Public') }}</title><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" /></svg>{% else %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-orange" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><title>{{ __('Hidden from Public') }}</title><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828" /><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87" /><path d="M3 3l18 18" /></svg>{% endif %}</div>
</div> </div>
<div class="datagrid-item">
<div class="datagrid-title">{{ __('Fax') }}</div>
<div class="datagrid-content">{{ contact.fax|default('N/A') }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ __('NIN') }}</div>
<div class="datagrid-content user-select-all">{{ contact.nin|default('N/A') }} {% if contact.nin_type == 'business' %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-info" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><title>{{ __('Business') }}</title><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 21l18 0" /><path d="M9 8l1 0" /><path d="M9 12l1 0" /><path d="M9 16l1 0" /><path d="M14 8l1 0" /><path d="M14 12l1 0" /><path d="M14 16l1 0" /><path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16" /></svg>{% endif %}</div>
</div>
<div class="datagrid-item"> <div class="datagrid-item">
<div class="datagrid-title">{{ __('Creation Date') }}</div> <div class="datagrid-title">{{ __('Creation Date') }}</div>
<div class="datagrid-content">{{ contact.crdate }}</div> <div class="datagrid-content">{{ contact.crdate }}</div>
</div> </div>
<div class="datagrid-item">
<div class="datagrid-title">{{ __('Last Updated') }}</div>
<div class="datagrid-content">{{ contact.lastupdate }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ __('Auth Info') }}</div>
<div class="datagrid-content blur" id="authInfo" onclick="toggleBlur()">
{{ contactAuth.authinfo }}
</div>
</div>
<div class="datagrid-item"> <div class="datagrid-item">
<div class="datagrid-title">{{ __('Registrar') }}</div> <div class="datagrid-title">{{ __('Registrar') }}</div>
<div class="datagrid-content">{{ registrars.name }}</div> <div class="datagrid-content">{{ registrars.name }}</div>
@ -244,4 +262,21 @@
</div> </div>
{% include 'partials/footer.twig' %} {% include 'partials/footer.twig' %}
</div> </div>
<style>
.blur {
filter: blur(5px);
cursor: pointer;
}
.blur:hover {
filter: blur(2px);
}
</style>
<script>
function toggleBlur() {
var authInfo = document.getElementById("authInfo");
authInfo.classList.toggle("blur");
}
</script>
{% endblock %} {% endblock %}