bullet_train-themes 1.9.0 → 1.10.0

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: 5c37530f5a44e1f11b76275f899321aea95ab902cb2f3d4f95db31447fcc17d1
4
- data.tar.gz: 35b2ca119a59092e590201363adf8c7e608cdc9bc6916d0a2790d9b1596b9c5d
3
+ metadata.gz: a52ae611e8a331a4f216c12dbc184f335803c59bf569c71a8c5c5a2e7ffd503a
4
+ data.tar.gz: 01f4e2bb88e5aac8d043a5cd9277a07d717b2f9cb0563c2e0931faddba70f563
5
5
  SHA512:
6
- metadata.gz: 73972ddee62fb161770dea8c1deb24a6d2a82b3f2ea86868b1844a9d72d336fb542f3aa230198a89d95dcec79a539dfbd9f659029f06ef7c157ba44729e3c8a8
7
- data.tar.gz: d099427e5fe5ff7364dd83c6280aaa0bb14f90e15090ea791473bb4d69306c6c6f4d73a53bbf725f1035ea3a336dcdfd3016045b16a3dfd21024fba88014c5a5
6
+ metadata.gz: d0be635c92ad557eefb46e5a5fad7ce20226d90a4688d85e450329e4738fdda059520cae73d42862ae3eb14e88be4b59d5018c830b86b1149a20ff0f9b18ea9c
7
+ data.tar.gz: 30a2846b42447c263c9904f9db79b6b207411f9f22981979c7338fc619e2fcc4656e30165aad755135a665cda5f4e8fccc9dd251671777e61e057a7e82e0932c
@@ -1,9 +1,15 @@
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.not_set") %>
5
+ <% display_when_blank = local_assigns[:display_when_blank] || false %>
4
6
 
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.public_send(attribute)}") %>
7
+ <% if !object[attribute].nil? || display_when_blank %>
8
+ <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
9
+ <% unless object[attribute].nil? %>
10
+ <%= t("#{object.class.name.underscore.pluralize}.fields.#{attribute}.options.#{object.public_send(attribute)}") %>
11
+ <% else %>
12
+ <%= default_message %>
13
+ <% end %>
8
14
  <% end %>
9
15
  <% end %>
@@ -2,11 +2,14 @@
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
4
  <% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
5
+ <% display_when_blank = local_assigns[:display_when_blank] || false %>
5
6
 
6
- <% if object.public_send(attribute).present? %>
7
+ <% if object.public_send(attribute).present? || display_when_blank %>
7
8
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
8
- <%= display_date(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format)) %>
9
+ <% if object.public_send(attribute).present? %>
10
+ <%= display_date(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format)) %>
11
+ <% else %>
12
+ <%= default_message %>
13
+ <% end %>
9
14
  <% end %>
10
- <% else %>
11
- <%= default_message %>
12
15
  <% end %>
@@ -2,11 +2,14 @@
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
4
  <% default_message = local_assigns[:default_message] || t('global.formats.timestamp_unavailable') %>
5
+ <% display_when_blank = local_assigns[:display_when_blank] || false %>
5
6
 
6
- <% if object.public_send(attribute).present? %>
7
+ <% if object.public_send(attribute).present? || display_when_blank %>
7
8
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
8
- <%= display_date_and_time(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format), **local_assigns.slice(:time_format)) %>
9
+ <% if object.public_send(attribute).present? %>
10
+ <%= display_date_and_time(object.public_send(attribute), **local_assigns.slice(:format), **local_assigns.slice(:date_format), **local_assigns.slice(:time_format)) %>
11
+ <% else %>
12
+ <%= default_message %>
13
+ <% end %>
9
14
  <% end %>
10
- <% else %>
11
- <%= default_message %>
12
15
  <% end %>
@@ -2,11 +2,14 @@
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
4
  <% default_message = local_assigns[:default_message] || t("global.never") %>
5
+ <% display_when_blank = local_assigns[:display_when_blank] || false %>
5
6
 
6
- <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
7
- <% if object.public_send(attribute) %>
8
- <%= t("global.time_ago", time: time_ago_in_words(object.send(attribute))) %>
9
- <% else %>
10
- <%= default_message %>
7
+ <% if object.public_send(attribute) || display_when_blank %>
8
+ <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
9
+ <% if object.public_send(attribute).present? %>
10
+ <%= t("global.time_ago", time: time_ago_in_words(object.send(attribute))) %>
11
+ <% else %>
12
+ <%= default_message %>
13
+ <% end %>
11
14
  <% end %>
12
15
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Themes
3
- VERSION = "1.9.0"
3
+ VERSION = "1.10.0"
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.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-19 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard