summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/js/comment.js2
-rw-r--r--modules/comment/tests/Comment_Model_Test.php3
-rw-r--r--modules/comment/views/comments.html.php5
3 files changed, 8 insertions, 2 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index bb204b78..3c8097c6 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -29,7 +29,7 @@ function ajaxify_comment_form() {
dataType: "json",
success: function(data) {
if (data.result == "success") {
- $("#g-comments #g-comment-detail ul").append(data.view);
+ $("#g-comments #g-comment-detail ul").append(data.view);
$("#g-comments #g-comment-detail ul li:last").effect("highlight", {color: "#cfc"}, 8000);
$("#g-comment-form").hide(2000).remove();
$("#g-no-comments-yet").hide(2000);
diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php
index f0449c05..798e4f6d 100644
--- a/modules/comment/tests/Comment_Model_Test.php
+++ b/modules/comment/tests/Comment_Model_Test.php
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Comment_Model_Test extends Gallery_Unit_Test_Case {
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
public function cant_view_comments_for_unviewable_items_test() {
$album = test::random_album();
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 0ed07c22..8e2a9e51 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<a href="<?= url::site("form/add/comments/{$item->id}") ?>" id="g-admin-comment-button"
- class="g-button ui-corner-all ui-icon-left ui-state-default right">
+ class="g-button ui-corner-all ui-icon-left ui-state-default">
<span class="ui-icon ui-icon-comment"></span>
<?= t("Add a comment") ?>
</a>
@@ -10,7 +10,9 @@
<?= t("No comments yet. Be the first to <a %attrs>comment</a>!",
array("attrs" => html::mark_clean("id= \"g-no-comments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?>
</p>
+<ul>&nbsp;</ul>
<? endif ?>
+<? if ($comments->count()): ?>
<ul>
<? foreach ($comments as $comment): ?>
<li id="g-comment-<?= $comment->id ?>">
@@ -39,4 +41,5 @@
</li>
<? endforeach ?>
</ul>
+<? endif ?>
</div>