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 +4 -4
- data/lib/bootstrap_concerns/components_helper.rb +57 -5
- 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: 28162042396d85235591daeb80f1e71b1b7b8aec3924bd8936b88bab35c1046a
         | 
| 4 | 
            +
              data.tar.gz: cefb18301a211b278ff0046cd3d1e0e05292d34438d4887d4da601621582b68a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 29508223f068e537111076d03786521e200401ecf44b25743a6afdb9ade542970fbd4fd8218b8244f58a1de4149c6db4f8923acf83250551900d417322973480
         | 
| 7 | 
            +
              data.tar.gz: 93efbaff1cda22b691b1357944c1dc0052e0385d895bf24ab5a700577e358abd4eaf8d0f81c0a38ef7d4bd3d6ab65f4e5a56b5ced979bdcdaa1638c82220ab53
         | 
| @@ -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,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. | 
| 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- | 
| 11 | 
            +
            date: 2025-02-13 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: actionview
         |