aaf-lipstick 4.4.0 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lipstick/auto_validation.rb +2 -2
- data/lib/lipstick/filterable.rb +1 -0
- data/lib/lipstick/helpers/bootstrap_form_builder.rb +4 -4
- data/lib/lipstick/helpers/form_helper.rb +14 -12
- data/lib/lipstick/helpers/form_validation_builder.rb +1 -3
- data/lib/lipstick/helpers/layout_helper.rb +2 -2
- data/lib/lipstick/helpers/nav_helper.rb +4 -4
- data/lib/lipstick/helpers/sortable_helper.rb +7 -7
- data/lib/lipstick/images/email_banner.rb +2 -2
- data/lib/lipstick/images/logo_only_email_banner.rb +7 -7
- data/lib/lipstick/images/processor.rb +2 -2
- data/lib/lipstick/version.rb +1 -1
- metadata +27 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 862164c04edef89f31516d9d5797701eabad356d9064513b05acdb8687fa27e0
|
4
|
+
data.tar.gz: 076135b76502c98cea0844630a9cafcbf54f4c75d23672b71c05620078437af7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388f4f6a8ba86682330f568458ac90c9884ac2bb8b142ec1af1997cfcb4665d8ab62551554e717ea246add53f300c29d80937c0e0807c63e3b47e6394414c72e
|
7
|
+
data.tar.gz: 8896f9a67b5075952a9e2c6034501c55cb130e182d8d7ac882b0407852ec1d711524f85cc06fae198bc9e75389505d9af03527a7557a7eba6a4e2518b8b92bf8
|
@@ -7,8 +7,8 @@ module Lipstick
|
|
7
7
|
return if base.respond_to?(:validators)
|
8
8
|
|
9
9
|
raise('Lipstick::AutoValidation requires a class which responds' \
|
10
|
-
|
11
|
-
|
10
|
+
' to the `validators` method. For example, as provided by' \
|
11
|
+
' ActiveModel::Validations')
|
12
12
|
end
|
13
13
|
|
14
14
|
def lipstick_auto_validators
|
data/lib/lipstick/filterable.rb
CHANGED
@@ -27,20 +27,20 @@ class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
|
|
27
27
|
super
|
28
28
|
end
|
29
29
|
|
30
|
-
def check_box(
|
30
|
+
def check_box(*, &block)
|
31
31
|
template.content_tag('div', class: 'checkbox') do
|
32
32
|
template.content_tag('label') do
|
33
33
|
template.concat(super)
|
34
|
-
template.concat(template.capture
|
34
|
+
template.concat(template.capture(&block))
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def radio_button(
|
39
|
+
def radio_button(*, &block)
|
40
40
|
template.content_tag('div', class: 'radio') do
|
41
41
|
template.content_tag('label') do
|
42
42
|
template.concat(super)
|
43
|
-
template.concat(template.capture
|
43
|
+
template.concat(template.capture(&block))
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -5,34 +5,36 @@ module Lipstick
|
|
5
5
|
module FormHelper
|
6
6
|
include ActionView::Helpers::FormTagHelper
|
7
7
|
|
8
|
-
def field_block(html_opts = {})
|
8
|
+
def field_block(html_opts = {}, &block)
|
9
9
|
add_css_class(html_opts, 'form-group')
|
10
|
-
content_tag('div', html_opts)
|
10
|
+
content_tag('div', html_opts, &block)
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
# rubocop:disable Style/OptionalBooleanParameter
|
14
|
+
def radio_button_tag(name, value, checked = false, options = {}, &block)
|
14
15
|
content_tag('div', class: 'radio') do
|
15
16
|
content_tag('label') do
|
16
17
|
concat(super)
|
17
|
-
concat(capture
|
18
|
+
concat(capture(&block))
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
22
|
+
# rubocop:enable Style/OptionalBooleanParameter
|
21
23
|
|
22
|
-
def check_box_tag(
|
24
|
+
def check_box_tag(*, &block)
|
23
25
|
content_tag('div', class: 'checkbox') do
|
24
26
|
content_tag('label') do
|
25
27
|
concat(super)
|
26
|
-
concat(capture
|
28
|
+
concat(capture(&block))
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
alias orig_form_tag form_tag
|
32
34
|
|
33
|
-
def inline_form_tag(url_for_options = {}, options = {})
|
35
|
+
def inline_form_tag(url_for_options = {}, options = {}, &block)
|
34
36
|
add_css_class(options, 'form-inline')
|
35
|
-
form_tag(url_for_options, options)
|
37
|
+
form_tag(url_for_options, options, &block)
|
36
38
|
end
|
37
39
|
|
38
40
|
def search_form_tag(filter, url: nil,
|
@@ -111,10 +113,10 @@ module Lipstick
|
|
111
113
|
end
|
112
114
|
|
113
115
|
def delete_button_tag(url, text: true, **opts)
|
114
|
-
action = text
|
116
|
+
action = text.is_a?(String) ? text : 'Delete'
|
115
117
|
|
116
118
|
content_tag('div', class: 'btn-group') do
|
117
|
-
concat(delete_dropdown_opener(text && action, opts))
|
119
|
+
concat(delete_dropdown_opener(text && action, **opts))
|
118
120
|
concat(confirm_delete_dropdown(url, action))
|
119
121
|
end
|
120
122
|
end
|
@@ -135,7 +137,7 @@ module Lipstick
|
|
135
137
|
# v.validate_field(:name, ...) # Validate the test_object[name] field
|
136
138
|
# end
|
137
139
|
# %>
|
138
|
-
def validate_form(selector, sym = nil)
|
140
|
+
def validate_form(selector, sym = nil, &block)
|
139
141
|
opts = {
|
140
142
|
type: 'application/vnd.aaf.lipstick.validations+json',
|
141
143
|
'data-target': selector,
|
@@ -143,7 +145,7 @@ module Lipstick
|
|
143
145
|
}
|
144
146
|
|
145
147
|
content_tag('script', opts) do
|
146
|
-
validation_json(sym)
|
148
|
+
validation_json(sym, &block).html_safe
|
147
149
|
end
|
148
150
|
end
|
149
151
|
|
@@ -42,9 +42,7 @@ module Lipstick
|
|
42
42
|
|
43
43
|
return validate_with_param(target, validation, true) if opts.empty?
|
44
44
|
|
45
|
-
if opts.keys == [:param]
|
46
|
-
return validate_with_param(target, validation, opts[:param])
|
47
|
-
end
|
45
|
+
return validate_with_param(target, validation, opts[:param]) if opts.keys == [:param]
|
48
46
|
|
49
47
|
add_rule(target, validation, opts)
|
50
48
|
end
|
@@ -10,11 +10,11 @@ module Lipstick
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def aaf_footer
|
13
|
+
def aaf_footer(&block)
|
14
14
|
content_tag('footer') do
|
15
15
|
content_tag('div', class: 'footer-content') do
|
16
16
|
concat(aaf_logo)
|
17
|
-
concat(capture
|
17
|
+
concat(capture(&block))
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module Lipstick
|
4
4
|
module Helpers
|
5
5
|
module NavHelper
|
6
|
-
def nav_bar
|
7
|
-
content_tag('nav', class: 'navbar shrink')
|
6
|
+
def nav_bar(&block)
|
7
|
+
content_tag('nav', class: 'navbar shrink', &block)
|
8
8
|
end
|
9
9
|
|
10
10
|
def nav_first_item(text, url)
|
@@ -14,10 +14,10 @@ module Lipstick
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def nav_collapsing_items
|
17
|
+
def nav_collapsing_items(&block)
|
18
18
|
attrs = { class: 'collapse navbar-collapse', id: 'aaf-nav-collapse' }
|
19
19
|
content_tag('div', attrs) do
|
20
|
-
content_tag('ul', class: 'nav navbar-nav')
|
20
|
+
content_tag('ul', class: 'nav navbar-nav', &block)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -25,13 +25,13 @@ module Lipstick
|
|
25
25
|
link_to request.query_parameters.merge(sort_by: param_name,
|
26
26
|
direction: opposite_direction) do
|
27
27
|
concat("#{name} ")
|
28
|
-
concat(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
)
|
28
|
+
concat(glyphicon(direction))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def glyphicon(direction)
|
33
|
+
content_tag('div', class: 'glyphicon') do
|
34
|
+
content_tag('div', nil, class: "glyphicon-chevron-#{icon(direction)}")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rmagick'
|
4
|
-
|
5
3
|
module Lipstick
|
6
4
|
module Images
|
7
5
|
# Creates an AAF standard email banner, with three elements, positioned as
|
@@ -30,6 +28,8 @@ module Lipstick
|
|
30
28
|
class EmailBanner
|
31
29
|
def initialize(image:, title:, environment:,
|
32
30
|
background_color:, resize_to:)
|
31
|
+
require 'rmagick'
|
32
|
+
|
33
33
|
@title = title
|
34
34
|
@environment = environment
|
35
35
|
@image = image
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rmagick'
|
4
|
-
|
5
3
|
module Lipstick
|
6
4
|
module Images
|
7
5
|
# Creates a logo-only email banner, with two elements.
|
@@ -14,6 +12,8 @@ module Lipstick
|
|
14
12
|
# into it. I promise there was a good reason for doing it.
|
15
13
|
class LogoOnlyEmailBanner
|
16
14
|
def initialize(image:, environment:, background_color:)
|
15
|
+
require 'rmagick'
|
16
|
+
|
17
17
|
@environment = environment.upcase
|
18
18
|
@image = image
|
19
19
|
@background_color = background_color
|
@@ -51,7 +51,7 @@ module Lipstick
|
|
51
51
|
title.pointsize = 36
|
52
52
|
title.gravity = Magick::ForgetGravity
|
53
53
|
title.fill = '#bc2028'
|
54
|
-
title.rotation =
|
54
|
+
title.rotation = -1 * ANGLE_DEGREES
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -97,11 +97,11 @@ module Lipstick
|
|
97
97
|
m = env_metrics
|
98
98
|
|
99
99
|
# The horizontal width of the environment text is found by:
|
100
|
-
# w cos(
|
100
|
+
# w cos(0) + h sin(0)
|
101
101
|
#
|
102
102
|
# w = text width
|
103
103
|
# h = text ascent
|
104
|
-
#
|
104
|
+
# 0 = angle of text rotation
|
105
105
|
#
|
106
106
|
# Contrary to the description in `EmailBanner`, since we're upper
|
107
107
|
# casing the environment string here, we don't need to worry about text
|
@@ -117,9 +117,9 @@ module Lipstick
|
|
117
117
|
m = env_metrics
|
118
118
|
|
119
119
|
# The horizontal width of the environment text is found by:
|
120
|
-
# w sin(
|
120
|
+
# w sin(0) + h cos(0)
|
121
121
|
h = Math.sin(ANGLE_RADIANS) * m.width +
|
122
|
-
|
122
|
+
Math.cos(ANGLE_RADIANS) * m.ascent
|
123
123
|
|
124
124
|
# We use addition here instead of the usual subtraction, as the text
|
125
125
|
# moves in the upward direction from the position we set.
|
@@ -16,7 +16,7 @@ module Lipstick
|
|
16
16
|
end
|
17
17
|
# rubocop:enable Security/Eval
|
18
18
|
|
19
|
-
def email_banner(image: 'logo.png',
|
19
|
+
def email_banner(title:, environment:, image: 'logo.png', **kwargs)
|
20
20
|
@context.depend_on_asset(image)
|
21
21
|
asset = @context.environment.find_asset(image)
|
22
22
|
|
@@ -29,7 +29,7 @@ module Lipstick
|
|
29
29
|
).to_png
|
30
30
|
end
|
31
31
|
|
32
|
-
def logo_only_email_banner(image: 'logo.png',
|
32
|
+
def logo_only_email_banner(environment:, image: 'logo.png', **kwargs)
|
33
33
|
@context.depend_on_asset(image)
|
34
34
|
asset = @context.environment.find_asset(image)
|
35
35
|
|
data/lib/lipstick/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aaf-lipstick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun Mangelsdorf
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -26,20 +26,6 @@ dependencies:
|
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kramdown
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.5'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.5'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rails
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - ">="
|
@@ -53,7 +39,7 @@ dependencies:
|
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: rails
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
@@ -220,6 +206,20 @@ dependencies:
|
|
220
206
|
- - ">="
|
221
207
|
- !ruby/object:Gem::Version
|
222
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rmagick
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rspec-rails
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,22 +252,16 @@ dependencies:
|
|
252
252
|
name: sqlite3
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
|
-
- - "
|
256
|
-
- !ruby/object:Gem::Version
|
257
|
-
version: '1.3'
|
258
|
-
- - "<"
|
255
|
+
- - ">="
|
259
256
|
- !ruby/object:Gem::Version
|
260
|
-
version: '
|
257
|
+
version: '0'
|
261
258
|
type: :development
|
262
259
|
prerelease: false
|
263
260
|
version_requirements: !ruby/object:Gem::Requirement
|
264
261
|
requirements:
|
265
|
-
- - "
|
266
|
-
- !ruby/object:Gem::Version
|
267
|
-
version: '1.3'
|
268
|
-
- - "<"
|
262
|
+
- - ">="
|
269
263
|
- !ruby/object:Gem::Version
|
270
|
-
version: '
|
264
|
+
version: '0'
|
271
265
|
- !ruby/object:Gem::Dependency
|
272
266
|
name: tilt
|
273
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,7 +276,7 @@ dependencies:
|
|
282
276
|
- - ">="
|
283
277
|
- !ruby/object:Gem::Version
|
284
278
|
version: '0'
|
285
|
-
description:
|
279
|
+
description:
|
286
280
|
email:
|
287
281
|
- s.mangelsdorf@gmail.com
|
288
282
|
executables: []
|
@@ -332,7 +326,7 @@ homepage: https://github.com/ausaccessfed/aaf-lipstick
|
|
332
326
|
licenses:
|
333
327
|
- Apache-2.0
|
334
328
|
metadata: {}
|
335
|
-
post_install_message:
|
329
|
+
post_install_message:
|
336
330
|
rdoc_options: []
|
337
331
|
require_paths:
|
338
332
|
- lib
|
@@ -340,15 +334,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
340
334
|
requirements:
|
341
335
|
- - ">="
|
342
336
|
- !ruby/object:Gem::Version
|
343
|
-
version: '
|
337
|
+
version: '2.7'
|
344
338
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
339
|
requirements:
|
346
340
|
- - ">="
|
347
341
|
- !ruby/object:Gem::Version
|
348
342
|
version: '0'
|
349
343
|
requirements: []
|
350
|
-
rubygems_version: 3.
|
351
|
-
signing_key:
|
344
|
+
rubygems_version: 3.2.26
|
345
|
+
signing_key:
|
352
346
|
specification_version: 4
|
353
347
|
summary: A gem for applying AAF branding to our services
|
354
348
|
test_files: []
|