show/contact: first attempt to restyle them

refs #7104
This commit is contained in:
Thomas Gelf 2014-09-05 18:09:22 +02:00
parent 38c6d6aaf8
commit 48f49c56b2
1 changed files with 57 additions and 67 deletions

View File

@ -1,69 +1,59 @@
<?php <?php $contactHelper = $this->getHelper('ContactFlags') ?>
$contactHelper = $this->getHelper('ContactFlags'); <div class="controls">
?> <h1><?= $this->translate('Contact details') ?></h1>
<div style="margin-top: 0.5em;"> <div class="circular" style="margin-top: 1em; margin-left: 2em; width: 120px; height: 120px; float: left; background-image: url('<?=
<?php if ($contact): ?> $this->href('static/gravatar', array('email' => $contact->contact_email))
<table style="border-spacing: 0.25em; border-collapse: separate;"> ?>')"></div>
<thead>
<tr>
<th colspan="2" style="text-align: left">
<?= $this->escape($contact->contact_name) ?><span style="font-weight: normal;"> (<?=
$this->escape($contact->contact_alias)
?>)</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><?= t('Email') ?></td>
<td><?php printf(
'<a href="mailto:%1$s">%1$s</a>',
$this->escape($contact->contact_email)
); ?></td>
</tr>
<?php if ($contact->contact_pager): ?>
<tr>
<td><?= t('Pager') ?></td>
<td><?= $this->escape($contact->contact_pager) ?></td>
</tr>
<?php endif; ?>
<tr>
<td><?= t('Flags (service)') ?></td>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?></td>
</tr>
<tr>
<td><?= t('Flags (host)') ?></td>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?></td>
</tr>
<tr>
<td><?= t('Service notification period') ?></td>
<td><?= $this->escape($contact->contact_notify_service_timeperiod) ?></td>
</tr>
<tr>
<td><?= t('Host notification period') ?></td>
<td><?= $this->escape($contact->contact_notify_host_timeperiod) ?></td>
</tr>
</tbody>
</table>
<?php if (count($commands)): ?> <?php if (! $contact): ?>
<h4><?= $this->translate('Commands'); ?>:</h4> <?= $this->translate('No such contact') ?>: <?= $contactName ?>
<ul>
<?php foreach ($commands as $command): ?>
<li><?= $command->command_name; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<h4><?= $this->translate('Notifications'); ?>:</h4>
<?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?>
<?php else: ?>
<p><?= $this->translate('No notifications for this contact'); ?></p>
<?php endif; ?>
<?php else: ?>
<?= $this->translate('No such contact'); ?>: <?= $contactName; ?>
<?php endif; ?>
</div> </div>
<?php return; endif ?>
<table class="avp" style="width: 70%">
<tbody>
<tr>
<th style="width: 20%"></th>
<td><strong><?= $this->escape($contact->contact_alias) ?></strong> (<?= $contact->contact_name ?>)</td>
</tr>
<?php if ($contact->contact_email): ?>
<tr>
<th><?= t('Email') ?></th>
<td><?= sprintf('<a href="mailto:%1$s">%1$s</a>', $this->escape($contact->contact_email)) ?></td>
</tr>
<?php endif ?>
<?php if ($contact->contact_pager): ?>
<tr>
<th><?= t('Pager') ?></th>
<td><?= $this->escape($contact->contact_pager) ?></td>
</tr>
<?php endif ?>
<tr>
<th><?= t('Hosts') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br />
<?= $this->escape($contact->contact_notify_host_timeperiod) ?></td>
</tr>
<tr>
<th><?= t('Services') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br />
<?= $this->escape($contact->contact_notify_service_timeperiod) ?></td>
</tr>
</tbody>
</table>
<?php /* WTF?? */ ?>
<?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>
</div>
<?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?>
<?php else: ?>
<div class="content"><?= $this->translate('No notifications have been sent for this contact') ?></div>
<?php endif ?>