Permalink
Browse files

adds twitter theme

  • Loading branch information...
Michael Bishop
Michael Bishop committed Oct 23, 2011
1 parent da144fd commit ea7cdffa4a49df6e8c533a44bacacc5b83b63973
View
@@ -0,0 +1 @@
+Attempts to line up with the markup strategy of Twitter Bootstrap.
@@ -0,0 +1,10 @@
+<%# 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
+ -%>
+<%= link_to raw(t 'views.pagination.first'), url, :remote => remote %>
+
@@ -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
+-%>
+<a><%= raw(t 'views.pagination.truncate') %></a>
@@ -0,0 +1,10 @@
+<%# 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
+-%>
+
+<%= link_to raw(t 'views.pagination.last'), url, {:remote => remote} %>
@@ -0,0 +1,10 @@
+<%# 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
+-%>
+
+<%= link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote, :class => "next" %>
@@ -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
+ -%>
+<%= link_to page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
@@ -0,0 +1,46 @@
+<%# 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
+ -%>
+ <% unless num_pages == 1 %>
+<div class="pagination">
+ <ul>
+ <% if current_page.first? %>
+ <%= content_tag(:li, paginator.first_page_tag, :class => "prev disabled") %>
+ <%= content_tag(:li, paginator.prev_page_tag, :class => "disabled") %>
+ <% else %>
+ <%= content_tag(:li, paginator.first_page_tag, :class => "prev") %>
+ <%= content_tag(:li, paginator.prev_page_tag) %>
+
+ <% end %>
+
+ <% paginator.each_page do |page| %>
+
+ <% if page.left_outer? || page.right_outer? || page.inside_window? %>
+ <% if page == current_page %>
+ <%= content_tag(:li, paginator.page_tag(page), :class => "active") %>
+ <% else %>
+ <%= content_tag(:li, paginator.page_tag(page)) %>
+ <% end %>
+ <% elsif !page.was_truncated? %>
+ <%= content_tag(:li, paginator.gap_tag, :class => "disabled") %>
+ <% end %>
+
+ <% end %>
+
+ <% if current_page.last? %>
+ <%= content_tag(:li, paginator.next_page_tag, :class => "disabled") %>
+ <%= content_tag(:li, paginator.last_page_tag, :class => "disabled next") %>
+ <% else %>
+ <%= content_tag(:li, paginator.next_page_tag) %>
+ <%= content_tag(:li, paginator.last_page_tag, :class => "next") %>
+ <% end %>
+
+
+ </ul>
+</div>
+<% end %>
@@ -0,0 +1,10 @@
+<%# 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
+-%>
+<%= link_to raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote, :class => "prev" %>
+

0 comments on commit ea7cdff

Please sign in to comment.