foundation-will_paginate 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,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in foundation-will_paginate.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Mark McConachie
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # Foundation::WillPaginate
2
+
3
+ Integrates Zurb Foundation's [pagination styles](http://foundation.zurb.com/docs/navigation.php) with [will_paginate](https://github.com/mislav/will_paginate).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'foundation-will_paginate'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install foundation-will_paginate
18
+
19
+ ## Usage
20
+
21
+ In your view where you would usually use
22
+
23
+ ```
24
+ <%= will_paginate @posts %>
25
+ ```
26
+
27
+ Now use
28
+
29
+ ```
30
+ <%= foundation_paginate @posts %>
31
+ ```
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'foundation-will_paginate/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "foundation-will_paginate"
8
+ gem.version = Foundation::WillPaginate::VERSION
9
+ gem.authors = ["Mark McConachie"]
10
+ gem.email = ["mark@markmcconachie.com"]
11
+ gem.description = %q{foundation-will_paginate provides a renderer and a view helper to let foundation and will_paginate work together}
12
+ gem.summary = %q{foundation pagination with will_paginate}
13
+ gem.homepage = "https://github.com/markmcconachie/foundation-will_paginate"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
@@ -0,0 +1,7 @@
1
+ require "foundation-will_paginate/version"
2
+ require "foundation-will_paginate/renderer"
3
+ require "foundation-will_paginate/helper"
4
+
5
+ ActiveSupport.on_load(:action_view) do
6
+ include Foundation::WillPaginate::Helper
7
+ end
@@ -0,0 +1,9 @@
1
+ module Foundation
2
+ module WillPaginate
3
+ module Helper
4
+ def foundation_paginate(pages)
5
+ will_paginate(pages, :class => 'pagination', :inner_window => 2, :outer_window => 0, :renderer => Foundation::WillPaginate::Renderer, :previous_label => '&laquo;'.html_safe, :next_label => '&raquo;'.html_safe)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,31 @@
1
+ require 'will_paginate/view_helpers/action_view'
2
+
3
+ module Foundation
4
+ module WillPaginate
5
+ class Renderer < ::WillPaginate::ActionView::LinkRenderer
6
+
7
+ protected
8
+
9
+ def gap
10
+ tag :li, link(super, '#'), :class => 'unavailable'
11
+ end
12
+
13
+ def page_number(page)
14
+ tag :li, link(page, page, :rel => rel_value(page)), :class => ('current' if page == current_page)
15
+ end
16
+
17
+ def previous_or_next_page(page, text, classname)
18
+ tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('unavailable' unless page)].join(' ')
19
+ end
20
+
21
+ def html_container(html)
22
+ tag(:ul, html, container_attributes)
23
+ end
24
+
25
+ def gap
26
+ tag :li, link(super, '#'), :class => 'unavailable'
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ module Foundation
2
+ module WillPaginate
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foundation-will_paginate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mark McConachie
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: foundation-will_paginate provides a renderer and a view helper to let
15
+ foundation and will_paginate work together
16
+ email:
17
+ - mark@markmcconachie.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - foundation-will_paginate.gemspec
28
+ - lib/foundation-will_paginate.rb
29
+ - lib/foundation-will_paginate/helper.rb
30
+ - lib/foundation-will_paginate/renderer.rb
31
+ - lib/foundation-will_paginate/version.rb
32
+ homepage: https://github.com/markmcconachie/foundation-will_paginate
33
+ licenses: []
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 1.8.23
53
+ signing_key:
54
+ specification_version: 3
55
+ summary: foundation pagination with will_paginate
56
+ test_files: []