bullet_train-themes-base 1.0.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 +7 -0
 - data/MIT-LICENSE +20 -0
 - data/README.md +28 -0
 - data/Rakefile +8 -0
 - data/app/assets/config/bullet_train_themes_base_manifest.js +0 -0
 - data/app/views/themes/base/attributes/_attribute.html.erb +8 -0
 - data/app/views/themes/base/attributes/_belongs_to.html.erb +14 -0
 - data/app/views/themes/base/attributes/_block.html.erb +9 -0
 - data/app/views/themes/base/attributes/_boolean.html.erb +9 -0
 - data/app/views/themes/base/attributes/_code.html.erb +10 -0
 - data/app/views/themes/base/attributes/_date.html.erb +9 -0
 - data/app/views/themes/base/attributes/_date_and_time.html.erb +9 -0
 - data/app/views/themes/base/attributes/_days_ago.html.erb +11 -0
 - data/app/views/themes/base/attributes/_email.html.erb +9 -0
 - data/app/views/themes/base/attributes/_has_many.html.erb +19 -0
 - data/app/views/themes/base/attributes/_html.html.erb +10 -0
 - data/app/views/themes/base/attributes/_image.html.erb +5 -0
 - data/app/views/themes/base/attributes/_option.html.erb +9 -0
 - data/app/views/themes/base/attributes/_options.html.erb +11 -0
 - data/app/views/themes/base/attributes/_phone_number.html.erb +9 -0
 - data/app/views/themes/base/attributes/_text.html.erb +9 -0
 - data/app/views/themes/base/fields/_ckeditor.html.erb +25 -0
 - data/app/views/themes/base/fields/_email_field.html.erb +9 -0
 - data/app/views/themes/base/fields/_password_field.html.erb +9 -0
 - data/app/views/themes/base/fields/_phone_field.html.erb +15 -0
 - data/app/views/themes/base/fields/_super_select.html.erb +39 -0
 - data/app/views/themes/base/fields/_text_area.html.erb +9 -0
 - data/app/views/themes/base/fields/_text_field.html.erb +9 -0
 - data/app/views/themes/base/fields/_trix_editor.html.erb +28 -0
 - data/config/routes.rb +2 -0
 - data/lib/bullet_train/themes/base/engine.rb +10 -0
 - data/lib/bullet_train/themes/base/path_snitch.rb +9 -0
 - data/lib/bullet_train/themes/base/version.rb +7 -0
 - data/lib/bullet_train/themes/base.rb +10 -0
 - data/lib/tasks/bullet_train/themes/base_tasks.rake +4 -0
 - metadata +93 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e90135f0124afb3b6e54f767de858928e986e1de7ffba7a527e7f7cc87883c1c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 178c5f64666f56144702963ba16b1a95a8a798b29071aba47bb0759c7ad8a05c
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 48aaaa404ea44ad4bb3d2bd4493b28e8f87c785d0a96274903d9c4ad3305dcff298550eb127177f29651cd78e6fb5019d1d2b85f9eb30c78dc55322d32e4ab3e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3d6ff4f5d793e2927e542052f051543bdb3a5bbbf202040460c77d49d55233de096200731ee8c97b2baa5107e872a60a6e6e1aa82931d956ac8ebd9b38cbe8ee
         
     | 
    
        data/MIT-LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright 2022 Andrew Culver
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 4 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 5 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 6 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 7 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 8 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 9 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 12 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 15 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 16 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 17 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 18 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 19 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 20 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,28 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # BulletTrain::Themes::Base
         
     | 
| 
      
 2 
     | 
    
         
            +
            Short description and motivation.
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 5 
     | 
    
         
            +
            How to use my plugin.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 8 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 11 
     | 
    
         
            +
            gem "bullet_train-themes-base"
         
     | 
| 
      
 12 
     | 
    
         
            +
            ```
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 15 
     | 
    
         
            +
            ```bash
         
     | 
| 
      
 16 
     | 
    
         
            +
            $ bundle
         
     | 
| 
      
 17 
     | 
    
         
            +
            ```
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            Or install it yourself as:
         
     | 
| 
      
 20 
     | 
    
         
            +
            ```bash
         
     | 
| 
      
 21 
     | 
    
         
            +
            $ gem install bullet_train-themes-base
         
     | 
| 
      
 22 
     | 
    
         
            +
            ```
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 25 
     | 
    
         
            +
            Contribution directions go here.
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            ## License
         
     | 
| 
      
 28 
     | 
    
         
            +
            The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
         
     | 
    
        data/Rakefile
    ADDED
    
    
| 
         
            File without changes
         
     | 
| 
         @@ -0,0 +1,8 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <%= render 'shared/attributes/base', strategy: strategy, url: url do |p| %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <% p.content_for :heading, t("#{object.class.name.pluralize.underscore}.fields.#{attribute}.heading") %>
         
     | 
| 
      
 7 
     | 
    
         
            +
              <% p.content_for :body, yield %>
         
     | 
| 
      
 8 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% disable_link ||= false %>
         
     | 
| 
      
 4 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 7 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 8 
     | 
    
         
            +
                <% if disable_link %>
         
     | 
| 
      
 9 
     | 
    
         
            +
                  <%= object.send(attribute).label_string %>
         
     | 
| 
      
 10 
     | 
    
         
            +
                <% else %>
         
     | 
| 
      
 11 
     | 
    
         
            +
                  <%= link_to object.send(attribute).label_string, url || [:account, object.send(attribute)] %>
         
     | 
| 
      
 12 
     | 
    
         
            +
                <% end %>
         
     | 
| 
      
 13 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 14 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <pre><%= object.send(attribute) %></pre>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <% unless object[attribute].nil? %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.send(attribute)}") %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% source ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 7 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 8 
     | 
    
         
            +
                <code class="text-pink-600 font-light"><%= object.send(source || attribute) %></code>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 10 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= display_date(object.send(attribute)) %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= display_date_and_time(object.send(attribute)) %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <% if object.send(attribute) %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= time_ago_in_words(object.send(attribute)) %> ago
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% else %>
         
     | 
| 
      
 9 
     | 
    
         
            +
                Never
         
     | 
| 
      
 10 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 11 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= link_to object.send(attribute), "mailto:#{object.send(attribute)}" %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% link_source ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
            <% disable_links ||= false %>
         
     | 
| 
      
 5 
     | 
    
         
            +
            <% link_options ||= {} %>
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            <% if object.send(attribute).any? %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy do %>
         
     | 
| 
      
 9 
     | 
    
         
            +
                <%= object.send(attribute).map do |child_object| %>
         
     | 
| 
      
 10 
     | 
    
         
            +
                  <% capture do %>
         
     | 
| 
      
 11 
     | 
    
         
            +
                    <% if disable_links %>
         
     | 
| 
      
 12 
     | 
    
         
            +
                      <%= child_object.label_string %>
         
     | 
| 
      
 13 
     | 
    
         
            +
                    <% else %>
         
     | 
| 
      
 14 
     | 
    
         
            +
                      <%= link_to child_object.label_string, [:account, link_source ? child_object.send(link_source) : child_object], link_options %>
         
     | 
| 
      
 15 
     | 
    
         
            +
                    <% end %>
         
     | 
| 
      
 16 
     | 
    
         
            +
                  <% end %>
         
     | 
| 
      
 17 
     | 
    
         
            +
                <% end.map(&:strip).to_sentence.html_safe %>
         
     | 
| 
      
 18 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 19 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <% # `.to_s` is for action text. %>
         
     | 
| 
      
 8 
     | 
    
         
            +
                <%= trix_content(object.send(attribute).to_s).html_safe %>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 10 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.send(attribute)}") %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).any? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= object.send(attribute).map do |value| %>
         
     | 
| 
      
 8 
     | 
    
         
            +
                  <% t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{value}") %>
         
     | 
| 
      
 9 
     | 
    
         
            +
                <% end.map(&:strip).to_sentence %>
         
     | 
| 
      
 10 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 11 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= display_phone_number(object.send(attribute)) %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% object ||= current_attributes_object %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% strategy ||= current_attributes_strategy || :none %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            <% url ||= nil %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <% if object.send(attribute).present? %>
         
     | 
| 
      
 6 
     | 
    
         
            +
              <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <%= object.send(attribute) %>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 9 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% yield %>
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            <%
         
     | 
| 
      
 4 
     | 
    
         
            +
            # ⚠️ CKEditor 5 is distributed under a GPL 2+ copyleft license.
         
     | 
| 
      
 5 
     | 
    
         
            +
            # You need a commercial license to utilize it in closed-source SaaS products.
         
     | 
| 
      
 6 
     | 
    
         
            +
            # See https://ckeditor.com/pricing/ for more details.
         
     | 
| 
      
 7 
     | 
    
         
            +
            %>
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            <%
         
     | 
| 
      
 10 
     | 
    
         
            +
            stimulus_controller = 'fields--ckeditor'
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            form ||= current_fields_form
         
     | 
| 
      
 13 
     | 
    
         
            +
            options ||= {}
         
     | 
| 
      
 14 
     | 
    
         
            +
            options = options.merge({ data: {"#{stimulus_controller}-target": 'field' }})
         
     | 
| 
      
 15 
     | 
    
         
            +
            other_options ||= {}
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            %>
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            <%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
         
     | 
| 
      
 20 
     | 
    
         
            +
              <% content_for :field do %>
         
     | 
| 
      
 21 
     | 
    
         
            +
                <div data-controller="<%= stimulus_controller %>">
         
     | 
| 
      
 22 
     | 
    
         
            +
                  <%= form.text_area method, options %>
         
     | 
| 
      
 23 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 24 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 25 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% yield %>
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            <%
         
     | 
| 
      
 4 
     | 
    
         
            +
            stimulus_controller = 'fields--phone'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            form ||= current_fields_form
         
     | 
| 
      
 7 
     | 
    
         
            +
            options ||= {}
         
     | 
| 
      
 8 
     | 
    
         
            +
            options = options.merge({type: 'tel', data: {method: method, "#{stimulus_controller}-target": 'field' }})
         
     | 
| 
      
 9 
     | 
    
         
            +
            other_options ||= {}
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            %>
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            <div data-controller="<%= stimulus_controller %>">
         
     | 
| 
      
 14 
     | 
    
         
            +
              <%= render 'shared/fields/field', form: form, method: method, helper: :text_field, options: options, other_options: other_options %>
         
     | 
| 
      
 15 
     | 
    
         
            +
            </div>
         
     | 
| 
         @@ -0,0 +1,39 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% yield %>
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            <%
         
     | 
| 
      
 4 
     | 
    
         
            +
            stimulus_controller = 'fields--super-select'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            form ||= current_fields_form
         
     | 
| 
      
 7 
     | 
    
         
            +
            options ||= {}
         
     | 
| 
      
 8 
     | 
    
         
            +
            other_options ||= {}
         
     | 
| 
      
 9 
     | 
    
         
            +
            html_options ||= {}
         
     | 
| 
      
 10 
     | 
    
         
            +
            html_options[:id] ||= id_for(form, method)
         
     | 
| 
      
 11 
     | 
    
         
            +
            html_options[:class] = "form-control select2 #{html_options[:class]}".strip
         
     | 
| 
      
 12 
     | 
    
         
            +
            choices_url ||= nil
         
     | 
| 
      
 13 
     | 
    
         
            +
            if choices_url.nil?
         
     | 
| 
      
 14 
     | 
    
         
            +
              choices ||= options_for(form, method)&.invert
         
     | 
| 
      
 15 
     | 
    
         
            +
            else
         
     | 
| 
      
 16 
     | 
    
         
            +
              # If we have a choices_url, we're going to lazy load the choices.  However, we still want to show the currently selected option.
         
     | 
| 
      
 17 
     | 
    
         
            +
              method_without_id = method.to_s.gsub("_id", "")
         
     | 
| 
      
 18 
     | 
    
         
            +
              if current_selection = form.object.send(method_without_id)
         
     | 
| 
      
 19 
     | 
    
         
            +
                choices = [[current_selection.label_string, current_selection.id]]
         
     | 
| 
      
 20 
     | 
    
         
            +
              else
         
     | 
| 
      
 21 
     | 
    
         
            +
                choices = {}
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            wrapper_options = { data: { controller: stimulus_controller }}
         
     | 
| 
      
 26 
     | 
    
         
            +
            wrapper_options[:data]["#{stimulus_controller}-enable-search-value"] = true if other_options[:search]
         
     | 
| 
      
 27 
     | 
    
         
            +
            wrapper_options[:data]["#{stimulus_controller}-accepts-new-value"] = true if other_options[:accepts_new]
         
     | 
| 
      
 28 
     | 
    
         
            +
            wrapper_options[:data]["#{stimulus_controller}-search-url-value"] = choices_url if choices_url.present?
         
     | 
| 
      
 29 
     | 
    
         
            +
            html_options[:data] = { "#{stimulus_controller}-target": 'select' }
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            %>
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            <%= render 'shared/fields/field', form: form, method: method, options: html_options, other_options: other_options do %>
         
     | 
| 
      
 34 
     | 
    
         
            +
              <% content_for :field do %>
         
     | 
| 
      
 35 
     | 
    
         
            +
                <%= content_tag :div, data: wrapper_options[:data] do %>
         
     | 
| 
      
 36 
     | 
    
         
            +
                  <%= form.select method, choices, options, html_options %>
         
     | 
| 
      
 37 
     | 
    
         
            +
                <% end %>
         
     | 
| 
      
 38 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 39 
     | 
    
         
            +
            <% end %>
         
     | 
| 
         @@ -0,0 +1,28 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <% yield %>
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            <%
         
     | 
| 
      
 4 
     | 
    
         
            +
            form ||= current_fields_form
         
     | 
| 
      
 5 
     | 
    
         
            +
            labels = labels_for(form, method)
         
     | 
| 
      
 6 
     | 
    
         
            +
            options ||= {}
         
     | 
| 
      
 7 
     | 
    
         
            +
            options[:class] = "formatted_content trix-content #{options[:class]}"
         
     | 
| 
      
 8 
     | 
    
         
            +
            options[:placeholder] ||= labels.placeholder if labels.placeholder
         
     | 
| 
      
 9 
     | 
    
         
            +
            options[:data] ||= {}
         
     | 
| 
      
 10 
     | 
    
         
            +
            options[:data][:mentions] = ([current_team].map { |team|
         
     | 
| 
      
 11 
     | 
    
         
            +
              {key: team.name, value: team.id, protocol: 'bullettrain', model: 'teams', id: team.id, label: team.name, photo: photo_for(team)}
         
     | 
| 
      
 12 
     | 
    
         
            +
            } + current_team.memberships.current_and_invited.map { |membership|
         
     | 
| 
      
 13 
     | 
    
         
            +
              {key: membership.name, value: membership.id, protocol: 'bullettrain', model: 'memberships', id: membership.id, label: membership.name, photo: membership_profile_photo_url(membership)}
         
     | 
| 
      
 14 
     | 
    
         
            +
            }).to_json
         
     | 
| 
      
 15 
     | 
    
         
            +
            options[:data][:topics] = []
         
     | 
| 
      
 16 
     | 
    
         
            +
            # current_team.scaffolding_things.map { |scaffolding_thing|
         
     | 
| 
      
 17 
     | 
    
         
            +
            #   {key: scaffolding_thing.name, value: scaffolding_thing.id, protocol: 'bullettrain', model: 'scaffolding/things', id: scaffolding_thing.id, label: scaffolding_thing.name, photo: photo_for(scaffolding_thing)}
         
     | 
| 
      
 18 
     | 
    
         
            +
            # }.to_json
         
     | 
| 
      
 19 
     | 
    
         
            +
            other_options ||= {}
         
     | 
| 
      
 20 
     | 
    
         
            +
            %>
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            <div class="<%= 'trix-hide-toolbar' if other_options[:hide_toolbar] %>">
         
     | 
| 
      
 23 
     | 
    
         
            +
            <%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
         
     | 
| 
      
 24 
     | 
    
         
            +
              <% content_for :field do %>
         
     | 
| 
      
 25 
     | 
    
         
            +
                <%= form.rich_text_area method, options %>
         
     | 
| 
      
 26 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 27 
     | 
    
         
            +
            <% end %>
         
     | 
| 
      
 28 
     | 
    
         
            +
            </div>
         
     | 
    
        data/config/routes.rb
    ADDED
    
    
| 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # TODO This is my best attempt at allowing us to figure out where theme partials might be getting served from.
         
     | 
| 
      
 2 
     | 
    
         
            +
            # We can only inspect the source location of a class (not a module), and this gem has no other classes, so we need this.
         
     | 
| 
      
 3 
     | 
    
         
            +
            # See https://stackoverflow.com/questions/13012109/get-class-location-from-class-object for context.
         
     | 
| 
      
 4 
     | 
    
         
            +
            class BulletTrain::Themes::Base::PathSnitch
         
     | 
| 
      
 5 
     | 
    
         
            +
              def self.confess
         
     | 
| 
      
 6 
     | 
    
         
            +
                # This method allows us to call `BulletTrain::Themes::PathSnitch.method(:confess).source_location` and see where
         
     | 
| 
      
 7 
     | 
    
         
            +
                # this gem is being served from... which allows us to check it's `view/themes` directory for partials.
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,93 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: bullet_train-themes-base
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Andrew Culver
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-01-24 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: rails
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: 7.0.0
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: 7.0.0
         
     | 
| 
      
 27 
     | 
    
         
            +
            description: Bullet Train Themes Base
         
     | 
| 
      
 28 
     | 
    
         
            +
            email:
         
     | 
| 
      
 29 
     | 
    
         
            +
            - andrew.culver@gmail.com
         
     | 
| 
      
 30 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 31 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 32 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 33 
     | 
    
         
            +
            files:
         
     | 
| 
      
 34 
     | 
    
         
            +
            - MIT-LICENSE
         
     | 
| 
      
 35 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 36 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 37 
     | 
    
         
            +
            - app/assets/config/bullet_train_themes_base_manifest.js
         
     | 
| 
      
 38 
     | 
    
         
            +
            - app/views/themes/base/attributes/_attribute.html.erb
         
     | 
| 
      
 39 
     | 
    
         
            +
            - app/views/themes/base/attributes/_belongs_to.html.erb
         
     | 
| 
      
 40 
     | 
    
         
            +
            - app/views/themes/base/attributes/_block.html.erb
         
     | 
| 
      
 41 
     | 
    
         
            +
            - app/views/themes/base/attributes/_boolean.html.erb
         
     | 
| 
      
 42 
     | 
    
         
            +
            - app/views/themes/base/attributes/_code.html.erb
         
     | 
| 
      
 43 
     | 
    
         
            +
            - app/views/themes/base/attributes/_date.html.erb
         
     | 
| 
      
 44 
     | 
    
         
            +
            - app/views/themes/base/attributes/_date_and_time.html.erb
         
     | 
| 
      
 45 
     | 
    
         
            +
            - app/views/themes/base/attributes/_days_ago.html.erb
         
     | 
| 
      
 46 
     | 
    
         
            +
            - app/views/themes/base/attributes/_email.html.erb
         
     | 
| 
      
 47 
     | 
    
         
            +
            - app/views/themes/base/attributes/_has_many.html.erb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - app/views/themes/base/attributes/_html.html.erb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - app/views/themes/base/attributes/_image.html.erb
         
     | 
| 
      
 50 
     | 
    
         
            +
            - app/views/themes/base/attributes/_option.html.erb
         
     | 
| 
      
 51 
     | 
    
         
            +
            - app/views/themes/base/attributes/_options.html.erb
         
     | 
| 
      
 52 
     | 
    
         
            +
            - app/views/themes/base/attributes/_phone_number.html.erb
         
     | 
| 
      
 53 
     | 
    
         
            +
            - app/views/themes/base/attributes/_text.html.erb
         
     | 
| 
      
 54 
     | 
    
         
            +
            - app/views/themes/base/fields/_ckeditor.html.erb
         
     | 
| 
      
 55 
     | 
    
         
            +
            - app/views/themes/base/fields/_email_field.html.erb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - app/views/themes/base/fields/_password_field.html.erb
         
     | 
| 
      
 57 
     | 
    
         
            +
            - app/views/themes/base/fields/_phone_field.html.erb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - app/views/themes/base/fields/_super_select.html.erb
         
     | 
| 
      
 59 
     | 
    
         
            +
            - app/views/themes/base/fields/_text_area.html.erb
         
     | 
| 
      
 60 
     | 
    
         
            +
            - app/views/themes/base/fields/_text_field.html.erb
         
     | 
| 
      
 61 
     | 
    
         
            +
            - app/views/themes/base/fields/_trix_editor.html.erb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - config/routes.rb
         
     | 
| 
      
 63 
     | 
    
         
            +
            - lib/bullet_train/themes/base.rb
         
     | 
| 
      
 64 
     | 
    
         
            +
            - lib/bullet_train/themes/base/engine.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
            - lib/bullet_train/themes/base/path_snitch.rb
         
     | 
| 
      
 66 
     | 
    
         
            +
            - lib/bullet_train/themes/base/version.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
            - lib/tasks/bullet_train/themes/base_tasks.rake
         
     | 
| 
      
 68 
     | 
    
         
            +
            homepage: https://github.com/bullet-train-co/bullet_train-themes-base
         
     | 
| 
      
 69 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 70 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 71 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 72 
     | 
    
         
            +
              homepage_uri: https://github.com/bullet-train-co/bullet_train-themes-base
         
     | 
| 
      
 73 
     | 
    
         
            +
              source_code_uri: https://github.com/bullet-train-co/bullet_train-themes-base
         
     | 
| 
      
 74 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
      
 75 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 76 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 77 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 78 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 81 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 83 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 84 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 85 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 86 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 87 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 88 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 89 
     | 
    
         
            +
            rubygems_version: 3.2.22
         
     | 
| 
      
 90 
     | 
    
         
            +
            signing_key:
         
     | 
| 
      
 91 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 92 
     | 
    
         
            +
            summary: Bullet Train Themes Base
         
     | 
| 
      
 93 
     | 
    
         
            +
            test_files: []
         
     |