web47core 1.1.10 → 1.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c95dc1ded2406eed714fa60226d939f995826d8fdb4997e86a967f4363a0dcfd
4
- data.tar.gz: fe198b4505c6a33fa455af240b59f28bcc1a38e3da9da3a9b77879dfbeeb56a3
3
+ metadata.gz: 8bf2d4642ca25a82b1e6dfe3b8a96aa40a694464290128b3c4c644dc5084dd11
4
+ data.tar.gz: 67dce9ec98fa99ebc16a6404ddf4d2db2be2503e85471d79f2b30e0c7ba3b490
5
5
  SHA512:
6
- metadata.gz: 6849efd0b1fc1c5960251d23ce8777738864c1e460e3e5832b64b06c733a858e2c408eefd9d300a3b294070f839e5def87bbe94e137689a787d801eb0a1e2bc9
7
- data.tar.gz: 4481ee2a4accca93a6fce56261e83aa4f3ca62787797d0b6ff2904ee5703d250bf333c7aa3c857eaa9e8537505b47022072be855f05092c588be5409e74918b7
6
+ metadata.gz: 1700c583d10bf42a5798bfbdd2cf5bb2962d804898907b12a4a2f51b21ce0e78f8c5778933eef74e306de275ed48340dfe52113e30efa87d18f9c40b28ebe06f
7
+ data.tar.gz: eba4ba933dea6c482c78f7b35c581752d176f67c8feb6571fb90989343d218b82bfc22567d37a7b3ee605631f4e2f3f7bbd129c1e847d48437fd6350909b9805
@@ -54,11 +54,15 @@ module CoreLinkHelper
54
54
  #
55
55
  # Add a favorite tag
56
56
  #
57
- def favorite_tag(favorite)
57
+ def favorite_tag(favorite, options = {})
58
+ data = {}
59
+ link_classes = tooltip_data(options, data, I18n.t('ui_form.actions.favorite'))
60
+ link_classes += %w[material-icons pointer favorite]
58
61
  content_tag(:i,
59
- class: 'material-icons pointer favorite',
62
+ class: link_classes.join(' '),
63
+ data: data,
60
64
  id: favorite.id.to_s,
61
- type: favorite.favorite_type) { concat('favorite_border') }
65
+ type: favorite.favorite_type) { concat(icon_name(options, 'favorite_border')) }
62
66
  end
63
67
 
64
68
  #
@@ -126,6 +130,7 @@ module CoreLinkHelper
126
130
  return unless can? :edit, obj
127
131
 
128
132
  data = {}
133
+ options[:icon_name] ||= 'replay'
129
134
  confirmation_data(options, data, t('links.replay_confirmation', name: obj.class.to_s.underscore.humanize))
130
135
  link_classes = tooltip_data(options, data)
131
136
  content_tag(:a, href: path, data: data, class: link_classes.join(' ')) do
@@ -146,6 +151,23 @@ module CoreLinkHelper
146
151
  end
147
152
  end
148
153
 
154
+ #
155
+ # Restart a thingy
156
+ #
157
+ def replay_button_tag(obj, path, options = {})
158
+ return unless can? :edit, obj
159
+
160
+ data = {}
161
+ options[:icon_name] ||= 'replay'
162
+ confirmation_data(options, data, t('links.replay_confirmation', name: obj.class.to_s.underscore.humanize))
163
+ link_classes = tooltip_data(options, data)
164
+ link_classes << 'btn' unless link_classes.include?('btn')
165
+ content_tag(:a, href: path, data: data, class: link_classes) do
166
+ concat(materialize_icon(icon_name(options), options))
167
+ concat(options[:label]) if options[:label].present?
168
+ end
169
+ end
170
+
149
171
  #
150
172
  # Details of a thingy in a pull down list
151
173
  #
@@ -163,8 +185,9 @@ module CoreLinkHelper
163
185
  return unless can? :read, obj
164
186
 
165
187
  data = {}
188
+ confirmation_data(options, data)
166
189
  link_classes = tooltip_data(options, data)
167
- content_tag(:a, href: path, classes: link_classes, data: data) do
190
+ content_tag(:a, href: path, class: link_classes, data: data) do
168
191
  concat(materialize_icon(icon_name(options, 'info'), options))
169
192
  concat(options[:label]) if options[:label].present?
170
193
  end
@@ -218,13 +241,29 @@ module CoreLinkHelper
218
241
 
219
242
  data = { method: :delete }
220
243
  confirmation_data(options, data, t('links.deletion_confirmation', name: obj.class.to_s.underscore.humanize))
221
- link_classes = tooltip_data(options, data)
244
+ link_classes = tooltip_data(options, data, I18n.t('ui_form.actions.delete'))
222
245
  content_tag(:a, href: path, class: link_classes, data: data) do
223
246
  concat(materialize_icon(icon_name(options, 'delete'), options))
224
247
  concat(options[:label]) if options[:label].present?
225
248
  end
226
249
  end
227
250
 
251
+ #
252
+ # Delete an thingy
253
+ #
254
+ def delete_button_tag(obj, path, options = {})
255
+ return unless can? :destroy, obj
256
+
257
+ data = { method: :delete }
258
+ confirmation_data(options, data, t('links.deletion_confirmation', name: obj.class.to_s.underscore.humanize))
259
+ link_classes = tooltip_data(options, data)
260
+ %w[btn red].each { |c| link_classes << c unless link_classes.include?(c) }
261
+ content_tag(:a, class: link_classes, href: path, data: data) do
262
+ concat(materialize_icon(icon_name(options, 'delete'), options))
263
+ concat(options[:label]) if options[:label].present?
264
+ end
265
+ end
266
+
228
267
  #
229
268
  # Create a thingy in a pull-down list
230
269
  #
@@ -32,6 +32,7 @@ en:
32
32
  delete: Delete
33
33
  info: View
34
34
  replay: Restart
35
+ favorite: Favorite
35
36
  system_configuration:
36
37
  placeholders:
37
38
  switchboard_base_url: https://switchboard.app47.com
@@ -100,10 +100,11 @@ class Notification
100
100
  #
101
101
  def finish_processing(processing_message = nil)
102
102
  if processing_message.present?
103
- set state: STATE_INVALID, error_message: processing_message
103
+ assign_attributes state: STATE_INVALID, error_message: processing_message
104
104
  else
105
- set state: STATE_PROCESSED, error_message: ''
105
+ assign_attributes state: STATE_PROCESSED, error_message: ''
106
106
  end
107
+ save(validate: false)
107
108
  end
108
109
 
109
110
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '1.1.10'
4
+ VERSION = '1.1.15'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-02 00:00:00.000000000 Z
11
+ date: 2021-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport