[logaling-commit] logaling/logaling-server [master] kaminari: rails g kaminari:views default -e haml

Zurück zum Archiv-Index

SHIMADA Koji null+****@clear*****
Fri Sep 28 01:49:33 JST 2012


SHIMADA Koji	2012-09-28 01:49:33 +0900 (Fri, 28 Sep 2012)

  New Revision: 00091a0ab887581f75cad2249528585d0e981518
  https://github.com/logaling/logaling-server/commit/00091a0ab887581f75cad2249528585d0e981518

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

  Log:
    kaminari: rails g kaminari:views default -e haml

  Added 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

  Added: app/views/kaminari/_first_page.html.haml (+9 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_first_page.html.haml    2012-09-28 01:49:33 +0900 (fee8112)
@@ -0,0 +1,9 @@
+-#  Link to the "First" page
+-#  available local variables
+-#    url:           url to the first page
+-#    current_page:  a page object for the currently displayed page
+-#    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

  Added: app/views/kaminari/_gap.html.haml (+8 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_gap.html.haml    2012-09-28 01:49:33 +0900 (f82f185)
@@ -0,0 +1,8 @@
+-#  Non-link tag that stands for skipped pages...
+-#  available local variables
+-#    current_page:  a page object for the currently displayed page
+-#    num_pages:     total number of pages
+-#    per_page:      number of items to fetch per page
+-#    remote:        data-remote
+%span.page.gap
+  = raw(t 'views.pagination.truncate')

  Added: app/views/kaminari/_last_page.html.haml (+9 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_last_page.html.haml    2012-09-28 01:49:33 +0900 (6e41d23)
@@ -0,0 +1,9 @@
+-#  Link to the "Last" page
+-#  available local variables
+-#    url:           url to the last page
+-#    current_page:  a page object for the currently displayed page
+-#    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}

  Added: app/views/kaminari/_next_page.html.haml (+9 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_next_page.html.haml    2012-09-28 01:49:33 +0900 (e87ab4e)
@@ -0,0 +1,9 @@
+-#  Link to the "Next" page
+-#  available local variables
+-#    url:           url to the next page
+-#    current_page:  a page object for the currently displayed page
+-#    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

  Added: app/views/kaminari/_page.html.haml (+10 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_page.html.haml    2012-09-28 01:49:33 +0900 (528bba8)
@@ -0,0 +1,10 @@
+-#  Link showing page number
+-#  available local variables
+-#    page:          a page object for "this" page
+-#    url:           url to this page
+-#    current_page:  a page object for the currently displayed page
+-#    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}

  Added: app/views/kaminari/_paginator.html.haml (+18 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_paginator.html.haml    2012-09-28 01:49:33 +0900 (1bf1884)
@@ -0,0 +1,18 @@
+-#  The container tag
+-#  available local variables
+-#    current_page:  a page object for the currently displayed page
+-#    num_pages:     total number of pages
+-#    per_page:      number of items to fetch per page
+-#    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?

  Added: app/views/kaminari/_prev_page.html.haml (+9 -0) 100644
===================================================================
--- /dev/null
+++ app/views/kaminari/_prev_page.html.haml    2012-09-28 01:49:33 +0900 (13f0d8a)
@@ -0,0 +1,9 @@
+-#  Link to the "Previous" page
+-#  available local variables
+-#    url:           url to the previous page
+-#    current_page:  a page object for the currently displayed page
+-#    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
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index