playbook_ui 11.11.0.pre.alpha.paginate1 → 11.11.0.pre.alpha.paginate2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f887ccce9480d7010b8c3e0c558a48fb9b7a9b1a9fcb0c9960e5954ecacdfe4
|
4
|
+
data.tar.gz: e28e2e224fc6150467c0bd40fb3b2df2fa00685e4588e8e3aa0b5e71a93584d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09b7285572384c038996fe2a2ddaa9c4992a67200aea2ea787ae9c5a59eb4509e3b360ded81c994e1dbe9b93ff93217d43a4a6847bbc82c6640a037147f47e60'
|
7
|
+
data.tar.gz: 0253c8a0e18f9c18a0152b3fe1dc0328c85cdb5c1d62f8cf88577567b09d45d38692ec16012794160dd02e4a4251e68cc2dd249a9f1b3a896f2306f92929a508
|
@@ -27,26 +27,26 @@
|
|
27
27
|
margin-left: 1px;
|
28
28
|
margin-right: 1px;
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
&:hover {
|
31
|
+
background-color: $active_light;
|
32
|
+
color: $primary !important;
|
33
|
+
border-radius: $border_rad_light;
|
34
|
+
}
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
border-radius: $border_rad_light;
|
39
|
-
outline-offset: -1px;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
.active > span {
|
43
|
-
background-color: $primary;
|
36
|
+
&:focus {
|
37
|
+
outline: 1px solid $primary !important;
|
44
38
|
border-radius: $border_rad_light;
|
45
|
-
|
46
|
-
|
39
|
+
outline-offset: -1px;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
.active > span {
|
43
|
+
background-color: $primary !important;
|
44
|
+
border-radius: $border_rad_light;
|
45
|
+
margin-left: 1px;
|
46
|
+
margin-right: 1px;
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
}
|
48
|
+
&:hover {
|
49
|
+
box-shadow: $shadow_deeper;
|
51
50
|
}
|
51
|
+
}
|
52
52
|
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "will_paginate/view_helpers/action_view"
|
4
|
+
|
5
|
+
module Playbook
|
6
|
+
module Pagination
|
7
|
+
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
|
8
|
+
def container_attributes
|
9
|
+
{ class: "pb_pagination pagination" }
|
10
|
+
end
|
11
|
+
|
12
|
+
def page_number(page)
|
13
|
+
if page == current_page
|
14
|
+
tag("li", tag("span", page), class: "active")
|
15
|
+
else
|
16
|
+
tag("li", link(page, page, rel: rel_value(page)))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def previous_or_next_page(page, text, classname)
|
21
|
+
if page
|
22
|
+
tag("li", link(text, page), class: classname)
|
23
|
+
else
|
24
|
+
tag("li", tag("span", text), class: "%s disabled")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def gap
|
29
|
+
tag("li", tag("span", "…"), class: "disabled")
|
30
|
+
end
|
31
|
+
|
32
|
+
def previous_page
|
33
|
+
num = @collection.current_page > 1 && @collection.current_page - 1
|
34
|
+
previous_or_next_page(num, "<i class='far fa-chevron-left'></i>", "prev")
|
35
|
+
end
|
36
|
+
|
37
|
+
def next_page
|
38
|
+
num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
|
39
|
+
previous_or_next_page(num, "<i class='far fa-chevron-right'></i>", "next")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/playbook/version.rb
CHANGED
data/lib/playbook.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.11.0.pre.alpha.
|
4
|
+
version: 11.11.0.pre.alpha.paginate2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-11-
|
12
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 0.3.2
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: will_paginate
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '3.3'
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '3.3'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: byebug
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2299,7 +2313,7 @@ files:
|
|
2299
2313
|
- lib/playbook/markdown/template_handler.rb
|
2300
2314
|
- lib/playbook/number_spacing.rb
|
2301
2315
|
- lib/playbook/order.rb
|
2302
|
-
- lib/playbook/
|
2316
|
+
- lib/playbook/pagination_renderer.rb
|
2303
2317
|
- lib/playbook/pb_doc_helper.rb
|
2304
2318
|
- lib/playbook/pb_forms_helper.rb
|
2305
2319
|
- lib/playbook/pb_kit_helper.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
|
5
|
-
def container_attributes
|
6
|
-
{ class: "pb_pagination pagination" }
|
7
|
-
end
|
8
|
-
|
9
|
-
def page_number(page)
|
10
|
-
if page == current_page
|
11
|
-
tag("li", tag("span", page), class: "active")
|
12
|
-
else
|
13
|
-
tag("li", link(page, page, rel: rel_value(page)))
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def previous_or_next_page(page, text, classname)
|
18
|
-
if page
|
19
|
-
tag("li", link(text, page), class: classname)
|
20
|
-
else
|
21
|
-
tag("li", tag("span", text), class: "%s disabled")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def gap
|
26
|
-
tag("li", tag("span", "…"), class: "disabled")
|
27
|
-
end
|
28
|
-
|
29
|
-
def previous_page
|
30
|
-
num = @collection.current_page > 1 && @collection.current_page - 1
|
31
|
-
previous_or_next_page(num, "<i class='far fa-chevron-left'></i>", "prev")
|
32
|
-
end
|
33
|
-
|
34
|
-
def next_page
|
35
|
-
num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
|
36
|
-
previous_or_next_page(num, "<i class='far fa-chevron-right'></i>", "next")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|