added displaying if a contact exists
This commit is contained in:
@@ -180,7 +180,16 @@
|
||||
<?php foreach($address->wohneinheiten as $unit): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="#" data-home-id="<?=$unit->id?>" data-home-contact title="Kontakte bearbeiten"><i class="fas fa-users-cog text-primary"></i></a>
|
||||
<?php
|
||||
$contacts = $unit->contact ? json_decode($unit->contact, true) : [];
|
||||
$contactCount = is_array($contacts) ? count($contacts) : 0;
|
||||
?>
|
||||
<a href="#" data-home-id="<?=$unit->id?>" data-home-contact title="Kontakte bearbeiten<?=$contactCount ? ' (' . $contactCount . ')' : ''?>" style="position: relative; display: inline-block;">
|
||||
<i class="fas fa-users-cog <?=$contactCount ? 'text-success' : 'text-muted'?>"></i>
|
||||
<?php if($contactCount): ?>
|
||||
<span style="position: absolute; top: -8px; right: -8px; background: #28a745; color: white; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; display: flex; align-items: center; justify-content: center; font-weight: bold; padding: 0; box-sizing: border-box;"><?=$contactCount?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<a href="<?=self::getUrl("ADBWohneinheit", "edit", ["id" => $unit->id])?>"><i class="fas fa-edit"></i></a>
|
||||
</td>
|
||||
<td><?=$unit->id?></td>
|
||||
|
||||
Reference in New Issue
Block a user