effective_bootstrap 0.9.30 → 0.9.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb +7 -2
- data/app/assets/stylesheets/effective_article_editor/input.scss +2 -0
- data/app/helpers/effective_bootstrap_helper.rb +46 -0
- data/app/models/effective/form_inputs/article_editor.rb +28 -12
- data/lib/effective_bootstrap/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: 724c9c09be1863a089556b42c8569d61c0dc8c5a94efde7406bad1c2835fe359
|
4
|
+
data.tar.gz: 8deca06ebd23e4ac4c572c82caf861847f8932c169e6f32ebe2c052f4634cc40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b7b872f2f83381421e3511b2b6401ccc672c68a8e550760e0e093002ec691f709f8ff39d936909ad9013125d8924bffe739309b6f30431488195d78600d7b1e
|
7
|
+
data.tar.gz: 2ed3d029a6f61ba2100df032d078c9d93e51a062d9d97acc8aefea7ed951f5947749d9c875f580efde85eadc1e15b3c2795683f7f7b7decea5b4070bd84d0ac7
|
@@ -18,8 +18,13 @@ if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && (window.Rails || $.rai
|
|
18
18
|
, 4000)
|
19
19
|
false # don't show the confirmation dialog
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
if window.Rails
|
22
|
+
window.Rails.confirm = (message) -> true
|
23
|
+
window.Rails.effective_bootstrap_custom_data_confirm = true
|
24
|
+
|
25
|
+
if $.rails
|
26
|
+
$.rails.confirm = (message) -> true
|
27
|
+
$.rails.effective_bootstrap_custom_data_confirm = true
|
23
28
|
|
24
29
|
$(document).on 'confirm:complete', (event) -> $(event.target).data('confirmed')
|
25
30
|
|
@@ -274,6 +274,52 @@ module EffectiveBootstrapHelper
|
|
274
274
|
content_tag(:div, '', class: 'dropdown-divider')
|
275
275
|
end
|
276
276
|
|
277
|
+
# Breadcrumb
|
278
|
+
#
|
279
|
+
# https://getbootstrap.com/docs/4.0/components/breadcrumb/
|
280
|
+
# Builds a breadcrumb based on the controller namespace, action and @page_title instance variable
|
281
|
+
#
|
282
|
+
def bootstrap_breadcrumb(root_title: nil, root_path: nil, index_title: nil, index_path: nil, page_title: nil)
|
283
|
+
effective_resource = (@_effective_resource || Effective::Resource.new(controller_path))
|
284
|
+
resource = instance_variable_get('@' + effective_resource.name) if effective_resource.name
|
285
|
+
|
286
|
+
root_title ||= 'Home'
|
287
|
+
root_path ||= '/'
|
288
|
+
|
289
|
+
index_title ||= controller.class.name.split('::').last.sub('Controller', '').titleize
|
290
|
+
index_path ||= effective_resource.action_path(:index) || request.path.split('/')[0...-1].join('/')
|
291
|
+
|
292
|
+
page_title ||= (@page_title || resource&.to_s || controller.action_name.titleize)
|
293
|
+
|
294
|
+
# Build items
|
295
|
+
# An array of arrays [[title, url]]
|
296
|
+
items = []
|
297
|
+
|
298
|
+
# Namespaces
|
299
|
+
Array(effective_resource.namespace).each do |namespace|
|
300
|
+
items << [namespace.titleize, '/' + namespace]
|
301
|
+
end
|
302
|
+
|
303
|
+
# Home
|
304
|
+
items << [root_title, '/'] unless items.present?
|
305
|
+
|
306
|
+
# Controller index action
|
307
|
+
items << [index_title, index_path] unless controller.action_name == 'index'
|
308
|
+
|
309
|
+
# Always
|
310
|
+
items << [page_title, nil]
|
311
|
+
|
312
|
+
# Now take items and turn them into breadcrumbs
|
313
|
+
content_tag(:ol, class: 'breadcrumb') do
|
314
|
+
(items[0...-1].map do |title, path|
|
315
|
+
content_tag(:li, link_to(title, path, title: title), class: 'breadcrumb-item')
|
316
|
+
end + items[-1..-1].map do |title, path|
|
317
|
+
content_tag(:li, title, class: 'breadcrumb-item active', 'aria-current': 'page')
|
318
|
+
end).join.html_safe
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
|
277
323
|
# Pagination
|
278
324
|
#
|
279
325
|
# https://getbootstrap.com/docs/4.0/components/pagination/
|
@@ -2,18 +2,11 @@ module Effective
|
|
2
2
|
module FormInputs
|
3
3
|
class ArticleEditor < Effective::FormInput
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
def input_html_options
|
10
|
-
{ class: 'effective_article_editor form-control', id: unique_id, autocomplete: 'off' }
|
11
|
-
end
|
12
|
-
|
13
|
-
def input_js_options
|
5
|
+
# https://imperavi.com/article/docs/settings/
|
6
|
+
def self.defaults
|
14
7
|
{
|
15
|
-
active_storage:
|
16
|
-
css: '/assets/
|
8
|
+
active_storage: nil,
|
9
|
+
css: '/assets/article_editor/',
|
17
10
|
custom: {
|
18
11
|
css: ['/assets/application.css', '/assets/effective_bootstrap_article_editor.css']
|
19
12
|
},
|
@@ -47,7 +40,7 @@ module Effective
|
|
47
40
|
'12': 'col-sm-12'
|
48
41
|
}
|
49
42
|
},
|
50
|
-
plugins: ['blockcode', 'imageposition', 'imageresize', 'inlineformat', 'removeformat', 'reorder', 'style'],
|
43
|
+
plugins: ['blockcode', 'cellcolor', 'imageposition', 'imageresize', 'inlineformat', 'removeformat', 'reorder', 'style'],
|
51
44
|
quote: {
|
52
45
|
template: '<blockquote><p></p></blockquote>'
|
53
46
|
},
|
@@ -58,10 +51,33 @@ module Effective
|
|
58
51
|
'small': { title: 'Small', classname: 'table-sm' },
|
59
52
|
'striped': { title: 'Striped', classname: 'table-striped' },
|
60
53
|
}
|
54
|
+
},
|
55
|
+
cellcolors: {
|
56
|
+
'primary': { title: 'Primary', classname: 'table-primary' },
|
57
|
+
'secondary': { title: 'Secondary', classname: 'table-secondary' },
|
58
|
+
'active': { title: 'Active', classname: 'table-active' },
|
59
|
+
'success': { title: 'Success', classname: 'table-success' },
|
60
|
+
'danger': { title: 'Danger', classname: 'table-danger' },
|
61
|
+
'warning': { title: 'Warning', classname: 'table-warning' },
|
62
|
+
'info': { title: 'Info', classname: 'table-info' },
|
63
|
+
'light': { title: 'Light', classname: 'table-light' },
|
64
|
+
'dark': { title: 'Dark', classname: 'table-dark' }
|
61
65
|
}
|
62
66
|
}
|
63
67
|
end
|
64
68
|
|
69
|
+
def build_input(&block)
|
70
|
+
@builder.super_text_area(name, options[:input])
|
71
|
+
end
|
72
|
+
|
73
|
+
def input_html_options
|
74
|
+
{ class: 'effective_article_editor form-control', id: unique_id, autocomplete: 'off' }
|
75
|
+
end
|
76
|
+
|
77
|
+
def input_js_options
|
78
|
+
self.class.defaults.merge(active_storage: active_storage)
|
79
|
+
end
|
80
|
+
|
65
81
|
def active_storage
|
66
82
|
return @active_storage unless @active_storage.nil?
|
67
83
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|