nicolas-besnard / adminlte2-rails

MIT License
104 stars 57 forks source link

remove plain bootstrap, bootstrap-saas gem added as dependency #4

Closed esergion closed 9 years ago

esergion commented 9 years ago

Plain bootstrap.css includes these strings:

  src: url('/assets/glyphicons-halflings-regular.eot');
  src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
       url('/assets/glyphicons-halflings-regular.woff2') format('woff2'),
       url('/assets/glyphicons-halflings-regular.woff') format('woff'),
       url('/assets/glyphicons-halflings-regular.ttf') format('truetype'),
       url('/assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

It is not right, because we need a timestamps for precompiled assets (asset-url()). So, for production (when static assets served by Nginx or Apache etc..) it will give 404 error for glyphicons font.

Also, in many projects its needed to include bootstrap-sass not only for admin-panel, but for whole site. Now its easy to do like so (assume that we have Admin::BaseController, and all other admin-controllers are inherited from that): app/assets/stylesheets/application.css:

 *= require_tree .
 *= require_self
 */

app/assets/stylesheets/main.scss:

@import "bootstrap-sprockets";
@import "bootstrap";

and import AdminLTE for only admin namespace app/assets/sytlesheets/admin/base.scss:

@import "AdminLTE/skins/skin-blue";
@import "AdminLTE/AdminLTE";

sorry for my english =)

nicolas-besnard commented 9 years ago

Nice idea ! You forgot to require the gem in lib/adminlte2_rails.rb, so I've done it :)

I also add the css import in the generator.

It's now included in v0.0.6 (associated commit here)