[Bps-public-commit] r20208 - in RT-Extension-ReportSpam/html/Tools: . Spam

ruz at bestpractical.com ruz at bestpractical.com
Fri Dec 11 17:56:37 EST 2009


Author: ruz
Date: Fri Dec 11 17:56:37 2009
New Revision: 20208

Added:
   RT-Extension-ReportSpam/html/Tools/
   RT-Extension-ReportSpam/html/Tools/Spam/
   RT-Extension-ReportSpam/html/Tools/Spam/Elements/
   RT-Extension-ReportSpam/html/Tools/Spam/Elements/Tabs
   RT-Extension-ReportSpam/html/Tools/Spam/Recent.html
   RT-Extension-ReportSpam/html/Tools/Spam/Reported.html
   RT-Extension-ReportSpam/html/Tools/Spam/index.html

Log:
* spam handling interface in tools

Added: RT-Extension-ReportSpam/html/Tools/Spam/Elements/Tabs
==============================================================================
--- (empty file)
+++ RT-Extension-ReportSpam/html/Tools/Spam/Elements/Tabs	Fri Dec 11 17:56:37 2009
@@ -0,0 +1,39 @@
+<& /Tools/Elements/Tabs,
+    current_tab    => 'Tools/Spam/',
+    subtabs        => $tabs,
+    current_subtab => $current_tab,
+    Title => $Title,
+&>
+
+
+<%INIT>
+my $tabs = {
+    a => {
+        title => loc('Recent'),
+        path  => 'Tools/Spam/Recent.html',
+    },
+    b => {
+        title => loc('Reported'),
+        path  => 'Tools/Spam/Reported.html',
+    },
+};
+
+$m->callback( %ARGS, tabs => $tabs );
+
+if ( $subtabs ) {
+    foreach my $tab ( values %{$tabs} ) {
+        next unless $tab->{'path'} eq $current_tab;
+
+        $tab->{"subtabs"}        = $subtabs;
+        $tab->{"current_subtab"} = $current_subtab;
+    }
+}
+</%INIT>
+<%ARGS>
+$current_tab => undef
+
+$subtabs => undef
+$current_subtab => undef
+
+$Title => undef
+</%ARGS>

Added: RT-Extension-ReportSpam/html/Tools/Spam/Recent.html
==============================================================================
--- (empty file)
+++ RT-Extension-ReportSpam/html/Tools/Spam/Recent.html	Fri Dec 11 17:56:37 2009
@@ -0,0 +1,46 @@
+<& /Elements/Header, Title => $title &>
+<& /Tools/Spam/Elements/Tabs,
+    Title => $title,
+    current_tab => "Tools/Spam/Recent.html",
+&>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<p>
+<% loc('Recently created tickets with status "new" and without owner.') %>
+<% loc('Mark spam by clicking "S".') %>
+<% loc('If you have rights to delete tickets then they will be deleted.') %>
+</p>
+
+<& /Elements/CollectionList, 
+    Rows         => 100,
+    OrderBy      => 'id',
+    Order        => 'DESC',
+    %ARGS,
+    Class        => 'RT::Tickets',
+    Query        => $Query,
+    Format       => $Format,
+    AllowSorting => 1,
+    ShowEmpty    => 1,
+&>
+
+<%ARGS>
+$Format => undef
+</%ARGS>
+<%INIT>
+my $Query = 
+    'Status = "new"'
+    .' AND Owner = "Nobody"'
+    .' AND HasNoAttribute= "SpamReports"';
+
+my $title = loc('Recently created tickets');
+my @results;
+
+$Format ||= qq{
+    '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
+    '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+    Requestors,
+    QueueName,
+    ReportSpam
+};
+</%INIT>

Added: RT-Extension-ReportSpam/html/Tools/Spam/Reported.html
==============================================================================
--- (empty file)
+++ RT-Extension-ReportSpam/html/Tools/Spam/Reported.html	Fri Dec 11 17:56:37 2009
@@ -0,0 +1,44 @@
+<& /Elements/Header, Title => $title &>
+<& /Tools/Spam/Elements/Tabs,
+    Title => $title,
+    current_tab => "Tools/Spam/Reported.html",
+&>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<p>
+<% loc('Tickets reported as spam by other without rights to delete tickets.') %>
+<% loc('Confirm by clicking "S".') %>
+<% loc('If you have rights to delete tickets then they will be deleted.') %>
+</p>
+
+<& /Elements/CollectionList, 
+    Rows         => 100,
+    OrderBy      => 'id',
+    Order        => 'DESC',
+    %ARGS,
+    Class        => 'RT::Tickets',
+    Query        => $Query,
+    Format       => $Format,
+    AllowSorting => 1,
+    ShowEmpty    => 1,
+&>
+
+
+<%ARGS>
+$Format => undef
+</%ARGS>
+<%INIT>
+my $Query = 'HasAttribute = "SpamReports"';
+
+my $title = loc('Recently created tickets');
+my @results;
+
+$Format ||= qq{
+    '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
+    '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+    Requestors,
+    QueueName,
+    ReportSpam
+};
+</%INIT>

Added: RT-Extension-ReportSpam/html/Tools/Spam/index.html
==============================================================================
--- (empty file)
+++ RT-Extension-ReportSpam/html/Tools/Spam/index.html	Fri Dec 11 17:56:37 2009
@@ -0,0 +1,12 @@
+<& /Elements/Header, Title => $title &>
+<& /Tools/Spam/Elements/Tabs,
+    Title       => $title,
+    current_tab => "Tools/Spam/",
+&>
+
+<p>
+<% loc('You can either <a href="Recent.html">review recenlty</a> created tickets or <a href="Reported.html">review reported</a> tickets that are still not deleted.') |n %>
+</p>
+<%INIT>
+my $title = loc("Spam handling");
+</%INIT>



More information about the Bps-public-commit mailing list