|
@@ -36,9 +36,9 @@ def rails_6?
|
|
|
end
|
|
|
|
|
|
def add_gems
|
|
|
- gem 'administrate', github: "thoughtbot/administrate"
|
|
|
+ gem 'administrate', github: "excid3/administrate", branch: 'jumpstart'
|
|
|
gem 'bootstrap', '~> 4.3', '>= 4.3.1'
|
|
|
- gem 'devise', '~> 4.6', '>= 4.6.1'
|
|
|
+ gem 'devise', '~> 4.7', '>= 4.7.0'
|
|
|
gem 'devise-bootstrapped', github: 'excid3/devise-bootstrapped', branch: 'bootstrap4'
|
|
|
gem 'devise_masquerade', '~> 0.6.2'
|
|
|
gem 'font-awesome-sass', '~> 5.6', '>= 5.6.1'
|
|
@@ -53,7 +53,8 @@ def add_gems
|
|
|
gem 'sitemap_generator', '~> 6.0', '>= 6.0.1'
|
|
|
gem 'whenever', require: false
|
|
|
gem 'simple_form', '~> 4.1.0'
|
|
|
-
|
|
|
+ gem "breadcrumbs_on_rails", '~> 3.0.1'
|
|
|
+
|
|
|
gem_group :development do
|
|
|
gem 'pry', '~> 0.12.2'
|
|
|
gem 'bullet', '~> 6.0.0'
|
|
@@ -183,9 +184,9 @@ end
|
|
|
def add_administrate
|
|
|
generate "administrate:install"
|
|
|
|
|
|
- #gsub_file "app/dashboards/announcement_dashboard.rb",
|
|
|
- #/announcement_type: Field::String/,
|
|
|
- #"announcement_type: Field::Select.with_options(collection: Announcement::TYPES)"
|
|
|
+ gsub_file "app/dashboards/announcement_dashboard.rb",
|
|
|
+ /announcement_type: Field::String/,
|
|
|
+ "announcement_type: Field::Select.with_options(collection: Announcement::TYPES)"
|
|
|
|
|
|
gsub_file "app/dashboards/user_dashboard.rb",
|
|
|
/email: Field::String/,
|
|
@@ -246,6 +247,14 @@ def add_simple_form
|
|
|
generate "simple_form:install --bootstrap"
|
|
|
end
|
|
|
|
|
|
+def add_breadcrumbs
|
|
|
+ content = <<-RUBY
|
|
|
+ config.i18n.default_locale = 'zh-TW'
|
|
|
+ config.time_zone = 'Taipei'
|
|
|
+ RUBY
|
|
|
+ insert_into_file "config/application.rb", "#{content}\n\n", after: "class Application < Rails::Application\n"
|
|
|
+end
|
|
|
+
|
|
|
def stop_spring
|
|
|
run "spring stop"
|
|
|
end
|
|
@@ -299,6 +308,7 @@ after_bundle do
|
|
|
add_sidekiq
|
|
|
add_friendly_id
|
|
|
add_simple_form
|
|
|
+ add_breadcrumbs
|
|
|
|
|
|
copy_templates
|
|
|
add_whenever
|