rails-starter directory structure
The starter project by default includes all third-party plugins.
Optionally you can remove unwanted plugins to reduce output assets size and compile time:
dependencies section in the package.json file.vendor/assets/libs directory.@imports and @includes in the vendor/assets/stylesheets/_theme/_libs.scss file.For example, if you want to exclude plyr plugin, you will need to:
plyr dependency in the package.json file.vendor/assets/libs/plyr directory.@import "../../libs/plyr/mixins"; and @include plyr-theme($background, $color);
lines in the vendor/assets/stylesheets/_theme/_libs.scss file.
npm i -g yarncmd.exe as an administrator and run command npm install --add-python-to-path='true' --global --production windows-build-tools.Now you need to install Ruby and required gems. Don't use RailsInstaller because it uses outdated Ruby version that isn't supported by Rails 6.
pacman -Sy pacman.gem install bundlergem install railsrails-starter directory and run command bundle install.npm install.bundle exec rails s.sudo apt-get update && sudo apt-get upgrade.sudo apt-get install curl.npm i -g yarnsudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev.sudo apt-add-repository ppa:brightbox/ruby-ng; sudo apt-get update; sudo apt-get install ruby2.6 ruby2.6-dev.gem install bundlergem install railsrails-starter directory and run command bundle install.npm install.bundle exec rails s.npm i -g yarnruby -v command in the terminal. Update ruby if required.gem install bundlergem install railsrails-starter directory and run command bundle install.npm install.bundle exec rails s.Main layoutapp/views/layouts/application.html.erb
<!DOCTYPE html>
<html lang="en" class="light-style">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<title><%= @title ? @title + " - " : "" %>Rails Starter</title>
<!-- Main font -->
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900" rel="stylesheet">
<!-- Icons. Uncomment required icon fonts -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/fontawesome', media: 'all' %> -->
<%= stylesheet_pack_tag 'vendor/fonts/ionicons', media: 'all' %>
<!-- <%= stylesheet_pack_tag 'vendor/fonts/linearicons', media: 'all' %> -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/open-iconic', media: 'all' %> -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/pe-icon-7-stroke', media: 'all' %> -->
<!-- Core stylesheets -->
<%= stylesheet_pack_tag 'vendor/bootstrap', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/appwork', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/colors', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/uikit', media: 'all' %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<!-- Load polyfills -->
<%= javascript_pack_tag 'vendor/polyfills' %>
<script>document['documentMode']===10&&document.write('<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en"><\/script>')</script>
<!-- Layout helpers -->
<%= javascript_pack_tag 'vendor/layout-helpers' %>
<!-- Libs -->
<!-- `perfect-scrollbar` library required by SideNav plugin -->
<%= stylesheet_pack_tag 'vendor/libs/perfect-scrollbar/perfect-scrollbar', media: 'all' %>
<%= yield :styles %>
</head>
<body>
<%= content_for?(:content) ? yield(:content) : yield %>
<!-- Core scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<%= javascript_pack_tag 'vendor/libs/popper/popper' %>
<%= javascript_pack_tag 'vendor/bootstrap' %>
<%= javascript_pack_tag 'vendor/sidenav' %>
<!-- Scripts -->
<%= javascript_pack_tag 'vendor/libs/perfect-scrollbar/perfect-scrollbar' %>
<%= javascript_pack_tag 'application' %>
<%= yield :scripts %>
</body>
</html>
<!DOCTYPE html>
<html lang="en" class="light-style">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<title><%= @title ? @title + " - " : "" %>Rails Starter</title>
<!-- Main font -->
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900" rel="stylesheet">
<!-- Icons. Uncomment required icon fonts -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/fontawesome', media: 'all' %> -->
<%= stylesheet_pack_tag 'vendor/fonts/ionicons', media: 'all' %>
<!-- <%= stylesheet_pack_tag 'vendor/fonts/linearicons', media: 'all' %> -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/open-iconic', media: 'all' %> -->
<!-- <%= stylesheet_pack_tag 'vendor/fonts/pe-icon-7-stroke', media: 'all' %> -->
<!-- Core stylesheets -->
<%= stylesheet_pack_tag 'vendor/bootstrap', media: 'all', class: 'theme-settings-bootstrap-css' %>
<%= stylesheet_pack_tag 'vendor/appwork', media: 'all', class: 'theme-settings-appwork-css' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate', media: 'all', class: 'theme-settings-theme-css' %>
<%= stylesheet_pack_tag 'vendor/colors', media: 'all', class: 'theme-settings-colors-css' %>
<%= stylesheet_pack_tag 'vendor/uikit', media: 'all' %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<!-- Load polyfills -->
<%= javascript_pack_tag 'vendor/polyfills' %>
<script>document['documentMode']===10&&document.write('<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en"><\/script>')</script>
<!-- Layout helpers -->
<%= javascript_pack_tag 'vendor/layout-helpers' %>
<!-- Theme settings -->
<%= javascript_pack_tag 'vendor/theme-settings' %>
<%= stylesheet_pack_tag 'vendor/theme-settings', media: 'all' %>
<script>
// Use settings panel generator to configure the plugin
window.themeSettings = new ThemeSettings({
cssPath: '',
themesPath: '',
pathResolver: function(path) {
var resolvedPaths = {
// Core stylesheets
<%- ['bootstrap', 'appwork', 'colors'].each do |name| %>
'<%= name %>.css': '<%= asset_pack_path "vendor/#{name}.css" %>',
'<%= name %>-material.css': '<%= asset_pack_path "vendor/#{name}-material.css" %>',
'<%= name %>-dark.css': '<%= asset_pack_path "vendor/#{name}-dark.css" %>',
<% end %>
// UI Kit
'uikit.css': '<%= asset_pack_path "vendor/uikit.css" %>',
// Themes
<%- ['air', 'corporate', 'cotton', 'gradient', 'paper', 'shadow', 'soft', 'sunrise', 'twitlight', 'vibrant'].each do |name| %>
'theme-<%= name %>.css': '<%= asset_pack_path "vendor/theme-#{name}.css" %>',
'theme-<%= name %>-material.css': '<%= asset_pack_path "vendor/theme-#{name}-material.css" %>',
'theme-<%= name %>-dark.css': '<%= asset_pack_path "vendor/theme-#{name}-dark.css" %>',
<% end %>
};
return resolvedPaths[path] || path;
}
});
</script>
<!-- Libs -->
<!-- `perfect-scrollbar` library required by SideNav plugin -->
<%= stylesheet_pack_tag 'vendor/libs/perfect-scrollbar/perfect-scrollbar', media: 'all' %>
<%= yield :styles %>
</head>
<body>
<%= content_for?(:content) ? yield(:content) : yield %>
<!-- Core scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<%= javascript_pack_tag 'vendor/libs/popper/popper' %>
<%= javascript_pack_tag 'vendor/bootstrap' %>
<%= javascript_pack_tag 'vendor/sidenav' %>
<!-- Scripts -->
<%= javascript_pack_tag 'vendor/libs/perfect-scrollbar/perfect-scrollbar' %>
<%= javascript_pack_tag 'application' %>
<%= yield :scripts %>
</body>
</html>
There are several ways you can set the layout:
layout in the ApplicationController.layout in SomeController.layout option.
You can find navbar, sidenav and footer templates in the app/views/layouts/partials directory.
app/controllers/some_controller.rb
class SomeController < ApplicationController
layout 'main/layout-1'
def index
render layout: 'main/layout-1'
end
end
app/controllers/some_controller.rb
class SomeController < ApplicationController
layout 'main/layout-1-flex'
def index
render layout: 'main/layout-1-flex'
end
end
app/controllers/some_controller.rb
class SomeController < ApplicationController
layout 'main/layout-2'
def index
render layout: 'main/layout-2'
end
end
app/controllers/some_controller.rb
class SomeController < ApplicationController
layout 'main/layout-2-flex'
def index
render layout: 'main/layout-2-flex'
end
end
app/controllers/some_controller.rb
class SomeController < ApplicationController
layout 'main/layout-blank'
def index
render layout: 'main/layout-blank'
end
end
To enable a theme, include theme stylesheet in your main layout.
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'vendor/theme-air', media: 'all' %>
To enable a theme just include the required theme stylesheet.
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'vendor/theme-air', media: 'all', class: 'theme-settings-theme-css' %>
To enable material styling you need to:
Set $enable-material-style variable to true.
vendor/assets/stylesheets/_custom-variables/_features.scss
...
$enable-material-style: true;
...
Set material-style class on the <html> element instead of light-style.
app/views/layouts/application.html.erb
<html class="material-style">
Add -material suffix to bootstrap, appwork, theme-* and colors stylesheets.
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'vendor/bootstrap-material', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/appwork-material', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate-material', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/colors-material', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/bootstrap-material', media: 'all', class: 'theme-settings-bootstrap-css' %>
<%= stylesheet_pack_tag 'vendor/appwork-material', media: 'all', class: 'theme-settings-appwork-css' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate-material', media: 'all', class: 'theme-settings-theme-css' %>
<%= stylesheet_pack_tag 'vendor/colors-material', media: 'all', class: 'theme-settings-colors-css' %>
Optionally you can enable material ripple. Just append material-ripple
script and stylesheet to the <head> section and call attachMaterialRippleOnLoad() function.
app/views/layouts/application.html.erb
<%= javascript_pack_tag 'vendor/material-ripple' %>
<%= stylesheet_pack_tag 'vendor/material-ripple', media: 'all' %>
<script>
window.attachMaterialRippleOnLoad();
</script>
Optionally you can enable material ripple. Just append material-ripple.js
script to the <head> section.
app/views/layouts/application.html.erb
<%= javascript_pack_tag 'vendor/material-ripple' %>
<%= stylesheet_pack_tag 'vendor/material-ripple', media: 'all' %>
To enable dark styling you need to:
Set $enable-dark-style variable to true.
vendor/assets/stylesheets/_custom-variables/_features.scss
...
$enable-dark-style: true;
...
Set dark-style class on the <html> element instead of light-style.
app/views/layouts/application.html.erb
<html class="dark-style">
Add -dark suffix to bootstrap, appwork, theme-* and colors stylesheets.
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'vendor/bootstrap-dark', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/appwork-dark', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate-dark', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/colors-dark', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/bootstrap-dark', media: 'all', class: 'theme-settings-bootstrap-css' %>
<%= stylesheet_pack_tag 'vendor/appwork-dark', media: 'all', class: 'theme-settings-appwork-css' %>
<%= stylesheet_pack_tag 'vendor/theme-corporate-dark', media: 'all', class: 'theme-settings-theme-css' %>
<%= stylesheet_pack_tag 'vendor/colors-dark', media: 'all', class: 'theme-settings-colors-css' %>
To enable RTL direction support:
Set $enable-rtl-support variable to true.
vendor/assets/stylesheets/_custom-variables/_features.scss
$enable-rtl-support: true;
...
Import Appwork's stylesheets from the vendor/rtl/ path.
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'vendor/rtl/bootstrap', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/rtl/appwork', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/rtl/theme-corporate', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/rtl/colors', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/rtl/uikit', media: 'all' %>
<%= stylesheet_pack_tag 'vendor/rtl/bootstrap', media: 'all', class: 'theme-settings-bootstrap-css' %>
<%= stylesheet_pack_tag 'vendor/rtl/appwork', media: 'all', class: 'theme-settings-appwork-css' %>
<%= stylesheet_pack_tag 'vendor/rtl/theme-corporate', media: 'all', class: 'theme-settings-theme-css' %>
<%= stylesheet_pack_tag 'vendor/rtl/colors', media: 'all', class: 'theme-settings-colors-css' %>
<%= stylesheet_pack_tag 'vendor/rtl/uikit', media: 'all' %>
To enable RTL direction, add dir="rtl" attribute to the <html> element.
app/views/layouts/application.html.erb
<html dir="rtl">
You can configure the initial layout by setting control classes to the <html> element.
app/views/layouts/application.html.erb
<html class="layout-fixed layout-collapsed">
| Control class | Description |
|---|---|
.layout-reversed |
Reverse layout direction without markup change. |
.layout-expanded |
Expand layout sidenav on small screens (< 992px). |
.layout-collapsed |
Collapse layout sidenav on large screens (>= 992px). |
.layout-offcanvas |
Make layout sidenav offcanvas. |
.layout-fixed |
Set layout position to fixed. |
.layout-fixed-offcanvas |
Set layout position to fixed with offcanvas sidenav. |
.layout-navbar-fixed |
Set layout navbar position to fixed. |
.layout-footer-fixed |
Set layout footer position to fixed. |
Optionally you can enable PACE.js progress bar:
Append pace.js script to the <head> section.
app/views/layouts/application.html.erb
<%= javascript_pack_tag 'vendor/pace' %>
Append .page-loader element to the <body>.
app/views/layouts/application.html.erb
<div class="page-loader"><div class="bg-primary"></div></div>
Use starter template generator to simplify the initial setup. Just replace a content of appropriate files with the generated code within the rails-starter directory.
Official Ruby on Rails changelogs: https://weblog.rubyonrails.org/releases/.
Check your Ruby version ruby -v. Upgrade it if the version is less than 2.5.0.
Upgrade Node.js to the latest LTS release (https://nodejs.org/en/)
Remove the next files and directories:
vendor/assets/libs/vegas/
Copy new files and directories:
config/initializers/permissions_policy.rb
Since some extensions were removed from the bootstrap-table package, remove vendor/assets/libs/bootstrap-table/ directory
and copy new appwork-v1_6_0/rails-starter/vendor/assets/libs/bootstrap-table/
Copy with replace all SCSS files within vendor/assets/stylesheets/ and vendor/assets/stylesheets/rtl/ directories:
vendor/assets/stylesheets/*.scss vendor/assets/stylesheets/rtl/*.scss
Copy with replace changed files and directories:
.gitattributes .gitignore config.ru bin/ vendor/assets/fonts/ vendor/assets/stylesheets/_appwork/ vendor/assets/stylesheets/_uikit/ vendor/assets/libs/blueimp-gallery/ vendor/assets/libs/bootstrap-slider/ vendor/assets/libs/dropzone/ vendor/assets/libs/fullcalendar/ vendor/assets/libs/nouislider/ vendor/assets/libs/minicolors/ vendor/assets/libs/photoswipe/ vendor/assets/libs/plyr/ vendor/assets/libs/select2/ vendor/assets/libs/smartwizard/ vendor/assets/libs/sortablejs/ vendor/assets/libs/swiper/ vendor/assets/libs/timepicker/ vendor/assets/libs/typeahead-js/
Update:
Gemfile. Diff
package.json. Diff
app/javascript/packs/application.js. Diff
config/application.rb. Diff
config/puma.rb. Diff
config/webpacker.yml. Diff
config/environments/development.rb. Diff
config/environments/production.rb. Diff
config/environments/test.rb. Diff
config/initializers/backtrace_silencers.rb. Diff
config/initializers/filter_parameter_logging.rb. Diff
Set your Ruby version in Gemfile and .ruby-version
Remove Gemfile.lock
Remove node_modules directory and package-lock.json. Then execute npm install
Execute bundle install
Changes in third-party components:
vegas plugin was excluded from the package.
fullcalendar changed its API and configuration object:
Before
var eventList = [{
...
className: 'fc-event-warning'
}, {
...
rendering: 'background'
}];
new Calendar($('#id')[0], {
...
defaultDate: ...,
eventLimit: ...,
defaultView: '...',
dir: 'rtl',
header: {
...
left: '...',
right: '...'
},
views: {
dayGrid: {
eventLimit: ...
}
},
});
After
var eventList = [{
...
classNames: 'fc-event-warning'
}, {
...
display: 'background'
}];
new Calendar($('#id')[0], {
...
initialDate: ...,
dayMaxEventRows: ...,
initialView: '...',
direction: 'rtl',
headerToolbar: {
...
start: '...',
end: '...'
},
views: {
dayGrid: {
dayMaxEventRows: ...
}
},
});
For more info see https://fullcalendar.io/docs/upgrading-from-v4
dropzone configuration is changed.
Before
$('#id').dropzone();
After
var previewTemplate =
'<div class="dz-preview dz-file-preview">' +
' <div class="dz-details">' +
' <div class="dz-thumbnail">' +
' <img data-dz-thumbnail>' +
' <span class="dz-nopreview">No preview</span>' +
' <div class="dz-success-mark"></div>' +
' <div class="dz-error-mark"></div>' +
' <div class="dz-error-message"><span data-dz-errormessage></span></div>' +
' <div class="progress"><div class="progress-bar progress-bar-primary" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-dz-uploadprogress></div></div>' +
' </div>' +
' <div class="dz-filename" data-dz-name></div>' +
' <div class="dz-size" data-dz-size></div>' +
' </div>' +
'</div>';
$('#id').dropzone({
previewTemplate: previewTemplate
});
smartwizard markup and API are changed.
Before
<ul>
<li><a href="#" class="mb-3">...</a></li>
...
</ul>
<div class="mb-3">
<div id="smartwizard-1-step-1" class="card animated fadeIn">
...
</div>
</div>
After
<ul class="nav">
<li><a href="#" class="nav-link mb-3">...</a></li>
...
</ul>
<div class="tab-content mb-3">
<div id="#" class="tab-pane card" role="tabpanel">
...
</div>
</div>
Before
$el.smartWizard({
useURLhash: false,
showStepURLhash: false,
...
})
.on('leaveStep', function(e, anchorObject, stepNumber, stepDirection) {
if (stepDirection === 'forward'){ return $el.valid(); }
return true;
})
.on('showStep', function(e, anchorObject, stepNumber, stepDirection) {
var $btn = $el.find('.btn-finish');
if (stepNumber === 3) {
$btn.removeClass('hidden');
} else {
$btn.addClass('hidden');
}
});
After
$el.smartWizard({
enableURLhash: false,
...
})
.on('leaveStep', function(e, anchorObject, currentStepIndex, nextStepIndex, stepDirection) {
var $finishBtn = $el.find('.btn-finish');
if (stepDirection === 'forward'){
var isValid = $el.valid();
if (!isValid) {
anchorObject.addClass('danger');
} else {
anchorObject.removeClass('danger');
if (nextStepIndex === 3) {
$finishBtn.removeClass('d-none');
}
}
return isValid;
} else {
$finishBtn.addClass('d-none');
}
return true;
})
.find('> .toolbar .btn:not(.btn-primary)').addClass('btn-secondary');
For more info see http://techlaboratory.net/jquery-smartwizard
Copy with replace the next files and directories:
vendor/assets/stylesheets/_appwork/_functions.scss vendor/assets/libs/bootstrap-datepicker/ vendor/assets/libs/bootstrap-daterangepicker/ vendor/assets/libs/bootstrap-material-datetimepicker/ vendor/assets/libs/bootstrap-select/ vendor/assets/libs/flatpickr/ vendor/assets/libs/growl/ vendor/assets/libs/plyr/ vendor/assets/libs/select2/ vendor/assets/libs/sweetalert2/ vendor/assets/libs/timepicker/ vendor/assets/libs/typeahead-js/
Copy with replace the next file:
vendor/assets/libs/flatpickr/flatpickr.scss
Check the Ruby version ruby -v. Upgrade it if the version is less than 2.5.0.
Upgrade Node.js to the latest LTS release (https://nodejs.org/en/)
Note: Yarn package manager is not reqired anymore.
Remove the next files and directories:
vendor/assets/stylesheets/migrate/
Copy new files and directories:
vendor/assets/stylesheets/_custom-variables/_appwork-dark.scss vendor/assets/stylesheets/_custom-variables/_features.scss
Since some extensions were removed from the bootstrap-table package, remove vendor/assets/libs/bootstrap-table/ directory
and copy new appwork-v1_5_0/rails-starter/vendor/assets/libs/bootstrap-table/
Copy with replace all SCSS files within vendor/assets/stylesheets/ and vendor/assets/stylesheets/rtl/ directories:
vendor/assets/stylesheets/*.scss vendor/assets/stylesheets/rtl/*.scss
Copy with replace changed files and directories:
bin/webpack bin/webpack-dev-server vendor/assets/fonts/fontawesome/ vendor/assets/fonts/fontawesome.css vendor/assets/javascripts/bootstrap.js vendor/assets/javascripts/layout-helpers.js vendor/assets/javascripts/polyfills.js vendor/assets/javascripts/sidenav.js vendor/assets/javascripts/theme-settings.js vendor/assets/javascripts/_theme-settings/ vendor/assets/stylesheets/_appwork/ vendor/assets/stylesheets/_theme/ vendor/assets/stylesheets/_uikit/ vendor/assets/stylesheets/pages/ vendor/assets/libs/autosize/ vendor/assets/libs/block-ui/ vendor/assets/libs/blueimp-gallery/ vendor/assets/libs/bootbox/ vendor/assets/libs/bootstrap-datepicker/ vendor/assets/libs/bootstrap-daterangepicker/ vendor/assets/libs/bootstrap-duallistbox/ vendor/assets/libs/bootstrap-markdown/ vendor/assets/libs/bootstrap-material-datetimepicker/ vendor/assets/libs/bootstrap-maxlength/ vendor/assets/libs/bootstrap-menu/ vendor/assets/libs/bootstrap-select/ vendor/assets/libs/bootstrap-slider/ vendor/assets/libs/bootstrap-sortable/ vendor/assets/libs/bootstrap-tagsinput/ vendor/assets/libs/c3/ vendor/assets/libs/chartist/ vendor/assets/libs/chartjs/ vendor/assets/libs/clipboard/ vendor/assets/libs/cropper/ vendor/assets/libs/d3/ vendor/assets/libs/datatables/ vendor/assets/libs/dragula/ vendor/assets/libs/dropzone/ vendor/assets/libs/eve/ vendor/assets/libs/flatpickr/ vendor/assets/libs/flot/ vendor/assets/libs/flow-js/ vendor/assets/libs/fullcalendar/ vendor/assets/libs/gmaps/ vendor/assets/libs/growl/ vendor/assets/libs/jstree/ vendor/assets/libs/knob/ vendor/assets/libs/ladda/ vendor/assets/libs/mapael/ vendor/assets/libs/markdown/ vendor/assets/libs/masonry/ vendor/assets/libs/minicolors/ vendor/assets/libs/moment/ vendor/assets/libs/morris/ vendor/assets/libs/nestable/ vendor/assets/libs/nouislider/ vendor/assets/libs/numeral/ vendor/assets/libs/perfect-scrollbar/ vendor/assets/libs/photoswipe/ vendor/assets/libs/plyr/ vendor/assets/libs/popper/ vendor/assets/libs/pwstrength-bootstrap/ vendor/assets/libs/quill/ vendor/assets/libs/raphael/ vendor/assets/libs/select2/ vendor/assets/libs/shepherd/ vendor/assets/libs/smartwizard/ vendor/assets/libs/sortablejs/ vendor/assets/libs/sparkline/ vendor/assets/libs/spin/ vendor/assets/libs/spinkit/ vendor/assets/libs/sweetalert2/ vendor/assets/libs/swiper/ vendor/assets/libs/tableexport/ vendor/assets/libs/timepicker/ vendor/assets/libs/toastr/ vendor/assets/libs/typeahead-js/ vendor/assets/libs/validate/ vendor/assets/libs/vanilla-text-mask/ vendor/assets/libs/vegas/
Update:
babel.config.js. Diff
Gemfile. Diff
package.json. Diff
vendor/assets/stylesheets/_custom-variables/_libs.scss. Diff
vendor/assets/stylesheets/_custom-variables/_pages.scss. Diff
vendor/assets/stylesheets/_custom-variables/_uikit.scss. Diff
Edit variables in the vendor/assets/stylesheets/_custom-variables/_features.scss file according your setup.
| Variable | Feature |
|---|---|
$enable-rtl-support |
Set to true to enable RTL mode support, otherwise set to false. |
$enable-light-style |
Set to true to enable light (previously default) style support, otherwise set to false. |
$enable-material-style |
Set to true to enable material style support, otherwise set to false. |
$enable-dark-style |
Set to true to enable dark style support, otherwise set to false. |
Remove Gemfile.lock
Remove node_modules directory and then execute npm install
Execute bundle install
theme-default class is renamed to theme-light.
[Before] app/views/layouts/application.html.erb
<html lang="en" class="default-style">
[After] app/views/layouts/application.html.erb
<html lang="en" class="light-style">
ThemeSettings plugin settings are changed. Use Settings Panel Generator to get updated settings.
ThemeSettings.setMaterial() method is removed.
Added ThemeSettings.setStyle(), ThemeSettings.isLightStyle(), ThemeSettings.isMaterialStyle(), ThemeSettings.isDarkStyle() methods.
See Settings panel docs.
New style-dependent utility classes, which change its color depending on the current active style:
.theme-text-white - White (light or material style) / dark (dark style) text..theme-text-dark - Dark (light or material style) / white (dark style) text..theme-bg-white - White (light or material style) / dark (dark style) background..theme-bg-dark - Dark (light or material style) / white (dark style) background..theme-border-white - White (light or material style) / dark (dark style) border..theme-border-dark - Dark (light or material style) / white (dark style) border.Changes in third-party components:
plyr changed its initialization method:
Before
plyr.setup('#selector', options);
After
new Plyr('#selector', options);
spinkit classes are changed. See https://github.com/tobiasahlin/SpinKit
SweetAlert's type option is renamed to icon.
Before
Swal.fire({
...,
type: 'warning',
});
After
Swal.fire({
...,
icon: 'warning',
});
rails-starter project was renamed to rails-turbolinks-starter. See Rails + Turbolinks migration guide.
Copy with replace the next directories:
vendor/assets/libs/bootstrap-sortable/ vendor/assets/libs/flot/ vendor/assets/libs/idletimer/
Update:
package.json. Diff
Execute yarn install
(Optional) Upgrade Node.js to 10.15 LTS and Yarn
Copy new files and directories:
vendor/assets/stylesheets/migrate/
Copy with replace all SCSS files within vendor/assets/stylesheets/ and vendor/assets/stylesheets/rtl/ directories:
vendor/assets/stylesheets/*.scss vendor/assets/stylesheets/rtl/*.scss
Copy with replace changed files and directories:
vendor/assets/stylesheets/_appwork/ vendor/assets/stylesheets/_theme/ vendor/assets/stylesheets/_uikit/_social.scss vendor/assets/stylesheets/pages/clients.scss vendor/assets/stylesheets/pages/messages.scss vendor/assets/javascripts/ vendor/assets/libs/ vendor/assets/fonts/
Remove excluded libraries:
vendor/assets/libs/bootstrap-tour/
Since some extensions were removed from the bootstrap-table package, remove
vendor/assets/libs/bootstrap-table/ directory
and copy new appwork-v1_3_0/rails-starter/vendor/assets/libs/bootstrap-table/
Update:
config/autoprefixer.yml. Diff
package.json. Diff
Execute yarn upgrade
(Optional) Upgrade Rails framework:
Update:
Gemfile. Diff
Remove Gemfile.lock
Execute bundle install
Include polyfills in the <head> block after core stylesheets (see rails-starter-generator for example):
<!-- Load polyfills -->
<%= javascript_include_tag 'polyfills.js', 'data-turbolinks-track': 'reload' %>
<script>document['documentMode']===10&&document.write('<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en"><\/script>')</script>
If you're using turbolinks, open app/assets/javascripts/main.js and add layoutHelpers.init() to the start of the turbolinks:load listener:
...
doc.addEventListener('turbolinks:load', function() {
if (layoutHelpers) {
layoutHelpers.init();
...
}
...
})
...
Bootstrap CSS:
Insert the following line into the config/initializers/assets.rb:
Rails.application.config.assets.precompile += ['stylesheets/migrate/appwork-130.css']
Include migration CSS file to the end of the <head> block:
<%= stylesheet_link_tag 'migrate/appwork-130.css', media: 'all', 'data-turbolinks-track': 'reload' %>
Changed classes:
.font-weight-thin → .font-weight-lighter
.text-dark → .text-body
.bg-none → .bg-transparent
.font-sans-serif → .text-sans-serif
.font-serif → .text-serif
.font-monospace → .text-monospace
.box-shadow-none → .shadow-none
.container-m--x → .container-m-nx
.container-m--y → .container-m-ny
.btn-round → .rounded-pill
Negative horizontal margins:
.m{sides}--{size} → .m{sides}-n{size}
.m{sides}-{breakpoint}--{size} → .m{sides}-{breakpoint}-n{size}
Bootstrap JS:
All dropdown links must have href="#" attribute. Dropdown links with href="javascript:void(0)" will throw an error
Plugin API changed:
Flot.js - See https://github.com/flot/flot/blob/master/CHANGELOG.md
bootstrap-table - see demo examples
Fullcalendar - See https://fullcalendar.io/docs
bootstrap-sweetalert is deprecated, use Sweetalert2 instead. See - https://sweetalert2.github.io/
bootstrap-tour library was removed, use "shepherd" tour library instead. See - https://shipshapecode.github.io/shepherd/
Note: Validation icons are disabled by default. To enable it, add the next
variable in the vendor/assets/stylesheets/_custom-variables/_appwork.scss
and
vendor/assets/stylesheets/_custom-variables/_appwork-material.scss:
$enable-validation-icons: true;
Update package.json. Diff
Copy with replace changed files and directories:
vendor/assets/javascripts/ vendor/assets/libs/ vendor/assets/fonts/fontawesome/ vendor/assets/fonts/ionicons/ionicons/ vendor/assets/fonts/fontawesome.css.erb vendor/assets/fonts/ionicons.css.erb vendor/assets/stylesheets/_appwork/_accordion.scss vendor/assets/stylesheets/_appwork/_breadcrumb.scss vendor/assets/stylesheets/_appwork/_buttons.scss vendor/assets/stylesheets/_appwork/_close.scss vendor/assets/stylesheets/_appwork/_custom-forms.scss vendor/assets/stylesheets/_appwork/_mixins.scss vendor/assets/stylesheets/_appwork/_switcher.scss vendor/assets/stylesheets/_appwork/_variables-material.scss vendor/assets/stylesheets/_appwork/_variables.scss vendor/assets/stylesheets/colors-material.scss
Execute yarn install