[livejournal] r18129: LJINT-362 (Comments for side projects): ...
Committer: ailyin
LJINT-362 (Comments for side projects): provide an error message if remote is logged out and it's javascript that needs our replyU trunk/htdocs/delcomment.bml U trunk/htdocs/delcomment.bml.text
Modified: trunk/htdocs/delcomment.bml
===================================================================
--- trunk/htdocs/delcomment.bml 2011-01-27 09:31:03 UTC (rev 18128)
+++ trunk/htdocs/delcomment.bml 2011-01-27 11:07:05 UTC (rev 18129)
@@ -81,8 +81,14 @@
my $entry = $comment->entry;
my $remote = LJ::get_remote();
- return LJ::needlogin_redirect()
- unless $remote;
+ unless ($remote) {
+ if ( $mode eq 'html' ) {
+ return LJ::needlogin_redirect();
+ } else {
+ my $ml_var = '/delcomment.bml.error.notloggedin';
+ return $error->( LJ::Lang::ml($ml_var) );
+ }
+ }
# what are we supposed to do? we can show form, or we can delete
# the comment, depending on the form parameters
Modified: trunk/htdocs/delcomment.bml.text
===================================================================
--- trunk/htdocs/delcomment.bml.text 2011-01-27 09:31:03 UTC (rev 18128)
+++ trunk/htdocs/delcomment.bml.text 2011-01-27 11:07:05 UTC (rev 18129)
@@ -33,6 +33,8 @@
.error.nocomment=The specified comment does not exist.
+.error.notloggedin=You need to log in in order to delete this comment.
+
.error.suspended=You are not allowed to delete comments while your account is suspended.
.success.andban=The comment has been deleted, and user [[user]] has been banned from commenting in your journal.
