bullet_train-themes 1.2.27 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/themes/base/attributes/_belongs_to.html.erb +3 -3
- data/app/views/themes/base/attributes/_block.html.erb +2 -2
- data/app/views/themes/base/attributes/_boolean.html.erb +1 -1
- data/app/views/themes/base/attributes/_code.html.erb +1 -1
- data/app/views/themes/base/attributes/_date.html.erb +2 -2
- data/app/views/themes/base/attributes/_date_and_time.html.erb +2 -2
- data/app/views/themes/base/attributes/_days_ago.html.erb +2 -2
- data/app/views/themes/base/attributes/_email.html.erb +2 -2
- data/app/views/themes/base/attributes/_has_many.html.erb +2 -2
- data/app/views/themes/base/attributes/_html.html.erb +8 -3
- data/app/views/themes/base/attributes/_image.html.erb +1 -1
- data/app/views/themes/base/attributes/_number.html.erb +7 -2
- data/app/views/themes/base/attributes/_option.html.erb +2 -2
- data/app/views/themes/base/attributes/_options.html.erb +2 -2
- data/app/views/themes/base/attributes/_phone_number.html.erb +2 -2
- data/app/views/themes/base/attributes/_text.html.erb +2 -2
- data/app/views/themes/base/fields/_ckeditor.html.erb +0 -2
- data/app/views/themes/base/fields/_email_field.html.erb +0 -2
- data/app/views/themes/base/fields/_emoji_field.html.erb +3 -5
- data/app/views/themes/base/fields/_number_field.html.erb +0 -2
- data/app/views/themes/base/fields/_password_field.html.erb +3 -5
- data/app/views/themes/base/fields/_phone_field.html.erb +0 -2
- data/app/views/themes/base/fields/_super_select.html.erb +2 -2
- data/app/views/themes/base/fields/_text_area.html.erb +0 -2
- data/app/views/themes/base/fields/_text_field.html.erb +0 -2
- data/config/locales/en/fields.en.yml +3 -0
- data/lib/bullet_train/themes/version.rb +1 -1
- data/lib/bullet_train/themes.rb +0 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94ebdadb90b19093075e1e32634070ae974786a71d74a01b7f521c9d6f5cebab
|
4
|
+
data.tar.gz: 1eb12f78279b6f19589ca017cff5e641d8540e5f2f405aa6d80cf659baced86a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 503f80aeecb02328e7f6c0c48c1af9c8313bedff3388bfb9bcf8426d6c665d408617c1057ee3c759506c2e79d499bb840521bbe952dd60c3c1bee082a906f947
|
7
|
+
data.tar.gz: 90c6bb3d9ec4406c439926b29d34650e872b334963a3a7e6f8e0a90567e9b25eca149a8bbe4298131ec40615488a9425fd2b52a9ca0509255651cb995c71954f
|
@@ -3,12 +3,12 @@
|
|
3
3
|
<% disable_link ||= false %>
|
4
4
|
<% url ||= nil %>
|
5
5
|
|
6
|
-
<% if object.
|
6
|
+
<% if object.public_send(attribute).present? %>
|
7
7
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
8
8
|
<% if disable_link %>
|
9
|
-
<%= object.
|
9
|
+
<%= object.public_send(attribute).label_string %>
|
10
10
|
<% else %>
|
11
|
-
<%= link_to object.
|
11
|
+
<%= link_to object.public_send(attribute).label_string, url || [:account, object.public_send(attribute)] %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).present? %>
|
6
6
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
7
|
-
<pre><%= object.
|
7
|
+
<pre><%= object.public_send(attribute) %></pre>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -4,6 +4,6 @@
|
|
4
4
|
|
5
5
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
6
6
|
<% unless object[attribute].nil? %>
|
7
|
-
<%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.
|
7
|
+
<%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.public_send(attribute)}") %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% source ||= nil %>
|
4
4
|
<% url ||= nil %>
|
5
5
|
|
6
|
-
<% if object.
|
6
|
+
<% if object.public_send(attribute).present? %>
|
7
7
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
8
8
|
<code class="text-pink-600 font-light"><%= object.send(source || attribute) %></code>
|
9
9
|
<% end %>
|
@@ -3,9 +3,9 @@
|
|
3
3
|
<% url ||= nil %>
|
4
4
|
<% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
|
5
5
|
|
6
|
-
<% if object.
|
6
|
+
<% if object.public_send(attribute).present? %>
|
7
7
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
8
|
-
<%= display_date(object.
|
8
|
+
<%= display_date(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format)) %>
|
9
9
|
<% end %>
|
10
10
|
<% else %>
|
11
11
|
<%= default_message %>
|
@@ -3,9 +3,9 @@
|
|
3
3
|
<% url ||= nil %>
|
4
4
|
<% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
|
5
5
|
|
6
|
-
<% if object.
|
6
|
+
<% if object.public_send(attribute).present? %>
|
7
7
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
8
|
-
<%= display_date_and_time(object.
|
8
|
+
<%= display_date_and_time(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format), **local_assigns.slice(:time_format)) %>
|
9
9
|
<% end %>
|
10
10
|
<% else %>
|
11
11
|
<%= default_message %>
|
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
6
6
|
<% if object.send(attribute) %>
|
7
|
-
<%= time_ago_in_words(object.send(attribute)) %>
|
7
|
+
<%= t("global.time_ago", time: time_ago_in_words(object.send(attribute))) %>
|
8
8
|
<% else %>
|
9
|
-
|
9
|
+
<%= t("global.never") %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).present? %>
|
6
6
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
7
|
-
<%= link_to object.
|
7
|
+
<%= link_to object.public_send(attribute), "mailto:#{object.public_send(attribute)}" %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -4,9 +4,9 @@
|
|
4
4
|
<% disable_links ||= false %>
|
5
5
|
<% link_options ||= {} %>
|
6
6
|
|
7
|
-
<% if object.
|
7
|
+
<% if object.public_send(attribute).any? %>
|
8
8
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy do %>
|
9
|
-
<%= object.
|
9
|
+
<%= object.public_send(attribute).map do |child_object| %>
|
10
10
|
<% capture do %>
|
11
11
|
<% if disable_links %>
|
12
12
|
<%= child_object.label_string %>
|
@@ -2,9 +2,14 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).present? %>
|
6
6
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
7
|
-
<% #
|
8
|
-
|
7
|
+
<% # Here we manually add a trix-content class since sanitizing the body removes the Rails default. %>
|
8
|
+
<% if object.send(attribute).is_a?(ActionText::RichText) %>
|
9
|
+
<%= tag.div(html_sanitize(object.public_send(attribute).body.to_trix_html).html_safe, class:"trix-content") %>
|
10
|
+
<% else %>
|
11
|
+
<% # `.to_s` is for action text. %>
|
12
|
+
<%= html_sanitize(object.public_send(attribute).to_s).html_safe %>
|
13
|
+
<% end %>
|
9
14
|
<% end %>
|
10
15
|
<% end %>
|
@@ -1,10 +1,15 @@
|
|
1
1
|
<% object ||= current_attributes_object %>
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
|
+
<% format ||= nil %>
|
4
5
|
<% options ||= {} %>
|
5
6
|
|
6
|
-
<% if object.
|
7
|
+
<% if object.public_send(attribute).present? %>
|
7
8
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy do %>
|
8
|
-
|
9
|
+
<% if format %>
|
10
|
+
<%= sprintf(format, object.public_send(attribute)) %>
|
11
|
+
<% else %>
|
12
|
+
<%= object.public_send(attribute) %>
|
13
|
+
<% end %>
|
9
14
|
<% end %>
|
10
15
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).present? %>
|
6
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.
|
7
|
+
<%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.public_send(attribute)}") %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).any? %>
|
6
6
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
7
7
|
<%# TODO: Multiple option partials return arrays with blank characters in them. Is this expected? %>
|
8
|
-
<%= object.
|
8
|
+
<%= object.public_send(attribute).reject(&:blank?).map do |value| %>
|
9
9
|
<% t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{value}") %>
|
10
10
|
<% end.map(&:strip).to_sentence %>
|
11
11
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<% strategy ||= current_attributes_strategy || :none %>
|
3
3
|
<% url ||= nil %>
|
4
4
|
|
5
|
-
<% if object.
|
5
|
+
<% if object.public_send(attribute).present? %>
|
6
6
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
7
|
-
<%= display_phone_number(object.
|
7
|
+
<%= display_phone_number(object.public_send(attribute)) %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<% url ||= nil %>
|
4
4
|
<% options ||= {} %>
|
5
5
|
|
6
|
-
<% if object.
|
6
|
+
<% if object.public_send(attribute).present? %>
|
7
7
|
<%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
|
8
|
-
<%= options[:password] ? "●" * object.
|
8
|
+
<%= options[:password] ? "●" * object.public_send(attribute).length : object.public_send(attribute) %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
@@ -1,5 +1,3 @@
|
|
1
|
-
<% yield %>
|
2
|
-
|
3
1
|
<%
|
4
2
|
stimulus_controller = 'fields--emoji-picker'
|
5
3
|
|
@@ -12,8 +10,8 @@ value = form.object.send(method)
|
|
12
10
|
<%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
|
13
11
|
<% content_for :field do %>
|
14
12
|
<div data-controller="<%= stimulus_controller %>">
|
15
|
-
<%= tag.button data: {action: "#{stimulus_controller}#toggle",
|
16
|
-
<span data
|
13
|
+
<%= tag.button data: {action: "#{stimulus_controller}#toggle", "#{stimulus_controller}_target": "button"}, class: "button-alternative" do %>
|
14
|
+
<span data-<%= stimulus_controller %>-target="display">
|
17
15
|
<% if value.present? %>
|
18
16
|
<%= value %>
|
19
17
|
<% else %>
|
@@ -21,7 +19,7 @@ value = form.object.send(method)
|
|
21
19
|
<% end %>
|
22
20
|
</span>
|
23
21
|
|
24
|
-
|
22
|
+
<%= t('fields.choose_emoji') %>
|
25
23
|
<% end %>
|
26
24
|
<%= form.hidden_field method, data: {"#{stimulus_controller}-target": "input"} %>
|
27
25
|
</div>
|
@@ -1,12 +1,10 @@
|
|
1
|
-
<% yield %>
|
2
|
-
|
3
1
|
<%
|
4
2
|
stimulus_controller = 'fields--password'
|
5
3
|
|
6
4
|
form ||= current_fields_form
|
7
5
|
options ||= {}
|
8
6
|
|
9
|
-
if options[:show_strength_indicator]
|
7
|
+
if options[:show_strength_indicator] && BulletTrain::Configuration.strong_passwords
|
10
8
|
options = options.merge({ data: {"action": "keyup->fields--password#estimateStrength" }})
|
11
9
|
end
|
12
10
|
|
@@ -17,6 +15,6 @@ other_options ||= {}
|
|
17
15
|
<%= render 'shared/fields/field', form: form, method: method, helper: :password_field, options: options, other_options: other_options %>
|
18
16
|
<% if options[:show_strength_indicator] %>
|
19
17
|
<% # TODO This is the wrong place to define this kind of style, but I couldn't make this work in the `:help` content buffer. %>
|
20
|
-
<div data-<%= stimulus_controller %>-target="strengthIndicator" class="hidden mt-1.5 text-xs text-red-
|
18
|
+
<div data-<%= stimulus_controller %>-target="strengthIndicator" class="hidden mt-1.5 text-xs text-red-500"></div>
|
21
19
|
<% end %>
|
22
|
-
</div>
|
20
|
+
</div>
|
@@ -1,11 +1,10 @@
|
|
1
|
-
<% yield %>
|
2
|
-
|
3
1
|
<%
|
4
2
|
stimulus_controller = 'fields--super-select'
|
5
3
|
|
6
4
|
form ||= current_fields_form
|
7
5
|
options ||= {}
|
8
6
|
other_options ||= {}
|
7
|
+
select2_options ||= nil
|
9
8
|
html_options ||= {}
|
10
9
|
html_options[:id] ||= form.field_id(method)
|
11
10
|
html_options[:class] = "form-control select2 #{html_options[:class]}".strip
|
@@ -26,6 +25,7 @@ wrapper_options = { data: { controller: stimulus_controller }}
|
|
26
25
|
wrapper_options[:data]["#{stimulus_controller}-enable-search-value"] = true if other_options[:search]
|
27
26
|
wrapper_options[:data]["#{stimulus_controller}-accepts-new-value"] = true if other_options[:accepts_new]
|
28
27
|
wrapper_options[:data]["#{stimulus_controller}-search-url-value"] = choices_url if choices_url.present?
|
28
|
+
wrapper_options[:data]["#{stimulus_controller}-select2-options-value"] = select2_options.to_json if select2_options.present?
|
29
29
|
|
30
30
|
unless options[:multiple]
|
31
31
|
wrapper_options[:data]["action"] ||= ""
|
data/lib/bullet_train/themes.rb
CHANGED
@@ -9,7 +9,6 @@ module BulletTrain
|
|
9
9
|
|
10
10
|
mattr_reader :partial_paths, default: {}
|
11
11
|
|
12
|
-
# TODO Do we want this to be configurable by downstream applications?
|
13
12
|
INVOCATION_PATTERNS = [
|
14
13
|
# ❌ This path is included for legacy purposes, but you shouldn't reference partials like this in new code.
|
15
14
|
/^account\/shared\//,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-themes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -78,19 +78,20 @@ files:
|
|
78
78
|
- app/views/themes/base/fields/_text_area.html.erb
|
79
79
|
- app/views/themes/base/fields/_text_field.html.erb
|
80
80
|
- app/views/themes/base/fields/_trix_editor.html.erb
|
81
|
+
- config/locales/en/fields.en.yml
|
81
82
|
- config/routes.rb
|
82
83
|
- lib/bullet_train/themes.rb
|
83
84
|
- lib/bullet_train/themes/engine.rb
|
84
85
|
- lib/bullet_train/themes/version.rb
|
85
86
|
- lib/tasks/application.rb
|
86
87
|
- lib/tasks/bullet_train/themes_tasks.rake
|
87
|
-
homepage: https://github.com/bullet-train-co/bullet_train-themes
|
88
|
+
homepage: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes
|
88
89
|
licenses:
|
89
90
|
- MIT
|
90
91
|
metadata:
|
91
|
-
homepage_uri: https://github.com/bullet-train-co/bullet_train-themes
|
92
|
-
source_code_uri: https://github.com/bullet-train-co/bullet_train-themes
|
93
|
-
post_install_message:
|
92
|
+
homepage_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes
|
93
|
+
source_code_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes
|
94
|
+
post_install_message:
|
94
95
|
rdoc_options: []
|
95
96
|
require_paths:
|
96
97
|
- lib
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
version: '0'
|
107
108
|
requirements: []
|
108
109
|
rubygems_version: 3.4.10
|
109
|
-
signing_key:
|
110
|
+
signing_key:
|
110
111
|
specification_version: 4
|
111
112
|
summary: Bullet Train Themes
|
112
113
|
test_files: []
|