-
Notifications
You must be signed in to change notification settings - Fork 0
Changes to make it easier to replace or customize admin templates. #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added `admin-` prefix to `admin-theme-default/partials/head.ejs`, `admin-theme-default/partials/nav.ejs`, and `admin-theme-default/partials/scripts.ejs`. Changed references to `render()` instead of `include()`. Changed `AdminController.js` to use generic names for element icons (rather than Font Awesome classes), then map them to class names in `admin-theme-default/partials/admin-nav-menu.ejs`. This leaves the `icon` option dangling, so added a hack to pass it as an `override` property for submenu items, then pick it up in `admin-nav-menu.ejs`.
|
Tested locally and made some changes, do these work for you @davidkellerman ?
|
|
@loppear Glad you caught the template dir registration. I "tested" the changes with my 100mhl code, rather than adding tests to the test suite. I'm torn on the icon changes. Definitely catches the cases I left dangling. I really don't like that Maybe a topic for a weekly/monthly meeting? I feel like our templating is broken; it's ugly to customize or move to new infrastructure. Gut feel is that it's too "low-level," and a layer of abstraction would be useful. |
|
Agree on torn / wrong level of abstraction, just didn't feel like the 'implementation in an ejs partial with a legacy parameter' addressed it either - because of the larger issue you raise |
|
Me neither. I would have thrown it out entirely, but was afraid code somewhere would break. |
Seems like this needs more thought. See Issue #29 for a discussion of potential improvements to the admin module.
Added
admin-prefix toadmin-theme-default/partials/head.ejs,admin-theme-default/partials/nav.ejs, andadmin-theme-default/partials/scripts.ejs. Changed references torender()instead ofinclude().Changed
AdminController.jsto use generic names for element icons (rather than Font Awesome classes), then map them to class names inadmin-theme-default/partials/admin-nav-menu.ejs. This leaves theiconoption dangling, so added a hack to pass it as anoverrideproperty for submenu items, then pick it up inadmin-nav-menu.ejs.