[Rt-commit] r13121 - in rt/branches/3.8-TESTING: . share/html/Elements

kyoki at bestpractical.com kyoki at bestpractical.com
Tue Jun 10 15:01:43 EDT 2008


Author: kyoki
Date: Tue Jun 10 15:01:43 2008
New Revision: 13121

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/Elements/CollectionList
   rt/branches/3.8-TESTING/share/html/Elements/CollectionListPaging
   rt/branches/3.8-TESTING/share/html/NoAuth/css/web2/ticket-lists.css

Log:
 r22712 at nyx:  kyoki | 2008-06-10 15:01:02 -0400
 made paging prettier


Modified: rt/branches/3.8-TESTING/share/html/Elements/CollectionList
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/CollectionList	(original)
+++ rt/branches/3.8-TESTING/share/html/Elements/CollectionList	Tue Jun 10 15:01:43 2008
@@ -134,7 +134,6 @@
 
 $m->out('</table>');
 if ( $Rows && $ShowNavigation && $TotalFound > $Rows ) {
-  $m->out('<hr />');
   my $oddRows = ($TotalFound && $TotalFound % $Rows == 0 )? 0 : 1;
   my $pages = int( $TotalFound / $Rows ) + $oddRows;
   $pages = 1 if $pages < 1;

Modified: rt/branches/3.8-TESTING/share/html/Elements/CollectionListPaging
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/CollectionListPaging	(original)
+++ rt/branches/3.8-TESTING/share/html/Elements/CollectionListPaging	Tue Jun 10 15:01:43 2008
@@ -55,6 +55,7 @@
 </%ARGS>
 
 <%INIT>
+$m->out(qq{<div class="paging">});
 if ($Pages == 1) {
   $m->out(loc('Page 1 of 1'));
 }
@@ -65,35 +66,43 @@
 		    %$URLParams,
 		    Page    => ( $CurrentPage - 1 )
 		   );
+my $next = $m->comp(
+		    '/Elements/QueryString',
+		    %$URLParams,
+		    Page    => ( $CurrentPage + 1 )
+		   );
 my %show;
 $show{1} = 1;
 $show{$_} = 1 for (($CurrentPage - 2)..($CurrentPage + 2));
 $show{$Pages} = 1;
 my $dots;
-for my $number (1..$Pages){
-  if ($show{$number}){
-    $dots = undef;
-    my $qs = $m->comp('/Elements/QueryString', %$URLParams, Page => $number);
-    $m->out(  qq{<a href="$BaseURL$qs">}
-	      . (($number == $CurrentPage)  ? "<em>$number</em>" : $number) 
-	      . qq{</a> });
-  }
-  elsif (not $dots){
-    $dots = 1;
-    $m->out(" ... ");
-  }
+
+for my $number ( 1 .. $Pages ) {
+    if ( $show{$number} ) {
+        $dots = undef;
+        my $qs =
+          $m->comp( '/Elements/QueryString', %$URLParams, Page => $number );
+	$m->out(qq{<span class="pagenum">});
+        if ( $number == $CurrentPage ) {
+            $m->out(qq{<span class="currentpage">$number</span> });
+        }
+        else {
+            $m->out(qq{<a href="$BaseURL$qs">$number</a> });
+        }
+    }
+    elsif ( not $dots ) {
+        $dots = 1;
+        $m->out(qq{<span class="dots">...</span>});
+    }
+	$m->out(qq{</span>});
 }
 
-my $next = $m->comp(
-		    '/Elements/QueryString',
-		    %$URLParams,
-		    Page    => ( $CurrentPage + 1 )
-		   );
 if ($CurrentPage > 1) {
-  $m->out(qq{<a href="$BaseURL$prev">}.loc('Previous ').qq{</a>});
+  $m->out(qq{<a href="$BaseURL$prev" class="nav">}.loc('Previous') . qq{</a>});
 }
 if (($CurrentPage * $Rows) < $TotalFound) {
-  $m->out(qq{<a href="$BaseURL$next">}.loc('Next').qq{</a>});
+  $m->out(qq{<a href="$BaseURL$next" class="nav">}.loc('Next').qq{</a>});
 }
 }
+$m->out(qq{</div>});
 </%INIT>

Modified: rt/branches/3.8-TESTING/share/html/NoAuth/css/web2/ticket-lists.css
==============================================================================
--- rt/branches/3.8-TESTING/share/html/NoAuth/css/web2/ticket-lists.css	(original)
+++ rt/branches/3.8-TESTING/share/html/NoAuth/css/web2/ticket-lists.css	Tue Jun 10 15:01:43 2008
@@ -136,6 +136,26 @@
  padding-right: 0.5em;
 }
 
+.pagenum.a:hover, .paging a.nav:hover{
+text-decoration: underline;
+}
+
+
+.pagenum *, .paging a.nav{
+padding: .5em;
+}
+
+.currentpage{
+text-decoration: none;
+font-weight: bold;
+background: #eee;
+}
+
+div.paging{
+text-align: center;
+padding-bottom: 1em;
+}
+
 /* full-page ticket lists */
 #body>table.ticket-list {
     border-bottom: 1px solid #ccc;


More information about the Rt-commit mailing list