rails_base 0.52.3 → 0.53.0
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/app/views/layouts/rails_base/application.html.erb +29 -1
- data/lib/rails_base/configuration/appearance.rb +14 -10
- data/lib/rails_base/configuration/display/back_to_top.rb +20 -0
- data/lib/rails_base/configuration/display/footer.rb +1 -1
- data/lib/rails_base/version.rb +2 -2
- metadata +4 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8a9e5642a22977c5cae3b9de0ff97843756c80ae5570ed79c180d1b5f2563c14
         | 
| 4 | 
            +
              data.tar.gz: 8b26fbf0624bc4334b0793872dd2a2ffd73dca21651c5082073e925a92fb7012
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a04d3da65692ffd59dc41961ffae4a7a292043731df480a683d9387997d65812af378a3276401696b7e8f1c8c4568f90caa1118ed1035c89a8be563e0ff3eb25
         | 
| 7 | 
            +
              data.tar.gz: 2ae5996b21c71bf4ac95b5b7ef774b6e0867aa3b08f8128a6ca97dfbc28ecb1846d8d6bba2d9390bc25d422365cb006ce737f4369ee4a817f618a1ae93dfaa0d
         | 
| @@ -20,6 +20,7 @@ | |
| 20 20 | 
             
                <link href="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/css/bootstrap4-toggle.min.css" rel="stylesheet">
         | 
| 21 21 | 
             
                <script src="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/js/bootstrap4-toggle.min.js"></script>
         | 
| 22 22 | 
             
                <script src="https://unpkg.com/sticky-table-headers"></script>
         | 
| 23 | 
            +
                <script src="https://kit.fontawesome.com/3b649de495.js" crossorigin="anonymous"></script>
         | 
| 23 24 |  | 
| 24 25 | 
             
                <%=
         | 
| 25 26 | 
             
                if RailsBase.config.app.favicon_path
         | 
| @@ -125,6 +126,33 @@ | |
| 125 126 | 
             
                  </footer>
         | 
| 126 127 | 
             
                <% end %>
         | 
| 127 128 | 
             
                </div>
         | 
| 129 | 
            +
                <% if RailsBase.appearance.back_to_top.enable? %>
         | 
| 130 | 
            +
                  <a id="rails-base-back-to-top" class="btn btn-light btn-lg back-to-top" role="button"><i class="fas fa-chevron-up"></i></a>
         | 
| 131 | 
            +
                  <script type="text/javascript">
         | 
| 132 | 
            +
                    $(document).ready(function(){
         | 
| 133 | 
            +
                      $(window).scroll(function () {
         | 
| 134 | 
            +
                        if ($(this).scrollTop() > 100) {
         | 
| 135 | 
            +
                          $('#rails-base-back-to-top').fadeIn();
         | 
| 136 | 
            +
                        } else {
         | 
| 137 | 
            +
                          $('#rails-base-back-to-top').fadeOut();
         | 
| 138 | 
            +
                        }
         | 
| 139 | 
            +
                      });
         | 
| 140 | 
            +
                      $('#rails-base-back-to-top').click(function () {
         | 
| 141 | 
            +
                        $('body,html').animate({
         | 
| 142 | 
            +
                          scrollTop: 0
         | 
| 143 | 
            +
                        }, 400);
         | 
| 144 | 
            +
                      });
         | 
| 145 | 
            +
                    });
         | 
| 146 | 
            +
                  </script>
         | 
| 147 | 
            +
                  <style type="text/css">
         | 
| 148 | 
            +
                    .back-to-top {
         | 
| 149 | 
            +
                        position: fixed;
         | 
| 150 | 
            +
                        bottom: 50px;
         | 
| 151 | 
            +
                        right: 25px;
         | 
| 152 | 
            +
                        display: none;
         | 
| 153 | 
            +
                    }
         | 
| 154 | 
            +
                  </style>
         | 
| 155 | 
            +
                <% end %>
         | 
| 128 156 |  | 
| 129 157 | 
             
                <script>
         | 
| 130 158 | 
             
                  modify_layout();
         | 
| @@ -168,7 +196,7 @@ | |
| 168 196 |  | 
| 169 197 | 
             
                    // Attempt to set timezone on every request
         | 
| 170 198 | 
             
                    set_cookie('<%= RailsBase::ApplicationController::TIMEZONE_OFFSET_COOKIE %>', new Date().getTimezoneOffset())
         | 
| 171 | 
            -
             | 
| 199 | 
            +
                    });
         | 
| 172 200 | 
             
                  <% end %>
         | 
| 173 201 | 
             
                  <% if Rails.env == 'production' %>
         | 
| 174 202 | 
             
                  // Disable console logging
         | 
| @@ -1,18 +1,19 @@ | |
| 1 1 | 
             
            require 'rails_base/configuration/base'
         | 
| 2 | 
            -
            require 'rails_base/configuration/display/ | 
| 3 | 
            -
            require 'rails_base/configuration/display/table_body'
         | 
| 2 | 
            +
            require 'rails_base/configuration/display/back_to_top'
         | 
| 4 3 | 
             
            require 'rails_base/configuration/display/background_color'
         | 
| 5 | 
            -
            require 'rails_base/configuration/display/ | 
| 6 | 
            -
            require 'rails_base/configuration/display/ | 
| 7 | 
            -
            require 'rails_base/configuration/display/ | 
| 4 | 
            +
            require 'rails_base/configuration/display/btn_danger'
         | 
| 5 | 
            +
            require 'rails_base/configuration/display/btn_dark'
         | 
| 6 | 
            +
            require 'rails_base/configuration/display/btn_info'
         | 
| 7 | 
            +
            require 'rails_base/configuration/display/btn_light'
         | 
| 8 8 | 
             
            require 'rails_base/configuration/display/btn_primary'
         | 
| 9 9 | 
             
            require 'rails_base/configuration/display/btn_secondary'
         | 
| 10 10 | 
             
            require 'rails_base/configuration/display/btn_success'
         | 
| 11 | 
            -
            require 'rails_base/configuration/display/btn_danger'
         | 
| 12 11 | 
             
            require 'rails_base/configuration/display/btn_warning'
         | 
| 13 | 
            -
            require 'rails_base/configuration/display/ | 
| 14 | 
            -
            require 'rails_base/configuration/display/ | 
| 15 | 
            -
            require 'rails_base/configuration/display/ | 
| 12 | 
            +
            require 'rails_base/configuration/display/footer'
         | 
| 13 | 
            +
            require 'rails_base/configuration/display/navbar'
         | 
| 14 | 
            +
            require 'rails_base/configuration/display/table_body'
         | 
| 15 | 
            +
            require 'rails_base/configuration/display/table_header'
         | 
| 16 | 
            +
            require 'rails_base/configuration/display/text'
         | 
| 16 17 |  | 
| 17 18 | 
             
            module RailsBase
         | 
| 18 19 | 
             
              module Configuration
         | 
| @@ -35,10 +36,11 @@ module RailsBase | |
| 35 36 | 
             
                    :navbar,
         | 
| 36 37 | 
             
                    :text,
         | 
| 37 38 | 
             
                    :footer,
         | 
| 39 | 
            +
                    :back_to_top,
         | 
| 38 40 |  | 
| 39 41 | 
             
                  ] + BUTTONS
         | 
| 40 42 |  | 
| 41 | 
            -
                  SKIP_DOWNSTREAM_CLASSES = [:footer]
         | 
| 43 | 
            +
                  SKIP_DOWNSTREAM_CLASSES = [:footer, :back_to_top]
         | 
| 42 44 | 
             
                  DARK_MODE = :dark
         | 
| 43 45 | 
             
                  LIGHT_MODE = :light
         | 
| 44 46 | 
             
                  MATCH_OS = :match_os
         | 
| @@ -83,7 +85,9 @@ module RailsBase | |
| 83 85 | 
             
                    @bg_color = Configuration::Display::BackgroundColor.new
         | 
| 84 86 | 
             
                    @navbar = Configuration::Display::Navbar.new
         | 
| 85 87 | 
             
                    @text = Configuration::Display::Text.new
         | 
| 88 | 
            +
             | 
| 86 89 | 
             
                    @footer = Configuration::Display::Footer.new
         | 
| 90 | 
            +
                    @back_to_top = Configuration::Display::BackTotop.new
         | 
| 87 91 |  | 
| 88 92 | 
             
                    @btn_primary = Configuration::Display::BtnPrimary.new
         | 
| 89 93 | 
             
                    @btn_secondary = Configuration::Display::BtnSecondary.new
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            require 'rails_base/configuration/base'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module RailsBase
         | 
| 4 | 
            +
              module Configuration
         | 
| 5 | 
            +
                module Display
         | 
| 6 | 
            +
                  class BackTotop < Base
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                    DEFAULT_VALUES = {
         | 
| 9 | 
            +
                      enable: {
         | 
| 10 | 
            +
                        type: :boolean,
         | 
| 11 | 
            +
                        default: true,
         | 
| 12 | 
            +
                        description: 'Enable Back to top icon on all pages',
         | 
| 13 | 
            +
                      },
         | 
| 14 | 
            +
                    }
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                    attr_accessor *DEFAULT_VALUES.keys
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
            end
         | 
| @@ -12,7 +12,7 @@ module RailsBase | |
| 12 12 | 
             
                      'RailsBase::MfaAuthController' => [:mfa_code],
         | 
| 13 13 | 
             
                      'RailsBase::SecondaryAuthenticationController' => [:static, :after_email_login_session_new, :forgot_password],
         | 
| 14 14 | 
             
                    }
         | 
| 15 | 
            -
                    DEFAULT_FOOTER_HTML = "©  | 
| 15 | 
            +
                    DEFAULT_FOOTER_HTML = "© #{DateTime.now.year} Year of the Rona: Bad Ass Rails Starter built by <a href='https://github.com/matt-taylor/' target='_blank'>@matt-taylor</a>"
         | 
| 16 16 |  | 
| 17 17 | 
             
                    DEFAULT_VALUES = {
         | 
| 18 18 | 
             
                      enable: {
         | 
    
        data/lib/rails_base/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rails_base
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.53.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Matt Taylor
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021- | 
| 11 | 
            +
            date: 2021-08-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -568,6 +568,7 @@ files: | |
| 568 568 | 
             
            - lib/rails_base/configuration/appearance.rb
         | 
| 569 569 | 
             
            - lib/rails_base/configuration/authentication.rb
         | 
| 570 570 | 
             
            - lib/rails_base/configuration/base.rb
         | 
| 571 | 
            +
            - lib/rails_base/configuration/display/back_to_top.rb
         | 
| 571 572 | 
             
            - lib/rails_base/configuration/display/background_color.rb
         | 
| 572 573 | 
             
            - lib/rails_base/configuration/display/btn_danger.rb
         | 
| 573 574 | 
             
            - lib/rails_base/configuration/display/btn_dark.rb
         | 
| @@ -613,7 +614,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 613 614 | 
             
                - !ruby/object:Gem::Version
         | 
| 614 615 | 
             
                  version: '0'
         | 
| 615 616 | 
             
            requirements: []
         | 
| 616 | 
            -
            rubygems_version: 3.2. | 
| 617 | 
            +
            rubygems_version: 3.2.22
         | 
| 617 618 | 
             
            signing_key: 
         | 
| 618 619 | 
             
            specification_version: 4
         | 
| 619 620 | 
             
            summary: Rails engine that takes care of the stuff you dont want to!
         |