smug 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: f6cf9169f484ccf010490d2f0fbd18a94b3d5333
4
- data.tar.gz: f106c5cac43f485164dfb13fd675f3a114894430
3
+ metadata.gz: 5f5f3be25154060d93776a4b74de4c9848761a44
4
+ data.tar.gz: ebab361ccadfdb1ae8f07216e34397da6c5713ba
5
5
  SHA512:
6
- metadata.gz: ddfe58648fdddf550b010297b9e3bc6743fb370baa94aea1436c3fea1745b98cb845d4cfe54f0bdcd55b964aba12a041197424d861307b83ee7b9539e0fa5e0c
7
- data.tar.gz: 6a53a845a5faee6388fd92e924a95e8afee956aacd2ee0be7d370a458cf23bb797190763918b4eb87b8474f991aafb8e5c8ea7da5556256ec1b38446eef10f0e
6
+ metadata.gz: 344137638ef29ff70a0b2ef90e6d28b956e8c954022c92f96f9b6c5a1ca4fdd0789a06ed26b69bad5d570cbd8051560ceee569beb344db9f28c7b04ff128432d
7
+ data.tar.gz: 784be452d3a8f3fdfa1654742ca0ace95d568c5c5c5960cdddee5a0f8a738dfe293f45f830fcb16e07a4a4cb790de9a0b923a915d3473e142879cc9dd47cdf0f
@@ -0,0 +1,11 @@
1
+ require "active_support/concern"
2
+
3
+ module DashboardInspection
4
+ extend ActiveSupport::Concern
5
+
6
+ class_methods do
7
+ def display_in_nav?
8
+ true
9
+ end
10
+ end
11
+ end
@@ -3,6 +3,7 @@ module Smug
3
3
  class CrudController < BaseController
4
4
  include ModelInspection
5
5
  include RouteInspection
6
+ include DashboardInspection
6
7
 
7
8
  before_action :find_items, only: :index
8
9
  before_action :find_item, only: [:show, :edit, :update, :destroy]
@@ -3,6 +3,6 @@
3
3
  = link_to 'Home', admin_dashboard_path
4
4
  = horizontal do
5
5
  = nav class: 'navbar-right' do
6
- - Smug::Plugin.all.each do |plugin|
6
+ - Smug::Plugin.all.select { |p| p.display_in_nav? }.each do |plugin|
7
7
  = link_to plugin.model_name.human(count: 2),
8
8
  [:admin, plugin.route_key]
@@ -28,5 +28,9 @@ module Smug
28
28
  def route_options
29
29
  controller_class.route_options
30
30
  end
31
+
32
+ def display_in_nav?
33
+ controller_class.display_in_nav?
34
+ end
31
35
  end
32
36
  end
@@ -1,3 +1,3 @@
1
1
  module Smug
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Bolt
@@ -295,6 +295,7 @@ files:
295
295
  - app/assets/stylesheets/smug/admin/application.scss
296
296
  - app/assets/stylesheets/smug/admin/list.scss
297
297
  - app/assets/stylesheets/smug/admin/space.scss
298
+ - app/controllers/concerns/dashboard_inspection.rb
298
299
  - app/controllers/concerns/model_inspection.rb
299
300
  - app/controllers/concerns/route_inspection.rb
300
301
  - app/controllers/smug/admin/base_controller.rb