Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Twitter Bootstrap Theme #10

Closed
wants to merge 2 commits into from

3 participants

@alem0lars

I've added a kaminari theme for twitter bootstrap.
I've already tested the haml templates. They work correctly.
I've also added the erb templates.

@Loremaster

+1. Add this functionality, PLEASE!

@amatsuda
Owner

Finally merged #8 for the Bootstrap theme. Thank you very much!

@amatsuda amatsuda closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  twitter_bootstrap/DESCRIPTION
@@ -0,0 +1 @@
+Kaminari theme using twitter bootstrap.
View
19 twitter_bootstrap/app/views/kaminari/_first_page.html.erb
@@ -0,0 +1,19 @@
+<!--
+ 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
+-->
+
+<li class="<%=current_page.first? ? 'disabled' : ''%>">
+ <span class="first">
+ <% if current_page.first? %>
+ <a class="disabled"><%= '«' %></a>
+ <% else %>
+ <%= link_to('«', url, remote: remote) %>
+ <% end %>
+ </span>
+</li>
View
13 twitter_bootstrap/app/views/kaminari/_first_page.html.haml
@@ -0,0 +1,13 @@
+-# 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
+%li{class: current_page.first? ? 'disabled' : ''}
+ %span.first
+ - if current_page.first?
+ %a.disabled= '«'
+ - else
+ = link_to '«', url, remote: remote
View
11 twitter_bootstrap/app/views/kaminari/_gap.html.erb
@@ -0,0 +1,11 @@
+-# 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
+<li class="disabled">
+ <span class="page gap">
+ <a>...</a>
+ </span>
+</li>
View
9 twitter_bootstrap/app/views/kaminari/_gap.html.haml
@@ -0,0 +1,9 @@
+-# 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
+%li.disabled
+ %span.page.gap
+ %a ...
View
20 twitter_bootstrap/app/views/kaminari/_last_page.html.erb
@@ -0,0 +1,20 @@
+<!--
+ 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
+-->
+
+<li class="<%= current_page.last? ? 'disabled' : ''%>">
+ <span class="last">
+ <% if current_page.last? %>
+ <a class="disabled"><%= '»' %></a>
+ <% else %>
+ <%= link_to('»', url, remote: remote) %>
+ <% end %>
+ </span>
+</li>
+
View
13 twitter_bootstrap/app/views/kaminari/_last_page.html.haml
@@ -0,0 +1,13 @@
+-# 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
+%li{class: current_page.last? ? 'disabled' : ''}
+ %span.last
+ - if current_page.last?
+ %a.disabled= '»'
+ - else
+ = link_to '»', url, remote: remote
View
20 twitter_bootstrap/app/views/kaminari/_next_page.html.erb
@@ -0,0 +1,20 @@
+<!--
+ 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
+-->
+
+<li class="<%= current_page.last? ? 'disabled' : '' %>">
+ <span class="next">
+ <% if current_page.last? %>
+ <a><%= '>' %></a>
+ <% else %>
+ <%= link_to('>', url, rel: 'next', remote: remote) %>
+ <% end %>
+ </span>
+</li>
+
View
13 twitter_bootstrap/app/views/kaminari/_next_page.html.haml
@@ -0,0 +1,13 @@
+-# 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
+%li{class: current_page.last? ? 'disabled' : ''}
+ %span.next
+ - if current_page.last?
+ %a= '>'
+ - else
+ = link_to '>', url, rel: 'next', remote: remote
View
21 twitter_bootstrap/app/views/kaminari/_page.html.erb
@@ -0,0 +1,21 @@
+<!--
+ 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
+-->
+
+<li class="<%= page.current? ? 'active' : '' %>">
+ <span class="<%= "page#{' current active' if page.current?}" %>">
+ <% if page.current? %>
+ <a><%= page %></a>
+ <% else %>
+ <%= link_to(page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}) %>
+ <% end %>
+ </span>
+</li>
+
View
14 twitter_bootstrap/app/views/kaminari/_page.html.haml
@@ -0,0 +1,14 @@
+-# 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
+%li{class: page.current? ? 'active' : ''}
+ %span{:class => "page#{' current active' if page.current?}"}
+ - if page.current?
+ %a= page
+ - else
+ = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
View
28 twitter_bootstrap/app/views/kaminari/_paginator.html.erb
@@ -0,0 +1,28 @@
+<!--
+ 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 class="pagination">
+ <ul>
+ <%= first_page_tag %>
+ <%= prev_page_tag %>
+ <% each_page do |page| %>
+ <% if page.left_outer? || page.right_outer? || page.inside_window? %>
+ <%= page_tag page %>
+ <% elsif !page.was_truncated? %>
+ <%= gap_tag %>
+ <% end %>
+ <% end %>
+ <%= next_page_tag %>
+ <%= last_page_tag %>
+ </ul>
+ </nav>
+<% end %>
+
View
19 twitter_bootstrap/app/views/kaminari/_paginator.html.haml
@@ -0,0 +1,19 @@
+-# 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
+ %ul
+ = first_page_tag
+ = prev_page_tag
+ - 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
+ = last_page_tag
View
20 twitter_bootstrap/app/views/kaminari/_prev_page.html.erb
@@ -0,0 +1,20 @@
+<!--
+ 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
+-->
+
+<li class="<%= current_page.first? ? 'disabled' : '' %>">
+ <span class="prev">
+ <% if current_page.first? %>
+ <a><%= '<' %></a>
+ <% else %>
+ <%= link_to('<', url, rel: 'prev', remote: remote) %>
+ <% end %>
+ </span>
+</li>
+
View
13 twitter_bootstrap/app/views/kaminari/_prev_page.html.haml
@@ -0,0 +1,13 @@
+-# 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
+%li{class: current_page.first? ? 'disabled' : ''}
+ %span.prev
+ - if current_page.first?
+ %a= '<'
+ - else
+ = link_to '<', url, rel: 'prev', remote: remote
Something went wrong with that request. Please try again.