bootstrap_concerns 0.1.4 → 0.1.6
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 +4 -4
- data/lib/bootstrap_concerns/components_helper.rb +62 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f35253ea93c0fce428414d3cf532fc201f01bd9a04fbf0fb423b4c75f46f06d
|
4
|
+
data.tar.gz: 1b5a2e4df178a55c00182bc36236d98d875d1e37cd57415a340c18800cd80521
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eab18846191880aad325cedb5b103a17f7536c9b81bbce11aab74b1ecafd5f20e5e2129222ccb11888f3b7f0a3c5e02d903ffda0d4f56525fa516c473e223a34
|
7
|
+
data.tar.gz: 40a5a0bd02122a02f368a8ceda3528021dd4abfb65b7253c6114fd10be60295355cdfbcf715a302958489549e67da7ebfda01c008503a630873b7e865e238001
|
@@ -1,11 +1,19 @@
|
|
1
1
|
module BootstrapConcerns
|
2
2
|
module ComponentsHelper
|
3
|
-
def
|
4
|
-
|
3
|
+
def assign_icon
|
4
|
+
icon("box-arrow-in-left", "Assign")
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
8
|
-
|
7
|
+
def boolean_false_icon
|
8
|
+
content_tag(:i, "", class: "bi bi-x-circle-fill")
|
9
|
+
end
|
10
|
+
|
11
|
+
def boolean_true_icon
|
12
|
+
content_tag(:i, "", class: "bi bi-check-circle-fill")
|
13
|
+
end
|
14
|
+
|
15
|
+
def bs_button_to(name = nil, options = nil, html_options = nil, &)
|
16
|
+
bs_link_or_button_to(:button_to, name, options, html_options, &)
|
9
17
|
end
|
10
18
|
|
11
19
|
def bs_link_or_button_to(method_name, name, options, html_options, &)
|
@@ -27,6 +35,30 @@ module BootstrapConcerns
|
|
27
35
|
)
|
28
36
|
end
|
29
37
|
|
38
|
+
def bs_link_to(name = nil, options = nil, html_options = nil, &)
|
39
|
+
bs_link_or_button_to(:link_to, name, options, html_options, &)
|
40
|
+
end
|
41
|
+
|
42
|
+
def copy_icon
|
43
|
+
icon("files", "Copy")
|
44
|
+
end
|
45
|
+
|
46
|
+
def delete_icon(text = "Delete")
|
47
|
+
icon("trash", text)
|
48
|
+
end
|
49
|
+
|
50
|
+
def download_icon
|
51
|
+
icon("download", "Download")
|
52
|
+
end
|
53
|
+
|
54
|
+
def edit_icon
|
55
|
+
icon("pencil-square", "Edit")
|
56
|
+
end
|
57
|
+
|
58
|
+
def export_icon(label = "Export")
|
59
|
+
icon("filetype-xlsx", label)
|
60
|
+
end
|
61
|
+
|
30
62
|
def flash_alert_color(key)
|
31
63
|
case key.to_s
|
32
64
|
when "notice"
|
@@ -37,5 +69,31 @@ module BootstrapConcerns
|
|
37
69
|
key
|
38
70
|
end
|
39
71
|
end
|
72
|
+
|
73
|
+
def icon(name, text)
|
74
|
+
content_tag("i", "", class: "bi bi-#{name}") + content_tag(:span, text, class: "ms-1 d-none d-sm-inline")
|
75
|
+
end
|
76
|
+
|
77
|
+
def import_icon
|
78
|
+
icon("box-arrow-in-down", "Import")
|
79
|
+
end
|
80
|
+
|
81
|
+
def new_icon(label = "New")
|
82
|
+
icon("file-earmark-plus", label)
|
83
|
+
end
|
84
|
+
|
85
|
+
def rename_icon
|
86
|
+
icon("input-cursor-text", "Rename")
|
87
|
+
end
|
88
|
+
|
89
|
+
def table(&)
|
90
|
+
content_tag :div, class: "table-responsive" do
|
91
|
+
content_tag(:table, class: "table table-striped table-sm", &)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def search_icon
|
96
|
+
icon("search", "Search")
|
97
|
+
end
|
40
98
|
end
|
41
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_concerns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Brooks
|
8
8
|
- Robert Keresnyei
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|