effective_bootstrap 0.9.33 → 0.9.37

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: 552e12e8fece400c8da24ef107725748d4713812251be90b0f3bb90706e69588
4
- data.tar.gz: 6ffc0440fafb987b757e2327ac3062cdb648d8a2a9a7d782c6fabc7dda3f9636
3
+ metadata.gz: b1772102ddc52f73871d564739ecf3ed9edd05d7213764f9820ffcaddddd5341
4
+ data.tar.gz: 4767059a01a6d4b34eb6a325f5ab14c941e1de8cef6f01f8542fd9dda7956a2a
5
5
  SHA512:
6
- metadata.gz: fa4606cb5a27d5eb075e36a9142b2d309d549d844c9c025af0203c18c748a652f69d56f704b9f26b4662952ff00a19980a77a6ad23a680619caa8c64a8fe091c
7
- data.tar.gz: d26bef35b1425d849b355e5dbd501270936d56cc494be742e322b15ddea0dcdc2de6334fc3eadb958db6655940409628de967747e57de31f07555fa20328b83b
6
+ metadata.gz: 26050084b30228053d8cd328e30d1f48668ed640a951074060d21db38d102560fc7fa4ae15f7b5bf16459fc65f0cccc552fd749546b9bf5054b2b30353249502
7
+ data.tar.gz: 5e3c97e66bd4bf2f6288f302a94adb085a6723fdebd6a1ead7661e8602249048814d1fcaa54d6a60f9f94bc24eee287494de9fbc5e424eaedddf0add94b58504
@@ -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; }
@@ -10,7 +10,7 @@ module EffectiveBootstrapHelper
10
10
  def accordion(options = nil, &block)
11
11
  (options ||= {})[:class] = "accordion #{options.delete(:class)}".strip
12
12
 
13
- id = "accordion-#{''.object_id}"
13
+ id = "accordion-#{String.new.object_id}"
14
14
 
15
15
  @_accordion_active = id
16
16
  content = content_tag(:div, capture(&block), options.merge(id: id))
@@ -259,7 +259,7 @@ module EffectiveBootstrapHelper
259
259
  def nav_dropdown(label, right: false, link_class: [], list_class: [], &block)
260
260
  raise 'expected a block' unless block_given?
261
261
 
262
- id = "dropdown-#{''.object_id}"
262
+ id = "dropdown-#{String.new.object_id}"
263
263
 
264
264
  content_tag(:li, class: 'nav-item dropdown') do
265
265
  content_tag(:a, class: 'nav-link dropdown-toggle', href: '#', id: id, role: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
@@ -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/
@@ -390,7 +436,7 @@ module EffectiveBootstrapHelper
390
436
 
391
437
  @_tab_mode = :tablist
392
438
  @_tab_active = (active || :first)
393
- @_tab_unique = ''.object_id if unique
439
+ @_tab_unique = String.new.object_id if unique
394
440
 
395
441
  content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) do
396
442
  yield # Yield to tab the first time
@@ -430,7 +476,7 @@ module EffectiveBootstrapHelper
430
476
 
431
477
  @_tab_mode = :tablist_vertical
432
478
  @_tab_active = (active || :first)
433
- @_tab_unique = ''.object_id if unique
479
+ @_tab_unique = String.new.object_id if unique
434
480
 
435
481
  content_tag(:div, class: 'row border') do
436
482
  content_tag(:div, class: 'col-3 border-right') do
@@ -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', 'cellcolor', '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
  },
@@ -75,7 +75,15 @@ module Effective
75
75
  end
76
76
 
77
77
  def input_js_options
78
- 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
+ ]
79
87
  end
80
88
 
81
89
  def active_storage
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.33'.freeze
2
+ VERSION = '0.9.37'.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.33
4
+ version: 0.9.37
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-16 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails