ui_bibz 2.0.0.alpha18 → 2.0.0.alpha19
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4090488e3b07a786d5eceaef52c25c08c34be127
|
4
|
+
data.tar.gz: d4d188984f0a959677b853d94a3f31153915a9bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48fd5d2cfa31cf68245d674440e9cee5ce07ffb18683175a564e0965dccb1c1ae01eac5f8c1c4abc4c8f23e1e48aac5c443edfd5ec35d34072233cd91f0afa3e
|
7
|
+
data.tar.gz: ab15956b2f5b95d0bf2221d8847e620c4f7f9b3f135630a5b40582bd7fdd4e7ee6a3cf433c857998b1abd6f2b476aae0953dc0ee2591b80f8264c83eee1376f0
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
require "will_paginate/view_helpers/action_view"
|
2
|
+
|
3
|
+
module PaginationHelper
|
4
|
+
|
5
|
+
module BootstrapRenderer
|
6
|
+
|
7
|
+
def to_html
|
8
|
+
html = pagination.map do |item|
|
9
|
+
item.is_a?(Fixnum) ?
|
10
|
+
page_number(item) :
|
11
|
+
send(item)
|
12
|
+
end.join(@options[:link_separator])
|
13
|
+
|
14
|
+
html = html_container(html) if @options[:container]
|
15
|
+
|
16
|
+
tag("nav", tag("ul", html, class: @options[:class]))
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def page_item(text, url, link_status = nil)
|
22
|
+
text = text.to_s + tag(:span, "(current)", class: "sr-only") if link_status == "active"
|
23
|
+
link_tag = link_status.nil? ? link(text, url, class: "page-link", rel: text) : tag(:span, text, class: "page-link")
|
24
|
+
|
25
|
+
tag(:li, link_tag, class: "page-item #{link_status}")
|
26
|
+
end
|
27
|
+
|
28
|
+
def page_number(page)
|
29
|
+
link_status = "active" if page == current_page
|
30
|
+
page_item(page, page, link_status)
|
31
|
+
end
|
32
|
+
|
33
|
+
def gap
|
34
|
+
text = @template.will_paginate_translate(:page_gap) { '…' }
|
35
|
+
page_item(text, nil, "disabled")
|
36
|
+
end
|
37
|
+
|
38
|
+
def previous_page
|
39
|
+
num = @collection.current_page > 1 && @collection.current_page - 1
|
40
|
+
previous_or_next_page(num, @options[:previous_label], "Previous")
|
41
|
+
end
|
42
|
+
|
43
|
+
def next_page
|
44
|
+
num = @collection.current_page < total_pages && @collection.current_page + 1
|
45
|
+
previous_or_next_page(num, @options[:next_label], "Next")
|
46
|
+
end
|
47
|
+
|
48
|
+
def previous_or_next_page(page, text, aria_label)
|
49
|
+
link_status = "disabled" unless page
|
50
|
+
page_item(text, page, link_status)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
WillPaginate::ActionView::LinkRenderer.send :include, PaginationHelper::BootstrapRenderer
|
@@ -22,7 +22,7 @@ module UiBibz::Ui::Core::Cards
|
|
22
22
|
# You can pass arguments in options attribute:
|
23
23
|
# * +status+ - status of élement with symbol value:
|
24
24
|
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
25
|
-
# *
|
25
|
+
# * text - Hash (+:size+, +:position+)
|
26
26
|
# (+:left+, +:right+, +:center+)
|
27
27
|
# * block - Boolean
|
28
28
|
# * type - Symbol
|
@@ -131,15 +131,15 @@ module UiBibz::Ui::Core::Cards
|
|
131
131
|
protected
|
132
132
|
|
133
133
|
def component_html_classes
|
134
|
-
["card",
|
134
|
+
["card", text, card_block, type, tab_pane]
|
135
135
|
end
|
136
136
|
|
137
137
|
def status
|
138
138
|
"card-#{ @options[:status] }" unless @options[:status].nil?
|
139
139
|
end
|
140
140
|
|
141
|
-
def
|
142
|
-
"text-#{ @options[:
|
141
|
+
def text
|
142
|
+
"text-#{ @options[:text][:size] || :md }-#{ @options[:text][:position] || :left }" unless @options[:text].nil?
|
143
143
|
end
|
144
144
|
|
145
145
|
def card_block
|
data/lib/ui_bibz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.alpha19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- lib/tasks/ui_bibz_tasks.rake
|
232
232
|
- lib/ui_bibz.rb
|
233
233
|
- lib/ui_bibz/concerns/models/searchable.rb
|
234
|
+
- lib/ui_bibz/helpers/pagination_helper.rb
|
234
235
|
- lib/ui_bibz/helpers/ui_core_helper.rb
|
235
236
|
- lib/ui_bibz/helpers/ui_ux_helper.rb
|
236
237
|
- lib/ui_bibz/helpers/utils_helper.rb
|