effective_bootstrap 0.9.32 → 0.9.36

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: 5e4006da022d1652bd4ca72bdc01f74262206efc1353d73b98e532b4c19c08b7
4
- data.tar.gz: 2211cb0defef54a536616e3990f055454e09fb6344e9f612f014884122e76ad6
3
+ metadata.gz: 94b89263c7cf0d7564203f9559a68cfdbd2b07746a89f35628f0555162d2e898
4
+ data.tar.gz: dcee74c0acec05c3d0a7786e26b1ecf9f2a0468aeb1057cac836968ecf2880e2
5
5
  SHA512:
6
- metadata.gz: 854a6a64b6df52e43acd1ea92657bf77b3772046e6b09f244077347f9d060d9642ee17793e0f80ded0b77606505d883b2ffc2af49a6c595e1ed1509ac2415244
7
- data.tar.gz: bec57138a80b59d82faa2647682636ae054a6cffebfdb3a00d1f1eb13452e534195d1b36cbedd6471d28aaa2520ddd2b5b7792e32eb5193c8a1378cb266c65e2
6
+ metadata.gz: 40bff96ef02ba73728037aded9304d3e8b8f630b4916c64788ca8ab417e5630ed15415a5f70fa831ee3f7af73703698276a3b0c463d874b8f94bdfabe365cefa
7
+ data.tar.gz: c3865baf35793093b672a90da1e191d3d31e8ab1f97677927cfa33cc89d522493c255d9de109d1b1c6b815867d6d65065a43bd41fee28aca11a134a9264cf19d
@@ -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
- (window.Rails || $.rails).confirm = (message) -> true
22
- (window.Rails || $.rails).effective_bootstrap_custom_data_confirm = true
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
 
@@ -1,3 +1,5 @@
1
1
  // Styles for the article editor look and feel
2
2
  // Use this to customize the textarea input, toolbar, etc
3
3
  // Does not affect the article editor iframe contents
4
+
5
+ .indented-list { list-style-type: none !important; }
@@ -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/
@@ -6,9 +6,9 @@ module Effective
6
6
  def self.defaults
7
7
  {
8
8
  active_storage: nil,
9
- css: '/assets/article_editor/',
9
+ css: ['/assets/article_editor/arx-frame.min.css'],
10
10
  custom: {
11
- css: ['/assets/application.css', '/assets/effective_bootstrap_article_editor.css']
11
+ css: ['/assets/effective_bootstrap_article_editor.css']
12
12
  },
13
13
  classes: {
14
14
  body: 'article-editor-body',
@@ -40,7 +40,7 @@ module Effective
40
40
  '12': 'col-sm-12'
41
41
  }
42
42
  },
43
- plugins: ['blockcode', 'imageposition', 'imageresize', 'inlineformat', 'removeformat', 'reorder', 'style'],
43
+ plugins: ['blockcode', 'cellcolor', 'imageposition', 'imageresize', 'inlineformat', 'listitem', 'removeformat', 'reorder', 'style'],
44
44
  quote: {
45
45
  template: '<blockquote><p></p></blockquote>'
46
46
  },
@@ -51,6 +51,17 @@ module Effective
51
51
  'small': { title: 'Small', classname: 'table-sm' },
52
52
  'striped': { title: 'Striped', classname: 'table-striped' },
53
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' }
54
65
  }
55
66
  }
56
67
  end
@@ -64,7 +75,15 @@ module Effective
64
75
  end
65
76
 
66
77
  def input_js_options
67
- self.class.defaults.merge(active_storage: active_storage)
78
+ self.class.defaults.merge(active_storage: active_storage, custom: { css: custom_css })
79
+ end
80
+
81
+ def custom_css
82
+ [
83
+ (@template.asset_pack_path('application.css') if @template.respond_to?(:asset_pack_path)),
84
+ (@template.asset_path('application.css') if @template.respond_to?(:asset_path)),
85
+ ('/assets/effective_bootstrap_article_editor.css')
86
+ ]
68
87
  end
69
88
 
70
89
  def active_storage
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.32'.freeze
2
+ VERSION = '0.9.36'.freeze
3
3
  end
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.32
4
+ version: 0.9.36
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-14 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails