GithubHelp home page GithubHelp logo

mwlang / gentelella-rails Goto Github PK

View Code? Open in Web Editor NEW
155.0 11.0 51.0 2.84 MB

Injects the gentelella theme and javascript files into Rails assets pipeline

License: MIT License

Ruby 0.14% JavaScript 99.08% CoffeeScript 0.06% CSS 0.70% HTML 0.02%

gentelella-rails's Introduction

Gentelella Rails

This is mostly an experimental effort to inject the Gentelella theme into Rails assets pipeline.

My goal in building this gem was to learn:

  • how to automate bower updates
  • package up only the files needed for the gem to function in production
  • load everything up with just one or two requires in the Rails app that uses it

Beware that this gem furnishes a fairly comprehensive theme and pulls in many other libraries such as:

  • jquery and jquery_ujs
  • bootstrap-sass and font-awesome-sass
  • icheck
  • nprogress
  • moment JS
  • bootstrap date range picker
  • fastclick
  • ChartJS
  • jquery Flot
  • DateJS
  • Switchery
  • Select2
  • Parsley JS

Where possible, I utilized well-maintained Rails gems for the above. However, if the gems were out of date, I utilized the Bower supplied version.

You may also find the demo Rails 5.x project on github

Theme Demo

Gentelella Bootstrap Admin Template

Template Demo

Installation

Add the following to your Rails application's Gemfile and bundle install:

gem 'gentelella-rails'

Then perform the following:

bundle install
rails g gentelella:install

NOTE: If the generator fails to work, then make sure you stop Spring: spring stop and then try again.

Add the following to your assets/javascripts/application.js

//= require gentelella
//= require gentelella-custom

If you're working with jquery.vmap, then your application.js will look something like this:

//= require gentelella
//= require jqvmap/maps/jquery.vmap.world
//= require jqvmap/maps/jquery.vmap.usa
//= require jquery.vmap.sampledata
//= require gentelella-custom

There is no need to include bootstrap-sprockets, font-awesome, jquery, etc. as these are all included via the gem when you "require gentelella"

NOTE: gentella-custom is meant to be edited! If you find things breaking from include/import lines of this file, comment out the offending lines. gentella-custom is where you can place all project-specific scripts.

Finally, add the stylesheet directives to your assets/stylesheets/application.scss

@import "gentelella";
@import "gentelella-custom";

This will pull in all necessary stylesheets including bootstrap, font-awesome, etc., which the theme uses.

gem 'gentelella-rails'

Contributing

I don't have any personal plans to utilize this theme in my projects, so if this project is of interest, fork and send pull requests and I will publish!

The gem should be fairly easy to update to latest JS libraries as they come available. If the JS or CSS libraries are via a rubygem, then:

bundle update GEMNAME

If the libraries are supplied by bower then:

rake bower:update
rake bower:vendor

Credits

The original theme was developed by Colorlib and released under MIT license.

License

The gem is available as open source under the terms of the MIT License.

gentelella-rails's People

Contributors

mwlang avatar oivoodoo avatar ravensnowbird avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gentelella-rails's Issues

Problem with JS not working on Heroku

When including gem 'gentelella-rails'. JS works fine on local but stops working on Heroku. i followed all the instructions. Using rails 5.1.2. Works fine if i remove gentelella-custom.js file.

Rails 6 webpack how include vendors?

Hello
I want to connect the gentelella template to my rails 6 project.
The project is completely empty.
Installed via yarn add gentelella.
Further in the file app / javascript / packs / application.js added
require ("gentelella")
But when you open any page, it gives an error that Jquery is not connected. If I understand correctly all the dependencies should have been connected from the vendors folder but this did not happen, at least for rails 6 it works for a friend.
Tell me how to properly connect all the dependencies so as not to install them manually.

SASS Sass::SyntaxError

Sass::SyntaxError appear on the error when i add Gentellia-Rails on the gem file, and the SASS files error appear on the screen

.secondary-text-color {
    color: $bgDefault !important;
}

.subtitle-font-size {

But when I remove the Gentellia-Rails on the Gem file and the error is no longer appear on the screen. is Gentellia-Rails SASS ready??

have found the issue as I am using @import Color.scss on the application.scss along with gentella-custom.scss, and few different imports scss, soi have to add @import color.scss on each scss, and it working but it should not happened.

Error on assets precompile after upgrading from 0.1.5 to 0.1.6

Assets precompile fails after i updated the gem from 0.1.5 to 0.1.6
i.e: RAILS_ENV=production bundle exec rake assets:precompile

rake aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected token: punc ({)
JS_Parse_Error.get ((execjs):3538:621)
(execjs):4060:47
(execjs):1:102
Object.<anonymous> ((execjs):1:120)
Module._compile (module.js:570:32)
Object.Module._extensions..js (module.js:579:10)
Module.load (module.js:487:32)
tryModuleLoad (module.js:446:12)
Function.Module._load (module.js:438:3)
Module.runMain (module.js:604:10)

Has no dependency to query

After instal the gem, run bundler install and visit to front page of my app, I see next error:

couldn't find file 'jquery' with type 'application/javascript'
Checked in these paths: 
...

In dependencies of the gem I don't see any requirements to jquery:

# .../gems/gentelella-rails-0.1.3/lib/gentelella-rails.rb
require 'bootstrap-sass'
require 'font-awesome-sass'
require 'nprogress-rails'
require 'icheck-rails'
require 'momentjs-rails'
require 'bootstrap-daterangepicker-rails'
require 'fastclick-rails'
require 'chart-js-rails'
require 'flot-rails'
require 'datejs-rails'
require 'switchery-rails'
require 'select2-rails'
require 'parsley-rails'

But I see requirements of jQuery in manifest

# .../gems/gentelella-rails-0.1.3/assets/javascripts/gentelella.coffee
#= require jquery
#= require jquery_ujs

I think you need to add requirement

gem 'jquery-rails'

to your gentelella-rails.rb

Form Wizards

We dont have Form wizards in these sample rails app, however its present in the original one. Will it be added or i should proceed on my own? Thanks!

Could not find generator 'gentelella:install'

Hi,

(My rails version is '~> 5.0.3'.)

  1. added gem 'gentelella-rails' to Gemfile.
  2. bundle install

3)when i do rails g gentelella:install - >console gives me following error message..

Running via Spring preloader in process 12725

Could not find generator 'gentelella:install'. Maybe you meant 'integration_test', 'generator' or 'coffee:assets'
Run `rails generate --help` for more options.

Any help would be appreciated.

Thanks.

Problem with the fullcalendar.js asset

When i use your instructions to load all the assets of Gentelella, those .js asset gives an Uncaugt TypeError e stops the rendering of the page. May you give a look to that problem?

In a local installation i replaced fullcalendar.js with a blank file and this problem got solved. Obviously, it's not a proper thing to do.

cattura
cattura2

rails 6 + (including 6.0.3 and 6.1.1) having issue with switchery-rails ( railties < 6.0, >= 3.2)

When am trying to upgrade rails 5.2.4.4 to 6.0.3 am having issue with gentelella-rails dependent gem (switchery-rails).

Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (~> 6.0.3) was resolved to 6.0.3, which depends on
railties (= 6.0.3)

**gentelella-rails was resolved to 0.1.11, which depends on
  switchery-rails was resolved to 0.8.1, which depends on
    railties (~> 4)**

when i comment gentelella-rails from Gemfile, am able to upgrade rails 6.0.3. but with switchery-rails am not able to upgrade.

Problem is the dependent gem switchery-rails can only support till 5.2.4.4 rails version, then how there people using gentelella-rails in to Rails 6.

Can anybody help to fix this issue.

Precompilation of so many dependencies takes too long

Hi, There is a lot of not always needed assets in the gem, like dozens of language packs. I know that they are dependencies of gentelella. But I am thinking if it would be possible to config it to use only some of them if not needed. Maybe in the rails initializer? I can contribute if you have no time. But I am not sure which approach should I take.

my nav bar hamburger and side bar menu contents not working

i have followed all the instructions on the installation and incorporation of the template to my project however as above mentioned the side bar menu contents cannot open and close same to the hamburger
a little help would be required to solve this for its nothing to do with my javascript or jquery

couldn't find file 'chart' with type 'application/javascript'

Hello, first of all thanks for the gem :)

After installed the gem, when load the application I have the next error:
ActionView::Template::Error (couldn't find file 'chart' with type 'application/javascript'
Checked in these paths:
/Users/usabi/Desarrollo/nani/app/assets/config
/Users/usabi/Desarrollo/nani/app/assets/images
/Users/usabi/Desarrollo/nani/app/assets/javascripts
/Users/usabi/Desarrollo/nani/app/assets/stylesheets
/Users/usabi/.rvm/gems/ruby-2.3.1/gems/parsley-rails-2.7.0.0/vendor/assets/javascripts
....

If I comment out the line which includes the chart library in gentelella.coffee, the problem seems solved.
I don't find the charts.js on your assets files, although I see chart-js-rails in your Gemspec file.
Thanks in advance :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.