bullet_train-themes 1.2.9 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf1796b8599056bfbd80da1b3d196d588df24d0e94f37e0bd78e922d2555f88a
4
- data.tar.gz: 3d350f5a7e3aa35da572707e59ea95fac320ebe92915a51afe861bfd67ed9c49
3
+ metadata.gz: 11a5f35480f1512c0799217b8ac2c5610e79263a0a93f83bb47edf7724846e9d
4
+ data.tar.gz: 746b8cec0f85996de9df5b706c1fbf62e6624670f2701dc372a5792019015bde
5
5
  SHA512:
6
- metadata.gz: 83649ec4393fb5b6f646467f3b057ee8f6ff18c94216a4f31a00d7cf0c0cd2408bd9f01287ec859032cc6483aaf551c2d2b19599a7a938a88284649d779fef89
7
- data.tar.gz: 357e22fdb148ecc3cfeb0ccd9dd578bf7edb558209e87fd357280edc41166b94340ddc98de09e60f621fb4a2fbdae405f4c2f9af92ca50fa7c1f8bdbce32f5ae
6
+ metadata.gz: 7d5ded2a4a6c89d5670558e91f62c294cd6dd1c2820111666e44561cbc3af614a2378bb7bccfc22395395a42689e3c1c5a01b617fdf32eaf3c21391cd7f49c8d
7
+ data.tar.gz: 1cc5e0a22568a555eeeff9f9d7ee40998ade7100bebea7592390b5739e8b2dd38dbcb2cdc900effccf0bab722ed88859fc8bcdeb905a22acc023a285b710937c
@@ -1,39 +1,3 @@
1
- # Our custom devise views are housed in `bullet_train-base`, but they're overwritten
2
- # by devise's standard views if the devise gem is declared after `bullet_train`.
3
- # To ensure we use our custom views, we temporarily unregister the original devise
4
- # views path from the FileSystemResolver, add our custom path, and find the views that way.
5
- module ActionView
6
- class LookupContext
7
- module ViewPaths
8
- def find(name, prefixes = [], partial = false, keys = [], options = {})
9
- name, prefixes = normalize_name(name, prefixes)
10
- details, details_key = detail_args_for(options)
11
-
12
- devise_view = false
13
- prefixes.each do |prefix|
14
- if prefix.match?(/devise/)
15
- devise_view = true
16
- break
17
- end
18
- end
19
-
20
- resolver = if name == "devise" || devise_view
21
- original_devise_view_path = BulletTrain::Themes::Light.original_devise_path
22
- bullet_train_resolver = @view_paths.paths.reject do |resolver|
23
- resolver.path.match?(original_devise_view_path)
24
- end
25
- PathSet.new(bullet_train_resolver)
26
- else
27
- @view_paths
28
- end
29
-
30
- resolver.find(name, prefixes, partial, details, details_key, keys)
31
- end
32
- alias_method :find_template, :find
33
- end
34
- end
35
- end
36
-
37
1
  module ThemeHelper
38
2
  def current_theme_object
39
3
  @current_theme_object ||= "BulletTrain::Themes::#{current_theme.to_s.classify}::Theme".constantize.new
@@ -1,9 +1,12 @@
1
1
  <% object ||= current_attributes_object %>
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
+ <% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
4
5
 
5
6
  <% if object.send(attribute).present? %>
6
7
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
7
8
  <%= display_date(object.send(attribute), local_assigns[:date_format]) %>
8
9
  <% end %>
10
+ <% else %>
11
+ <%= default_message %>
9
12
  <% end %>
@@ -1,9 +1,12 @@
1
1
  <% object ||= current_attributes_object %>
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
+ <% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
4
5
 
5
6
  <% if object.send(attribute).present? %>
6
7
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
7
8
  <%= display_date_and_time(object.send(attribute), local_assigns[:date_format], local_assigns[:time_format]) %>
8
9
  <% end %>
10
+ <% else %>
11
+ <%= default_message %>
9
12
  <% end %>
@@ -0,0 +1,8 @@
1
+ <% object ||= current_attributes_object %>
2
+ <% strategy ||= current_attributes_strategy || :none %>
3
+ <% url ||= nil %>
4
+ <% options ||= {} %>
5
+
6
+ <% if object.send(attribute).present? %>
7
+ <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy %>
8
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% yield %>
2
+
3
+ <%
4
+ form ||= current_fields_form
5
+ options ||= {}
6
+ other_options ||= {}
7
+ %>
8
+
9
+ <%= render 'shared/fields/field', form: form, method: method, helper: :number_field, options: options, other_options: other_options %>
@@ -26,6 +26,12 @@ wrapper_options = { data: { controller: stimulus_controller }}
26
26
  wrapper_options[:data]["#{stimulus_controller}-enable-search-value"] = true if other_options[:search]
27
27
  wrapper_options[:data]["#{stimulus_controller}-accepts-new-value"] = true if other_options[:accepts_new]
28
28
  wrapper_options[:data]["#{stimulus_controller}-search-url-value"] = choices_url if choices_url.present?
29
+
30
+ unless options[:multiple]
31
+ wrapper_options[:data]["action"] ||= ""
32
+ wrapper_options[:data]["action"] += " keydown->#{stimulus_controller}#injectKeystrokeIntoTextField $select2:open->#{stimulus_controller}#focusOnTextField"
33
+ end
34
+
29
35
  html_options[:data] ||= {}
30
36
  html_options[:data].merge!("#{stimulus_controller}-target": 'select')
31
37
 
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Themes
3
- VERSION = "1.2.9"
3
+ VERSION = "1.2.11"
4
4
  end
5
5
  end
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.2.9
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-28 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -63,6 +63,7 @@ files:
63
63
  - app/views/themes/base/attributes/_has_many.html.erb
64
64
  - app/views/themes/base/attributes/_html.html.erb
65
65
  - app/views/themes/base/attributes/_image.html.erb
66
+ - app/views/themes/base/attributes/_number.html.erb
66
67
  - app/views/themes/base/attributes/_option.html.erb
67
68
  - app/views/themes/base/attributes/_options.html.erb
68
69
  - app/views/themes/base/attributes/_phone_number.html.erb
@@ -70,6 +71,7 @@ files:
70
71
  - app/views/themes/base/fields/_ckeditor.html.erb
71
72
  - app/views/themes/base/fields/_email_field.html.erb
72
73
  - app/views/themes/base/fields/_emoji_field.html.erb
74
+ - app/views/themes/base/fields/_number_field.html.erb
73
75
  - app/views/themes/base/fields/_password_field.html.erb
74
76
  - app/views/themes/base/fields/_phone_field.html.erb
75
77
  - app/views/themes/base/fields/_super_select.html.erb
@@ -103,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
105
  - !ruby/object:Gem::Version
104
106
  version: '0'
105
107
  requirements: []
106
- rubygems_version: 3.3.7
108
+ rubygems_version: 3.4.1
107
109
  signing_key:
108
110
  specification_version: 4
109
111
  summary: Bullet Train Themes