svnno****@sourc*****
svnno****@sourc*****
2008年 12月 27日 (土) 20:04:46 JST
Revision: 910 http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=910 Author: tach Date: 2008-12-27 20:04:45 +0900 (Sat, 27 Dec 2008) Log Message: ----------- Fix to use getData() for moderation message using ajax.pl Modified Paths: -------------- slashjp/trunk/debian/changelog slashjp/trunk/plugins/Ajax/templates/data;ajax;default slashjp/trunk/plugins/Moderation/Moderation.pm -------------- next part -------------- Modified: slashjp/trunk/debian/changelog =================================================================== --- slashjp/trunk/debian/changelog 2008-12-26 09:18:30 UTC (rev 909) +++ slashjp/trunk/debian/changelog 2008-12-27 11:04:45 UTC (rev 910) @@ -4,8 +4,9 @@ * Add selectable d2 default using constants "d2_default" * Disable "getAd()" * Fix to change firehose default tab name + * Fix to use getData() for moderation message using ajax.pl - -- Taku YASUI <tach****@osdn*****> Fri, 19 Dec 2008 12:03:52 +0000 + -- Taku YASUI <tach****@osdn*****> Sat, 27 Dec 2008 11:04:05 +0000 slash (2.5.0.231-1) unstable; urgency=low Modified: slashjp/trunk/plugins/Ajax/templates/data;ajax;default =================================================================== --- slashjp/trunk/plugins/Ajax/templates/data;ajax;default 2008-12-26 09:18:30 UTC (rev 909) +++ slashjp/trunk/plugins/Ajax/templates/data;ajax;default 2008-12-27 11:04:45 UTC (rev 910) @@ -22,6 +22,18 @@ [% CASE 'no modcommentlog' %] <p>No comment history available.</p> +[% CASE 'moderate score' %] + Score: [% score %] + +[% CASE 'moderate moderated' %] + Moderated '[% reason.name %]'. [% points; points == 1 ? "point" : "points" %] left. + +[% CASE 'moderate no_moderation_performed' %] + Error: No moderation performed. + +[% CASE 'moderate moderation_points_left' %] + Error: [% points %] moderation points left. + [% END %] __seclev__ 1000 Modified: slashjp/trunk/plugins/Moderation/Moderation.pm =================================================================== --- slashjp/trunk/plugins/Moderation/Moderation.pm 2008-12-26 09:18:30 UTC (rev 909) +++ slashjp/trunk/plugins/Moderation/Moderation.pm 2008-12-27 11:04:45 UTC (rev 910) @@ -6,6 +6,7 @@ use strict; use Date::Format qw(time2str); +use Slash; use Slash::Utility; use Slash::Display; @@ -84,22 +85,21 @@ $self->countUsers({ max => 1 }), $self->getReasons ); - $html->{$score} = "Score:$points"; + $html->{$score} = getData("moderate score", { score => $points }); $html->{$score} = qq[<a href="#" onclick="getModalPrefs('modcommentlog', 'Moderation Comment Log', $cid); return false">$html->{$score}</a>] if $constants->{modal_prefs_active} && !$user->{is_anon}; $html->{$score} .= ", $reasons->{$comment->{reason}}{name}" if $comment->{reason} && $reasons->{$comment->{reason}}; $html->{$score} = "($html->{$score})"; - my $ptstr = $user->{points} == 1 ? 'point' : 'points'; - $html->{$select} = "Moderated '$reasons->{$reason}{name}.' $user->{points} $ptstr left."; + $html->{$select} = getData("moderate moderated", { reason => $reasons->{$reason}, points => $user->{points} }); $self->setStory($sid, { writestatus => 'dirty' }); } elsif (!$ret_val) { - $html->{$select} = "Error: No moderation performed."; + $html->{$select} = getData("moderate no_moderation_performed"); } elsif ($ret_val == -1 || $ret_val == -2) { - $html->{$select} = "Error: $user->{points} moderation points left."; + $html->{$select} = getData("moderate moderation_points_left", { points => $user->{points} }); } }