Merge branch '2.0' of github.com:s9y/Serendipity into 2.0

This commit is contained in:
Matthias Mees 2013-07-20 22:52:54 +02:00
commit d1bf5f628b
3 changed files with 96 additions and 72 deletions

View File

@ -61,8 +61,8 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio
$comment['parent_id'] = $serendipity['POST']['replyTo'];
if (!empty($comment['comment'])) {
if (serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL')) {
echo '<script type="text/javascript">alert("' . COMMENT_ADDED . '"); parent.focus(); this.close();</script>';
echo '<noscript><p class="serendipityAdminMsgError msg_error"><img class="img_error" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . COMMENT_ADDED . '</p></noscript>';
$data['commentReplied'] = true;
echo serendipity_smarty_show('admin/comments.inc.tpl', $data);
return true;
} else {
$errormsg .= COMMENT_NOT_ADDED;

View File

@ -1,6 +1,10 @@
{if !empty($errormsg)}
<span class="msg_error"><span class="icon-attention-circled"></span> {$errormsg}</span>
{/if}
{if $commentReplied}
<span class="msg_success"><span class="icon-ok-circled"></span> {$CONST.COMMENT_ADDED}</span>
<button id="comment_replied" type="button">{$CONST.BACK}</button>
{else}
<h2>{$CONST.COMMENTS}</h2>
<form action="" method="GET">
@ -82,82 +86,84 @@
</div>
</fieldset>
</form>
{if !is_array($sql)}
<span class="msg_notice"><span class="icon-info-circled"></span> {$CONST.NO_COMMENTS}</span>
{if !is_array($sql)}
<span class="msg_notice"><span class="icon-info-circled"></span> {$CONST.NO_COMMENTS}</span>
<a class="block_level" href="serendipity_admin.php?serendipity[adminModule]=comments">Return to default comment list</a> {* l18n *}
{else}
<form id="formMultiDelete" action="" method="POST" name="formMultiDelete">
{$formtoken}
<input name="serendipity[formAction]" type="hidden" value="multiDelete">
<a class="block_level" href="serendipity_admin.php?serendipity[adminModule]=comments">Return to default comment list</a> {* l18n *}
{else}
<form id="formMultiDelete" action="" method="POST" name="formMultiDelete">
{$formtoken}
<input name="serendipity[formAction]" type="hidden" value="multiDelete">
<div class="clearfix comments_pane">
{if is_array($comments)}
<ul id="serendipity_comments_list" class="clearfix plainList zebra_list">
{foreach $comments AS $comment}
<li id="comment_{$comment.id}" class="clearfix {cycle values="odd,even"}"><div class="form_check">
<input id="multidelete_comment{$comment.id}" class="multidelete" type="checkbox" name="serendipity[delete][{$comment.id}]" value="{$comment.entry_id}" data-multidelid="comment_{$comment.id}">
<label for="serendipity_multidelete_comment_{$comment.id}" class="visuallyhidden">Multiselect this comment</label> {* i18n *}
</div>
<div class="clearfix comments_pane">
{if is_array($comments)}
<ul id="serendipity_comments_list" class="clearfix plainList zebra_list">
{foreach $comments AS $comment}
<li id="comment_{$comment.id}" class="clearfix {cycle values="odd,even"}"><div class="form_check">
<input id="multidelete_comment{$comment.id}" class="multidelete" type="checkbox" name="serendipity[delete][{$comment.id}]" value="{$comment.entry_id}" data-multidelid="comment_{$comment.id}">
<label for="serendipity_multidelete_comment_{$comment.id}" class="visuallyhidden">Multiselect this comment</label> {* i18n *}
</div>
<h4 id="c{$comment.id}">{($comment.type == 'NORMAL') ? $CONST.COMMENT : (($comment.type == 'TRACKBACK') ? $CONST.TRACKBACK : $CONST.PINGBACK )} #{$comment.id} {$CONST.IN_REPLY_TO} <a href="{$comment.entry_url}">{$comment.title|escape}</a> {$CONST.ON} {$comment.timestamp|@formatTime:'%b %e %Y, %H:%M'}</h4>
<h4 id="c{$comment.id}">{($comment.type == 'NORMAL') ? $CONST.COMMENT : (($comment.type == 'TRACKBACK') ? $CONST.TRACKBACK : $CONST.PINGBACK )} #{$comment.id} {$CONST.IN_REPLY_TO} <a href="{$comment.entry_url}">{$comment.title|escape}</a> {$CONST.ON} {$comment.timestamp|@formatTime:'%b %e %Y, %H:%M'}</h4>
<details>
<summary>Comment data</summary> {* i18n *}
<dl class="comment_data clearfix">
<dt>{$CONST.AUTHOR}:</dt>
<dd>{$comment.author|escape|truncate:40:"&hellip;"} {$comment.action_author}</dd>
<dt>{$CONST.EMAIL}:</dt>
<dd>{if empty($comment.email)}N/A{else}<a href="mailto:{$comment.email|escape}" title="{$comment.email|escape}">{$comment.email|escape|truncate:40:"&hellip;"}</a>{if $comment.subscribed == 'true'} <i>({$CONST.ACTIVE_COMMENT_SUBSCRIPTION})</i>{/if}{/if} {$comment.action_email}</dd>
<dt>IP:</dt>
<dd>{if empty($comment.ip)}N/A{else}{$comment.ip|escape}{/if} {$comment.action_ip}</dd>
<dt>URL:</dt>
<dd>{if empty($comment.url)}N/A{else}<a href="{$comment.url|escape}" title="{$comment.url|escape}">{$comment.url|escape|truncate:40:"&hellip;"}</a> {/if} {$comment.action_url}</dd>
<dt>{$CONST.REFERER}:</dt>
<dd>{if empty($comment.referer)}N/A{else}<a href="{$comment.referer|escape}" title="{$comment.referer|escape}">{$comment.referer|escape|truncate:40:"&hellip;"}</a>{/if} {$comment.action_referer}</dd>
</dl>
</details>
<details>
<summary>Comment data</summary> {* i18n *}
<dl class="comment_data clearfix">
<dt>{$CONST.AUTHOR}:</dt>
<dd>{$comment.author|escape|truncate:40:"&hellip;"} {$comment.action_author}</dd>
<dt>{$CONST.EMAIL}:</dt>
<dd>{if empty($comment.email)}N/A{else}<a href="mailto:{$comment.email|escape}" title="{$comment.email|escape}">{$comment.email|escape|truncate:40:"&hellip;"}</a>{if $comment.subscribed == 'true'} <i>({$CONST.ACTIVE_COMMENT_SUBSCRIPTION})</i>{/if}{/if} {$comment.action_email}</dd>
<dt>IP:</dt>
<dd>{if empty($comment.ip)}N/A{else}{$comment.ip|escape}{/if} {$comment.action_ip}</dd>
<dt>URL:</dt>
<dd>{if empty($comment.url)}N/A{else}<a href="{$comment.url|escape}" title="{$comment.url|escape}">{$comment.url|escape|truncate:40:"&hellip;"}</a> {/if} {$comment.action_url}</dd>
<dt>{$CONST.REFERER}:</dt>
<dd>{if empty($comment.referer)}N/A{else}<a href="{$comment.referer|escape}" title="{$comment.referer|escape}">{$comment.referer|escape|truncate:40:"&hellip;"}</a>{/if} {$comment.action_referer}</dd>
</dl>
</details>
<div id="c{$comment.id}_summary" class="comment_summary">{$comment.fullBody|truncate:120:"&hellip;"}</div>
<div id="c{$comment.id}_summary" class="comment_summary">{$comment.fullBody|truncate:120:"&hellip;"}</div>
<div id="c{$comment.id}_full" class="comment_full additional_info">{$comment.fullBody}</div>
<div id="c{$comment.id}_full" class="comment_full additional_info">{$comment.fullBody}</div>
<ul class="plainList clearfix actions">
{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}
{if ($comment.status == 'approved')}
<li><a class="button_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=pending&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" title="{$CONST.SET_TO_MODERATED}"><span class="icon-lock"></span><span class="visuallyhidden"> {$CONST.SET_TO_MODERATED}</span></a></li>
{/if}
{if $comment.excerpt}
<li><a class="button_link toggle_comment_full" href="#c{$comment.id}_full" title="{$CONST.TOGGLE_ALL}"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></a></li>
{/if}
<li><a class="button_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-eye"></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_delete" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" data-delmsg='{($CONST.COMMENT_DELETE_CONFIRM|sprintf:$comment.id:$comment.author)|escape}' title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</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>
</ul>
{$comment.action_more}
</li>
{/foreach}
</ul>
{/if}
{if ($page != 1 && $page <= $pages)||$page != $pages}
<nav class="pagination">
<h3>{$CONST.PAGE_BROWSE_COMMENTS|sprintf:$page:$pages:$totalComments}</h3>
<ul class="clearfix">
<li class="prev">{if ($page != 1 && $page <= $pages)}<a class="button_link" href="{$linkPrevious}" title="{$CONST.PREVIOUS}"><span class="icon-left-open"></span><span class="visuallyhidden"> {$CONST.PREVIOUS}</span></a>{else}<span class="visuallyhidden">{$CONST.NO_ENTRIES_TO_PRINT}</span>{/if}</li>
<li class="next">{if $page != $pages}<a class="button_link" href="{$linkNext}" title="{$CONST.NEXT}"><span class="visuallyhidden">{$CONST.NEXT} </span><span class="icon-right-open"></span></a>{else}<span class="visuallyhidden">{$CONST.NO_ENTRIES_TO_PRINT}</span>{/if}</li>
<ul class="plainList clearfix actions">
{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}
{if ($comment.status == 'approved')}
<li><a class="button_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=pending&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" title="{$CONST.SET_TO_MODERATED}"><span class="icon-lock"></span><span class="visuallyhidden"> {$CONST.SET_TO_MODERATED}</span></a></li>
{/if}
{if $comment.excerpt}
<li><a class="button_link toggle_comment_full" href="#c{$comment.id}_full" title="{$CONST.TOGGLE_ALL}"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></a></li>
{/if}
<li><a class="button_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-eye"></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_delete" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" data-delmsg='{($CONST.COMMENT_DELETE_CONFIRM|sprintf:$comment.id:$comment.author)|escape}' title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</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>
</ul>
{$comment.action_more}
</li>
{/foreach}
</ul>
</nav>
{/if}
</div>
{/if}
{if ($page != 1 && $page <= $pages)||$page != $pages}
<nav class="pagination">
<h3>{$CONST.PAGE_BROWSE_COMMENTS|sprintf:$page:$pages:$totalComments}</h3>
<ul class="clearfix">
<li class="prev">{if ($page != 1 && $page <= $pages)}<a class="button_link" href="{$linkPrevious}" title="{$CONST.PREVIOUS}"><span class="icon-left-open"></span><span class="visuallyhidden"> {$CONST.PREVIOUS}</span></a>{else}<span class="visuallyhidden">{$CONST.NO_ENTRIES_TO_PRINT}</span>{/if}</li>
<li class="next">{if $page != $pages}<a class="button_link" href="{$linkNext}" title="{$CONST.NEXT}"><span class="visuallyhidden">{$CONST.NEXT} </span><span class="icon-right-open"></span></a>{else}<span class="visuallyhidden">{$CONST.NO_ENTRIES_TO_PRINT}</span>{/if}</li>
</ul>
</nav>
{/if}
</div>
<div class="form_buttons">
<input class="invert_selection" name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}">
<input class="state_cancel comments_multidelete" name="toggle" type="submit" value="{$CONST.DELETE_SELECTED_COMMENTS}">
<input name="serendipity[togglemoderate]" type="submit" value="{$CONST.MODERATE_SELECTED_COMMENTS}">
</div>
</form>
<div class="form_buttons">
<input class="invert_selection" name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}">
<input class="state_cancel comments_multidelete" name="toggle" type="submit" value="{$CONST.DELETE_SELECTED_COMMENTS}">
<input name="serendipity[togglemoderate]" type="submit" value="{$CONST.MODERATE_SELECTED_COMMENTS}">
</div>
</form>
<script src="{serendipity_getFile file='admin/js/jquery.magnific-popup.js'}"></script>
{/if}
{/if}

View File

@ -558,6 +558,14 @@ window.log = function f(){ log.history = log.history || []; log.history.push(arg
$('#' + id).toggleClass('multidel_selected');
}
serendipity.closeCommentPopup = function() {
{if $use_popups}
parent.self.close();
{else}
window.parent.parent.$.magnificPopup.close();
{/if}
}
}( window.serendipity = window.serendipity || {}, jQuery ));
// Source: https://github.com/yatil/accessifyhtml5.js
@ -814,7 +822,11 @@ var AccessifyHTML5 = function (defaults, more_fixes) {
$('.comments_reply').click(function(e) {
e.preventDefault();
window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1').focus();
{if $use_popups}
window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1').focus();
{else}
$(this).magnificPopup({ type:'iframe' });
{/if}
});
$('.comments_multidelete').click(function() {
@ -987,6 +999,12 @@ var AccessifyHTML5 = function (defaults, more_fixes) {
$('.media_pane .pagination').clone().prependTo('.media_pane');
$('.comments_pane .pagination').clone().prependTo('.comments_pane');
$('.entries_pane .pagination').clone().prependTo('.entries_pane');
if ($('body').has('#comment_replied').size() > 0) {
$('#comment_replied').click(function() {
serendipity.closeCommentPopup();
});
}
// Equal Heights