De-tabbify
svn path=/plone.app.discussion/trunk/; revision=33491
This commit is contained in:
parent
ece5e3c302
commit
c27d1b5cc1
@ -32,7 +32,7 @@
|
|||||||
tal:define="reply reply_dict/comment;
|
tal:define="reply reply_dict/comment;
|
||||||
depth reply_dict/depth|python:0;
|
depth reply_dict/depth|python:0;
|
||||||
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
||||||
has_author_link python:author_home_url and not isAnon;
|
has_author_link python:author_home_url and not isAnon;
|
||||||
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
||||||
review_state python:wtool.getInfoFor(reply, 'review_state');"
|
review_state python:wtool.getInfoFor(reply, 'review_state');"
|
||||||
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
||||||
|
@ -87,10 +87,10 @@
|
|||||||
permission="zope2.View"
|
permission="zope2.View"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Resource directory for javascripts -->
|
<!-- Resource directory for javascripts -->
|
||||||
<browser:resourceDirectory
|
<browser:resourceDirectory
|
||||||
name="plone.app.discussion.javascripts"
|
name="plone.app.discussion.javascripts"
|
||||||
directory="javascripts"
|
directory="javascripts"
|
||||||
layer="..interfaces.IDiscussionLayer"
|
layer="..interfaces.IDiscussionLayer"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ jq(document).ready(function() {
|
|||||||
* comment form.
|
* comment form.
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
jq(".reply").find("input[name='form.buttons.reply']").css("display", "none");
|
jq(".reply").find("input[name='form.buttons.reply']").css("display", "none");
|
||||||
jq(".reply").find("input[name='form.buttons.cancel']").css("display", "none");
|
jq(".reply").find("input[name='form.buttons.cancel']").css("display", "none");
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
@ -14,13 +14,13 @@ jq(document).ready(function() {
|
|||||||
* the comment.
|
* the comment.
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
var post_comment_div = jq("#commenting");
|
var post_comment_div = jq("#commenting");
|
||||||
var in_reply_to_field = post_comment_div.find("input[name='form.widgets.in_reply_to']");
|
var in_reply_to_field = post_comment_div.find("input[name='form.widgets.in_reply_to']");
|
||||||
if (in_reply_to_field.val() != "") {
|
if (in_reply_to_field.val() != "") {
|
||||||
var current_reply_id = "#" + in_reply_to_field.val();
|
var current_reply_id = "#" + in_reply_to_field.val();
|
||||||
var current_reply_to_div = jq(".discussion").find(current_reply_id);
|
var current_reply_to_div = jq(".discussion").find(current_reply_id);
|
||||||
createReplyForm(current_reply_to_div);
|
createReplyForm(current_reply_to_div);
|
||||||
clearForm(post_comment_div);
|
clearForm(post_comment_div);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* Remove the z3c.form error messages and all input values from a
|
* Remove the z3c.form error messages and all input values from a
|
||||||
@ -28,10 +28,10 @@ jq(document).ready(function() {
|
|||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
function clearForm(form_div) {
|
function clearForm(form_div) {
|
||||||
form_div.find(".error").removeClass("error");
|
form_div.find(".error").removeClass("error");
|
||||||
form_div.find(".fieldErrorBox").remove();
|
form_div.find(".fieldErrorBox").remove();
|
||||||
form_div.find("input[type='text']").attr("value", "")
|
form_div.find("input[type='text']").attr("value", "")
|
||||||
form_div.find("textarea").attr("value", "")
|
form_div.find("textarea").attr("value", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* Create a reply-to-comment form right under the comment_div.
|
* Create a reply-to-comment form right under the comment_div.
|
||||||
@ -50,7 +50,7 @@ jq(document).ready(function() {
|
|||||||
/* Remove the ReCaptcha JS code before appending the form. If not
|
/* Remove the ReCaptcha JS code before appending the form. If not
|
||||||
* removed, this causes problems
|
* removed, this causes problems
|
||||||
*/
|
*/
|
||||||
reply_div.find("#formfield-form-widgets-captcha").find("script").remove();
|
reply_div.find("#formfield-form-widgets-captcha").find("script").remove();
|
||||||
|
|
||||||
/* Insert the cloned comment form right after the reply button of the
|
/* Insert the cloned comment form right after the reply button of the
|
||||||
* current comment.
|
* current comment.
|
||||||
@ -84,7 +84,7 @@ jq(document).ready(function() {
|
|||||||
|
|
||||||
/* Show the cancel button in the reply-to-comment form */
|
/* Show the cancel button in the reply-to-comment form */
|
||||||
cancel_reply_button.css("display", "inline");
|
cancel_reply_button.css("display", "inline");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* Show the reply button only when Javascript is enabled.
|
* Show the reply button only when Javascript is enabled.
|
||||||
@ -94,12 +94,12 @@ jq(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* Create reply to comment form.
|
* Create reply to comment form.
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
jq(".reply-to-comment-button").bind("click", function(e){
|
jq(".reply-to-comment-button").bind("click", function(e){
|
||||||
var comment_div = jq(this).parents().filter(".comment");
|
var comment_div = jq(this).parents().filter(".comment");
|
||||||
createReplyForm(comment_div);
|
createReplyForm(comment_div);
|
||||||
clearForm(comment_div);
|
clearForm(comment_div);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
@ -123,12 +123,12 @@ jq(document).ready(function() {
|
|||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
/*
|
/*
|
||||||
jq("input[name='form.button.DeleteComment']").click(function(e){
|
jq("input[name='form.button.DeleteComment']").click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var form = jq(this).parent();
|
var form = jq(this).parent();
|
||||||
var target = jq(form).attr("action");
|
var target = jq(form).attr("action");
|
||||||
var comment = jq(form).parent();
|
var comment = jq(form).parent();
|
||||||
var reply_comments = jq(comment).find("~ .comment:not(.replyTreeLevel0 ~ div)");
|
var reply_comments = jq(comment).find("~ .comment:not(.replyTreeLevel0 ~ div)");
|
||||||
reply_comments.css("background", "red");
|
reply_comments.css("background", "red");
|
||||||
jq.ajax({
|
jq.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: target,
|
url: target,
|
||||||
@ -151,7 +151,7 @@ jq(document).ready(function() {
|
|||||||
/*
|
/*
|
||||||
jq("input[name='form.button.PublishComment']").click(function(e){
|
jq("input[name='form.button.PublishComment']").click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var button = jq(this);
|
var button = jq(this);
|
||||||
var form = jq(this).parent();
|
var form = jq(this).parent();
|
||||||
var target = jq(form).attr("action");
|
var target = jq(form).attr("action");
|
||||||
var comment = jq(form).parent()
|
var comment = jq(form).parent()
|
||||||
|
@ -28,7 +28,7 @@ jq(document).ready(function() {
|
|||||||
var row = jq(this).parent().parent();
|
var row = jq(this).parent().parent();
|
||||||
var form = jq(row).parents("form");
|
var form = jq(row).parents("form");
|
||||||
var path = jq(row).find("input:checkbox").attr("value");
|
var path = jq(row).find("input:checkbox").attr("value");
|
||||||
var target = path + "/@@moderate-delete-comment";
|
var target = path + "/@@moderate-delete-comment";
|
||||||
var comment_id = jq(this).attr("id");
|
var comment_id = jq(this).attr("id");
|
||||||
jq.ajax({
|
jq.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -39,7 +39,7 @@ jq(document).ready(function() {
|
|||||||
jq(this).remove();
|
jq(this).remove();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function(msg){
|
error: function(msg){
|
||||||
alert("Error sending AJAX request:" + target);
|
alert("Error sending AJAX request:" + target);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -58,7 +58,7 @@ jq(document).ready(function() {
|
|||||||
jq.ajax({
|
jq.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: target,
|
url: target,
|
||||||
data: "workflow_action=publish",
|
data: "workflow_action=publish",
|
||||||
success: function(msg){
|
success: function(msg){
|
||||||
// fade out row
|
// fade out row
|
||||||
jq(row).fadeOut("normal", function(){
|
jq(row).fadeOut("normal", function(){
|
||||||
@ -83,10 +83,10 @@ jq(document).ready(function() {
|
|||||||
var valArray = jq('input:checkbox:checked');
|
var valArray = jq('input:checkbox:checked');
|
||||||
var selectField = jq(form).find("[name='form.select.BulkAction']");
|
var selectField = jq(form).find("[name='form.select.BulkAction']");
|
||||||
if (selectField.val() == '-1') {
|
if (selectField.val() == '-1') {
|
||||||
// XXX: translate message
|
// XXX: translate message
|
||||||
alert("You haven't selected a bulk action. Please select one.");
|
alert("You haven't selected a bulk action. Please select one.");
|
||||||
} else if (valArray.length == 0) {
|
} else if (valArray.length == 0) {
|
||||||
// XXX: translate message
|
// XXX: translate message
|
||||||
alert("You haven't selected any comment for this bulk action. Please select at least one comment.");
|
alert("You haven't selected any comment for this bulk action. Please select at least one comment.");
|
||||||
} else {
|
} else {
|
||||||
jq.post(target, params, function(data) {
|
jq.post(target, params, function(data) {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<h1 class="documentFirstHeading" i18n:translate="title_review">
|
<h1 class="documentFirstHeading" i18n:translate="title_review">
|
||||||
Moderate comments
|
Moderate comments
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<form tal:condition="not:items">
|
<form tal:condition="not:items">
|
||||||
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
||||||
<p id="no-comments-message" i18n:translate="message_nothing_to_moderate">
|
<p id="no-comments-message" i18n:translate="message_nothing_to_moderate">
|
||||||
|
@ -9,34 +9,34 @@
|
|||||||
---------------------------------------------------------------- */
|
---------------------------------------------------------------- */
|
||||||
.discussion,
|
.discussion,
|
||||||
#commenting {
|
#commenting {
|
||||||
/* Clear "float: left" from "manage portlets" div above the
|
/* Clear "float: left" from "manage portlets" div above the
|
||||||
comment viewlet. This will get fixed in the next Plone 4
|
comment viewlet. This will get fixed in the next Plone 4
|
||||||
release. */
|
release. */
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment {
|
.comment {
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentImage {
|
.commentImage {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: -90px;
|
margin-right: -90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentImage a:link {
|
.commentImage a:link {
|
||||||
/* Override the default bottom border of links in Plone 4. */
|
/* Override the default bottom border of links in Plone 4. */
|
||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentImage img {
|
.commentImage img {
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentBody {
|
.commentBody {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.showCommenterImage h3,
|
.showCommenterImage h3,
|
||||||
@ -44,9 +44,9 @@
|
|||||||
.showCommenterImage .commentBody,
|
.showCommenterImage .commentBody,
|
||||||
.showCommenterImage .commentActions,
|
.showCommenterImage .commentActions,
|
||||||
.showCommenterImage .reply {
|
.showCommenterImage .reply {
|
||||||
/* The showCommenterImage CSS class is only set if showing the
|
/* The showCommenterImage CSS class is only set if showing the
|
||||||
* commenters image is enabled.
|
* commenters image is enabled.
|
||||||
*/
|
*/
|
||||||
margin-left: 90px;
|
margin-left: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,22 +55,22 @@
|
|||||||
---------------------------------------------------------------- */
|
---------------------------------------------------------------- */
|
||||||
|
|
||||||
.reply fieldset {
|
.reply fieldset {
|
||||||
/* Fix bouncing fieldset when reply form is shown. */
|
/* Fix bouncing fieldset when reply form is shown. */
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reply-to-comment-button {
|
.reply-to-comment-button {
|
||||||
/* Hide the reply-to-comment button and show it only if Javascript
|
/* Hide the reply-to-comment button and show it only if Javascript
|
||||||
* is enabled. Since the reply functions rely on jQuery.
|
* is enabled. Since the reply functions rely on jQuery.
|
||||||
*/
|
*/
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancelreplytocomment {
|
.cancelreplytocomment {
|
||||||
/* Hide the cancel button in the comment form, show it only in the reply form
|
/* Hide the cancel button in the comment form, show it only in the reply form
|
||||||
* in order to close it.
|
* in order to close it.
|
||||||
*/
|
*/
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -78,11 +78,11 @@
|
|||||||
---------------------------------------------------------------- */
|
---------------------------------------------------------------- */
|
||||||
|
|
||||||
#bulkactions {
|
#bulkactions {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dobulkaction {
|
#dobulkaction {
|
||||||
margin: 0.3em 0;
|
margin: 0.3em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-publish-button {
|
.comment-publish-button {
|
||||||
@ -94,15 +94,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#review-comments {
|
#review-comments {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fieldset-moderate-comments {
|
#fieldset-moderate-comments {
|
||||||
padding: 2em 1em;
|
padding: 2em 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fieldset-moderate-comments .actions {
|
#fieldset-moderate-comments .actions {
|
||||||
width: 14em;
|
width: 14em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -113,11 +113,11 @@
|
|||||||
not have a .row class for portal-column-content. */
|
not have a .row class for portal-column-content. */
|
||||||
|
|
||||||
.row #dobulkaction {
|
.row #dobulkaction {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row #commenting {
|
.row #commenting {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row textarea {
|
.row textarea {
|
||||||
@ -137,6 +137,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.row #fieldset-moderate-comments .actions {
|
.row #fieldset-moderate-comments .actions {
|
||||||
width: 9em !important;
|
width: 9em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
</index>
|
</index>
|
||||||
|
|
||||||
<column value="total_comments" />
|
<column value="total_comments" />
|
||||||
<column value="last_comment_date" />
|
<column value="last_comment_date" />
|
||||||
<column value="commentators" />
|
<column value="commentators" />
|
||||||
<column value="in_response_to" />
|
<column value="in_response_to" />
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
appId="plone.app.discussion"
|
appId="plone.app.discussion"
|
||||||
category="Products"
|
category="Products"
|
||||||
condition_expr=""
|
condition_expr=""
|
||||||
icon_expr="string:${portal_url}/discussionitem_icon.gif"
|
icon_expr="string:${portal_url}/discussionitem_icon.gif"
|
||||||
url_expr="string:${portal_url}/@@discussion-settings"
|
url_expr="string:${portal_url}/@@discussion-settings"
|
||||||
visible="True"
|
visible="True"
|
||||||
i18n:attributes="title">
|
i18n:attributes="title">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
id="++resource++plone.app.discussion.javascripts/comments.js"
|
id="++resource++plone.app.discussion.javascripts/comments.js"
|
||||||
cacheable="False" compression="safe" cookable="False"
|
cacheable="False" compression="safe" cookable="False"
|
||||||
enabled="True" expression="" inline="False"
|
enabled="True" expression="" inline="False"
|
||||||
/>
|
/>
|
||||||
<javascript
|
<javascript
|
||||||
id="++resource++plone.app.discussion.javascripts/moderation.js"
|
id="++resource++plone.app.discussion.javascripts/moderation.js"
|
||||||
cacheable="False" compression="safe" cookable="False"
|
cacheable="False" compression="safe" cookable="False"
|
||||||
|
@ -229,7 +229,7 @@ class CommentCatalogTest(PloneTestCase):
|
|||||||
self.assertEquals(self.comment_brain.in_response_to, 'doc1')
|
self.assertEquals(self.comment_brain.in_response_to, 'doc1')
|
||||||
|
|
||||||
def test_clear_and_rebuild_catalog(self):
|
def test_clear_and_rebuild_catalog(self):
|
||||||
# Clear and rebuild catalog
|
# Clear and rebuild catalog
|
||||||
self.catalog.clearFindAndRebuild()
|
self.catalog.clearFindAndRebuild()
|
||||||
|
|
||||||
# Check if comment is still there
|
# Check if comment is still there
|
||||||
|
Loading…
Reference in New Issue
Block a user