<?php $contactHelper = $this->getHelper('ContactFlags') ?>
<div class="controls">
 <?php if (! $this->compact): ?>
  <?= $this->tabs; ?>
 <?php endif ?>
  <h1><?= $this->translate('Contact details') ?></h1>

<?php if (! $contact): ?>
  <?= $this->translate('No such contact') ?>: <?= $contactName ?>
</div>
<?php return; endif ?>

  <table class="name-value-table">
    <tbody>
      <tr>
        <th></th>
        <td><strong><?= $this->escape($contact->contact_alias) ?></strong> (<?= $contact->contact_name ?>)</td>
      </tr>
<?php if ($contact->contact_email): ?>
      <tr>
        <th><?= $this->translate('Email') ?></th>
        <td>
            <a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
                <?= $this->escape($contact->contact_email); ?>
            </a>
        </td>
      </tr>
<?php endif ?>
<?php if ($contact->contact_pager): ?>
      <tr>
        <th><?= $this->translate('Pager') ?></th>
        <td><?= $this->escape($contact->contact_pager) ?></td>
      </tr>
<?php endif ?>
      <tr>
        <th><?= $this->translate('Hosts') ?></th>
        <td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br />
        <?= $this->escape($contact->contact_notify_host_timeperiod) ?></td>
      </tr>
      <tr>
        <th><?= $this->translate('Services') ?></th>
        <td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br />
        <?= $this->escape($contact->contact_notify_service_timeperiod) ?></td>
      </tr>
    </tbody>
  </table>
  <?php if (count($commands)): ?>
  <h1><?= $this->translate('Commands') ?>:</h1>
  <ul>
  <?php foreach ($commands as $command): ?>
    <li><?= $command->command_name ?></li>
  <?php endforeach ?>
  </ul>
  <?php endif ?>
  <h1><?= $this->translate('Notifications sent to this contact') ?></h1>
  <?= $this->limiter; ?>
  <?= $this->paginator; ?>
</div>

<?php if (count($notifications)): ?>
<?= $this->partial('list/notifications.phtml', array(
    'notifications' => $notifications,
    'compact' => true
)); ?>
<?php else: ?>
<div class="content"><?= $this->translate('No notifications have been sent for this contact') ?></div>
<?php endif ?>
