bootstrap_kaminari 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # Twitter Bootstrap Theme For Kaminari
2
+
3
+ ## Dependencies
4
+
5
+ ### Kaminari
6
+
7
+ https://github.com/amatsuda/kaminari
8
+
9
+ ``` ruby
10
+ gem 'kaminari'
11
+ ```
12
+
13
+ ### Twitter Bootstrap
14
+
15
+ - SCSS Flavor (Asset Pipeline): https://github.com/anjlab/bootstrap-rails
16
+ - Less Flavor (Asset Pipeline): https://github.com/seyhunak/twitter-bootstrap-rails
17
+ - Vanilla: https://github.com/twitter/bootstrap
18
+
19
+ ## Usage
20
+
21
+ Add Kaminari and some form of Twitter Bootstrap to your project.
22
+
23
+ Require `bootstrap_kaminari` in your Gemfile:
24
+
25
+ ``` ruby
26
+ gem 'bootstrap_kaminari'
27
+ ```
28
+
29
+ or
30
+
31
+ ``` ruby
32
+ gem 'bootstrap_kaminari', :git => 'git://github.com/dleavitt/bootstrap_kaminari.git'
33
+ ```
34
+
35
+ The theme is namespaced, so invoke it like this:
36
+
37
+ ``` ruby
38
+ paginate @items, theme: "bootstrap"
39
+ ```
@@ -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
+ %li.disabled
8
+ = link_to "...", "#"
@@ -0,0 +1,9 @@
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
+ %li{class: "next" + (current_page.last? ? " disabled" : "") }
9
+ = link_to "Next →".html_safe, current_page.last? ? '#' : url, :rel => 'next', :remote => remote
@@ -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
+ %li{:class => "page#{' active' if page.current?}"}
10
+ = link_to page, page.current? ? "#" : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
@@ -0,0 +1,17 @@
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
+ = paginator.render do
9
+ %nav.pagination
10
+ %ul
11
+ = prev_page_tag
12
+ - each_page do |page|
13
+ - if page.left_outer? || page.right_outer? || page.inside_window?
14
+ = page_tag page
15
+ - elsif !page.was_truncated?
16
+ = gap_tag
17
+ = next_page_tag
@@ -0,0 +1,9 @@
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
+ %li{class: "prev" + (current_page.first? ? " disabled" : "") }
9
+ = link_to "← Prev".html_safe, current_page.first? ? '#' : url, :rel => 'prev', :remote => remote
@@ -0,0 +1,5 @@
1
+ module BootstrapKaminari
2
+ module Rails
3
+ require "bootstrap_kaminari/engine"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Bootstrap
2
+ module Kaminari
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module BootstrapKaminari
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bootstrap_kaminari do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap_kaminari
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Daniel Leavitt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &2151913900 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2151913900
25
+ - !ruby/object:Gem::Dependency
26
+ name: kaminari
27
+ requirement: &2151912800 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.12.4
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2151912800
36
+ description: Bootstrap theme for Kaminari .
37
+ email:
38
+ - daniel@hyfn.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - app/views/kaminari/bootstrap/_gap.html.haml
44
+ - app/views/kaminari/bootstrap/_next_page.html.haml
45
+ - app/views/kaminari/bootstrap/_page.html.haml
46
+ - app/views/kaminari/bootstrap/_paginator.html.haml
47
+ - app/views/kaminari/bootstrap/_prev_page.html.haml
48
+ - lib/bootstrap_kaminari/engine.rb
49
+ - lib/bootstrap_kaminari/version.rb
50
+ - lib/bootstrap_kaminari.rb
51
+ - lib/tasks/bootstrap_kaminari_tasks.rake
52
+ - MIT-LICENSE
53
+ - README.md
54
+ homepage: https://github.com/dleavitt/bootstrap_kaminari
55
+ licenses: []
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 1.8.11
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Twitter Bootstrap pagination theme for Kaminari.
78
+ test_files: []
79
+ has_rdoc: