five-two-nw-olivander 0.2.0.47 → 0.2.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/components/olivander/components/tabs_component.html.haml +33 -0
- data/app/components/olivander/components/tabs_component.rb +38 -0
- data/app/datatables/olivander/datatable.rb +2 -0
- data/app/helpers/olivander/application_helper.rb +6 -0
- data/app/inputs/date_time_input.rb +13 -11
- data/app/views/layouts/olivander/adminlte/_sidebar.html.haml +1 -1
- data/lib/olivander/application_context.rb +1 -1
- data/lib/olivander/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d230d3b035fa0ef2848260e9a18935d703332e40ae67e1f3ac82720859ed681
|
4
|
+
data.tar.gz: 25d75dde2112dee7691f9e01f02da3383b7f86fb1a5bebf21516fffbef504443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64885a09cd9644a5eb035605186ec6ccfd711906772a81ff62b3ecf8523c78cf7ed2fd6a6eeb4e349e19779591f09b7f02516dd6ab06f8a4a0520aca8af0a212
|
7
|
+
data.tar.gz: 95a26ab22fb487d7fae8646898457fc77fbd77d02dd0a5fa8439931a892b1da3e05c80ac23307c9d2db6a0f3561f0c727abcf4975f93315679b913761b201a89
|
@@ -0,0 +1,33 @@
|
|
1
|
+
- content_for tab_strip_id do
|
2
|
+
%ul.nav.nav-tabs{id: id, role: "tablist"}
|
3
|
+
- tabs.each_with_index do |tab, index|
|
4
|
+
%li.nav-item
|
5
|
+
%a.nav-link{
|
6
|
+
id: "#{tab.id}-tab",
|
7
|
+
href: "##{tab.id}",
|
8
|
+
"data-toggle": "tab",
|
9
|
+
role: "tab",
|
10
|
+
"aria-controls": tab.id,
|
11
|
+
"aria-selected": tab.active,
|
12
|
+
class: ("nav-link active" if tab.active)
|
13
|
+
}
|
14
|
+
= tab.title
|
15
|
+
- content_for tab_content_id do
|
16
|
+
.tab-content.mt-2{id: "#{id}-content"}
|
17
|
+
- tabs.each do |tab|
|
18
|
+
.tab-pane.fade{
|
19
|
+
id: tab.id,
|
20
|
+
role: "tabpanel",
|
21
|
+
"aria-labelledby": "#{tab.id}-tab",
|
22
|
+
class: ("tab-pane fade show active" if tab.active)
|
23
|
+
}
|
24
|
+
= tab
|
25
|
+
- if card
|
26
|
+
.card.card-tabs{ class: card_class }
|
27
|
+
.card-header.p-0.pt-1
|
28
|
+
= content_for tab_strip_id
|
29
|
+
.card-body
|
30
|
+
= content_for tab_content_id
|
31
|
+
- else
|
32
|
+
= content_for tab_strip_id
|
33
|
+
= content_for tab_content_id
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# app/components/tab_component.rb
|
4
|
+
module Olivander
|
5
|
+
module Components
|
6
|
+
# component to render tabs
|
7
|
+
class TabsComponent < ViewComponent::Base
|
8
|
+
renders_many :tabs, '::Olivander::Components::TabsComponent::Tab'
|
9
|
+
|
10
|
+
attr_reader :id, :card, :card_class, :tab_strip_id, :tab_content_id
|
11
|
+
|
12
|
+
def initialize(*args)
|
13
|
+
super
|
14
|
+
options = args.extract_options!
|
15
|
+
@id = options[:id] || "tabs-#{SecureRandom.hex(4)}"
|
16
|
+
@card = options.key?(:card) ? !!options[:card] : true
|
17
|
+
@card_class = options.key?(:card_class) ? !!options[:card_class] : 'card-primary'
|
18
|
+
@tab_strip_id = "tab-strip-#{SecureRandom.hex(4)}"
|
19
|
+
@tab_content_id = "tab-strip-#{SecureRandom.hex(4)}"
|
20
|
+
end
|
21
|
+
|
22
|
+
class Tab < ViewComponent::Base
|
23
|
+
attr_reader :title, :id, :active
|
24
|
+
|
25
|
+
def initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false)
|
26
|
+
super
|
27
|
+
@title = title
|
28
|
+
@id = id
|
29
|
+
@active = active
|
30
|
+
end
|
31
|
+
|
32
|
+
def call
|
33
|
+
content
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -41,6 +41,8 @@ module Olivander
|
|
41
41
|
dc = collection.nil? ? klazz.all : collection
|
42
42
|
|
43
43
|
attributes.each do |att|
|
44
|
+
next if att[0].to_s == 'deleted_at' && klazz.respond_to?(:paranoid?) && klazz.paranoid?
|
45
|
+
|
44
46
|
dc = dc.where("#{att[0]} = ?", att[1]) if klazz_attributes.include?(att[0].to_s)
|
45
47
|
end
|
46
48
|
|
@@ -173,6 +173,12 @@ module Olivander
|
|
173
173
|
(is_dev_environment? ? 'bg-danger' : 'bg-info')
|
174
174
|
end
|
175
175
|
|
176
|
+
def sidebar_class
|
177
|
+
Olivander::CurrentContext.application_context.sidebar_class ||
|
178
|
+
ENV['SIDEBAR_CLASS'] ||
|
179
|
+
'sidebar-dark-primary'
|
180
|
+
end
|
181
|
+
|
176
182
|
def header_page_title
|
177
183
|
[is_dev_environment? ? sidebar_context_suffix.upcase : nil, page_title].reject(&:blank?).join(' ')
|
178
184
|
end
|
@@ -1,32 +1,34 @@
|
|
1
1
|
class DateTimeInput < SimpleForm::Inputs::Base
|
2
|
-
def input(
|
2
|
+
def input(_wrapper_options)
|
3
3
|
raw_value = parse_value(object.public_send(attribute_name), options[:date_format])
|
4
4
|
|
5
5
|
disabled = options[:disabled] || false
|
6
6
|
|
7
|
-
hash = { id: "#{attribute_name}_datetimepicker", class: 'form-control datetimepicker-input', value: raw_value,
|
7
|
+
hash = { id: "#{attribute_name}_datetimepicker", class: 'form-control datetimepicker-input', value: raw_value,
|
8
|
+
disabled: disabled, 'data-toggle': 'datetimepicker', 'data-target': "##{attribute_name}_datetimepicker", autocomplete: 'off' }
|
8
9
|
data = options[:data] || {}
|
9
10
|
data.keys.each do |d|
|
10
11
|
hash["data-#{d.to_s.dasherize}".to_sym] = data[d]
|
11
12
|
end
|
12
13
|
field = @builder.text_field(attribute_name, hash)
|
13
14
|
|
14
|
-
add_on_class = options[:add_on_class] ||
|
15
|
+
add_on_class = options[:add_on_class] || 'fa fa-calendar'
|
15
16
|
|
16
|
-
add_on = template.content_tag(:div, class:
|
17
|
-
add_on = template.content_tag(:div, class:
|
18
|
-
hash = { class: add_on_class, 'data-toggle': 'datetimepicker',
|
17
|
+
add_on = template.content_tag(:div, class: 'input-group-prepend') do
|
18
|
+
add_on = template.content_tag(:div, class: 'input-group-text') do
|
19
|
+
hash = { class: add_on_class, 'data-toggle': 'datetimepicker',
|
20
|
+
'data-target': "##{attribute_name}_datetimepicker" }
|
19
21
|
template.content_tag(:i, '', hash)
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
25
|
all = content_tag(:div, add_on + field, class: 'input-group')
|
24
26
|
|
25
|
-
script =
|
26
|
-
unless disabled
|
27
|
-
picker_options = options[:picker_options] || { "format":
|
27
|
+
script = ''.html_safe
|
28
|
+
unless disabled
|
29
|
+
picker_options = options[:picker_options] || { "format": 'MM/DD/YYYY' }
|
28
30
|
|
29
|
-
script = "
|
31
|
+
script = ''"
|
30
32
|
<script>
|
31
33
|
$(document).ready(function() {
|
32
34
|
$('##{attribute_name}_datetimepicker').datetimepicker(
|
@@ -34,7 +36,7 @@ class DateTimeInput < SimpleForm::Inputs::Base
|
|
34
36
|
);
|
35
37
|
});
|
36
38
|
</script>
|
37
|
-
"
|
39
|
+
"''.html_safe
|
38
40
|
end
|
39
41
|
|
40
42
|
all + script
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/ Main Sidebar Container
|
2
|
-
%aside.main-sidebar.
|
2
|
+
%aside.main-sidebar.elevation-4{ class: sidebar_class, data: { controller: 'left-nav' }}
|
3
3
|
/ Brand Logo
|
4
4
|
%a.brand-link{ href: "/", class: sidebar_background_class }
|
5
5
|
%img.brand-image.img-circle.elevation-3{:alt => Olivander::CurrentContext.application_context.logo.alt, :src => Olivander::CurrentContext.application_context.logo.url, :style => "opacity: .8"}/
|
@@ -4,7 +4,7 @@ module Olivander
|
|
4
4
|
# DTO to represent the overall application context
|
5
5
|
class ApplicationContext
|
6
6
|
attr_accessor :name, :logo, :login_logo, :company, :menu_items,
|
7
|
-
:route_builder, :sign_out_path, :sidebar_background_class,
|
7
|
+
:route_builder, :sign_out_path, :sidebar_class, :sidebar_background_class,
|
8
8
|
:nav_container, :nav_class, :layout_container, :layout_class,
|
9
9
|
:sidebar, :back_to_top
|
10
10
|
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -268,6 +268,8 @@ files:
|
|
268
268
|
- app/components/olivander/components/table_portlet_component.html.haml
|
269
269
|
- app/components/olivander/components/table_portlet_component.rb
|
270
270
|
- app/components/olivander/components/table_portlet_component/table_component.html.haml
|
271
|
+
- app/components/olivander/components/tabs_component.html.haml
|
272
|
+
- app/components/olivander/components/tabs_component.rb
|
271
273
|
- app/controllers/concerns/olivander/resources/application_record.rb
|
272
274
|
- app/controllers/concerns/olivander/resources/auto_form_attributes.rb
|
273
275
|
- app/controllers/concerns/olivander/resources/crud_controller.rb
|