[logaling-commit] logaling/logaling-server [master] Customize the pagination helper

Back to archive index

SHIMADA Koji null+****@clear*****
Fri Sep 28 02:51:39 JST 2012


SHIMADA Koji	2012-09-28 02:51:39 +0900 (Fri, 28 Sep 2012)

  New Revision: 150a0e28b0816db68a96abc0901ee8f6d0046594
  https://github.com/logaling/logaling-server/commit/150a0e28b0816db68a96abc0901ee8f6d0046594

  Merged 71a096d: Merge pull request #20 from logaling/kaminarize

  Log:
    Customize the pagination helper

  Modified files:
    app/views/kaminari/_first_page.html.haml
    app/views/kaminari/_gap.html.haml
    app/views/kaminari/_last_page.html.haml
    app/views/kaminari/_next_page.html.haml
    app/views/kaminari/_page.html.haml
    app/views/kaminari/_paginator.html.haml
    app/views/kaminari/_prev_page.html.haml

  Modified: app/views/kaminari/_first_page.html.haml (+2 -2)
===================================================================
--- app/views/kaminari/_first_page.html.haml    2012-09-28 02:51:19 +0900 (fee8112)
+++ app/views/kaminari/_first_page.html.haml    2012-09-28 02:51:39 +0900 (d7d0a45)
@@ -5,5 +5,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span.first
-  = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
+%li
+  = link_to raw(t 'views.pagination.first'), url, :remote => remote

  Modified: app/views/kaminari/_gap.html.haml (+1 -1)
===================================================================
--- app/views/kaminari/_gap.html.haml    2012-09-28 02:51:19 +0900 (f82f185)
+++ app/views/kaminari/_gap.html.haml    2012-09-28 02:51:39 +0900 (b2b04ae)
@@ -4,5 +4,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span.page.gap
+%li
   = raw(t 'views.pagination.truncate')

  Modified: app/views/kaminari/_last_page.html.haml (+2 -2)
===================================================================
--- app/views/kaminari/_last_page.html.haml    2012-09-28 02:51:19 +0900 (6e41d23)
+++ app/views/kaminari/_last_page.html.haml    2012-09-28 02:51:39 +0900 (e00f6ab)
@@ -5,5 +5,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span.last
-  = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
+%li
+  = link_to raw(t 'views.pagination.last'), url, {:remote => remote}

  Modified: app/views/kaminari/_next_page.html.haml (+2 -2)
===================================================================
--- app/views/kaminari/_next_page.html.haml    2012-09-28 02:51:19 +0900 (e87ab4e)
+++ app/views/kaminari/_next_page.html.haml    2012-09-28 02:51:39 +0900 (39db799)
@@ -5,5 +5,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span.next
-  = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
+%li
+  = link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote

  Modified: app/views/kaminari/_page.html.haml (+2 -2)
===================================================================
--- app/views/kaminari/_page.html.haml    2012-09-28 02:51:19 +0900 (528bba8)
+++ app/views/kaminari/_page.html.haml    2012-09-28 02:51:39 +0900 (4133106)
@@ -6,5 +6,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span{:class => "page#{' current' if page.current?}"}
-  = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
+%li{:class => "#{'active' if page.current?}"}
+  = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}

  Modified: app/views/kaminari/_paginator.html.haml (+11 -10)
===================================================================
--- app/views/kaminari/_paginator.html.haml    2012-09-28 02:51:19 +0900 (1bf1884)
+++ app/views/kaminari/_paginator.html.haml    2012-09-28 02:51:39 +0900 (910ea48)
@@ -6,13 +6,14 @@
 -#    remote:        data-remote
 -#    paginator:     the paginator that renders the pagination tags inside
 = paginator.render do
-  %nav.pagination
-    = first_page_tag unless current_page.first?
-    = prev_page_tag unless current_page.first?
-    - each_page do |page|
-      - if page.left_outer? || page.right_outer? || page.inside_window?
-        = page_tag page
-      - elsif !page.was_truncated?
-        = gap_tag
-    = next_page_tag unless current_page.last?
-    = last_page_tag unless current_page.last?
+  .pagination
+    %ul
+      = first_page_tag unless current_page.first?
+      = prev_page_tag unless current_page.first?
+      - each_page do |page|
+        - if page.left_outer? || page.right_outer? || page.inside_window?
+          = page_tag page
+        - elsif !page.was_truncated?
+          = gap_tag
+      = next_page_tag unless current_page.last?
+      = last_page_tag unless current_page.last?

  Modified: app/views/kaminari/_prev_page.html.haml (+2 -2)
===================================================================
--- app/views/kaminari/_prev_page.html.haml    2012-09-28 02:51:19 +0900 (13f0d8a)
+++ app/views/kaminari/_prev_page.html.haml    2012-09-28 02:51:39 +0900 (2b9c8b6)
@@ -5,5 +5,5 @@
 -#    num_pages:     total number of pages
 -#    per_page:      number of items to fetch per page
 -#    remote:        data-remote
-%span.prev
-  = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
+%li
+  = link_to raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
-------------- next part --------------
An HTML attachment was scrubbed...
下载 



More information about the logaling-commit mailing list
Back to archive index