Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adds twitter theme

  • Loading branch information...
commit ea7cdffa4a49df6e8c533a44bacacc5b83b63973 1 parent da144fd
Mike Bishop authored October 22, 2011
1  twitter/DESCRIPTION
... ...
@@ -0,0 +1 @@
  1
+Attempts to line up with the markup strategy of Twitter Bootstrap.
10  twitter/app/views/kaminari/_first_page.html.erb
... ...
@@ -0,0 +1,10 @@
  1
+<%# Link to the "First" page
  2
+  - available local variables
  3
+    url:           url to the first page
  4
+    current_page:  a page object for the currently displayed page
  5
+    num_pages:     total number of pages
  6
+    per_page:      number of items to fetch per page
  7
+    remote:        data-remote
  8
+  -%>
  9
+<%= link_to raw(t 'views.pagination.first'), url, :remote => remote %>
  10
+
8  twitter/app/views/kaminari/_gap.html.erb
... ...
@@ -0,0 +1,8 @@
  1
+<%# Non-link tag that stands for skipped pages...
  2
+  - available local variables
  3
+    current_page:  a page object for the currently displayed page
  4
+    num_pages:     total number of pages
  5
+    per_page:      number of items to fetch per page
  6
+    remote:        data-remote
  7
+-%>
  8
+<a><%= raw(t 'views.pagination.truncate') %></a>
10  twitter/app/views/kaminari/_last_page.html.erb
... ...
@@ -0,0 +1,10 @@
  1
+<%# Link to the "Last" page
  2
+  - available local variables
  3
+    url:           url to the last page
  4
+    current_page:  a page object for the currently displayed page
  5
+    num_pages:     total number of pages
  6
+    per_page:      number of items to fetch per page
  7
+    remote:        data-remote
  8
+-%>
  9
+
  10
+<%= link_to raw(t 'views.pagination.last'), url, {:remote => remote} %>
10  twitter/app/views/kaminari/_next_page.html.erb
... ...
@@ -0,0 +1,10 @@
  1
+<%# Link to the "Next" page
  2
+  - available local variables
  3
+    url:           url to the next page
  4
+    current_page:  a page object for the currently displayed page
  5
+    num_pages:     total number of pages
  6
+    per_page:      number of items to fetch per page
  7
+    remote:        data-remote
  8
+-%>
  9
+
  10
+<%= link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote, :class => "next" %>
10  twitter/app/views/kaminari/_page.html.erb
... ...
@@ -0,0 +1,10 @@
  1
+<%# Link showing page number
  2
+  - available local variables
  3
+    page:          a page object for "this" page
  4
+    url:           url to this page
  5
+    current_page:  a page object for the currently displayed page
  6
+    num_pages:     total number of pages
  7
+    per_page:      number of items to fetch per page
  8
+    remote:        data-remote
  9
+  -%>
  10
+<%= link_to page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
46  twitter/app/views/kaminari/_paginator.html.erb
... ...
@@ -0,0 +1,46 @@
  1
+<%# The container tag
  2
+  - available local variables
  3
+    current_page:  a page object for the currently displayed page
  4
+    num_pages:     total number of pages
  5
+    per_page:      number of items to fetch per page
  6
+    remote:        data-remote
  7
+    paginator:     the paginator that renders the pagination tags inside
  8
+  -%>
  9
+  <% unless num_pages == 1 %>
  10
+<div class="pagination">
  11
+  <ul>
  12
+    <% if current_page.first? %>
  13
+      <%= content_tag(:li, paginator.first_page_tag, :class => "prev disabled") %>
  14
+      <%= content_tag(:li, paginator.prev_page_tag, :class => "disabled") %>
  15
+    <% else %>
  16
+      <%= content_tag(:li, paginator.first_page_tag, :class => "prev") %>
  17
+      <%= content_tag(:li, paginator.prev_page_tag) %>
  18
+      
  19
+    <% end %>
  20
+
  21
+    <% paginator.each_page do |page| %>
  22
+
  23
+      <% if page.left_outer? || page.right_outer? || page.inside_window? %>
  24
+        <% if page == current_page %>
  25
+          <%= content_tag(:li, paginator.page_tag(page), :class => "active") %>
  26
+        <% else %>
  27
+          <%= content_tag(:li, paginator.page_tag(page)) %>
  28
+        <% end %>
  29
+      <% elsif !page.was_truncated? %>
  30
+        <%= content_tag(:li, paginator.gap_tag, :class => "disabled") %>
  31
+      <% end %>
  32
+
  33
+    <% end %>
  34
+
  35
+    <% if current_page.last? %>
  36
+      <%= content_tag(:li, paginator.next_page_tag, :class => "disabled") %>
  37
+      <%= content_tag(:li, paginator.last_page_tag, :class => "disabled next") %>
  38
+    <% else %>
  39
+      <%= content_tag(:li, paginator.next_page_tag) %>
  40
+      <%= content_tag(:li, paginator.last_page_tag, :class => "next") %>
  41
+    <% end %>
  42
+
  43
+
  44
+  </ul>
  45
+</div>
  46
+<% end %>
10  twitter/app/views/kaminari/_prev_page.html.erb
... ...
@@ -0,0 +1,10 @@
  1
+<%# Link to the "Previous" page
  2
+  - available local variables
  3
+    url:           url to the previous page
  4
+    current_page:  a page object for the currently displayed page
  5
+    num_pages:     total number of pages
  6
+    per_page:      number of items to fetch per page
  7
+    remote:        data-remote
  8
+-%>
  9
+<%= link_to raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote, :class => "prev" %>
  10
+

0 notes on commit ea7cdff

Please sign in to comment.
Something went wrong with that request. Please try again.