web47core 1.1.11 → 1.1.16

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: d88fe31aee5eea282393cfd45b0da78a4a295fe259f5fed562182e3e3d2bab3f
4
- data.tar.gz: 44eb5b74fce3169a1080d82785341e83e39e2d7d0897700f5c75805ccf0280d0
3
+ metadata.gz: c7e886a348260b75a1a9bc39a1442cb96736b86568acc693eb9e68e2cd060cf3
4
+ data.tar.gz: 343664865ffe80bd9a1b459edf147f42315174900e05e2fa61dc35d1a8a15e62
5
5
  SHA512:
6
- metadata.gz: 49ade944da83d0465d6d9fb9b91647b8bf5e1e845eea99b424598c814d703afe8930117f0ff0daab92660ad0847bc752f2617c12841f492b1c975ad2d7ec572e
7
- data.tar.gz: 438c967ff87ce0888e2c559f69b4c8a7fa560e3ce988acea52ae87a77a94322cfe3ee543bbfb30b2c22a3f0e177fd057d2fb74fda6f723540aceb954d857b6b4
6
+ metadata.gz: 0fab6ed638e678f9daaef7afb26440579b142536f551ee368156491fe51a83534addb675c09e028aa54dbb5559ad0b647d60612d1e44135be2ebd4f308777d76
7
+ data.tar.gz: fc649419956e85eb0c3d084ae655e1bf3067416c1a5a847e8f79a9cbf5472edc799e6de0f1834764907534145676defe841822f7c4f796d014ffd9e61f09ed31
@@ -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
  #
@@ -219,13 +241,29 @@ module CoreLinkHelper
219
241
 
220
242
  data = { method: :delete }
221
243
  confirmation_data(options, data, t('links.deletion_confirmation', name: obj.class.to_s.underscore.humanize))
222
- link_classes = tooltip_data(options, data)
244
+ link_classes = tooltip_data(options, data, I18n.t('ui_form.actions.delete'))
223
245
  content_tag(:a, href: path, class: link_classes, data: data) do
224
246
  concat(materialize_icon(icon_name(options, 'delete'), options))
225
247
  concat(options[:label]) if options[:label].present?
226
248
  end
227
249
  end
228
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
+
229
267
  #
230
268
  # Create a thingy in a pull-down list
231
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
  #
@@ -35,12 +35,15 @@ class SmsNotification < Notification
35
35
  account_sid = config.twilio_account_id
36
36
  auth_token = config.twilio_auth_token
37
37
  client = Twilio::REST::Client.new account_sid, auth_token
38
-
39
- twilio_message = client.account.messages.create(
40
- body: message,
41
- to: to,
42
- from: config.twilio_phone_number
43
- )
38
+ twilio_message = if client.respond_to?(:account)
39
+ client.account.messages.create(body: message,
40
+ to: to,
41
+ from: config.twilio_phone_number)
42
+ else
43
+ client.messages.create(body: message,
44
+ to: to,
45
+ from: config.twilio_phone_number)
46
+ end
44
47
  # We are saved in the calling class, no reason to save again
45
48
  set sid: twilio_message.sid
46
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '1.1.11'
4
+ VERSION = '1.1.16'
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.11
4
+ version: 1.1.16
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-17 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -278,20 +278,14 @@ dependencies:
278
278
  requirements:
279
279
  - - ">="
280
280
  - !ruby/object:Gem::Version
281
- version: '3.0'
282
- - - "<="
283
- - !ruby/object:Gem::Version
284
- version: '4.13'
281
+ version: '5'
285
282
  type: :runtime
286
283
  prerelease: false
287
284
  version_requirements: !ruby/object:Gem::Requirement
288
285
  requirements:
289
286
  - - ">="
290
287
  - !ruby/object:Gem::Version
291
- version: '3.0'
292
- - - "<="
293
- - !ruby/object:Gem::Version
294
- version: '4.13'
288
+ version: '5'
295
289
  - !ruby/object:Gem::Dependency
296
290
  name: tzinfo
297
291
  requirement: !ruby/object:Gem::Requirement