Skip to content

Commit

Permalink
restyle the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Nov 26, 2012
1 parent 90cc442 commit 81a19d5
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 70 deletions.
182 changes: 113 additions & 69 deletions Core/Comments/View/InfinitasComments/admin_index.ctp
Expand Up @@ -21,82 +21,126 @@
echo $this->Form->create('InfinitasComment', array('action' => 'mass'));
echo $this->Infinitas->adminIndexHead($filterOptions, array(
'edit',
'reply',
'toggle',
'spam',
'ban',
'delete'
));
?>
<table class="listing">
<?php
echo $this->Infinitas->adminTableHeader(array(
$this->Form->checkbox('all') => array(
'class' => 'first'
),
$this->Paginator->sort(__d('comments', 'Where'), 'class'),
$this->Paginator->sort('email') => array(
'style' => '50px;'
),
$this->Paginator->sort('ip_address'),
$this->Paginator->sort('created') => array(
'class' => 'date'
),
$this->Paginator->sort('points') => array(
'width' => '50px'
),
__d('comments', 'Status') => array(
'class' => 'actions'

$this->Infinitas->adminTableHeader(array(
$this->Form->checkbox('all') => array(
'class' => 'first'
),
$this->Paginator->sort(__d('comments', 'Where'), 'class'),
$this->Paginator->sort('email') => array(
'style' => '50px;'
),
$this->Paginator->sort('ip_address'),
$this->Paginator->sort('created') => array(
'class' => 'date'
),
$this->Paginator->sort('points') => array(
'width' => '50px'
),
__d('comments', 'Status') => array(
'class' => 'actions'
)
));
echo $this->Form->checkbox('all');
foreach ($comments as $comment) {
$class = null;
$tags = array();
if(!$comment['InfinitasComment']['mx_record']) {
$class = 'text-warning';
$tags[] = $this->Html->tag('div', __d('comments', 'MX Record'), array(
'class' => 'label label-warning'
));
}
if (!$comment['InfinitasComment']['active']) {
$class = 'text-warning';
$tags[] = $this->Html->tag('div', __d('comments', 'Disabled'), array(
'class' => 'label label-info'
));
}

if ($comment['InfinitasComment']['status'] == 'spam') {
$class = 'text-error';
$tags[] = $this->Html->tag('div', __d('comments', 'Spam'), array(
'class' => 'label label-important'
));
}
$points = 'badge-success';
if($comment['InfinitasComment']['points'] < 3) {
$points = 'badge badge-warning';
if($comment['InfinitasComment']['points'] < 0) {
$points = 'badge badge-important';
}
}
$tags[] = $this->Html->tag('div', $comment['InfinitasComment']['points'], array(
'class' => array(
'badge',
$points
)
));
$title = $this->Infinitas->massActionCheckBox($comment) . $this->Html->link($comment['InfinitasComment']['post'], array(
'action' => 'edit',
$comment['InfinitasComment']['id']
));

$title .= $this->Infinitas->date($comment['InfinitasComment']['created']);

echo $this->Html->tag('div', implode('', array(
$this->Html->link($this->Gravatar->image($comment['InfinitasComment']['email']), 'mailto://' . $comment['InfinitasComment']['email'], array(
'escape' => false,
'class' => 'pull-left'
)),
$this->Html->tag('div', implode('', array(
$this->Html->tag('h4', $title),
$this->Html->tag('p', str_replace('\n', ' ', strip_tags($comment['InfinitasComment']['comment'])), array(
'class' => $class
)),
$this->Html->tag('div', implode('', $tags), array(
'class' => 'labels'
))
)), array('class' => 'media-body')),
$this->Html->tag('hr')
)), array('class' => 'media'));
continue;

?>
<tr class="multi-line">
<td>
<?php
echo $this->Html->link(
$comment['InfinitasComment']['class'],
array(
'Comment.class' => $comment['InfinitasComment']['class']
)
);
?>&nbsp;
</td>
<td><?php echo $this->Text->autoLinkEmails($comment['InfinitasComment']['email']); ?>&nbsp;</td>
<td><?php echo $comment['InfinitasComment']['ip_address']; ?>&nbsp;</td>
<td><?php echo $this->Time->timeAgoInWords(); ?>&nbsp;</td>
<td><?php echo $comment['InfinitasComment']['points']; ?>&nbsp;</td>
<td>
<?php
echo $this->Infinitas->status($comment['InfinitasComment']['active'], $comment['InfinitasComment']['id']);
if (!$comment['InfinitasComment']['active']) {
echo ' ', Inflector::humanize($comment['InfinitasComment']['status']);
}
echo $this->Infinitas->status(
$comment['InfinitasComment']['mx_record'],
array(
'title_yes' => __d('comments', 'MX Record :: The email address seems valid'),
'title_no' => __d('comments', 'MX Record :: This email address could be fake'),
)
);
?>
</td>
</tr> <?php
}

foreach ($comments as $comment) { ?>
<tr class="multi-line">
<td><?php echo $this->Infinitas->massActionCheckBox($comment); ?>&nbsp;</td>
<td>
<?php
echo $this->Html->link(
$comment['InfinitasComment']['class'],
array(
'Comment.class' => $comment['InfinitasComment']['class']
)
);
?>&nbsp;
</td>
<td><?php echo $this->Text->autoLinkEmails($comment['InfinitasComment']['email']); ?>&nbsp;</td>
<td><?php echo $comment['InfinitasComment']['ip_address']; ?>&nbsp;</td>
<td><?php echo $this->Time->timeAgoInWords($comment['InfinitasComment']['created']); ?>&nbsp;</td>
<td><?php echo $comment['InfinitasComment']['points']; ?>&nbsp;</td>
<td>
<?php
echo $this->Infinitas->status($comment['InfinitasComment']['active'], $comment['InfinitasComment']['id']);
if (!$comment['InfinitasComment']['active']) {
echo ' ', Inflector::humanize($comment['InfinitasComment']['status']);
}
echo $this->Infinitas->status(
$comment['InfinitasComment']['mx_record'],
array(
'title_yes' => __d('comments', 'MX Record :: The email address seems valid'),
'title_no' => __d('comments', 'MX Record :: This email address could be fake'),
)
);
?>
</td>
</tr>
<tr>
<td colspan="2">
<?php
echo $this->Html->link($comment['InfinitasComment']['post'], array(
'action' => 'edit', $comment['InfinitasComment']['id']
));
?>&nbsp;
</td>
<td colspan="100">
<?php echo str_replace('\n', ' ', strip_tags($comment['InfinitasComment']['comment'])); ?>
</td>
</tr> <?php
}
?>
</table>
<?php
echo $this->Form->end();
echo $this->element('pagination/admin/navigation');
2 changes: 1 addition & 1 deletion View/Themed/infinitas
Submodule infinitas updated 1 files
+38 −2 webroot/less/admin.less

0 comments on commit 81a19d5

Please sign in to comment.