Make contacts' view look more like contactgroups' view

This commit is contained in:
Alexander Klimov 2014-07-15 16:16:11 +02:00
parent c7c2ad3790
commit 4c415aac5c

View File

@ -11,25 +11,31 @@ $contactHelper = $this->getHelper('ContactFlags');
</div> </div>
<div class="content contacts"> <div class="content contacts">
<table data-base-target="_next" class="action">
<tbody>
<?php <?php
if (count($contacts) === 0) { if (count($contacts) === 0) {
echo t('No contacts matching the filter'); echo t('No contacts matching the filter');
} }
foreach ($contacts as $contact): foreach ($contacts as $contact):
$periodLink = $this->href('monitoring/show/contacts', array('contact' => $contact->contact_name)); ?> $periodLink = $this->href('monitoring/show/contacts', array('contact' => $contact->contact_name)); ?>
<tr> <div style="background-color: lightgray; padding: 0.5em; border-radius: 0.5em; overflow: hidden; margin: 0.125em; float: left;">
<td><?= $contact->contact_name ?></td> <img src="<?= $this->href('/static/gravatar', array('email' => $contact->contact_email )) ?>"
<td><?= $contact->contact_alias ?></td> style="width: 60px; border: 4px solid white; border-radius: 8px; margin-right: 8px; float: left;" />
<td><?= $contact->contact_email ?></td> <strong><?= $contact->contact_name ?></strong> (<?= $contact->contact_alias ?>)
<td><?= $contact->contact_pager ?></td> <?php
<td><?= $contactHelper->contactFlags($contact, 'service') ?></td> foreach (array(
<td><?= $contactHelper->contactFlags($contact, 'host') ?></td> $contact->contact_email => 'eMail: <a href="mailto:%1$s">%1$s</a>',
<td><?= $contact->contact_notify_service_timeperiod ?></td> $contact->contact_pager => 'Pager: %s',
<td><?= $contact->contact_notify_host_timeperiod ?></td> $contact->contact_notify_service_timeperiod => 'Service notification period: %s',
</tr> $contact->contact_notify_host_timeperiod => 'Host notification period: %s'
<?php endforeach; ?> ) as $value => $format):
</tbody> if ($value): ?>
</table> <br />
<?php
printf($format, $value);
endif;
endforeach;
?>
<div class="clearfix"></div>
</div>
<?php endforeach; ?>
</div> </div>