From f97fb3a457240718b0a4c43c5e137da35b0a1d87 Mon Sep 17 00:00:00 2001 From: kapil verma Date: Sat, 1 Sep 2012 19:00:47 +0530 Subject: [PATCH 1/5] Updated Paginator to fit better with bootstrap 2.1 The Paginator Renders a list of links compatible with bootstrap 2.1 standards ... so the irritating bug that used to be there on active and disabled pages is gone --- laravel/paginator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/laravel/paginator.php b/laravel/paginator.php index 3deb5f61..e45e7d7c 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -183,7 +183,7 @@ class Paginator { $links = $this->slider($adjacent); } - $content = $this->previous().' '.$links.' '.$this->next(); + $content = ''; return ''; } @@ -300,7 +300,7 @@ class Paginator { // the "first" element should be a span instead of a link. if ($disabled($this->page, $this->last)) { - return HTML::span($text, array('class' => "{$class} disabled")); + return '"{$class} disabled")).'>'.$text.''; } else { @@ -349,7 +349,7 @@ class Paginator { { if ($this->page == $page) { - $pages[] = HTML::span($page, array('class' => 'current')); + $pages[] = '
  • '.$page.'
  • '; } else { @@ -372,7 +372,7 @@ class Paginator { { $query = '?page='.$page.$this->appendage($this->appends); - return HTML::link(URI::current().$query, $text, compact('class'), Request::secure()); + return ''. HTML::link(URI::current().$query, $text, [], Request::secure()).''; } /** From 2a5d7c3080901b30e37898e79e5df94d290ac11c Mon Sep 17 00:00:00 2001 From: kapil verma Date: Sun, 2 Sep 2012 12:27:06 +0530 Subject: [PATCH 2/5] Fixed the use of 5.4 array syntax in one place SO that things dont break for 5.3 peeps --- laravel/paginator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/paginator.php b/laravel/paginator.php index e45e7d7c..7f406281 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -372,7 +372,7 @@ class Paginator { { $query = '?page='.$page.$this->appendage($this->appends); - return ''. HTML::link(URI::current().$query, $text, [], Request::secure()).''; + return ''. HTML::link(URI::current().$query, $text, array(), Request::secure()).''; } /** From 4de8921f2db47c6e216abfdb563dd31581f0e59d Mon Sep 17 00:00:00 2001 From: kapil verma Date: Mon, 10 Sep 2012 12:02:55 +0530 Subject: [PATCH 3/5] Fixed The $dots property So that it doesn't screw up pagination --- laravel/paginator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/paginator.php b/laravel/paginator.php index 7f406281..b12c4a27 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -65,7 +65,7 @@ class Paginator { * * @var string */ - protected $dots = '...'; + protected $dots = '
  • ...
  • '; /** * Create a new Paginator instance. From 85cab82f37731f09f319418a0a308d2580c57a1d Mon Sep 17 00:00:00 2001 From: kapil verma Date: Tue, 11 Sep 2012 07:48:01 +0530 Subject: [PATCH 4/5] Fixed 2 stupid bugs for better markup Thats it .. pulling on the docs now --- laravel/paginator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/paginator.php b/laravel/paginator.php index b12c4a27..e9b95e35 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -300,7 +300,7 @@ class Paginator { // the "first" element should be a span instead of a link. if ($disabled($this->page, $this->last)) { - return '"{$class} disabled")).'>'.$text.''; + return '"{$class} disabled")).'>'.$text.''; } else { @@ -372,7 +372,7 @@ class Paginator { { $query = '?page='.$page.$this->appendage($this->appends); - return ''. HTML::link(URI::current().$query, $text, array(), Request::secure()).''; + return ' $class)).'>'. HTML::link(URI::current().$query, $text, array(), Request::secure()).''; } /** From b63b0c08294a00a0a9c30e3d5a0152f9e3088b05 Mon Sep 17 00:00:00 2001 From: kapil verma Date: Tue, 11 Sep 2012 08:09:30 +0530 Subject: [PATCH 5/5] Updated Documentation for Bootstrap-y Pagination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Docs now show bootstrap style Pagination  --- laravel/documentation/views/pagination.md | 30 ++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/laravel/documentation/views/pagination.md b/laravel/documentation/views/pagination.md index 95b5479b..081a6f60 100644 --- a/laravel/documentation/views/pagination.md +++ b/laravel/documentation/views/pagination.md @@ -80,29 +80,31 @@ Sometimes you may need to create a Paginator instance manually, without using th All pagination link elements can be style using CSS classes. Here is an example of the HTML elements generated by the links method: When you are on the first page of results, the "Previous" link will be disabled. Likewise, the "Next" link will be disabled when you are on the last page of results. The generated HTML will look like this: - Previous +
  • Previous