denki 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e53011667902b6348434ccd4edc8073a467f193f46ec8ae11abd977f97a067a3
4
+ data.tar.gz: c20e5ff803e6743019fa3a0b8da423728bd3d586194aa146b73fe1ab3bff8181
5
+ SHA512:
6
+ metadata.gz: bd2b4ccd3c31ed64e5babe05081089c921d9012055e80f444b5a407698de620b088a6b39805988752fab0899eb09abbf6a28bd91192d671d408a8d4845d2ec7e
7
+ data.tar.gz: b776e1d67299615e989706020742eec25dfd94d120df61181ed0605c3045c6873f8d1af981cb2af9ec269a11785ab223bb2628f0a58dde747c6c7ffa9dc4f1d6
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # Denki Kaminari Extension
2
+
3
+ ## Installation
4
+ Add to your Gemfile
5
+
6
+ ```bash
7
+ gem 'denki', '~> 0.0.1'
8
+ ```
9
+
10
+ And run in console
11
+
12
+ ```bash
13
+ bundle install
14
+ ```
15
+
16
+ ## Usage
17
+ Render pagination with this gem's theme:
18
+
19
+ ```erb
20
+ <%= paginate(@users, theme: 'bs5') %>
21
+ ```
22
+
23
+ You can also add specific pagination and nav classes:
24
+
25
+ ```erb
26
+ <%= paginate(@users,
27
+ theme: 'bs5',
28
+ pagination_class: 'pagination-sm flex-wrap justify-content-center',
29
+ nav_class: 'd-inline-block') %>
30
+ ```
31
+
32
+ ### Credits
33
+
34
+ Bootstrap 5 compatible styles for [bootstrap5-kaminari-views](https://github.com/felipecalvo/bootstrap5-kaminari-views)
35
+
36
+ [Kaminari](https://github.com/kaminari/kaminari) - Pagination gem
37
+
38
+ [twitter-bootstrap-kaminari-views](https://github.com/gabetax/twitter-bootstrap-kaminari-views) - Original, non-gemified implementation
39
+
40
+ [bootstrap-kaminari-views](https://github.com/matenia/bootstrap-kaminari-views) - Bootstrap 2.x and 3.x compatible gem
41
+
42
+ [bootstrap4-kaminari-views](https://github.com/KamilDzierbicki/bootstrap4-kaminari-views) - Bootstrap 4.0 compatible gem
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env rake
2
+ # frozen_string_literal: true
3
+
4
+ begin
5
+ require 'bundler/setup'
6
+ rescue LoadError
7
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
8
+ end
9
+ begin
10
+ require 'rdoc/task'
11
+ rescue LoadError
12
+ require 'rdoc/rdoc'
13
+ require 'rake/rdoctask'
14
+ RDoc::Task = Rake::RDocTask
15
+ end
16
+
17
+ RDoc::Task.new(:rdoc) do |rdoc|
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.title = 'Denki'
20
+ rdoc.options << '--line-numbers'
21
+ rdoc.rdoc_files.include('README.rdoc')
22
+ rdoc.rdoc_files.include('lib/**/*.rb')
23
+ end
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+ task default: :test
@@ -0,0 +1,17 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first 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
+ -%>
9
+ <% unless current_page.first? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.first?,
12
+ raw(t 'views.pagination.first'),
13
+ url,
14
+ :class => 'page-link',
15
+ :remote => remote %>
16
+ </li>
17
+ <% end %>
@@ -0,0 +1,12 @@
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
+ -%>
8
+ <li class="page-item disabled">
9
+ <a href="#" onclick="return false;" class="page-link">
10
+ <%= raw(t 'views.pagination.truncate') %>
11
+ </a>
12
+ </li>
@@ -0,0 +1,17 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last 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
+ -%>
9
+ <% unless current_page.last? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.last?,
12
+ raw(t 'views.pagination.last'),
13
+ url,
14
+ :class => 'page-link',
15
+ :remote => remote %>
16
+ </li>
17
+ <% end %>
@@ -0,0 +1,18 @@
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
+ -%>
9
+ <% unless current_page.last? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.last?,
12
+ raw(t 'views.pagination.next'),
13
+ url,
14
+ :class => 'page-link',
15
+ :rel => 'next',
16
+ :remote => remote %>
17
+ </li>
18
+ <% end %>
@@ -0,0 +1,18 @@
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
+ -%>
10
+ <li class="page-item<%= ' active' if page.current? %>">
11
+ <%= link_to page,
12
+ url,
13
+ opts = {
14
+ :remote => remote,
15
+ :class => 'page-link',
16
+ :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil
17
+ } %>
18
+ </li>
@@ -0,0 +1,27 @@
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
+ -%>
9
+ <%- pagination_class ||= '' %>
10
+ <%- nav_class ||= '' %>
11
+ <%= paginator.render do -%>
12
+ <nav class="<%= nav_class %>">
13
+ <ul class="pagination <%= pagination_class %>">
14
+ <%= first_page_tag unless current_page.first? %>
15
+ <%= prev_page_tag unless current_page.first? %>
16
+ <% each_page do |page| -%>
17
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
18
+ <%= page_tag page %>
19
+ <% elsif !page.was_truncated? -%>
20
+ <%= gap_tag %>
21
+ <% end -%>
22
+ <% end -%>
23
+ <%= next_page_tag unless current_page.last? %>
24
+ <%= last_page_tag unless current_page.last? %>
25
+ </ul>
26
+ </nav>
27
+ <% end -%>
@@ -0,0 +1,18 @@
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
+ -%>
9
+ <% unless current_page.first? %>
10
+ <li class="page-item">
11
+ <%= link_to_unless current_page.first?,
12
+ raw(t 'views.pagination.previous'),
13
+ url,
14
+ :rel => 'prev',
15
+ :remote => remote,
16
+ :class => 'page-link' %>
17
+ </li>
18
+ <% end %>
@@ -0,0 +1,21 @@
1
+ en:
2
+ views:
3
+ pagination:
4
+ first: "« First"
5
+ last: "Last &raquo;"
6
+ previous: "‹ Prev"
7
+ next: "Last »"
8
+ truncate: "…"
9
+ helpers:
10
+ page_entries_info:
11
+ entry:
12
+ zero: "entries"
13
+ one: "entry"
14
+ other: "entries"
15
+ one_page:
16
+ display_entries:
17
+ zero: "No %{entry_name} found"
18
+ one: "Displaying <b>1</b> %{entry_name}"
19
+ other: "Displaying <b>all %{count}</b> %{entry_name}"
20
+ more_pages:
21
+ display_entries: "Displaying %{entry_name} <b>%{first} - %{last}</b> of <b>%{total}</b> in total"
data/lib/denki.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'kaminari'
4
+ require 'kaminari-i18n'
5
+
6
+ module Denki
7
+ class Engine < Rails::Engine
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: denki
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Walmir Neto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: kaminari
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.13'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: kaminari-i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '3.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '3.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-performance
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description:
112
+ email:
113
+ - owalmirneto@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - README.md
119
+ - Rakefile
120
+ - app/views/kaminari/bs5/_first_page.html.erb
121
+ - app/views/kaminari/bs5/_gap.html.erb
122
+ - app/views/kaminari/bs5/_last_page.html.erb
123
+ - app/views/kaminari/bs5/_next_page.html.erb
124
+ - app/views/kaminari/bs5/_page.html.erb
125
+ - app/views/kaminari/bs5/_paginator.html.erb
126
+ - app/views/kaminari/bs5/_prev_page.html.erb
127
+ - config/locales/denki.yml
128
+ - lib/denki.rb
129
+ homepage: http://github.com/owalmirneto/denki
130
+ licenses: []
131
+ metadata:
132
+ rubygems_mfa_required: 'true'
133
+ post_install_message:
134
+ rdoc_options: []
135
+ require_paths:
136
+ - lib
137
+ required_ruby_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ requirements: []
148
+ rubygems_version: 3.3.8
149
+ signing_key:
150
+ specification_version: 4
151
+ summary: Denki is a Bootstrap 5 compatible styles for Kaminari
152
+ test_files: []