beautiful_scaffold 2.0.0.pre → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG +45 -0
- data/Gemfile +5 -4
- data/README.rdoc +22 -4
- data/Rakefile +0 -3
- data/beautiful_scaffold.gemspec +0 -2
- data/lib/beautiful_scaffold/version.rb +1 -1
- data/lib/generators/USAGE +25 -11
- data/lib/generators/beautiful_cancancan_generator.rb +51 -0
- data/lib/generators/beautiful_jointable_generator.rb +3 -5
- data/lib/generators/beautiful_locale_generator.rb +15 -13
- data/lib/generators/beautiful_migration_generator.rb +3 -1
- data/lib/generators/beautiful_scaffold_common_methods.rb +10 -2
- data/lib/generators/beautiful_scaffold_generator.rb +2 -10
- data/lib/generators/beautiful_sorcery_generator.rb +137 -0
- data/lib/generators/beautiful_storage_generator.rb +61 -0
- data/lib/generators/templates/app/assets/javascripts/application-bs.js +0 -2
- data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +15 -30
- data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +16 -15
- data/lib/generators/templates/app/assets/stylesheets/application-bs.css +0 -2
- data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +9 -1
- data/lib/generators/templates/app/controllers/user_sessions_controller.rb +20 -0
- data/lib/generators/templates/app/helpers/beautiful_helper.rb +19 -5
- data/lib/generators/templates/app/locales/beautiful_scaffold.en.yml +8 -0
- data/lib/generators/templates/app/locales/beautiful_scaffold.fr.yml +9 -1
- data/lib/generators/templates/app/locales/beautiful_scaffold.ja.yml +9 -2
- data/lib/generators/templates/app/mailers/user_mailer.rb +13 -0
- data/lib/generators/templates/app/models/ability.rb +39 -0
- data/lib/generators/templates/app/models/concerns/caption_concern.rb +1 -1
- data/lib/generators/templates/app/models/user.rb +11 -0
- data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +3 -3
- data/lib/generators/templates/app/views/layout.html.erb +12 -2
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.html.erb +16 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.text.erb +9 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.html.erb +16 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.html.erb +19 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.html.erb +19 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_sessions/_form.html.erb +15 -0
- data/lib/generators/templates/app/views/login_logout/user_sessions/new.html.erb +3 -0
- data/lib/generators/templates/app/views/partials/_form_field.html.erb +33 -25
- data/lib/generators/templates/app/views/partials/_index_column.html.erb +2 -0
- data/lib/generators/templates/app/views/partials/_login_logout_register.html.erb +7 -0
- data/lib/generators/templates/app/views/partials/_show_field.html.erb +2 -0
- metadata +23 -15
- data/Gemfile.lock +0 -209
- data/lib/generators/beautiful_devisecancan_generator.rb +0 -128
- data/lib/generators/templates/app/assets/javascripts/bootstrap-colorpicker.js +0 -520
- data/lib/generators/templates/app/assets/javascripts/tagit.js +0 -489
- data/lib/generators/templates/app/assets/stylesheets/colorpicker.css +0 -127
- data/lib/generators/templates/app/assets/stylesheets/tagit-dark-grey.css +0 -135
- data/lib/generators/templates/app/views/partials/_register_form.html.erb +0 -44
- data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +0 -18
- data/lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb +0 -19
- data/lib/generators/templates/lib/custom_failure.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90c697cd1e3c71ed04460ed4f75cc9320e6a843fb3df59eb605dc294e46ce19
|
4
|
+
data.tar.gz: 7891a26affac91b9251b4364a279b2ecd340decf6b4ce34f5837006bfa995286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98703dfffcad9793f1c3391c7016ed558f35f8fb4c6ffa0f2dcac9c501033dd40dbb18f7440c32662a0eb7d81cb0be8bfe512f4f0239c3af843e939583709903
|
7
|
+
data.tar.gz: dc4a1c435dc7117b840afc0d1b686f52790ca8203e64d6cb5d4463a5fc8a53c1128e227e01b5733c7763e7367a7855b092f3902ce3b2e09092a063a64d75bae9
|
data/.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
test/dummy/log/test.log
|
1
|
+
test/dummy/log/test.log
|
2
|
+
Gemfile.lock
|
data/CHANGELOG
CHANGED
@@ -4,6 +4,51 @@
|
|
4
4
|
|
5
5
|
* bugfix
|
6
6
|
|
7
|
+
== TODO
|
8
|
+
|
9
|
+
ActionText / trix.
|
10
|
+
Include pg_search for fulltext field.
|
11
|
+
Remove "image_processing" specific version + add gem 'mini_magick' (pour la génération des variants)
|
12
|
+
|
13
|
+
== 2.0.3
|
14
|
+
|
15
|
+
* bugfix
|
16
|
+
* _ids in permitted_attributes (beautiful_jointable)
|
17
|
+
|
18
|
+
* enhancement
|
19
|
+
* Replace tagit by select2 (+ _ids in permitted_attributes)
|
20
|
+
* Bootstrap 4.3 -> 5.1
|
21
|
+
|
22
|
+
== 2.0.2
|
23
|
+
|
24
|
+
* enhancement
|
25
|
+
* Native html colorpicker
|
26
|
+
|
27
|
+
* bugfix
|
28
|
+
* Datetime picker for model form
|
29
|
+
* Display price in model form
|
30
|
+
|
31
|
+
== 2.0.1
|
32
|
+
|
33
|
+
* enhancement
|
34
|
+
* Replace Devise by Sorcery
|
35
|
+
* Tests Sorcery and Cancancan generators
|
36
|
+
* New generator for ActiveStorage
|
37
|
+
|
38
|
+
* bugfix
|
39
|
+
* Locale : fix all locale in the same file.
|
40
|
+
* Visual fix ('-' in menu)
|
41
|
+
* Will_paginate right locales
|
42
|
+
* Avoid adding gems multiple times
|
43
|
+
|
44
|
+
== 2.0.0
|
45
|
+
|
46
|
+
* enhancement
|
47
|
+
* Bootstrap 4.5 for search field.
|
48
|
+
|
49
|
+
* bugfix
|
50
|
+
* Beautiful migration & Rails 6 (fix #23)
|
51
|
+
|
7
52
|
== 2.0.0.pre
|
8
53
|
|
9
54
|
* enhancement
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem "rails", "~> 6.
|
5
|
+
gem "rails", "~> 6.1"
|
6
6
|
|
7
7
|
group :test do
|
8
8
|
gem 'sqlite3'
|
@@ -14,11 +14,12 @@ group :test do
|
|
14
14
|
'prawn' => nil, #'2.1.0',
|
15
15
|
'prawn-table' => nil, #'0.2.2',
|
16
16
|
'sanitize' => nil,
|
17
|
-
'bootstrap' => '~>
|
18
|
-
'font-awesome-rails' => '4.7.0.
|
17
|
+
'bootstrap' => '~> 5.1.0',
|
18
|
+
'font-awesome-rails' => '4.7.0.7',
|
19
19
|
'momentjs-rails' => '>= 2.9.0',
|
20
20
|
'bootstrap4-datetime-picker-rails' => nil,
|
21
|
-
'jquery-rails' => '4.3.1'
|
21
|
+
'jquery-rails' => '4.3.1',
|
22
|
+
'sorcery' => '0.15.0'
|
22
23
|
}
|
23
24
|
|
24
25
|
gems.each{ |gem_to_add, version|
|
data/README.rdoc
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
Beautiful Scaffold is a gem which propose generators for a complete scaffold with paginate, sort and filter.
|
4
4
|
Fully customizable.
|
5
|
+
|
6
|
+
Note : Avoid to change Beautiful-Scaffold version in your project (incompatibility between generated code).
|
7
|
+
Note 2 : Be careful to have a clean git repository for your project because Beautiful-Scaffold change many files.
|
8
|
+
It will be easier to revert changes.
|
9
|
+
|
5
10
|
Info : https://github.com/rivsc/Beautiful-Scaffold
|
6
11
|
Demo : http://beautiful-scaffold.rivsc.ovh/
|
7
12
|
|
@@ -70,10 +75,23 @@ Run `rake db:migrate` before `rails g beautiful_locale` (to get lastest attribut
|
|
70
75
|
|
71
76
|
rails g beautiful_jointable model1 model2
|
72
77
|
|
73
|
-
|
74
|
-
|
78
|
+
=== Install et preconfigure Sorcery (authentification) (this generator doesn't work on engine)
|
79
|
+
|
80
|
+
# If it is not done yet
|
81
|
+
rails g beautiful_scaffold user email:string
|
82
|
+
rails g beautiful_sorcery
|
83
|
+
|
84
|
+
=== Install et preconfigure Cancancan (authorization) (this generator doesn't work on engine)
|
85
|
+
|
86
|
+
# If it is not done yet
|
87
|
+
rails g beautiful_scaffold user email:string
|
88
|
+
# If it is not done yet
|
89
|
+
rails g beautiful_sorcery
|
90
|
+
rails g beautiful_cancancan
|
91
|
+
|
92
|
+
=== Storage (ActiveStorage)
|
75
93
|
|
76
|
-
|
94
|
+
rails g beautiful_storage model attachment_field
|
77
95
|
|
78
96
|
=== In views
|
79
97
|
|
@@ -103,7 +121,7 @@ Example : when you click on the #bs-help tag presentation tour display on screen
|
|
103
121
|
|
104
122
|
If you want to add 'slide' :
|
105
123
|
|
106
|
-
For add instruction to element, add this to your markup :
|
124
|
+
For add instruction to DOM element, add this to your markup :
|
107
125
|
|
108
126
|
id="myunique-id-in-the-page" data-present-title="Title for the slide" data-present-description="Short description" data-present-order="1"
|
109
127
|
|
data/Rakefile
CHANGED
@@ -16,11 +16,8 @@ end
|
|
16
16
|
|
17
17
|
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
18
|
load 'rails/tasks/engine.rake'
|
19
|
-
|
20
19
|
load 'rails/tasks/statistics.rake'
|
21
|
-
|
22
20
|
require 'bundler/gem_tasks'
|
23
|
-
|
24
21
|
require 'rake/testtask'
|
25
22
|
|
26
23
|
Rake::TestTask.new(:test) do |t|
|
data/beautiful_scaffold.gemspec
CHANGED
data/lib/generators/USAGE
CHANGED
@@ -1,16 +1,30 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
#
|
2
|
+
# How to test Beautiful-Scaffold in a fresh rails app
|
3
|
+
#
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
rails generate beautiful_migration AddColorToProducts color:string
|
5
|
+
rails new my_test_app
|
6
|
+
cd my_test_app
|
7
|
+
echo "gem 'beautiful_scaffold', '2.0.2'" >> Gemfile
|
8
|
+
bundle update
|
10
9
|
|
11
|
-
|
10
|
+
rails generate beautiful_scaffold family name:string description:wysiwyg
|
11
|
+
rails generate beautiful_scaffold product family:references price:price name:string visible:boolean description:wysiwyg
|
12
|
+
rails generate beautiful_scaffold user pseudo:string email:string
|
13
|
+
rails generate beautiful_scaffold tag name:string
|
12
14
|
|
13
|
-
|
15
|
+
rails generate beautiful_jointable product tag
|
16
|
+
|
17
|
+
rails generate beautiful_migration AddColorSecToProducts color_secondary:color
|
18
|
+
|
19
|
+
rails generate beautiful_locale fr
|
20
|
+
|
21
|
+
rails generate beautiful_sorcery
|
22
|
+
rails generate beautiful_cancancan
|
23
|
+
|
24
|
+
rake db:migrate
|
25
|
+
rails server
|
26
|
+
|
27
|
+
# Open a web browser http://localhost:3000/
|
28
|
+
# Register, and copy/paste the link you see in the rails server log : e.g. http://localhost:3000/users/axfEQ8i38ZtXTi-oTzuw/activate
|
14
29
|
|
15
|
-
rails generate beautiful_devisecancan user
|
16
30
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding : utf-8
|
2
|
+
class BeautifulCancancanGenerator < Rails::Generators::Base
|
3
|
+
require_relative 'beautiful_scaffold_common_methods'
|
4
|
+
include BeautifulScaffoldCommonMethods
|
5
|
+
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
7
|
+
|
8
|
+
#argument :model, :type => :string, :desc => "Name of model (ex: user)"
|
9
|
+
|
10
|
+
def install_cancancan
|
11
|
+
model = "user"
|
12
|
+
|
13
|
+
gem("cancancan", "3.2.1")
|
14
|
+
|
15
|
+
Bundler.with_unbundled_env do
|
16
|
+
run "bundle install"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Because generators doesn't work !
|
20
|
+
copy_file("app/models/ability.rb")
|
21
|
+
|
22
|
+
# Why that doesn't work... boring...
|
23
|
+
#puts rails_command("generate cancan:ability", capture: true)
|
24
|
+
# Why that doesn't work too... boring...
|
25
|
+
#generate("cancan:ability")
|
26
|
+
|
27
|
+
# current_user method need for CanCan
|
28
|
+
current_user_method = ""
|
29
|
+
if model != "user" then
|
30
|
+
current_user_method = "
|
31
|
+
def current_user
|
32
|
+
current_#{model}
|
33
|
+
end"
|
34
|
+
end
|
35
|
+
|
36
|
+
# Exception for AccessDenied
|
37
|
+
inject_into_file("app/controllers/application_controller.rb", "
|
38
|
+
rescue_from CanCan::AccessDenied do |exception|
|
39
|
+
respond_to do |format|
|
40
|
+
format.json { head :forbidden, content_type: 'text/html' }
|
41
|
+
format.html { redirect_to root_url, :alert => exception.message }
|
42
|
+
format.js { head :forbidden, content_type: 'text/html' }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
#{current_user_method}
|
46
|
+
", :after => "class ApplicationController < ActionController::Base\n")
|
47
|
+
|
48
|
+
# Access controlled by CanCanCan (in beautiful_scaffold)
|
49
|
+
inject_into_file("app/controllers/application_controller.rb", "#", :before => "before_action :authenticate_#{model}!, :except => [:dashboard]")
|
50
|
+
end
|
51
|
+
end
|
@@ -5,7 +5,7 @@ class BeautifulJointableGenerator < Rails::Generators::Base
|
|
5
5
|
|
6
6
|
source_root File.expand_path('../templates', __FILE__)
|
7
7
|
|
8
|
-
argument :join_models, :type => :array, :default => [], :banner => "model
|
8
|
+
argument :join_models, :type => :array, :default => [], :banner => "Two model names singular downcase (ex: product family)"
|
9
9
|
|
10
10
|
class_option :mountable_engine, default: nil
|
11
11
|
|
@@ -42,10 +42,8 @@ class BeautifulJointableGenerator < Rails::Generators::Base
|
|
42
42
|
# Add habtm relation
|
43
43
|
inject_into_file("app/models/#{engine_name}#{sorted_model[0]}.rb", "\n #{engine_name.present? ? ' ' : ''}has_and_belongs_to_many :#{sorted_model[1].pluralize}", :after => "ApplicationRecord")
|
44
44
|
inject_into_file("app/models/#{engine_name}#{sorted_model[1]}.rb", "\n #{engine_name.present? ? ' ' : ''}has_and_belongs_to_many :#{sorted_model[0].pluralize}", :after => "ApplicationRecord")
|
45
|
-
inject_into_file("app/models/#{engine_name}#{sorted_model[0]}.rb", "{ :#{sorted_model[1]}_ids => [] }, ", :after =>
|
46
|
-
return
|
47
|
-
inject_into_file("app/models/#{engine_name}#{sorted_model[1]}.rb", "{ :#{sorted_model[0]}_ids => [] }, ", :after => "permitted_attributes
|
48
|
-
return ")
|
45
|
+
inject_into_file("app/models/#{engine_name}#{sorted_model[0]}.rb", "{ :#{sorted_model[1]}_ids => [] }, ", :after => /permitted_attributes#{regexp_an_string}return /)
|
46
|
+
inject_into_file("app/models/#{engine_name}#{sorted_model[1]}.rb", "{ :#{sorted_model[0]}_ids => [] }, ", :after => /permitted_attributes#{regexp_an_string}return /)
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
@@ -5,7 +5,7 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
5
5
|
|
6
6
|
source_root File.expand_path('../templates', __FILE__)
|
7
7
|
|
8
|
-
argument :name, :type => :string, :desc => "type of locale : fr
|
8
|
+
argument :name, :type => :string, :desc => "type of locale : fr, en, de, all"
|
9
9
|
|
10
10
|
class_option :mountable_engine, :default => nil
|
11
11
|
|
@@ -18,13 +18,15 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
18
18
|
|
19
19
|
def install_locale
|
20
20
|
list_locales.each{ |temp_locale|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
|
22
|
+
["beautiful_scaffold.#{temp_locale}.yml"].each do |filename|
|
23
|
+
gem_localepath = "app/locales/#{filename}"
|
24
|
+
app_localepath = "config/locales/#{filename}"
|
25
|
+
begin
|
26
|
+
copy_file gem_localepath, app_localepath
|
27
|
+
rescue
|
28
|
+
say_status("Error", "This beautiful_locale #{temp_locale} doesn't exist !", :red)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
rails_locale_file = "#{temp_locale}.yml"
|
@@ -36,7 +38,7 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
36
38
|
end
|
37
39
|
|
38
40
|
willpaginate_locale_file = "will_paginate.#{temp_locale}.yml"
|
39
|
-
download_path = "https://raw.
|
41
|
+
download_path = "https://raw.githubusercontent.com/tigrish/will-paginate-i18n/master/config/locales/#{temp_locale}.yml"
|
40
42
|
begin
|
41
43
|
get download_path, "config/locales/#{willpaginate_locale_file}"
|
42
44
|
say_status("Warning", "You must modify Will_paginate locale at : Rails.root/config/locale/#{willpaginate_locale_file}", :red)
|
@@ -51,8 +53,8 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
51
53
|
def regenerate_app_locale
|
52
54
|
require 'net/http'
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
+
app_path = (Rails.root || engine_opt)
|
57
|
+
app_name = Rails.application.class.name.split('::').first.downcase
|
56
58
|
prefix = engine_opt.blank? ? '' : "#{engine_opt.camelize}::"
|
57
59
|
|
58
60
|
already_processed = {}
|
@@ -63,7 +65,7 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
63
65
|
|
64
66
|
already_processed[locale] ||= {}
|
65
67
|
|
66
|
-
filepath = File.join(
|
68
|
+
filepath = File.join(app_path, 'config', 'locales', "#{app_name}.#{locale}.yml")
|
67
69
|
begin
|
68
70
|
if File.exist?(filepath)
|
69
71
|
hi18n = YAML.load_file(filepath)
|
@@ -154,7 +156,7 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
154
156
|
File.unlink(filepath) if File.exist?(filepath)
|
155
157
|
|
156
158
|
file = File.open(filepath, "w")
|
157
|
-
file.write(hi18n.to_yaml)
|
159
|
+
file.write(hi18n[locale].to_yaml)
|
158
160
|
file.close
|
159
161
|
end
|
160
162
|
end
|
@@ -60,7 +60,9 @@ class BeautifulMigrationGenerator < Rails::Generators::Base
|
|
60
60
|
private
|
61
61
|
|
62
62
|
def model
|
63
|
-
|
63
|
+
model_extracted = name.scan(/^Add(.*)To(.*)$/).flatten[1].underscore.singularize
|
64
|
+
model_extracted = model_extracted.gsub("#{options[:mountable_engine].underscore}_",'') if !options[:mountable_engine].blank?
|
65
|
+
return model_extracted
|
64
66
|
end
|
65
67
|
|
66
68
|
end
|
@@ -51,6 +51,10 @@ module BeautifulScaffoldCommonMethods
|
|
51
51
|
return result
|
52
52
|
end
|
53
53
|
|
54
|
+
def regexp_an_string
|
55
|
+
'\s*\R\s*'
|
56
|
+
end
|
57
|
+
|
54
58
|
############
|
55
59
|
# Models
|
56
60
|
############
|
@@ -195,7 +199,7 @@ module BeautifulScaffoldCommonMethods
|
|
195
199
|
'prawn-table' => nil, #'0.2.2',
|
196
200
|
'sanitize' => nil,
|
197
201
|
#'twitter-bootstrap-rails' => '3.2.2', # Bootstrap 3 for Rails 6+
|
198
|
-
'bootstrap' => '~>
|
202
|
+
'bootstrap' => '~> 5.1.0', # Bootstrap 4 for Rails 6+
|
199
203
|
'font-awesome-sass' => '~> 5.13.0',
|
200
204
|
'momentjs-rails' => '>= 2.9.0',
|
201
205
|
'bootstrap4-datetime-picker-rails' => nil,
|
@@ -208,8 +212,12 @@ module BeautifulScaffoldCommonMethods
|
|
208
212
|
puts "============> Engine : You must add gems to your main app \n #{gems.to_a.map{ |a| "gem '#{a[0]}'#{(a[1].nil? ? '' : ", '#{a[1]}'")} " }.join("\n")}"
|
209
213
|
end
|
210
214
|
|
215
|
+
gemfile_content = File.read('Gemfile')
|
211
216
|
gems.each{ |gem_to_add, version|
|
212
|
-
|
217
|
+
# Bug add at every times, need to check if already present
|
218
|
+
if !gemfile_content.include?(gem_to_add)
|
219
|
+
gem(gem_to_add, version)
|
220
|
+
end
|
213
221
|
}
|
214
222
|
end
|
215
223
|
|
@@ -13,7 +13,7 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
13
13
|
|
14
14
|
source_root File.expand_path('../templates', __FILE__)
|
15
15
|
|
16
|
-
argument :model_opt, type: :string, desc: "Name of model (
|
16
|
+
argument :model_opt, type: :string, desc: "Name of model singular downcase (ex: family)"
|
17
17
|
argument :myattributes, type: :array, default: [], banner: "field:type field:type"
|
18
18
|
|
19
19
|
class_option :namespace, default: nil
|
@@ -62,8 +62,6 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
62
62
|
# Css
|
63
63
|
bc_css = [
|
64
64
|
"beautiful-scaffold.css.scss",
|
65
|
-
"tagit-dark-grey.css",
|
66
|
-
"colorpicker.css",
|
67
65
|
"bootstrap-wysihtml5.css"
|
68
66
|
]
|
69
67
|
|
@@ -80,8 +78,6 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
80
78
|
|
81
79
|
if !engine_name.blank?
|
82
80
|
['beautiful-scaffold',
|
83
|
-
'tagit-dark-grey',
|
84
|
-
'colorpicker',
|
85
81
|
'bootstrap-wysihtml5'].each do |fileassets|
|
86
82
|
gsub_file File.join(stylesheetspath_dest, "application-bs.scss"), " *= require #{fileassets}", " *= require #{engine_name}#{fileassets}"
|
87
83
|
end
|
@@ -102,8 +98,6 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
102
98
|
"bootstrap-datetimepicker-for-beautiful-scaffold.js",
|
103
99
|
"jquery-barcode.js",
|
104
100
|
"jstree.min.js",
|
105
|
-
"tagit.js",
|
106
|
-
"bootstrap-colorpicker.js",
|
107
101
|
"a-wysihtml5-0.3.0.min.js",
|
108
102
|
"bootstrap-wysihtml5.js",
|
109
103
|
"fixed_menu.js"
|
@@ -115,10 +109,8 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
115
109
|
|
116
110
|
if !engine_name.blank?
|
117
111
|
['a-wysihtml5-0.3.0.min',
|
118
|
-
'bootstrap-colorpicker',
|
119
112
|
'bootstrap-datetimepicker-for-beautiful-scaffold',
|
120
113
|
'bootstrap-wysihtml5',
|
121
|
-
'tagit.js',
|
122
114
|
'jstree.min.js',
|
123
115
|
'jquery-barcode',
|
124
116
|
'beautiful_scaffold',
|
@@ -145,7 +137,7 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
145
137
|
manifest_prefix = ""
|
146
138
|
end
|
147
139
|
#append_to_file("app/assets/config/#{manifest_prefix}manifest.js", '//= link_directory ../stylesheets/faq .css')
|
148
|
-
append_to_file("app/assets/config/#{manifest_prefix}manifest.js", '//= link_directory ../javascripts
|
140
|
+
append_to_file("app/assets/config/#{manifest_prefix}manifest.js", '//= link_directory ../javascripts .js')
|
149
141
|
end
|
150
142
|
|
151
143
|
def generate_layout
|