From 34501f7f21a63c310e6c85bbf841d0f35ab258de Mon Sep 17 00:00:00 2001 From: Sergey Novikov Date: Tue, 26 Jan 2016 11:39:37 +0300 Subject: [PATCH] Add bootstrap4 theme --- bootstrap4/README.md | 7 +++++++ .../app/views/kaminari/_first_page.html.erb | 3 +++ .../app/views/kaminari/_first_page.html.haml | 2 ++ .../app/views/kaminari/_first_page.html.slim | 2 ++ bootstrap4/app/views/kaminari/_last_page.html.erb | 3 +++ .../app/views/kaminari/_last_page.html.haml | 2 ++ .../app/views/kaminari/_last_page.html.slim | 2 ++ bootstrap4/app/views/kaminari/_next_page.html.erb | 3 +++ .../app/views/kaminari/_next_page.html.haml | 2 ++ .../app/views/kaminari/_next_page.html.slim | 2 ++ bootstrap4/app/views/kaminari/_page.html.erb | 9 +++++++++ bootstrap4/app/views/kaminari/_page.html.haml | 6 ++++++ bootstrap4/app/views/kaminari/_page.html.slim | 6 ++++++ bootstrap4/app/views/kaminari/_paginator.html.erb | 15 +++++++++++++++ .../app/views/kaminari/_paginator.html.haml | 10 ++++++++++ .../app/views/kaminari/_paginator.html.slim | 10 ++++++++++ bootstrap4/app/views/kaminari/_prev_page.html.erb | 3 +++ .../app/views/kaminari/_prev_page.html.haml | 2 ++ .../app/views/kaminari/_prev_page.html.slim | 2 ++ 19 files changed, 91 insertions(+) create mode 100644 bootstrap4/README.md create mode 100644 bootstrap4/app/views/kaminari/_first_page.html.erb create mode 100644 bootstrap4/app/views/kaminari/_first_page.html.haml create mode 100644 bootstrap4/app/views/kaminari/_first_page.html.slim create mode 100644 bootstrap4/app/views/kaminari/_last_page.html.erb create mode 100644 bootstrap4/app/views/kaminari/_last_page.html.haml create mode 100644 bootstrap4/app/views/kaminari/_last_page.html.slim create mode 100644 bootstrap4/app/views/kaminari/_next_page.html.erb create mode 100644 bootstrap4/app/views/kaminari/_next_page.html.haml create mode 100644 bootstrap4/app/views/kaminari/_next_page.html.slim create mode 100644 bootstrap4/app/views/kaminari/_page.html.erb create mode 100644 bootstrap4/app/views/kaminari/_page.html.haml create mode 100644 bootstrap4/app/views/kaminari/_page.html.slim create mode 100644 bootstrap4/app/views/kaminari/_paginator.html.erb create mode 100644 bootstrap4/app/views/kaminari/_paginator.html.haml create mode 100644 bootstrap4/app/views/kaminari/_paginator.html.slim create mode 100644 bootstrap4/app/views/kaminari/_prev_page.html.erb create mode 100644 bootstrap4/app/views/kaminari/_prev_page.html.haml create mode 100644 bootstrap4/app/views/kaminari/_prev_page.html.slim diff --git a/bootstrap4/README.md b/bootstrap4/README.md new file mode 100644 index 0000000..7e5c8fd --- /dev/null +++ b/bootstrap4/README.md @@ -0,0 +1,7 @@ +# Pagination for [Bootstrap 4](http://v4-alpha.getbootstrap.com) + +With support for: + +- erb +- haml +- slim diff --git a/bootstrap4/app/views/kaminari/_first_page.html.erb b/bootstrap4/app/views/kaminari/_first_page.html.erb new file mode 100644 index 0000000..cc107ec --- /dev/null +++ b/bootstrap4/app/views/kaminari/_first_page.html.erb @@ -0,0 +1,3 @@ +
  • + <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %> +
  • diff --git a/bootstrap4/app/views/kaminari/_first_page.html.haml b/bootstrap4/app/views/kaminari/_first_page.html.haml new file mode 100644 index 0000000..ef4db45 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_first_page.html.haml @@ -0,0 +1,2 @@ +%li.page-item + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_first_page.html.slim b/bootstrap4/app/views/kaminari/_first_page.html.slim new file mode 100644 index 0000000..cc5a1cc --- /dev/null +++ b/bootstrap4/app/views/kaminari/_first_page.html.slim @@ -0,0 +1,2 @@ +li.page-item + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_last_page.html.erb b/bootstrap4/app/views/kaminari/_last_page.html.erb new file mode 100644 index 0000000..76ce130 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_last_page.html.erb @@ -0,0 +1,3 @@ +
  • + <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' } %> +
  • diff --git a/bootstrap4/app/views/kaminari/_last_page.html.haml b/bootstrap4/app/views/kaminari/_last_page.html.haml new file mode 100644 index 0000000..aabf8f2 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_last_page.html.haml @@ -0,0 +1,2 @@ +%li.page-item + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' } diff --git a/bootstrap4/app/views/kaminari/_last_page.html.slim b/bootstrap4/app/views/kaminari/_last_page.html.slim new file mode 100644 index 0000000..9635712 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_last_page.html.slim @@ -0,0 +1,2 @@ +li.page-item + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' } diff --git a/bootstrap4/app/views/kaminari/_next_page.html.erb b/bootstrap4/app/views/kaminari/_next_page.html.erb new file mode 100644 index 0000000..7ca72a8 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_next_page.html.erb @@ -0,0 +1,3 @@ +
  • + <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %> +
  • diff --git a/bootstrap4/app/views/kaminari/_next_page.html.haml b/bootstrap4/app/views/kaminari/_next_page.html.haml new file mode 100644 index 0000000..a25e7ce --- /dev/null +++ b/bootstrap4/app/views/kaminari/_next_page.html.haml @@ -0,0 +1,2 @@ +%li.page-item + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_next_page.html.slim b/bootstrap4/app/views/kaminari/_next_page.html.slim new file mode 100644 index 0000000..5adc455 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_next_page.html.slim @@ -0,0 +1,2 @@ +li.page-item + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_page.html.erb b/bootstrap4/app/views/kaminari/_page.html.erb new file mode 100644 index 0000000..57bc591 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_page.html.erb @@ -0,0 +1,9 @@ +<% if page.current? %> +
  • + <%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %> +
  • +<% else %> +
  • + <%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %> +
  • +<% end %> diff --git a/bootstrap4/app/views/kaminari/_page.html.haml b/bootstrap4/app/views/kaminari/_page.html.haml new file mode 100644 index 0000000..96c99a3 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_page.html.haml @@ -0,0 +1,6 @@ +- if page.current? + %li.page-item.active + = content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' +- else + %li.page-item + = link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_page.html.slim b/bootstrap4/app/views/kaminari/_page.html.slim new file mode 100644 index 0000000..d77a6c6 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_page.html.slim @@ -0,0 +1,6 @@ +- if page.current? + li.page-item.active + = content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' +- else + li.page-item + = link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_paginator.html.erb b/bootstrap4/app/views/kaminari/_paginator.html.erb new file mode 100644 index 0000000..b60a3f3 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_paginator.html.erb @@ -0,0 +1,15 @@ +<%= paginator.render do %> + +<% end %> diff --git a/bootstrap4/app/views/kaminari/_paginator.html.haml b/bootstrap4/app/views/kaminari/_paginator.html.haml new file mode 100644 index 0000000..5dc9313 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_paginator.html.haml @@ -0,0 +1,10 @@ += paginator.render do + %nav + %ul.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 + = next_page_tag unless current_page.last? + = last_page_tag unless current_page.last? diff --git a/bootstrap4/app/views/kaminari/_paginator.html.slim b/bootstrap4/app/views/kaminari/_paginator.html.slim new file mode 100644 index 0000000..fba696b --- /dev/null +++ b/bootstrap4/app/views/kaminari/_paginator.html.slim @@ -0,0 +1,10 @@ += paginator.render do + nav + ul.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 + = next_page_tag unless current_page.last? + = last_page_tag unless current_page.last? diff --git a/bootstrap4/app/views/kaminari/_prev_page.html.erb b/bootstrap4/app/views/kaminari/_prev_page.html.erb new file mode 100644 index 0000000..c7803fa --- /dev/null +++ b/bootstrap4/app/views/kaminari/_prev_page.html.erb @@ -0,0 +1,3 @@ +
  • + <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %> +
  • diff --git a/bootstrap4/app/views/kaminari/_prev_page.html.haml b/bootstrap4/app/views/kaminari/_prev_page.html.haml new file mode 100644 index 0000000..0fb55c3 --- /dev/null +++ b/bootstrap4/app/views/kaminari/_prev_page.html.haml @@ -0,0 +1,2 @@ +%li.page-item + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' diff --git a/bootstrap4/app/views/kaminari/_prev_page.html.slim b/bootstrap4/app/views/kaminari/_prev_page.html.slim new file mode 100644 index 0000000..83f33ee --- /dev/null +++ b/bootstrap4/app/views/kaminari/_prev_page.html.slim @@ -0,0 +1,2 @@ +li.page-item + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link'