testimonials 0.7.3 → 0.7.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5bf8a4df33767c43e6a84f87a635254b995a1754f6b01e0e80103fcf1234ae4
4
- data.tar.gz: 89c4e0dc0c5a159f5c138c9034d8a2a4cd3f970f16fffda26b305fa4a134ac57
3
+ metadata.gz: 34e1f1ffb9b1e7217fed8e7400d9fdc4daca3a55cbbd9de83cc0cf2673d56d34
4
+ data.tar.gz: 7a10eae3c313e84bcee8d214a27c6f7ee869fd72e2ad2d43fbf88fb5538278af
5
5
  SHA512:
6
- metadata.gz: d3feb8fe03281e68cd2c380c7273e4ec3d2c273b04bd69af55f88ded834b9501ccebfa5ca21037daf981cc245b057d041b90b80213b6104274b746795d40693d
7
- data.tar.gz: 61ba044530d515dabdc3b9c445bc13b21067ec199874fdbdf74eb4c0299d09feeb029995193de26186a9008881cb7e089265056706f8d6aba60cd42fb47f3358
6
+ metadata.gz: 815b0b61911a5003afa4998cef859063d050a1695b110410070cad97d6f630ed223632ec35290a1c0996ee357860ce9967edfd328c009f3255cba05cd5afb009
7
+ data.tar.gz: c9abcab68c1a3a1e38d67a90c4cc2a01b98627b0df7f4be7405bee09fe4b66b99e0aaefe18ee6b667ae7709b0e88e6396980823512b504309438b81e03033c3d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.4
4
+
5
+ - Added `config.admin_layout`, letting host apps render the testimonial and NPS
6
+ dashboards inside their own admin layout while keeping the standalone gem
7
+ layout as the default.
8
+
3
9
  ## 0.7.3
4
10
 
5
11
  - Redesigned the testimonial and NPS admin dashboards into two-column review
@@ -6,6 +6,10 @@ module Testimonials
6
6
 
7
7
  private
8
8
 
9
+ def testimonials_admin_layout
10
+ Testimonials.config.admin_layout
11
+ end
12
+
9
13
  def current_author
10
14
  return @current_author if defined?(@current_author)
11
15
 
@@ -5,7 +5,7 @@ module Testimonials
5
5
  class NpsResponsesController < ApplicationController
6
6
  PER_PAGE = 50
7
7
 
8
- layout 'testimonials/application'
8
+ layout :testimonials_admin_layout
9
9
 
10
10
  before_action :require_admin
11
11
  before_action :set_response, only: :show
@@ -4,7 +4,7 @@ module Testimonials
4
4
  class TestimonialsController < ApplicationController
5
5
  PER_PAGE = 50
6
6
 
7
- layout 'testimonials/application', except: :create
7
+ layout :testimonials_admin_layout, except: :create
8
8
 
9
9
  # create is the public widget endpoint; everything else is the dashboard.
10
10
  before_action :require_enabled, only: :create
@@ -12,6 +12,10 @@ Testimonials.configure do |config|
12
12
  # Who can triage testimonials at the mount path. Defaults to development
13
13
  # only — override before deploying.
14
14
  # config.authorize_admin = ->(request) { request.env["warden"]&.user&.admin? }
15
+ #
16
+ # Render the dashboard inside your app's admin layout. Default: the gem's
17
+ # standalone dashboard layout.
18
+ # config.admin_layout = "admin/application"
15
19
 
16
20
  # Attribute submissions to a user (optional). Return an object responding
17
21
  # to #id, or nil. Receives the request.
@@ -17,6 +17,10 @@ module Testimonials
17
17
  # only — override it before deploying, e.g. with an admin check.
18
18
  attr_accessor :authorize_admin
19
19
 
20
+ # Layout used by the built-in dashboard. Override this to render
21
+ # Testimonials inside your app's admin shell, e.g. "admin/application".
22
+ attr_accessor :admin_layout
23
+
20
24
  # Resolve the current user for attribution (optional). Return an object
21
25
  # responding to #id, or nil. Receives the request.
22
26
  attr_accessor :current_user
@@ -104,6 +108,7 @@ module Testimonials
104
108
  @app_name = nil
105
109
  @enabled = ->(_request) { true }
106
110
  @authorize_admin = ->(_request) { Rails.env.development? }
111
+ @admin_layout = 'testimonials/application'
107
112
  @current_user = ->(_request) {}
108
113
  @tenant = ->(_request) {}
109
114
  @user_display = lambda { |user|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Testimonials
4
- VERSION = '0.7.3'
4
+ VERSION = '0.7.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testimonials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov