Add expand to dashboard-comment

temporary, to be replaced with a nice solution, same like for the normal comment view
This commit is contained in:
onli 2013-10-01 01:57:42 +02:00
parent 1e8d3a58e4
commit eadc5bc027
2 changed files with 16 additions and 2 deletions

View File

@ -28,8 +28,18 @@ $comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPref
ORDER BY c.id DESC LIMIT 5");
if (count($comments) > 1) {
foreach ($comments as &$comment) {
$entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
$comment['entrylink'] = $entrylink;
$comment['entrylink'] = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
$comment['fullBody'] = $comment['body'];
$comment['summary'] = serendipity_mb('substr', $comment['body'], 0, 100);
if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
$comment['excerpt'] = true;
// When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
$comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody']));
$comment['summary'] = nl2br(strip_tags($comment['summary']));
}
}
}

View File

@ -17,11 +17,15 @@
<li><div class="comment_summary">
<b><a href="{$comment.entrylink}" title="Comment to {$comment.title}">#{$comment.id}</a></b> - {$comment.body|truncate:100:"&hellip;"}
</div>
<div id="c{$comment.id}_full" class="comment_full additional_info">{$comment.fullBody}</div>
<ul class="plainList actions">
<li><a class="button_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-zoom-in"></span><span class="visuallyhidden"> {$CONST.VIEW}</span></a></li>
<li><a class="button_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="button_link comments_reply" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=reply&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;{$urltoken}" title="{$CONST.REPLY}"><span class="icon-chat"></span><span class="visuallyhidden"> {$CONST.REPLY}</span></a></li>
{if $comment.excerpt}
<li><button class="button_link toggle_comment_full" type="button" data-href="#c{$comment.id}_full" title="{$CONST.TOGGLE_ALL}"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></button></li>
{/if}
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
<li><a class="button_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=approve&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" title="{$CONST.APPROVE}"><span class="icon-lock-open"></span><span class="visuallyhidden">{$CONST.APPROVE}</span></a></li>
{/if}