Author: peter
Date: 2008-09-25 17:14:59 -0700 (Thu, 25 Sep 2008)
New Revision: 1391

Modified:
   trunk/apps/qubit/modules/actor/templates/listSuccess.php
   trunk/apps/qubit/modules/digitalobject/templates/_browse.php
   trunk/apps/qubit/modules/informationobject/templates/listSuccess.php
   trunk/apps/qubit/modules/repository/templates/listSuccess.php
   trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
   trunk/lib/QubitPager.class.php
   trunk/web/css/graphic.css
Log:
re-style list pagination controls to blend with Qubit default style and echo 
Yahoo! convention, incl. the display of 'previous' and 'next' options in all 
instances except if showing the very first or last page respectively.  Keep 
default list length at 10 but move max number of page links to 10 from 5. 
Remove extra 'add new' button which was cluttering bottom of list templates and 
pagination display. 'Add new' remains available at the top of the list in the 
table column header.

Modified: trunk/apps/qubit/modules/actor/templates/listSuccess.php
===================================================================
--- trunk/apps/qubit/modules/actor/templates/listSuccess.php    2008-09-25 
21:46:50 UTC (rev 1390)
+++ trunk/apps/qubit/modules/actor/templates/listSuccess.php    2008-09-26 
00:14:59 UTC (rev 1391)
@@ -1,7 +1,5 @@
 <div class="pageTitle"><?php echo __('list %1%', array('%1%' => 
sfConfig::get('app_ui_label_actor'))) ?></div>
 
-<?php echo $actors->getNbResults() ?> results found.<br />
-Displaying results <?php echo $actors->getFirstIndice() ?> to  <?php echo 
$actors->getLastIndice() ?>
 <table class="list"><thead><tr>
   <th>
     <?php if ($sort == 'nameUp'): ?>
@@ -45,26 +43,22 @@
 </tr><?php endforeach; ?></tbody></table>
 
 <?php if ($actors->haveToPaginate()): ?>
-<p><div class="pager" style="text-align: center; font-size: 12px">
-  Pages:<br />
+<div class="pager">
   <?php $links = $actors->getLinks(); ?>
-  <?php if ($actors->getFirstPage() < $actors->getfirstPageLink()): ?>
-    <?php echo link_to($actors->getFirstPage(), 
'actor/list?sort='.$sort.'&page='.$actors->getFirstPage()) ?>
-    ...
+  <?php if ($actors->getPage() != $actors->getFirstPage()): ?>
+ <?php echo link_to('< '.__('previous'), 
'actor/list?sort='.$sort.'&page='.($actors->getPage()-1)) ?>
   <?php endif; ?>
   <?php foreach ($links as $page): ?>
-    <?php echo ($page == $actors->getPage()) ? $page : link_to($page, 
'actor/list?sort='.$sort.'&page='.$page) ?>
+    <?php echo ($page == $actors->getPage()) ? '<strong>'.$page.'</strong>' : 
link_to($page, 'actor/list?sort='.$sort.'&page='.$page) ?>
     <?php if ($page != $actors->getCurrentMaxLink()): ?> <?php endif ?>
   <?php endforeach ?>
-  <?php if ($actors->getLastPage() > $actors->getLastPageLink()): ?>
-    ...
-    <?php echo link_to($actors->getLastPage(), 
'actor/list?sort='.$sort.'&page='.$actors->getLastPage()) ?>
+  <?php if ($actors->getPage() != $actors->getLastPage()): ?>
+ <?php echo link_to(__('next').' >', 
'actor/list?sort='.$sort.'&page='.($actors->getPage()+1)) ?>
   <?php endif; ?>
-</div></p>
-<?php endif ?><br />
+</div>
+<?php endif ?>
 
-<?php if ($editCredentials): ?>
-  <div class="menu-action">
-    <?php echo link_to(__('add new %1%', array('%1%' => 
sfConfig::get('app_ui_label_actor'))), 'actor/create') ?>
-  </div>
-<?php endif; ?>
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$actors->getFirstIndice(), '%2%' => $actors->getLastIndice(), '%3%' => 
$actors->getNbResults())) ?>
+</div>
+

Modified: trunk/apps/qubit/modules/digitalobject/templates/_browse.php
===================================================================
--- trunk/apps/qubit/modules/digitalobject/templates/_browse.php        
2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/apps/qubit/modules/digitalobject/templates/_browse.php        
2008-09-26 00:14:59 UTC (rev 1391)
@@ -1,6 +1,3 @@
-<?php echo __('Found %1% objects', 
array('%1%'=>$digitalObjects->getNbResults())) ?><br />
-<?php echo __('Displaying results %1% to %2%',
-    array('%1%' => $digitalObjects->getFirstIndice(), '%2%' => 
$digitalObjects->getLastIndice())) ?>
 <table class="digitalObjectBrowse">
 <tr>
 <?php foreach ($digitalObjects->getResults() as $i => $digitalObject): ?>
@@ -17,8 +14,10 @@
       </div>
       <div class="digitalObjectDesc">
         <?php echo 
string_wrap($informationObject->getTitle(array('cultureFallback'=>true)), 16, 
3); ?><br />
+        <?php if ($collectionRoot->getId() != $informationObject->getId()): ?>
         <b><?php echo __('Part of') ?>:</b>
         <?php echo link_to($collectionRoot->getTitle(array('cultureFallback' 
=> true)), 'informationobject/show?id='.$collectionRoot->getId()); ?>
+        <?php endif; ?>
       </div>
   </div></td>
   <?php if((intval($i)%4) == 3): // New row after every 4 objects ?>
@@ -29,20 +28,21 @@
 </tr>
 </table>
 <?php if ($digitalObjects->haveToPaginate()): ?>
-<p><div class="pager" style="text-align: center; font-size: 12px">
-  Pages:<br />
+<div class="pager">
   <?php $links = $digitalObjects->getLinks(); ?>
-  <?php if ($digitalObjects->getFirstPage() < 
$digitalObjects->getfirstPageLink()): ?>
-    <?php echo link_to($digitalObjects->getFirstPage(), 
'digitalobject/browse?mediatype='.$mediaTypeId.'&page='.$digitalObjects->getFirstPage())
 ?>
-    ...
+  <?php if ($digitalObjects->getPage() != $digitalObjects->getFirstPage()): ?>
+    <?php echo link_to('< '.__('previous'), 
'digitalobject/browse?mediatype='.$mediaTypeId.'&page='.($digitalObjects->getPage()-1))
 ?>
   <?php endif; ?>
   <?php foreach ($links as $page): ?>
     <?php echo ($page == $digitalObjects->getPage()) ? $page : link_to($page, 
'digitalobject/browse?mediatype='.$mediaTypeId.'&page='.$page) ?>
     <?php if ($page != $digitalObjects->getCurrentMaxLink()): ?> <?php endif ?>
   <?php endforeach ?>
-  <?php if ($digitalObjects->getLastPage() > 
$digitalObjects->getLastPageLink()): ?>
-    ...
-    <?php echo link_to($digitalObjects->getLastPage(), 
'digitalobject/browse?mediatype='.$mediaTypeId.'&page='.$digitalObjects->getLastPage())
 ?>
+  <?php if ($digitalObjects->getPage() != $digitalObjects->getLastPage()): ?>
+    <?php echo link_to(__('next').' >', 
'digitalobject/browse?mediatype='.$mediaTypeId.'&page='.($digitalObjects->getPage()+1))
 ?>
   <?php endif; ?>
-</div></p>
-<?php endif ?><br />
\ No newline at end of file
+</div>
+<?php endif ?>
+
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$digitalObjects->getFirstIndice(), '%2%' => $digitalObjects->getLastIndice(), 
'%3%' => $digitalObjects->getNbResults())) ?>
+</div>

Modified: trunk/apps/qubit/modules/informationobject/templates/listSuccess.php
===================================================================
--- trunk/apps/qubit/modules/informationobject/templates/listSuccess.php        
2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/apps/qubit/modules/informationobject/templates/listSuccess.php        
2008-09-26 00:14:59 UTC (rev 1391)
@@ -1,8 +1,5 @@
 <div class="pageTitle"><?php echo __('list %1%', array('%1%' => 
sfConfig::get('app_ui_label_informationobject'))); ?></div>
 
-<?php echo $informationObjects->getNbResults() ?> results found.<br />
-Displaying results <?php echo $informationObjects->getFirstIndice() ?> to  
<?php echo $informationObjects->getLastIndice() ?>
-
 <table class="list">
 <thead>
 <tr>
@@ -51,26 +48,23 @@
 </table>
 
 <?php if ($informationObjects->haveToPaginate()): ?>
-<p><div class="pager" style="text-align: center; font-size: 12px">
-  Pages:<br />
+<div class="pager">
   <?php $links = $informationObjects->getLinks(); ?>
-  <?php if ($informationObjects->getFirstPage() < 
$informationObjects->getfirstPageLink()): ?>
-    <?php echo link_to($informationObjects->getFirstPage(), 
'informationobject/list?sort='.$sort.'&page='.$informationObjects->getFirstPage())
 ?>
-    ...
+  <?php if ($informationObjects->getPage() != 
$informationObjects->getFirstPage()): ?>
+ <?php echo link_to('< '.__('previous'), 
'informationobject/list?sort='.$sort.'&page='.($informationObjects->getPage()-1))
 ?>
   <?php endif; ?>
   <?php foreach ($links as $page): ?>
-    <?php echo ($page == $informationObjects->getPage()) ? $page : 
link_to($page, 'informationobject/list?sort='.$sort.'&page='.$page) ?>
+    <?php echo ($page == $informationObjects->getPage()) ? 
'<strong>'.$page.'</strong>' : link_to($page, 
'informationobject/list?sort='.$sort.'&page='.$page) ?>
     <?php if ($page != $informationObjects->getCurrentMaxLink()): ?> <?php 
endif ?>
   <?php endforeach ?>
-  <?php if ($informationObjects->getLastPage() > 
$informationObjects->getLastPageLink()): ?>
-    ...
-    <?php echo link_to($informationObjects->getLastPage(), 
'informationobject/list?sort='.$sort.'&page='.$informationObjects->getLastPage())
 ?>
+  <?php if ($informationObjects->getPage() != 
$informationObjects->getLastPage()): ?>
+ <?php echo link_to(__('next').' >', 
'informationobject/list?sort='.$sort.'&page='.($informationObjects->getPage()+1))
 ?>
   <?php endif; ?>
-</div></p>
-<?php endif ?><br />
+</div>
+<?php endif ?>
 
-<?php if ($editCredentials): ?>
-<div class="menu-action">
-  <?php echo link_to (__('add new %1%', array('%1%' => 
sfConfig::get('app_ui_label_informationobject'))), 'informationobject/create') 
?>
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$informationObjects->getFirstIndice(), '%2%' => 
$informationObjects->getLastIndice(), '%3%' => 
$informationObjects->getNbResults())) ?>
 </div>
-<?php endif; ?>
+
+

Modified: trunk/apps/qubit/modules/repository/templates/listSuccess.php
===================================================================
--- trunk/apps/qubit/modules/repository/templates/listSuccess.php       
2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/apps/qubit/modules/repository/templates/listSuccess.php       
2008-09-26 00:14:59 UTC (rev 1391)
@@ -1,8 +1,5 @@
 <div class="pageTitle"><?php echo __('list %1%', array('%1%' => 
sfConfig::get('app_ui_label_repository'))); ?></div>
 
-<?php echo $repositories->getNbResults() ?> results found.<br />
-Displaying results <?php echo $repositories->getFirstIndice() ?> to  <?php 
echo $repositories->getLastIndice() ?>
-
 <table class="list">
 <thead>
 <tr>
@@ -81,26 +78,22 @@
 </table>
 
 <?php if ($repositories->haveToPaginate()): ?>
-<p><div class="pager" style="text-align: center; font-size: 12px">
-  Pages:<br />
+<div class="pager">
   <?php $links = $repositories->getLinks(); ?>
-  <?php if ($repositories->getFirstPage() < 
$repositories->getfirstPageLink()): ?>
-    <?php echo link_to($repositories->getFirstPage(), 
'repository/list?sort='.$sort.'&page='.$repositories->getFirstPage()) ?>
-    ...
+  <?php if ($repositories->getPage() != $repositories->getFirstPage()): ?>
+ <?php echo link_to('< '.__('previous'), 
'actor/list?sort='.$sort.'&page='.($repositories->getPage()-1)) ?>
   <?php endif; ?>
   <?php foreach ($links as $page): ?>
-    <?php echo ($page == $repositories->getPage()) ? $page : link_to($page, 
'repository/list?sort='.$sort.'&page='.$page) ?>
+    <?php echo ($page == $repositories->getPage()) ? 
'<strong>'.$page.'</strong>' : link_to($page, 
'repository/list?sort='.$sort.'&page='.$page) ?>
     <?php if ($page != $repositories->getCurrentMaxLink()): ?> <?php endif ?>
   <?php endforeach ?>
-  <?php if ($repositories->getLastPage() > $repositories->getLastPageLink()): 
?>
-    ...
-    <?php echo link_to($repositories->getLastPage(), 
'repository/list?sort='.$sort.'&page='.$repositories->getLastPage()) ?>
+  <?php if ($repositories->getPage() != $repositories->getLastPage()): ?>
+ <?php echo link_to(__('next').' >', 
'actor/list?sort='.$sort.'&page='.($repositories->getPage()+1)) ?>
   <?php endif; ?>
-</div></p>
-<?php endif ?><br />
+</div>
+<?php endif ?>
 
-<?php if ($editCredentials): ?>
-<div class="menu-action">
-  <?php echo link_to(__('add new %1%', array('%1%' => 
sfConfig::get('app_ui_label_repository'))), 'repository/create'); ?>
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$repositories->getFirstIndice(), '%2%' => $repositories->getLastIndice(), '%3%' 
=> $repositories->getNbResults())) ?>
 </div>
-<?php endif; ?>
+

Modified: trunk/apps/qubit/modules/term/templates/browseTermSuccess.php
===================================================================
--- trunk/apps/qubit/modules/term/templates/browseTermSuccess.php       
2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/apps/qubit/modules/term/templates/browseTermSuccess.php       
2008-09-26 00:14:59 UTC (rev 1391)
@@ -5,8 +5,6 @@
 <?php echo $termName ?>
 </div>
 
-<?php echo __('Displaying results %1% to %2%',
-    array('%1%' => $informationObjects->getFirstIndice(), '%2%' => 
$informationObjects->getLastIndice())) ?>
 <table class="list">
 <thead>
 
@@ -34,24 +32,26 @@
 </table>
 
 <?php if ($informationObjects->haveToPaginate()): ?>
-<p><div class="pager" style="text-align: center; font-size: 12px">
-  Pages:<br />
+<div class="pager">
   <?php $links = $informationObjects->getLinks(); ?>
-  <?php if ($informationObjects->getFirstPage() < 
$informationObjects->getfirstPageLink()): ?>
-    <?php echo link_to($informationObjects->getFirstPage(), 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.$informationObjects->getFirstPage())
 ?>
-    ...
+  <?php if ($informationObjects->getPage() != 
$informationObjects->getFirstPage()): ?>
+    <?php echo link_to('< '.__('previous'), 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.($informationObjects->getPage()-1))
 ?>
   <?php endif; ?>
   <?php foreach ($links as $page): ?>
-    <?php echo ($page == $informationObjects->getPage()) ? $page : 
link_to($page, 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.$page)
 ?>
+    <?php echo ($page == $informationObjects->getPage()) ? 
'<strong>'.$page.'</strong>' : link_to($page, 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.$page)
 ?>
     <?php if ($page != $informationObjects->getCurrentMaxLink()): ?> <?php 
endif ?>
   <?php endforeach ?>
-  <?php if ($informationObjects->getLastPage() > 
$informationObjects->getLastPageLink()): ?>
-    ...
-    <?php echo link_to($informationObjects->getLastPage(), 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.$informationObjects->getLastPage())
 ?>
+  <?php if ($informationObjects->getPage() != 
$informationObjects->getLastPage()): ?>
+    <?php echo link_to(__('next').' >', 
'term/browse?termId='.$termId.'&sortColumn='.$sortColumn.'&sortDirection='.$sortDirection.'&page='.($informationObjects->getLastPage()+1))
 ?>
   <?php endif; ?>
-</div></p>
-<?php endif ?><br />
+</div>
+<?php endif ?>
 
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$informationObjects->getFirstIndice(), '%2%' => 
$informationObjects->getLastIndice(), '%3%' => 
$informationObjects->getNbResults())) ?>
+</div>
+
+
 <div class="menu-extra">
   <?php echo link_to(__('browse all %1%', array('%1%' => $taxonomyName)), 
'term/browse?taxonomyId='.$term->getTaxonomyId()); ?>
 </div>

Modified: trunk/lib/QubitPager.class.php
===================================================================
--- trunk/lib/QubitPager.class.php      2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/lib/QubitPager.class.php      2008-09-26 00:14:59 UTC (rev 1391)
@@ -146,7 +146,7 @@
    * @param unknown_type $nb_links
    * @return unknown
    */
-  public function getLinks($nb_links = 5)
+  public function getLinks($nb_links = 10)
   {
     $links = array();
     $tmp   = $this->page - floor($nb_links / 2);
@@ -303,4 +303,4 @@
     
     return $this->totalRecordCount;
   }
-}
\ No newline at end of file
+}

Modified: trunk/web/css/graphic.css
===================================================================
--- trunk/web/css/graphic.css   2008-09-25 21:46:50 UTC (rev 1390)
+++ trunk/web/css/graphic.css   2008-09-26 00:14:59 UTC (rev 1391)
@@ -826,3 +826,28 @@
 {
   float: right;
 }
+
+/*********************************************************
+             PAGER
+**********************************************************/
+
+.result-count
+{
+  text-align:center; 
+  color: #999999; 
+  margin-top: 10px;
+}
+
+.pager
+{
+  margin-top: 20px;
+  text-align: center; 
+  font-size: 12px;
+  line-height: 20px;
+}
+
+.pager a
+{
+  border: 1px solid #CCCCCC;
+  padding: 2px 4px 2px 4px;
+}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to