dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 441 forks source link

pagination bugfix #73

Closed till closed 11 years ago

till commented 11 years ago
diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml
index 59d07ce..17b0a1a 100644
--- a/PHPCI/View/Project/view.phtml
+++ b/PHPCI/View/Project/view.phtml
@@ -61,14 +61,14 @@
        $pages = ceil($total / 10);
        $pages = $pages == 0 ? 1 : $pages;

-       print '<li class="'.($page == 1 ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'">&laquo;</a></li>';
+       print '<li class="'.($page == 1 ? 'disabled' : '').'"><a href="' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'">&laquo;</a></li>';

        for($i = 1; $i <= $pages; $i++)
        {
-               print '<li><a href="<?= PHPCI_URL ?>project/view/' . $project->getId() . '?p=' . $i . '">' . $i . '</a></li>';
+               print '<li><a href="' . PHPCI_URL . 'project/view/' . $project->getId() . '?p=' . $i . '">' . $i . '</a></li>';
        }

-       print '<li class="'.($page == $pages ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'">&raquo;</a></li>';
+       print '<li class="'.($page == $pages ? 'disabled' : '').'"><a href="' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'">&raquo;</a></li>';

        print '</ul></div>';
kamermans commented 11 years ago

Note that the pagination control grows to be very wide now, eventually wrapping and making it difficult to use:

image

Not sure how to solve this with the current UI system.

till commented 11 years ago

@kamermans You could do what everyone does — some people call it "digg-style pagination". So you omit a couple runs in between: < 1 2 3 4 ... 30 31 32 33 34 >