five-two-nw-olivander 0.1.2.36 → 0.1.2.38

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: 3e55a54429f0d10d6f23e477b5615cb32f1c2cbbccbd6a622b73f2cb07b70131
4
- data.tar.gz: 04d1f0ee790725256e7a65b93c20baf0c2199fe7c3dbfbc5b7f576f6decf93bb
3
+ metadata.gz: b894aa3a01736ad773b5a52f08c0acdaab74520595221d899d9ce20ef5b34a1b
4
+ data.tar.gz: 5bbc393744805eea7ed61a69008a6364e18c4bffa5c2eaa6b81186d1b05c15de
5
5
  SHA512:
6
- metadata.gz: 3a9555b4ebbfdbd0d55df3c3a0ec03b7e48ccd0be00fd1c25700511ae2bc2085451d3d0d023bb340cd6b1a5a0e8131b3c58311dcd33c6befa2c195ead6cbcc34
7
- data.tar.gz: dfb311cdc4987aaf562859af28e0d81d2beb944fe75fdfad53fede0045f42ffd925e6ebff562e72b0a4e9c57dff8e93068af88349be2923a14c430346cef7448
6
+ metadata.gz: aac18d221352178ceba27048d7066bbdfcc2830302dab609673470f55bbd971dbdc7dd7674e2458c2aab933d6d52260bdbcf903b4483bfc4bfb0fa7ac64d045b
7
+ data.tar.gz: 7f9dae501b17eb02c2ab4362396b7f58221046440221191a821f12ad680b23b6b6cf7bce3de4e2ef2c604f66593fe1f04440100967903b95a1ed966c39621f5d
@@ -0,0 +1,25 @@
1
+ .post{ id: @id }
2
+ - note = @note
3
+ .user-block
4
+ %img.img-circle.img-bordered-sm{ alt: "Avatar", src: image_path(user_image_path(@avatar_url)), title: @poster }
5
+ - if tools?
6
+ .float-right
7
+ = tools
8
+  
9
+ %span.username
10
+ - if @poster.is_a?(String)
11
+ = @poster
12
+ - else
13
+ = link_to @poster, @poster
14
+ %span.description
15
+ %i.fas.fa-clock
16
+ posted #{@posted.to_fs}
17
+ - if @updated.present? && @updated != @posted
18
+ , updated #{time_ago_in_words(@updated)} ago
19
+ %p
20
+ - if content?
21
+ = content
22
+ - elsif @text
23
+ = simple_format(@text)
24
+ - else
25
+ %i No text entered
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Olivander
4
+ module Components
5
+ class PostComponent < ViewComponent::Base
6
+ renders_one :tools
7
+ delegate :user_image_path, to: :helpers
8
+
9
+ def initialize(poster, posted, updated, text: nil, id: nil, avatar_url: nil)
10
+ super
11
+ @poster = poster
12
+ @posted = posted
13
+ @updated = updated
14
+ @text = text
15
+ @id = id
16
+ @avatar_url = avatar_url
17
+ end
18
+ end
19
+ end
20
+ end
@@ -21,6 +21,7 @@ module Olivander
21
21
  class TableComponent < ViewComponent::Base
22
22
  with_collection_parameter :item
23
23
  delegate :can?, :cannot?, to: :helpers
24
+ delegate :user_image_path, to: :helpers
24
25
 
25
26
  def initialize(item:, item_iteration:, builder:, headers:)
26
27
  super
@@ -15,7 +15,7 @@ module Olivander
15
15
  end
16
16
  end
17
17
 
18
- def self.auto_datatable(klazz, collection: nil, link_path: nil, only: [], except: [], hide: [], show: [], order_by: [])
18
+ def self.auto_datatable(klazz, collection: nil, link_path: nil, only: [], except: [], hide: [], show: [], order_by: [], scopes: [])
19
19
  Rails.logger.debug "initializing datatable for #{klazz}"
20
20
 
21
21
  klazz_attributes = klazz.new.attributes.collect{ |x| x[0] }
@@ -27,6 +27,12 @@ module Olivander
27
27
 
28
28
  default_hidden = %w[id created updated created_at updated_at deleted_at current_user current_action]
29
29
 
30
+ filters do
31
+ scopes.each do |s|
32
+ scope s
33
+ end
34
+ end
35
+
30
36
  collection do
31
37
  dc = collection.nil? ? klazz.all : collection
32
38
 
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.1.2.36'.freeze
2
+ VERSION = '0.1.2.38'.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.36
4
+ version: 0.1.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-15 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick
@@ -186,6 +186,8 @@ files:
186
186
  - app/components/olivander/components/menu_item_component.rb
187
187
  - app/components/olivander/components/portlet_component.html.haml
188
188
  - app/components/olivander/components/portlet_component.rb
189
+ - app/components/olivander/components/post_component.html.haml
190
+ - app/components/olivander/components/post_component.rb
189
191
  - app/components/olivander/components/resource_form_component.html.haml
190
192
  - app/components/olivander/components/resource_form_component.rb
191
193
  - app/components/olivander/components/resource_show_component.html.haml