web47core 1.1.10 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/core_link_helper.rb +44 -5
- data/config/locales/en.yml +1 -0
- data/lib/app/models/notification.rb +3 -2
- data/lib/web47core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bf2d4642ca25a82b1e6dfe3b8a96aa40a694464290128b3c4c644dc5084dd11
|
4
|
+
data.tar.gz: 67dce9ec98fa99ebc16a6404ddf4d2db2be2503e85471d79f2b30e0c7ba3b490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: '
|
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,
|
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
|
#
|
data/config/locales/en.yml
CHANGED
@@ -100,10 +100,11 @@ class Notification
|
|
100
100
|
#
|
101
101
|
def finish_processing(processing_message = nil)
|
102
102
|
if processing_message.present?
|
103
|
-
|
103
|
+
assign_attributes state: STATE_INVALID, error_message: processing_message
|
104
104
|
else
|
105
|
-
|
105
|
+
assign_attributes state: STATE_PROCESSED, error_message: ''
|
106
106
|
end
|
107
|
+
save(validate: false)
|
107
108
|
end
|
108
109
|
|
109
110
|
#
|
data/lib/web47core/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|