active_admin_prism 0.1.0
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 +7 -0
- data/CHANGELOG.md +133 -0
- data/INTEGRATION.md +1012 -0
- data/LICENSE.txt +21 -0
- data/README.md +319 -0
- data/app/assets/javascripts/active_admin_prism/prism.js +1 -0
- data/app/assets/stylesheets/active_admin_prism/_variable_overrides.scss +43 -0
- data/app/assets/stylesheets/active_admin_prism/prism.css +1 -0
- data/app/views/active_admin/devise/confirmations/new.html.erb +26 -0
- data/app/views/active_admin/devise/passwords/edit.html.erb +29 -0
- data/app/views/active_admin/devise/passwords/new.html.erb +26 -0
- data/app/views/active_admin/devise/registrations/new.html.erb +32 -0
- data/app/views/active_admin/devise/sessions/new.html.erb +37 -0
- data/app/views/active_admin/devise/shared/_brand.html.erb +34 -0
- data/app/views/active_admin/devise/unlocks/new.html.erb +25 -0
- data/js-src/prism.js +270 -0
- data/lib/active_admin/views/filters_sidebar.rb +69 -0
- data/lib/active_admin/views/flash_messages.rb +77 -0
- data/lib/active_admin/views/index_table_actions.rb +46 -0
- data/lib/active_admin/views/prism_sidebar.rb +212 -0
- data/lib/active_admin_prism/configuration.rb +180 -0
- data/lib/active_admin_prism/engine.rb +18 -0
- data/lib/active_admin_prism/version.rb +5 -0
- data/lib/active_admin_prism.rb +33 -0
- data/lib/formtastic/inputs/prism_toggle_input.rb +31 -0
- data/lib/generators/active_admin_prism/error_pages/error_pages_generator.rb +49 -0
- data/lib/generators/active_admin_prism/error_pages/templates/404.html +164 -0
- data/lib/generators/active_admin_prism/error_pages/templates/500.html +173 -0
- data/lib/generators/active_admin_prism/install/install_generator.rb +69 -0
- data/lib/prism_icons.rb +82 -0
- data/lib/prism_login_helper.rb +31 -0
- data/lib/prism_toggle_tag.rb +35 -0
- data/scss-src/_base.scss +281 -0
- data/scss-src/_buttons.scss +134 -0
- data/scss-src/_forms.scss +272 -0
- data/scss-src/_icons.scss +27 -0
- data/scss-src/_login.scss +306 -0
- data/scss-src/_panels.scss +249 -0
- data/scss-src/_sidebar.scss +479 -0
- data/scss-src/_tables.scss +142 -0
- data/scss-src/_variables.scss +101 -0
- data/scss-src/prism.scss +15 -0
- metadata +157 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 903311b452f71d21629d8bb53cd03722b1789a0fbab84f47920fd9347f03d98c
|
|
4
|
+
data.tar.gz: 81382766724dea1283fa50481b421ee8394a2f1b310c3dcfa30ed9af6ffeede9
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 58344d5b63d18fa7e24b0a3a8f3d4285c382a25c3b191016f9d4c02d640dc6a434a92822313056b6fe7eea2757c4358347eb3cc5f8b10e1dffdcec205434837b
|
|
7
|
+
data.tar.gz: 69bc5e4f99226abf52f76ada12054cc6a1e8816bbda267b33aa537fdf1bebe99017005e1a1b03a56688bcf2978372480eb907e77ee55193ca47535e40b8caa5c
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- **The shipped `prism.css`/`prism.js` are now minified.** `bin/build-css`
|
|
6
|
+
compiles with `style: :compressed` instead of `:expanded`, and a new
|
|
7
|
+
`bin/build-js` (backed by the `terser` dev dependency) minifies the real
|
|
8
|
+
source — moved to `js-src/prism.js`, mirroring `scss-src/`'s role —
|
|
9
|
+
into the compiled `app/assets/javascripts/active_admin_prism/prism.js`.
|
|
10
|
+
Nothing changes for hosts using Sprockets (which already re-minifies on
|
|
11
|
+
its own `assets:precompile`), but this is a real reduction for Propshaft
|
|
12
|
+
hosts, which has no built-in minification step at all. All the
|
|
13
|
+
documentation comments explaining specificity fixes etc. still live in
|
|
14
|
+
`scss-src`/`js-src`, not the compiled output — never hand-edit the
|
|
15
|
+
latter.
|
|
16
|
+
- A "Languages" dropdown renders near the top of the sidebar (below the
|
|
17
|
+
brand, above the Pages nav) — no `admin.build_menu :utility_navigation`
|
|
18
|
+
code needed. Ships with 3 languages by default
|
|
19
|
+
(English/Español/Français); `config.languages` is a
|
|
20
|
+
`[{ label:, locale:, url: }, ...]` array you can replace with any list,
|
|
21
|
+
and `config.language_switcher = false` (or an empty `languages` array)
|
|
22
|
+
removes it entirely. Each option links to the current page with
|
|
23
|
+
`?locale=xx` appended (`url_for(locale: ...)`) by default; give an entry
|
|
24
|
+
its own `url:` (`String`/`Proc`/`Symbol`, evaluated the same way an
|
|
25
|
+
`ActiveAdmin::MenuItem`'s own `url:` proc is) to hit a remote/dedicated
|
|
26
|
+
locale-switching endpoint instead. Actually honoring the `locale` param
|
|
27
|
+
is still your own app's responsibility, the same as with a hand-rolled
|
|
28
|
+
utility-nav menu.
|
|
29
|
+
- **Added a real RSpec test suite** (`spec/`, with a minimal `spec/dummy`
|
|
30
|
+
Rails+ActiveAdmin+Devise app to exercise it against): configuration
|
|
31
|
+
defaults/`configure`/`reset_configuration!`, `.enable!`'s header
|
|
32
|
+
registration, the sidebar, table-action icons, the collapsible Filters
|
|
33
|
+
panel, flash messages, every Devise auth page's brand treatment
|
|
34
|
+
(including the `config.login_page = false` fallback and custom
|
|
35
|
+
`login_logo`/`login_app_name`/`login_tagline`), the icon/toggle-tag
|
|
36
|
+
helpers, and both generators (`install`, `error_pages`) — 64 examples.
|
|
37
|
+
Run with `bundle install && bundle exec rspec` (or `rake`).
|
|
38
|
+
- **Fixed: `f.input :x, as: :prism_toggle`'s wrapping `<label>` rendered a
|
|
39
|
+
stray leading space in its `class` attribute** (`class=" prism-toggle"`)
|
|
40
|
+
— found by the new test suite. `input_html_options`/`label_html_options`
|
|
41
|
+
in `lib/formtastic/inputs/prism_toggle_input.rb` were filtering `nil`
|
|
42
|
+
class values but not blank/empty ones before joining.
|
|
43
|
+
- **`config.login_page`'s card/brand-mark treatment now covers every
|
|
44
|
+
Devise auth page**, not just sign-in: sign up, forgot/reset password,
|
|
45
|
+
resend confirmation, and resend unlock all render through the same
|
|
46
|
+
shared `devise/shared/_brand` partial, so they redesign (or degrade back
|
|
47
|
+
to stock ActiveAdmin) together. Each page shows its own action's
|
|
48
|
+
translated title as the subtitle instead of `login_tagline` (which stays
|
|
49
|
+
sign-in's own dedicated line). The submit button on every one of these
|
|
50
|
+
pages is now full-width instead of left-aligned, and ActiveAdmin's
|
|
51
|
+
shared error-messages partial (`#error_explanation`, rendered by every
|
|
52
|
+
page but sign-in) is reskinned to match the flash banners.
|
|
53
|
+
- **Fixed: flash messages losing their reskin to ActiveAdmin's own
|
|
54
|
+
`body.logged_in .flash`/`body.logged_out .flash` rules**, which carry
|
|
55
|
+
higher CSS specificity than a flat `.flash` selector regardless of load
|
|
56
|
+
order. Most visible on the sign-in page (a plain bold-text flash with no
|
|
57
|
+
background/border/radius instead of Prism's colored banner), but the same
|
|
58
|
+
rule affected the main app too wherever a property collided. Fixed by
|
|
59
|
+
matching AA's own specificity via `body.active_admin .flash` and relying
|
|
60
|
+
on `prism.css` loading after `active_admin.css` to win the tie.
|
|
61
|
+
- **Fixed: sign-in page rendered a redundant "card inside a card"** —
|
|
62
|
+
`fieldset.inputs`'s own border/border-radius (meant for fieldsets sitting
|
|
63
|
+
directly on the gray page background elsewhere in the app) was never
|
|
64
|
+
reset by ActiveAdmin's login-page styles, leaving a second bordered box
|
|
65
|
+
around the email/password fields inside the already-bordered login card.
|
|
66
|
+
Sign-up/forgot-password/etc links are now rendered as a row of pill
|
|
67
|
+
chips instead of a divider line above plain underlined text.
|
|
68
|
+
- **Renamed the gem** from `activeadmin_prism_theme` to `active_admin_prism`
|
|
69
|
+
(Ruby constant `ActiveAdminPrismTheme` → `ActiveAdminPrism`). Update your
|
|
70
|
+
`Gemfile` (`gem "active_admin_prism"`), any
|
|
71
|
+
`ActiveAdminPrism.configure`/`.enable!` calls in
|
|
72
|
+
`config/initializers/active_admin.rb`, and the
|
|
73
|
+
`@import "active_admin_prism/variable_overrides";` line in
|
|
74
|
+
`active_admin.scss` (was `active_admin_prism_theme/variable_overrides`).
|
|
75
|
+
The generator commands are now `rails g active_admin_prism:install` and
|
|
76
|
+
`rails g active_admin_prism:error_pages`.
|
|
77
|
+
- `ActiveAdminPrism::Configuration` — per-feature toggles (`sidebar`,
|
|
78
|
+
`colorize_action_icons`, `styled_confirms`, `collapsible_filters`,
|
|
79
|
+
`sidebar_footer`, `flash_dismissible`, `flash_auto_dismiss`,
|
|
80
|
+
`flash_auto_dismiss_seconds`, `flash_transition_ms`, `login_page`,
|
|
81
|
+
`login_logo`, `login_app_name`, `login_tagline`) via
|
|
82
|
+
`ActiveAdminPrism.configure { |config| ... }`, letting a host disable
|
|
83
|
+
any single piece of the theme, or all of them, without uninstalling the
|
|
84
|
+
gem.
|
|
85
|
+
- Sign-in page (Devise `sessions#new`) gets a centered card, animated brand
|
|
86
|
+
mark, and tidied sign-up/forgot-password links row instead of
|
|
87
|
+
ActiveAdmin's default gradient header box. The mark, app name, and
|
|
88
|
+
tagline are all configurable (`login_logo`/`login_app_name`/
|
|
89
|
+
`login_tagline`, same `String`/`Proc`/`Symbol` convention ActiveAdmin
|
|
90
|
+
itself uses for `config.footer`); `login_page = false` reverts to
|
|
91
|
+
ActiveAdmin's original plain login box.
|
|
92
|
+
- `INTEGRATION.md` — new "Markup & CSS class reference" section documenting
|
|
93
|
+
every `prism-*` class/id, the DOM structure it appears in, and the full
|
|
94
|
+
`$prism-*` Sass variable/design-token table.
|
|
95
|
+
- `rails g active_admin_prism:error_pages` — copies Prism-styled
|
|
96
|
+
`public/404.html`/`public/500.html` into the host app (static files, so
|
|
97
|
+
this is a separate, explicit generator rather than something `install` or
|
|
98
|
+
`ActiveAdminPrism::Configuration` can drive automatically).
|
|
99
|
+
- `prism_toggle_tag(value)` helper — a read-only toggle-switch visual for
|
|
100
|
+
boolean index columns / show `attributes_table` rows.
|
|
101
|
+
- Row-level View/Edit/Delete index links render as color-coded icon buttons
|
|
102
|
+
by default (blue eye, purple pencil, red trash).
|
|
103
|
+
- `data-confirm` links (not just Batch Actions) now route through
|
|
104
|
+
ActiveAdmin's own styled jQuery UI dialog instead of the native browser
|
|
105
|
+
`confirm()`.
|
|
106
|
+
- The "Filters" sidebar panel collapses to a real inline-icon-only button by
|
|
107
|
+
default, expanding to the full form on click (keyboard-accessible); the
|
|
108
|
+
index table/content area reflows to reclaim the freed-up width while
|
|
109
|
+
collapsed.
|
|
110
|
+
- Flash messages get a dismiss button, auto-hide after a configurable
|
|
111
|
+
delay, and a smoother, configurable fade/slide transition.
|
|
112
|
+
- "Powered by Active Admin" moved from the page footer into the sidebar,
|
|
113
|
+
pinned below the account/logout area regardless of nav length. Toggle
|
|
114
|
+
with `config.sidebar_footer` — off leaves it in ActiveAdmin's original
|
|
115
|
+
page footer instead.
|
|
116
|
+
- `variable_overrides.scss` — Prism's values for ActiveAdmin's own default
|
|
117
|
+
Sass palette, auto-wired by the install generator into a host's
|
|
118
|
+
`active_admin.scss` (before `active_admin/mixins`), so components AA
|
|
119
|
+
renders itself (dialogs, dropdown menus) inherit Prism's colors too.
|
|
120
|
+
- `INTEGRATION.md` — full integration guide (config reference, feature
|
|
121
|
+
guide, switching/disabling the theme, troubleshooting).
|
|
122
|
+
- Several CSS specificity fixes where ActiveAdmin's own ID-scoped selectors
|
|
123
|
+
and `:not(.disabled)`-wrapped hover/active states could beat a
|
|
124
|
+
same-or-lower-specificity theme override regardless of load order.
|
|
125
|
+
|
|
126
|
+
## 0.1.0
|
|
127
|
+
|
|
128
|
+
- Initial release: collapsible left sidebar (drop-in `header` replacement),
|
|
129
|
+
card-style panels/tables, reskinned Formtastic forms, opt-in
|
|
130
|
+
`as: :prism_toggle` switch input, curated inline SVG icon set.
|
|
131
|
+
- Zero-config asset delivery: precompiled CSS/JS auto-registered by the
|
|
132
|
+
engine, no Sass compiler or manifest edits required in the host app.
|
|
133
|
+
- `rails g active_admin_prism:install` enables the theme with one line.
|