bootstrap_concerns 0.1.3 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31d5e399c3df170e89482e6538c4aaa9dc2ba4e8a60d369b85dc76b8ff3c65c6
4
- data.tar.gz: d9853f42ef0b0be5b350dd3eb2be09b7e9ed6c27058e43405e4c6418d19ae6bb
3
+ metadata.gz: 28162042396d85235591daeb80f1e71b1b7b8aec3924bd8936b88bab35c1046a
4
+ data.tar.gz: cefb18301a211b278ff0046cd3d1e0e05292d34438d4887d4da601621582b68a
5
5
  SHA512:
6
- metadata.gz: a12819936111447076690e20aebb635dd77703baf99a338a248926f24d24c62815c1b2f687f3957de4a38bfa99559aa4e652409123273102da08886dbe6b852a
7
- data.tar.gz: 2a776d433403d40738a0892f5243541c129c2de8fc7ca44bf161c0cee2e41d6048a721eb08b8f2ddf9ca1eaa99c09dad0d850f05161da5a62f0d434c54c20cc0
6
+ metadata.gz: 29508223f068e537111076d03786521e200401ecf44b25743a6afdb9ade542970fbd4fd8218b8244f58a1de4149c6db4f8923acf83250551900d417322973480
7
+ data.tar.gz: 93efbaff1cda22b691b1357944c1dc0052e0385d895bf24ab5a700577e358abd4eaf8d0f81c0a38ef7d4bd3d6ab65f4e5a56b5ced979bdcdaa1638c82220ab53
@@ -1,11 +1,19 @@
1
1
  module BootstrapConcerns
2
2
  module ComponentsHelper
3
- def bs_button_to(name = nil, options = nil, html_options = nil, &)
4
- bs_link_or_button_to(:button_to, name, options, html_options, &)
3
+ def assign_icon
4
+ icon("box-arrow-in-left", "Assign")
5
5
  end
6
6
 
7
- def bs_link_to(name = nil, options = nil, html_options = nil, &)
8
- bs_link_or_button_to(:link_to, name, options, html_options, &)
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,8 +35,32 @@ 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
- case key
63
+ case key.to_s
32
64
  when "notice"
33
65
  "success"
34
66
  when "alert"
@@ -37,5 +69,25 @@ 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 search_icon
90
+ icon("search", "Search")
91
+ end
40
92
  end
41
93
  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.3
4
+ version: 0.1.5
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-10 00:00:00.000000000 Z
11
+ date: 2025-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview