kaminari-tailwind 0.1.0
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.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +8 -0
- data/app/views/kaminari/tailwind/_first_page.html.erb +3 -0
- data/app/views/kaminari/tailwind/_gap.html.erb +1 -0
- data/app/views/kaminari/tailwind/_last_page.html.erb +3 -0
- data/app/views/kaminari/tailwind/_next_page.html.erb +3 -0
- data/app/views/kaminari/tailwind/_page.html.erb +5 -0
- data/app/views/kaminari/tailwind/_paginator.html.erb +19 -0
- data/app/views/kaminari/tailwind/_prev_page.html.erb +3 -0
- data/docs/img/en.png +0 -0
- data/docs/img/ja.png +0 -0
- data/lib/kaminari/tailwind/engine.rb +6 -0
- data/lib/kaminari/tailwind/version.rb +7 -0
- data/lib/kaminari/tailwind.rb +11 -0
- data/sig/kaminari/tailwind.rbs +6 -0
- metadata +66 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bbf75987f244cfe70a986a0ff33ca99391c6ba0a4af770a9f4f51ba14f3665df
|
|
4
|
+
data.tar.gz: de5a7717f78f784fb103410834f51a9cac2bf8f874e37f40366990fd8d516bd7
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 54efff5ce00cbb212fde7f222f4cfec191b568ebc4c1b973ff001bad7c92a89a5db276775d2f4f09af81d34f9459e6bf053f30545596b99f018d285f3f123fbf
|
|
7
|
+
data.tar.gz: c320fbbb2b97258d2be15d2d7dbb6c5de800fa900015a553787e9b0cfc07bcde852be3283840f863beffe216967cceebf223fc48e68aaa7300e785b69370905f
|
data/.rspec
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Seiya Takahashi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Kaminari::Tailwind
|
|
2
|
+
|
|
3
|
+
kaminari-tailwind is a Ruby gem that provides a Tailwind CSS–based pagination template for Kaminari. With minimal setup, you can quickly get a responsive pagination style in your Rails applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Seamless integration with Kaminari pagination
|
|
8
|
+
- Pre-built pagination views styled with Tailwind CSS
|
|
9
|
+
- Easy to customize—simply modify the generated partials to fit your design
|
|
10
|
+
|
|
11
|
+
## ScreenShot
|
|
12
|
+
|
|
13
|
+
<img src="docs/img/ja.png" width="300px" />
|
|
14
|
+
<img src="docs/img/en.png" width="300px" />
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
1. Add the following lines to your Gemfile:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
gem 'kaminari'
|
|
22
|
+
gem 'kaminari-tailwind'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. Run bundle install to install the gems:
|
|
26
|
+
|
|
27
|
+
`bundle install`
|
|
28
|
+
|
|
29
|
+
## Getting Started
|
|
30
|
+
|
|
31
|
+
1. Set up pagination in your controller:
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
def index
|
|
35
|
+
@users = User.page(params[:page]).per(10)
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Add pagination links in your view:
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
<%= paginate @users, theme: 'tailwind' %>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Here, theme: 'tailwind' tells Kaminari to use the Tailwind-based views provided by this gem.
|
|
46
|
+
|
|
47
|
+
## Customization
|
|
48
|
+
|
|
49
|
+
- If you ran rails generate kaminari:views tailwind, you can edit the generated partials in app/views/kaminari/ to change classes, spacing, colors, etc.
|
|
50
|
+
- Adjust your tailwind.config.js if you have a custom Tailwind setup or want to add utility classes.
|
|
51
|
+
|
|
52
|
+
## Contributing
|
|
53
|
+
|
|
54
|
+
1. Fork this repository and clone it to your local environment.
|
|
55
|
+
2. Create a new branch for your feature or bugfix.
|
|
56
|
+
3. Make your changes, add tests, and run the test suite (if applicable).
|
|
57
|
+
4. Submit a Pull Request.
|
|
58
|
+
|
|
59
|
+
We appreciate all contributions—bug reports, feature requests, and pull requests are welcome!
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
This project is licensed under the MIT License. See the LICENSE file for details.
|
|
64
|
+
|
|
65
|
+
Feel free to add badges, screenshots, or any additional sections (e.g., FAQ, advanced usage) to make your README more comprehensive.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote,
|
|
2
|
+
class: "inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2",
|
|
3
|
+
'aria-label': t('views.pagination.first') %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<span class="tracking-wider text-gray-600 px-3 py-1 text-sm font-medium bg-gray-100 rounded-md"><%= t('views.pagination.truncate').html_safe %></span>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote,
|
|
2
|
+
class: "inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2",
|
|
3
|
+
'aria-label': t('views.pagination.last') %>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote,
|
|
2
|
+
class: "inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2",
|
|
3
|
+
'aria-label': t('views.pagination.next') %>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<% if page.current? %>
|
|
2
|
+
<span class="inline-flex items-center justify-center bg-teal-600 text-white px-4 py-2 rounded-md text-sm font-medium shadow-sm"><%= page %></span>
|
|
3
|
+
<% else %>
|
|
4
|
+
<%= link_to page, url, remote: remote, rel: page.rel, class: "inline-flex items-center justify-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2 shadow-sm" %>
|
|
5
|
+
<% end %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%= paginator.render do -%>
|
|
2
|
+
<nav class="pagination-row flex items-center justify-center space-x-2 m-10" role="navigation" aria-label="pager">
|
|
3
|
+
<%= first_page_tag unless current_page.first? %>
|
|
4
|
+
<%= prev_page_tag unless current_page.first? %>
|
|
5
|
+
<div class="flex items-center justify-center">
|
|
6
|
+
<% each_page do |page| -%>
|
|
7
|
+
<% if page.display_tag? -%>
|
|
8
|
+
<%= page_tag page %>
|
|
9
|
+
<% elsif !page.was_truncated? -%>
|
|
10
|
+
<%= gap_tag %>
|
|
11
|
+
<% end -%>
|
|
12
|
+
<% end -%>
|
|
13
|
+
</div>
|
|
14
|
+
<% unless current_page.out_of_range? %>
|
|
15
|
+
<%= next_page_tag unless current_page.last? %>
|
|
16
|
+
<%= last_page_tag unless current_page.last? %>
|
|
17
|
+
<% end %>
|
|
18
|
+
</nav>
|
|
19
|
+
<% end -%>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote,
|
|
2
|
+
class: "inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2",
|
|
3
|
+
'aria-label': t('views.pagination.previous') %>
|
data/docs/img/en.png
ADDED
|
Binary file
|
data/docs/img/ja.png
ADDED
|
Binary file
|
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: kaminari-tailwind
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Seiya Takahashi
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-02-22 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: kaminari-tailwind is a gem that provides a Tailwind CSS pagination template
|
|
14
|
+
for Kaminari.
|
|
15
|
+
email:
|
|
16
|
+
- seiya4@icloud.com
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- ".rspec"
|
|
22
|
+
- LICENSE.txt
|
|
23
|
+
- README.md
|
|
24
|
+
- Rakefile
|
|
25
|
+
- app/views/kaminari/tailwind/_first_page.html.erb
|
|
26
|
+
- app/views/kaminari/tailwind/_gap.html.erb
|
|
27
|
+
- app/views/kaminari/tailwind/_last_page.html.erb
|
|
28
|
+
- app/views/kaminari/tailwind/_next_page.html.erb
|
|
29
|
+
- app/views/kaminari/tailwind/_page.html.erb
|
|
30
|
+
- app/views/kaminari/tailwind/_paginator.html.erb
|
|
31
|
+
- app/views/kaminari/tailwind/_prev_page.html.erb
|
|
32
|
+
- docs/img/en.png
|
|
33
|
+
- docs/img/ja.png
|
|
34
|
+
- lib/kaminari/tailwind.rb
|
|
35
|
+
- lib/kaminari/tailwind/engine.rb
|
|
36
|
+
- lib/kaminari/tailwind/version.rb
|
|
37
|
+
- sig/kaminari/tailwind.rbs
|
|
38
|
+
homepage: https://github.com/PeterTakahashi/kaminari-tailwind
|
|
39
|
+
licenses:
|
|
40
|
+
- MIT
|
|
41
|
+
metadata:
|
|
42
|
+
homepage_uri: https://github.com/PeterTakahashi/kaminari-tailwind
|
|
43
|
+
source_code_uri: https://github.com/PeterTakahashi/kaminari-tailwind
|
|
44
|
+
changelog_uri: https://github.com/PeterTakahashi/kaminari-tailwind
|
|
45
|
+
post_install_message:
|
|
46
|
+
rdoc_options: []
|
|
47
|
+
require_paths:
|
|
48
|
+
- lib
|
|
49
|
+
- app
|
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 3.0.0
|
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
requirements: []
|
|
61
|
+
rubygems_version: 3.5.11
|
|
62
|
+
signing_key:
|
|
63
|
+
specification_version: 4
|
|
64
|
+
summary: kaminari-tailwind is a gem that provides a Tailwind CSS pagination template
|
|
65
|
+
for Kaminari.
|
|
66
|
+
test_files: []
|