five-two-nw-olivander 0.1.2.56 → 0.1.2.57

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: c375be3fe2ce5dbfceaa1e12970b854f5cf2cd5736235ce2c8dba116e3a08bc6
4
- data.tar.gz: 4a28b8b8495f6509047fed0ff810b2f773d7c867101413d319f81720a9fd96cc
3
+ metadata.gz: 69a61a8a8ef5070daf0d67aedfcea7ec0785f08795e0dee8e7db90b205a89478
4
+ data.tar.gz: aaadfdc3d026377f28b6fefb83d0c939483ea46a0bdd058dbde5d6da42210f20
5
5
  SHA512:
6
- metadata.gz: 3efdab042d7beb478fb17125e1dfcd029baa6554ced91ae946486303d4966ae398b42d4c89b3923c7cb5da60794b20c863f595e096f2b7ab1edd255bd0cdcc4c
7
- data.tar.gz: 20b769eddd5030e3ba3f444ab67266d28546598b85aceff5023ddfc010e2dac50f5b31054fcf8c1d2a0601eb5dfb70358b5cc5b1606dec713ad78987a78336cd
6
+ metadata.gz: 066232ebd7a3eab92f61cb7825f8eaec6f077b5e2a966986d79b040f72eabc19864606c4802f8263e5449220a39172b1a119eaa0bb67d742234019118415470e
7
+ data.tar.gz: 2b84b2ae10634df082052ea8a2af783f8c7f763b9fcc37d437e192b05d11140a1626f146fde24066762b6904484c7b71ef8697f63280837c6d9610e9d5688861
@@ -0,0 +1,64 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ // Connects to data-controller="datatable-expandable-chart"
4
+ export default class extends Controller {
5
+ connect() {
6
+ var self = this,
7
+ ele = self.element
8
+ $(ele).on('maximized.lte.cardwidget', function(evt) {
9
+ var attempts = 0,
10
+ maximized = false,
11
+ initialHeight = ele.offsetHeight,
12
+ lastHeight = initialHeight
13
+
14
+ self.toggleChartDiv(ele)
15
+ setTimeout(function tryAgain() {
16
+ attempts += 1
17
+ maximized = lastHeight > initialHeight && ele.offsetHeight == lastHeight
18
+ if (attempts < 10 && !maximized) {
19
+ lastHeight = ele.offsetHeight
20
+ setTimeout(tryAgain, 50)
21
+ } else {
22
+ self.fireResize(ele)
23
+ }
24
+ }, 50)
25
+ })
26
+
27
+ $(ele).on('minimized.lte.cardwidget', function(evt) {
28
+ var attempts = 0,
29
+ minimized = false,
30
+ initialHeight = ele.offsetHeight,
31
+ lastHeight = initialHeight
32
+
33
+ self.toggleChartDiv(ele)
34
+ setTimeout(function tryAgain() {
35
+ attempts += 1
36
+ minimized = lastHeight < initialHeight && ele.offsetHeight == lastHeight
37
+ if (attempts < 10 && !minimized) {
38
+ lastHeight = ele.offsetHeight
39
+ setTimeout(tryAgain, 50)
40
+ } else {
41
+ self.fireResize(ele)
42
+ }
43
+ }, 50)
44
+ })
45
+ }
46
+
47
+ fireResize(ele) {
48
+ this.toggleChartDiv(ele)
49
+ var evt = document.createEvent('Event')
50
+ evt.initEvent('resize', true, true)
51
+ window.dispatchEvent(evt)
52
+ }
53
+
54
+ toggleChartDiv(ele) {
55
+ var cardBody = ele.querySelector('.card-body'),
56
+ chartDiv = cardBody.firstElementChild
57
+
58
+ if (chartDiv.style.display == 'none') {
59
+ chartDiv.style.display = 'block'
60
+ } else {
61
+ chartDiv.style.display = 'none'
62
+ }
63
+ }
64
+ }
@@ -34,7 +34,7 @@
34
34
  - when :file
35
35
  - if val.present?
36
36
  - if val.content_type.include?('image')
37
- %img{ src: val.expiring_url }
37
+ %img.user-image{ src: val.expiring_url, style: 'max-height: 50px; max-width: 50px' }
38
38
  - else
39
39
  = link_to val, val.expiring_url
40
40
  - else
@@ -80,6 +80,10 @@ module Olivander
80
80
  icon_class = val ? 'fa-check text-success' : 'fa-times text-danger'
81
81
  "<div class='text-center'><i class='fa fa-icon #{icon_class}'></div>".html_safe
82
82
  end
83
+ elsif sym == 'avatar'
84
+ col sym, visible: visible, label: label, search: false, sort: false do |c|
85
+ "<div class='image'><img style='max-height: 25px; max-width: 25px' class='img-circle elevation-2' src='#{c.send(sym).expiring_url}'></div>".html_safe
86
+ end
83
87
  else
84
88
  col sym, visible: visible, label: label
85
89
  end
@@ -0,0 +1,9 @@
1
+ .btn-group.buttons-bulk-actions
2
+ %button.btn.btn-outline-primary.btn-sm.dropdown-toggle{'type': 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false, 'disabled': 'disabled'}
3
+ = t('effective_datatables.bulk_actions')
4
+ .dropdown-menu
5
+ - if datatable._bulk_actions.present?
6
+ = datatable._bulk_actions.join.html_safe
7
+ - else
8
+ %a.dropdown-item{href: '#'}
9
+ = t('effective_datatables.no_bulk_actions')
@@ -0,0 +1,14 @@
1
+ - if datatable._bulk_actions.present?
2
+ = render('/effective/datatables/bulk_actions_dropdown', datatable: datatable)
3
+
4
+ - if datatable.searchable?
5
+ = link_to '#', class: 'btn btn-outline-primary btn-sm buttons-reset-search' do
6
+ %span= t('effective_datatables.reset')
7
+
8
+ - if datatable.reorder? && EffectiveDatatables.authorized?(self, :update, datatable.collection_class)
9
+ = link_to '#', class: 'btn btn-primary btn-sm buttons-reorder' do
10
+ %span= t('effective_datatables.reorder')
11
+
12
+ - if datatable.downloadable?
13
+ = link_to 'download.csv', class: 'btn btn-primary btn-sm buttons-download', 'aria-controls': datatable.to_param do
14
+ %span= t('effective_datatables.download')
@@ -3,7 +3,7 @@
3
3
  / Left navbar links
4
4
  %ul.navbar-nav
5
5
  %li.nav-item
6
- %a.nav-link{"data-widget" => "pushmenu", :href => "#", :role => "button"}
6
+ %a.nav-link{"data-widget" => "pushmenu", :href => "#", :role => "button", 'data-enable-remember': "true"}
7
7
  %i.fas.fa-bars
8
8
  - @context.visible_modules.each do |menu_item|
9
9
  %li.nav-item.d-none.d-sm-inline-block
@@ -115,9 +115,9 @@
115
115
  Profile
116
116
  = link_to @context.sign_out_path, method: :delete, class: 'btn btn-default btn-flat float-right' do
117
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
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
121
  -# %li.nav-item
122
122
  -# %a.nav-link{title: 'Show Sidebar Options', "data-controlsidebar-slide" => "true", "data-widget" => "control-sidebar", :href => "#", :role => "button"}
123
123
  -# %i.fas.fa-th-large
@@ -3,7 +3,10 @@ module Olivander
3
3
  isolate_namespace Olivander
4
4
 
5
5
  initializer "olivander.assets.precompile" do |app|
6
- app.config.assets.precompile += %w[adminlte.js datatable_index_charts_controller.js adminlte.css avatar0.png avatar1.png avatar2.png avatar3.png avatar4.png]
6
+ app.config.assets.precompile += %w[
7
+ adminlte.js datatable_index_charts_controller.js
8
+ datatable_expandable_chart_controller.js
9
+ adminlte.css avatar0.png avatar1.png avatar2.png avatar3.png avatar4.png]
7
10
  end
8
11
 
9
12
  initializer "olivander.action_controller" do |app|
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.1.2.56'.freeze
2
+ VERSION = '0.1.2.57'.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.56
4
+ version: 0.1.2.57
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-30 00:00:00.000000000 Z
11
+ date: 2024-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick
@@ -204,6 +204,7 @@ files:
204
204
  - app/assets/javascripts/adminlte/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css
205
205
  - app/assets/javascripts/adminlte/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js
206
206
  - app/assets/javascripts/adminlte/select2_defaults.coffee
207
+ - app/assets/javascripts/controllers/datatable_expandable_chart_controller.js
207
208
  - app/assets/javascripts/controllers/datatable_index_charts_controller.js
208
209
  - app/assets/stylesheets/adminlte.css
209
210
  - app/assets/stylesheets/fa-fix.scss
@@ -239,6 +240,8 @@ files:
239
240
  - app/views/application/index.json.jbuilder
240
241
  - app/views/application/new.html.haml
241
242
  - app/views/application/show.html.haml
243
+ - app/views/effective/datatables/_bulk_actions_dropdown.html.haml
244
+ - app/views/effective/datatables/_buttons.html.haml
242
245
  - app/views/effective/resource/_actions_dropleft.html.haml
243
246
  - app/views/layouts/olivander/adminlte/_content.html.haml
244
247
  - app/views/layouts/olivander/adminlte/_content_kanban.html.haml