summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-29 10:49:25 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-29 10:49:25 -0700
commit1527f149a90a46428c48b4b811d4b8ecc10b9d2c (patch)
tree5132259e5e703dce92e8a025d007de3b220d8457 /modules/comment
parentb833cb607323000b987428c94995e18a9d07df65 (diff)
parentb518a5173da57d65d454518fd2400fe28cdfef3c (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/helpers/comment_theme.php2
-rw-r--r--modules/comment/js/comment.js10
-rw-r--r--modules/comment/views/comments.html.php10
3 files changed, 17 insertions, 5 deletions
diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php
index b807e2cf..38a00b5c 100644
--- a/modules/comment/helpers/comment_theme.php
+++ b/modules/comment/helpers/comment_theme.php
@@ -26,7 +26,6 @@ class comment_theme_Core {
static function photo_bottom($theme) {
$block = new Block;
$block->css_id = "gComments";
- $block->anchor = t("comments");
$block->title = t("Comments");
$view = new View("comments.html");
@@ -37,7 +36,6 @@ class comment_theme_Core {
->find_all();
$block->content = $view;
- $block->content .= comment::get_add_form($theme->item())->render("form.html");
return $block;
}
} \ No newline at end of file
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index 00fc6027..9fd63c1a 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -1,5 +1,13 @@
$("document").ready(function() {
- ajaxify_comment_form();
+ $("#gAddCommentButton").click(function(event) {
+ event.preventDefault();
+ $.get($(this).attr("href"),
+ {},
+ function(data) {
+ $("#gCommentDetail").append(data);
+ ajaxify_comment_form();
+ });
+ });
});
function ajaxify_comment_form() {
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index f7251389..6dce9971 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -1,11 +1,17 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
+ <a href="<?= url::site("form/add/comments/{$item->id})") ?>" id="gAddCommentButton"
+ class="gButtonLink ui-corner-all ui-icon-left ui-state-default right">
+ <span class="ui-icon ui-icon-comment"></span>
+ <?= t("Add a comment") ?>
+</a>
+<div id="gCommentDetail">
<? if (!$comments->count()): ?>
<p id="gNoCommentsYet">
<?= t("No comments yet. Be the first to <a %attrs>comment</a>!",
array("attrs" => "href=\"#add_comment_form\" class=\"showCommentForm\"")) ?>
</p>
<? endif ?>
-<ul id="gComments">
+<ul>
<? foreach ($comments as $comment): ?>
<li id="gComment-<?= $comment->id ?>">
<p class="gAuthor">
@@ -26,4 +32,4 @@
</li>
<? endforeach ?>
</ul>
-<a name="add_comment_form"></a>
+</div>