five-two-nw-olivander 0.1.2.44 → 0.1.2.46

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: 16cf7a76d584d994ebe2a9288a075ace5c102267db5f9f9a1421419649a1e2d4
4
- data.tar.gz: 70cf5157b16b6ba71d3b9419fa7be32313fb2649f3f0f18a895a935968ac20b5
3
+ metadata.gz: 6a3e404238fed9729daec685e3012bceaf41309a41b8ea3a18afa0d7380c7f0f
4
+ data.tar.gz: 7cfddd1873f16e872f4babe5081fd80f217b90881a8c7baa6686c8b750c91dc1
5
5
  SHA512:
6
- metadata.gz: 733bf715caa8743fedbaac361989ac3a666fa0a5de69d13d30e4172a4a7b3950528bfd22ea617d412148757f2c96fcfb9a84e8561f4014812e724146856376b6
7
- data.tar.gz: 61153f2f1bf784b231420905d8de974d09f68a188ed12fe59ef1c8690a38a742ee345754673e426acdc8d8d002a9b8293170b3c8bb05869eddf5454681be78ca
6
+ metadata.gz: 0dd476db5ea95b5738920477a7d6d60c0e6bb9a7d155c1ca96fdc112c902bdefba9d2e4a64b45a5a2e0aa50d0b19905da17d0b535bdb88edb4047e9a71bb1fdb
7
+ data.tar.gz: 0a5ac894a7c708a8e599fc0035d1b429d039cfb641ac0d937b1a7e090797f6aa34786692baaab8d2ae726ed3009dad40ae65173cc8ff3a0b78fc5f35fcbef739
@@ -16,8 +16,8 @@
16
16
  %td{ colspan: colspan }
17
17
  - val = @resource.send(f.sym)
18
18
  - case f.type
19
- - when :string
20
- = val
19
+ - when :string, :text
20
+ = simple_format(val)
21
21
  - when :boolean
22
22
  - icon_class = val ? 'fa-check text-success' : 'fa-times text-danger'
23
23
  %i.fa{ class: icon_class }
@@ -29,7 +29,14 @@
29
29
  %li= link_to val1
30
30
  - else
31
31
  = link_to val if val.present?
32
+ - when :file
33
+ - if val.present?
34
+ - if val.content_type.include?('image')
35
+ %img{ src: val.expiring_url }
36
+ - else
37
+ = link_to val, val.expiring_url
32
38
  - else
39
+ = f.type
33
40
  = val
34
41
  - (section.columns-slice.size).times do
35
42
  %th
@@ -49,16 +49,23 @@ module Olivander
49
49
  sym = att.name.to_sym
50
50
  type = att.type
51
51
  next unless inc == sym
52
+
52
53
  resource_field sym, type
53
54
  end
54
55
 
55
56
  reflections.map{ |x| x[1] }
56
- .filter{ |x| x.foreign_key == inc || x.name == inc }
57
- .each do |r|
57
+ .filter{ |x| x.foreign_key == inc || x.name == inc }
58
+ .each do |r|
58
59
  sym = r.name
59
60
  type = :association
60
61
  resource_field sym, type
61
62
  end
63
+
64
+ next unless respond_to?(:attachment_definitions)
65
+
66
+ attachment_definitions.filter{ |x| puts x; puts inc; x == inc }.each do |ad|
67
+ resource_field ad[0], :file
68
+ end
62
69
  end
63
70
  end
64
71
  end
@@ -49,7 +49,7 @@ module Olivander
49
49
  if ma.confirm
50
50
  bulk_action ma.sym, url_for(controller: ma.controller, action: "confirm_#{ma.action}")
51
51
  else
52
- bulk_action ma.sym, url_for(controller: ma.controller, action: ma.action), data: { turbo_frame: ma.turbo_frame }
52
+ bulk_action ma.sym, send(ma.path_helper), data: { turbo_frame: ma.turbo_frame }
53
53
  end
54
54
  end
55
55
  end
@@ -54,6 +54,14 @@ module Olivander
54
54
  action.to_s.titleize
55
55
  end
56
56
 
57
+ def resource_form_action_icon(resource, action)
58
+ key = resource.class.name.underscore
59
+ return I18n.t("activerecord.actions.#{key}.#{action}-icon") if I18n.exists?("activerecord.actions.#{key}.#{action}-icon")
60
+ return I18n.t("activerecord.actions.#{action}-icon") if I18n.exists?("activerecord.actions.#{action}-icon")
61
+
62
+ action.to_s.titleize
63
+ end
64
+
57
65
  def resource_field_group_label(resource_class, key)
58
66
  i18n_key = "activerecord.attributes.#{resource_class.name.underscore}.resource_field_groups.#{key}"
59
67
  I18n.exists?(i18n_key) ? I18n.t(i18n_key) : key.to_s.titleize
@@ -1,15 +1,16 @@
1
- - actions.each_with_index do |a, idx|
2
- - cf_sym = "link_inner#{idx}".to_sym
3
- = content_for cf_sym do
4
- - icon_key = "activerecord.actions.icons.#{a.sym}"
5
- - if I18n.exists?(icon_key)
6
- %i.fa{ class: I18n.t(icon_key)}
7
- = resource_form_action_label(@resource, a.sym)
1
+ - actions.group_by(&:crud_action).reverse_each.with_index do |g, gidx|
2
+ - g[1].each_with_index do |a, idx|
3
+ - cf_sym = "link_inner#{gidx}-#{idx}".to_sym
4
+ = content_for cf_sym do
5
+ - icon_key = "activerecord.actions.icons.#{a.sym}"
6
+ - if I18n.exists?(icon_key)
7
+ %i.fa{ class: I18n.t(icon_key)}
8
+ = resource_form_action_label(@resource, a.sym)
8
9
 
9
- - if a.turbo_frame.blank?
10
- = link_to({ controller: a.controller, action: a.action }, method: a.verb, class: 'btn btn-tool', data: { confirm: 'are you sure?' }) do
11
- = yield cf_sym
12
- - else
13
- = link_to({ controller: a.controller, action: a.action }, class: 'btn btn-tool', data: { turbo: true, turbo_method: a.verb, turbo_frame: a.turbo_frame }) do
14
- = yield cf_sym
15
-  
10
+ - if a.turbo_frame.blank?
11
+ = link_to({ controller: a.controller, action: a.action }, method: a.verb, class: 'btn btn-tool') do
12
+ = yield cf_sym
13
+ - else
14
+ = link_to({ controller: a.controller, action: a.action }, class: 'btn btn-tool', data: { turbo: true, turbo_method: a.verb, turbo_frame: a.turbo_frame }) do
15
+ = yield cf_sym
16
+  
@@ -4,7 +4,7 @@
4
4
 
5
5
  - if @datatable
6
6
  - content_for :datatable do
7
- = render_datatable(@datatable, charts: false)
7
+ = render_datatable(@datatable, charts: false, input_js: { "stripeClasses": [] })
8
8
  - content_for :datatable_charts do
9
9
  - keys = @datatable._charts.keys
10
10
  - ks = keys.size
@@ -1,6 +1,26 @@
1
1
  - route_builder = @context&.route_builder || datatable.class::ROUTE_BUILDER
2
- = dropdown(variation: :dropleft, btn_class: btn_class) do
3
- - authorized_resource_actions(route_builder, resource, for_action: action_name).select{ |x| x.show_in_datatable }.each do |a|
2
+ -# = dropdown(variation: :dropleft, btn_class: btn_class) do
3
+ -# - authorized_resource_actions(route_builder, resource, for_action: action_name).select{ |x| x.show_in_datatable }.each do |a|
4
+ -# - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
5
+ -# - data = a.turbo_frame.present? ? { turbo: true, turbo_frame: a.turbo_frame } : {}
6
+ -# = dropdown_link_to resource_form_action_label(resource, a.sym), path, data: data
7
+ - actions = authorized_resource_actions(route_builder, resource, for_action: action_name).select{ |x| x.show_in_datatable }
8
+ - crud_actions = actions.select{ |a| a.crud_action }
9
+ - non_crud_actions = actions.select{ |a| !a.crud_action }
10
+ .btn-group
11
+ - if non_crud_actions.size.positive?
12
+ .btn-group
13
+ %button.btn.btn-sm.dropdown-toggle{ type: :button, data: { toggle: 'dropdown' }}
14
+ %ul.dropdown-menu
15
+ - non_crud_actions.each do |a|
16
+ - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
17
+ - data = a.turbo_frame.present? ? { turbo: true, turbo_frame: a.turbo_frame } : {}
18
+ %li
19
+ = dropdown_link_to resource_form_action_label(resource, a.sym), path, data: data, method: a.verb
20
+ - crud_actions.each do |a|
4
21
  - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
5
22
  - data = a.turbo_frame.present? ? { turbo: true, turbo_frame: a.turbo_frame } : {}
6
- = dropdown_link_to resource_form_action_label(resource, a.sym), path, data: data
23
+ - icon_class = (a.verb == :delete ? '' : '')
24
+ = link_to path, data: data, method: a.verb, title: resource_form_action_label(resource, a.sym), class: "btn btn-sm #{icon_class}" do
25
+ %i{ class: resource_form_action_icon(resource, a.sym), style: 'display: block; font-size: 10px' }
26
+ %span{ style: 'font-size: 12px' }= resource_form_action_label(resource, a.sym)
@@ -23,85 +23,101 @@
23
23
  %i.fas.fa-search
24
24
  %button.btn.btn-navbar{"data-widget" => "navbar-search", :type => "button"}
25
25
  %i.fas.fa-times
26
- / Messages Dropdown Menu
27
- %li.nav-item.dropdown
28
- %a.nav-link{"data-toggle" => "dropdown", :href => "#"}
29
- %i.far.fa-comments
30
- %span.badge.badge-danger.navbar-badge 3
31
- .dropdown-menu.dropdown-menu-lg.dropdown-menu-right
32
- %a.dropdown-item{:href => "#"}
33
- / Message Start
34
- .media
35
- %img.img-size-50.mr-3.img-circle{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
36
- .media-body
37
- %h3.dropdown-item-title
38
- Brad Diesel
39
- %span.float-right.text-sm.text-danger
40
- %i.fas.fa-star
41
- %p.text-sm Call me whenever you can...
42
- %p.text-sm.text-muted
43
- %i.far.fa-clock.mr-1
44
- 4 Hours Ago
45
- / Message End
46
- .dropdown-divider
47
- %a.dropdown-item{:href => "#"}
48
- / Message Start
49
- .media
50
- %img.img-size-50.img-circle.mr-3{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
51
- .media-body
52
- %h3.dropdown-item-title
53
- John Pierce
54
- %span.float-right.text-sm.text-muted
55
- %i.fas.fa-star
56
- %p.text-sm I got your message bro
57
- %p.text-sm.text-muted
58
- %i.far.fa-clock.mr-1
59
- 4 Hours Ago
60
- / Message End
61
- .dropdown-divider
62
- %a.dropdown-item{:href => "#"}
63
- / Message Start
64
- .media
65
- %img.img-size-50.img-circle.mr-3{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
66
- .media-body
67
- %h3.dropdown-item-title
68
- Nora Silvester
69
- %span.float-right.text-sm.text-warning
70
- %i.fas.fa-star
71
- %p.text-sm The subject goes here
72
- %p.text-sm.text-muted
73
- %i.far.fa-clock.mr-1
74
- 4 Hours Ago
75
- / Message End
76
- .dropdown-divider
77
- %a.dropdown-item.dropdown-footer{:href => "#"} See All Messages
78
- / Notifications Dropdown Menu
79
- %li.nav-item.dropdown
80
- %a.nav-link{"data-toggle" => "dropdown", :href => "#"}
81
- %i.far.fa-bell
82
- %span.badge.badge-warning.navbar-badge 15
83
- .dropdown-menu.dropdown-menu-lg.dropdown-menu-right
84
- %span.dropdown-item.dropdown-header 15 Notifications
85
- .dropdown-divider
86
- %a.dropdown-item{:href => "#"}
87
- %i.fas.fa-envelope.mr-2
88
- 4 new messages
89
- %span.float-right.text-muted.text-sm 3 mins
90
- .dropdown-divider
91
- %a.dropdown-item{:href => "#"}
92
- %i.fas.fa-users.mr-2
93
- 8 friend requests
94
- %span.float-right.text-muted.text-sm 12 hours
95
- .dropdown-divider
96
- %a.dropdown-item{:href => "#"}
97
- %i.fas.fa-file.mr-2
98
- 3 new reports
99
- %span.float-right.text-muted.text-sm 2 days
100
- .dropdown-divider
101
- %a.dropdown-item.dropdown-footer{:href => "#"} See All Notifications
102
- %li.nav-item
103
- %a.nav-link{title: 'Full Screen Mode', "data-widget" => "fullscreen", :href => "#", :role => "button"}
104
- %i.fas.fa-expand-arrows-alt
105
- %li.nav-item
106
- %a.nav-link{title: 'Show Sidebar Options', "data-controlsidebar-slide" => "true", "data-widget" => "control-sidebar", :href => "#", :role => "button"}
107
- %i.fas.fa-th-large
26
+ -# / Messages Dropdown Menu
27
+ -# %li.nav-item.dropdown
28
+ -# %a.nav-link{"data-toggle" => "dropdown", :href => "#"}
29
+ -# %i.far.fa-comments
30
+ -# %span.badge.badge-danger.navbar-badge 3
31
+ -# .dropdown-menu.dropdown-menu-lg.dropdown-menu-right
32
+ -# %a.dropdown-item{:href => "#"}
33
+ -# / Message Start
34
+ -# .media
35
+ -# %img.img-size-50.mr-3.img-circle{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
36
+ -# .media-body
37
+ -# %h3.dropdown-item-title
38
+ -# Brad Diesel
39
+ -# %span.float-right.text-sm.text-danger
40
+ -# %i.fas.fa-star
41
+ -# %p.text-sm Call me whenever you can...
42
+ -# %p.text-sm.text-muted
43
+ -# %i.far.fa-clock.mr-1
44
+ -# 4 Hours Ago
45
+ -# / Message End
46
+ -# .dropdown-divider
47
+ -# %a.dropdown-item{:href => "#"}
48
+ -# / Message Start
49
+ -# .media
50
+ -# %img.img-size-50.img-circle.mr-3{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
51
+ -# .media-body
52
+ -# %h3.dropdown-item-title
53
+ -# John Pierce
54
+ -# %span.float-right.text-sm.text-muted
55
+ -# %i.fas.fa-star
56
+ -# %p.text-sm I got your message bro
57
+ -# %p.text-sm.text-muted
58
+ -# %i.far.fa-clock.mr-1
59
+ -# 4 Hours Ago
60
+ -# / Message End
61
+ -# .dropdown-divider
62
+ -# %a.dropdown-item{:href => "#"}
63
+ -# / Message Start
64
+ -# .media
65
+ -# %img.img-size-50.img-circle.mr-3{:alt => "User Avatar", :src => image_path(user_image_path(nil))}/
66
+ -# .media-body
67
+ -# %h3.dropdown-item-title
68
+ -# Nora Silvester
69
+ -# %span.float-right.text-sm.text-warning
70
+ -# %i.fas.fa-star
71
+ -# %p.text-sm The subject goes here
72
+ -# %p.text-sm.text-muted
73
+ -# %i.far.fa-clock.mr-1
74
+ -# 4 Hours Ago
75
+ -# / Message End
76
+ -# .dropdown-divider
77
+ -# %a.dropdown-item.dropdown-footer{:href => "#"} See All Messages
78
+ -# / Notifications Dropdown Menu
79
+ -# %li.nav-item.dropdown
80
+ -# %a.nav-link{"data-toggle" => "dropdown", :href => "#"}
81
+ -# %i.far.fa-bell
82
+ -# %span.badge.badge-warning.navbar-badge 15
83
+ -# .dropdown-menu.dropdown-menu-lg.dropdown-menu-right
84
+ -# %span.dropdown-item.dropdown-header 15 Notifications
85
+ -# .dropdown-divider
86
+ -# %a.dropdown-item{:href => "#"}
87
+ -# %i.fas.fa-envelope.mr-2
88
+ -# 4 new messages
89
+ -# %span.float-right.text-muted.text-sm 3 mins
90
+ -# .dropdown-divider
91
+ -# %a.dropdown-item{:href => "#"}
92
+ -# %i.fas.fa-users.mr-2
93
+ -# 8 friend requests
94
+ -# %span.float-right.text-muted.text-sm 12 hours
95
+ -# .dropdown-divider
96
+ -# %a.dropdown-item{:href => "#"}
97
+ -# %i.fas.fa-file.mr-2
98
+ -# 3 new reports
99
+ -# %span.float-right.text-muted.text-sm 2 days
100
+ -# .dropdown-divider
101
+ -# %a.dropdown-item.dropdown-footer{:href => "#"} See All Notifications
102
+ %li.nav-item.dropdown.user-menu
103
+ %a.nav-link.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
104
+ %img.user-image.img-circle.elevation-2{:alt => "User Image", :src => image_path(user_image_path(current_user))}/
105
+
106
+ %span.d-none.d-md-inline= current_user.display_name
107
+ %ul.dropdown-menu.dropdown-menu-lg.dropdown-menu-right
108
+ / User image
109
+ %li.user-header.bg-primary
110
+ %img.img-circle.elevation-2{:alt => "User Image", src: image_path(user_image_path(current_user))}/
111
+ %p= current_user.display_name
112
+ / Menu Footer
113
+ %li.user-footer
114
+ = link_to user_path(current_user), class: 'btn btn-default btn-flat' do
115
+ Profile
116
+ = link_to @context.sign_out_path, method: :delete, class: 'btn btn-default btn-flat float-right' do
117
+ Sign out
118
+ -# %li.nav-item
119
+ -# %a.nav-link{title: 'Full Screen Mode', "data-widget" => "fullscreen", :href => "#", :role => "button"}
120
+ -# %i.fas.fa-expand-arrows-alt
121
+ -# %li.nav-item
122
+ -# %a.nav-link{title: 'Show Sidebar Options', "data-controlsidebar-slide" => "true", "data-widget" => "control-sidebar", :href => "#", :role => "button"}
123
+ -# %i.fas.fa-th-large
@@ -6,14 +6,8 @@
6
6
  %span.brand-text.font-weight-light= sidebar_context_name
7
7
  / Sidebar
8
8
  .sidebar
9
- / Sidebar user panel (optional)
10
- .user-panel.mt-3.pb-3.mb-3.d-flex
11
- .image
12
- %img.img-circle.elevation-2{:alt => "User Image", :src => image_path(user_image_path(nil))}/
13
- .info
14
- = link_to current_user, @context.sign_out_path, method: :delete, class: 'd-block'
15
9
  / SidebarSearch Form
16
- .form-inline
10
+ .form-inline{ style: 'padding-top: 7px' }
17
11
  .input-group{"data-widget" => "sidebar-search"}
18
12
  %input.form-control.form-control-sidebar{"aria-label" => "Search Menu Items", :placeholder => "Search Menu Items", :type => "search"}/
19
13
  .input-group-append
@@ -10,7 +10,6 @@
10
10
  %a.h1{ href: '/' }
11
11
  %b= sidebar_context_name
12
12
  .card-body
13
- %p.login-box-msg Sign in to start your session
14
13
  = render partial: 'layouts/olivander/adminlte/login_flashes'
15
14
  = yield
16
15
  .card-footer
@@ -6,3 +6,4 @@ require 'view_component'
6
6
  require 'simple_form'
7
7
  require 'olivander'
8
8
  require 'devise'
9
+ require 'net/http'
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.1.2.44'.freeze
2
+ VERSION = '0.1.2.46'.freeze
3
3
  end
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.1.2.44
4
+ version: 0.1.2.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-16 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: net-http
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rails
85
99
  requirement: !ruby/object:Gem::Requirement