meteor-admin icon indicating copy to clipboard operation
meteor-admin copied to clipboard

Admin style interferes with app style

Open create opened this issue 9 years ago • 13 comments

In other words, by installing bootstrap and font:awesome the appearance of the normal application is altered. Ideally, meteor-admin should be standalone with no side effects.

create avatar Aug 14 '15 03:08 create

We used to wrap adminlte style in .admin-layout but it defines some properties on html and body so it wasn't working well. In the new version we are injecting css file on admin routes only.

mpowaga avatar Aug 17 '15 22:08 mpowaga

I'm on the latest version and the CSS remains when I leave the admin page.

JaylanT avatar Aug 18 '15 19:08 JaylanT

Same here, bootstrap CSS is included on every route.

ekuiter avatar Sep 10 '15 14:09 ekuiter

Same here.

mcecot avatar Sep 23 '15 09:09 mcecot

Yes... It's ugly.

Router.configure({
    waitOn: function () {
         if(Router.current().route.getName().indexOf('adminDashboard')==-1)
                $('head').find('link[type="text/css"]:not(.__meteor-css__)').remove();
    }
});

deliciousmonster avatar Sep 27 '15 03:09 deliciousmonster

as an idea: For larger projects it might be better to split your application into two apps: a frontend-app and an admin-app. This would also save some bandwidth.

You could share code with packages that could contain things like Schema-definitions, etc.

The two apps would either communicate via ddp or just access the same database.

macrozone avatar Sep 28 '15 14:09 macrozone

I ended up doing exactly that (frontend and backend as separate apps, Atmosphere package for shared collections and publications). In general, your approach works fine - the only problem I found is that this doesn't work with meteor deploy, because every meteor.com-App always gets its own database. You need to have control over the MONGO_URL, so you have to deploy to Modulus, Heroku, or whatever.

ekuiter avatar Sep 28 '15 16:09 ekuiter

you could serve the whole content from the frontend-app, which manages its collections and have the admin-app connect via ddp to the running frontend app. You could even access and modify the public instance of the frontend-app from your local running admin-app (or vis-verca, but i think it is better that way performance-wise). :+1:

macrozone avatar Sep 28 '15 22:09 macrozone

Can you please fix this issue?

rudza avatar Dec 15 '15 16:12 rudza

I have the same issue. I've tried approaches that instead of removing it, add it when you're logged in as admin and using an admin route. Unfortunately the packages use bootstrap as a dependency so eliminating it from the project and manually adding it isn't very reliable.

Running two apps sounds really messy when it comes to local development too. This is a pretty big flaw, and is causing all sorts of issues on my app unfortunately. Anyone have any ideas on how to contribute in a way that would update this?

jeffyamada avatar Feb 14 '16 23:02 jeffyamada

+1

abuddenb avatar Apr 12 '16 20:04 abuddenb

One solution I've seen in another package is to put a link in the HTML templates, which retrieves Bootstrap from a CDN, rather than using the package. This way, you get easy, explicit control over the pages on which Bootstrap is imported. Devs, would that be a workable solution for you?

neil-s avatar Apr 12 '16 22:04 neil-s

Please implement.

levino avatar May 25 '16 15:05 levino