fuji_admin 0.1.1 → 0.1.2
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 +4 -4
- data/lib/fuji_admin/active_admin_patch.rb +11 -15
- data/lib/fuji_admin/version.rb +1 -1
- data/lib/fuji_admin.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ced4ed49bdd67f0df172275fee1324778c378ae9e0ee99d3977e136ce819596
|
|
4
|
+
data.tar.gz: feb7791cec556d78eede014b8f9e3e531bfd31512cdb6fce9f60277e28a6dd20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d233f8162d6fbd660000f429aaf480756385da78f4e58aa1ed73680c080afec0e117b1f143cfe6099651b03a009dc1af9cba699620ee8efa55255803dee339fd
|
|
7
|
+
data.tar.gz: 64b65816c0c78554be7afdc1c716133f49a98dc4c42dd37d367063f14f6e335b31ef7565294eb42f14d4e895fc01c0d7a7eda25439f2ab192461c007334ca9ef
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
module FujiAdmin
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
meta(name: "fuji-default-palette", content: FujiAdmin.config.default_palette.to_s)
|
|
14
|
-
end
|
|
2
|
+
# Surfaces FujiAdmin.config to the browser by registering entries in each
|
|
3
|
+
# ActiveAdmin namespace's built-in `meta_tags` hash. AA renders those
|
|
4
|
+
# entries as <meta> tags inside <head> (lib/active_admin/views/pages/base.rb),
|
|
5
|
+
# so the palette JavaScript can read them on page load without any
|
|
6
|
+
# monkey-patching of arbre's view builders.
|
|
7
|
+
def self.install_meta_tags!
|
|
8
|
+
return unless defined?(::ActiveAdmin)
|
|
9
|
+
|
|
10
|
+
ActiveAdmin.application.namespaces.each do |namespace|
|
|
11
|
+
namespace.meta_tags["fuji-palette-picker"] = config.palette_picker.to_s
|
|
12
|
+
namespace.meta_tags["fuji-default-palette"] = config.default_palette.to_s
|
|
15
13
|
end
|
|
16
14
|
end
|
|
17
15
|
end
|
|
18
|
-
|
|
19
|
-
ActiveAdmin::Views::Pages::Base.prepend(FujiAdmin::ActiveAdminPatch) if defined?(::ActiveAdmin)
|
data/lib/fuji_admin/version.rb
CHANGED
data/lib/fuji_admin.rb
CHANGED
|
@@ -16,8 +16,12 @@ module FujiAdmin
|
|
|
16
16
|
|
|
17
17
|
module Rails
|
|
18
18
|
class Engine < ::Rails::Engine
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# Register meta tags after all initializers have run (so both
|
|
20
|
+
# FujiAdmin.configure and ActiveAdmin.setup have populated their state)
|
|
21
|
+
# and AA's namespaces are available to iterate.
|
|
22
|
+
config.after_initialize do
|
|
23
|
+
require "fuji_admin/active_admin_patch"
|
|
24
|
+
FujiAdmin.install_meta_tags!
|
|
21
25
|
end
|
|
22
26
|
end
|
|
23
27
|
end
|