spina-admin-conferences-blog 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +42 -0
- data/Rakefile +34 -0
- data/app/assets/config/spina_admin_conferences_blog_manifest.js +0 -0
- data/app/controllers/spina/admin/conferences/blog/categories_controller.rb +80 -0
- data/app/controllers/spina/admin/conferences/blog/posts_controller.rb +103 -0
- data/app/decorators/spina/admin/conferences/blog/post_decorator.rb +26 -0
- data/app/helpers/spina/admin/conferences/blog/posts_helper.rb +18 -0
- data/app/models/spina/admin/conferences/blog/application_record.rb +12 -0
- data/app/models/spina/admin/conferences/blog/category.rb +23 -0
- data/app/models/spina/admin/conferences/blog/post.rb +52 -0
- data/app/models/spina/admin/conferences/blog.rb +10 -0
- data/app/views/layouts/spina/admin/conferences/blog/blog.html.haml +29 -0
- data/app/views/layouts/spina/admin/conferences/blog/categories.html.haml +10 -0
- data/app/views/spina/admin/conferences/blog/categories/_category.html.haml +8 -0
- data/app/views/spina/admin/conferences/blog/categories/_form.html.haml +42 -0
- data/app/views/spina/admin/conferences/blog/categories/edit.html.haml +3 -0
- data/app/views/spina/admin/conferences/blog/categories/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/blog/categories/new.html.haml +2 -0
- data/app/views/spina/admin/conferences/blog/posts/_form.html.haml +43 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_configuration.html.haml +50 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_content.html.haml +46 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_seo.html.haml +14 -0
- data/app/views/spina/admin/conferences/blog/posts/_post.html.haml +19 -0
- data/app/views/spina/admin/conferences/blog/posts/edit.html.haml +3 -0
- data/app/views/spina/admin/conferences/blog/posts/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/blog/posts/new.html.haml +2 -0
- data/app/views/spina/admin/hooks/conferences/blog/_primary_navigation.html.haml +10 -0
- data/config/initializers/friendly_id.rb +94 -0
- data/config/locales/en.yml +41 -0
- data/config/locales/nl.yml +42 -0
- data/config/locales/pt-BR.yml +41 -0
- data/config/routes.rb +32 -0
- data/db/migrate/1_create_spina_blog_posts.rb +18 -0
- data/db/migrate/2_create_spina_blog_friendly_id_slugs.rb +19 -0
- data/db/migrate/3_create_spina_blog_categories.rb +12 -0
- data/db/migrate/4_add_category_id_to_spina_blog_posts.rb +7 -0
- data/db/migrate/5_add_featured_to_spina_blog_posts.rb +9 -0
- data/db/migrate/6_add_seo_fields.rb +11 -0
- data/lib/generators/spina_admin_conferences_blog/install_generator.rb +24 -0
- data/lib/spina/admin/conferences/blog/configuration.rb +17 -0
- data/lib/spina/admin/conferences/blog/engine.rb +24 -0
- data/lib/spina/admin/conferences/blog/version.rb +8 -0
- data/lib/spina/admin/conferences/blog.rb +18 -0
- data/lib/spina/admin/conferences.rb +6 -0
- data/lib/spina/admin.rb +5 -0
- data/lib/tasks/spina/admin/conferences/blog_tasks.rake +14 -0
- data/spec/controllers/spina/admin/conferences/blog/categories_controller_spec.rb +99 -0
- data/spec/controllers/spina/admin/conferences/blog/posts_controller_spec.rb +152 -0
- data/spec/dummy/Rakefile +8 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/default/application.css.sass +0 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/jobs/application_job.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/application_record.rb +6 -0
- data/spec/dummy/app/views/default/pages/homepage.html.haml +2 -0
- data/spec/dummy/app/views/default/pages/show.html.haml +3 -0
- data/spec/dummy/app/views/default/shared/_navigation.html.haml +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/default/application.html.haml +11 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/config/application.rb +16 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/database.yml +17 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +56 -0
- data/spec/dummy/config/environments/production.rb +88 -0
- data/spec/dummy/config/environments/test.rb +44 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +13 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/mobility.rb +16 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +25 -0
- data/spec/dummy/config/initializers/session_store.rb +5 -0
- data/spec/dummy/config/initializers/spina.rb +22 -0
- data/spec/dummy/config/initializers/themes/default.rb +32 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/puma.rb +49 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/db/migrate/20190513103729_create_spina_tables.spina.rb +132 -0
- data/spec/dummy/db/migrate/20190513103730_create_spina_translation_tables.spina.rb +46 -0
- data/spec/dummy/db/migrate/20190513103731_create_spina_navigations.spina.rb +24 -0
- data/spec/dummy/db/migrate/20190513103732_add_password_reset_token_to_spina_users.spina.rb +9 -0
- data/spec/dummy/db/migrate/20190513103733_remove_translated_columns.spina.rb +14 -0
- data/spec/dummy/db/migrate/20190513103734_create_spina_options.spina.rb +11 -0
- data/spec/dummy/db/migrate/20190513103735_create_spina_settings.spina.rb +14 -0
- data/spec/dummy/db/migrate/20190513103736_create_spina_media_folders.spina.rb +11 -0
- data/spec/dummy/db/migrate/20190513103737_create_spina_images.spina.rb +13 -0
- data/spec/dummy/db/migrate/20190513103738_create_spina_image_collections.spina.rb +17 -0
- data/spec/dummy/db/migrate/20190513103739_create_spina_resources.spina.rb +18 -0
- data/spec/dummy/db/schema.rb +288 -0
- data/spec/dummy/db/seeds.rb +4 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/spina/admin/conferences/blog/categories.rb +11 -0
- data/spec/factories/spina/admin/conferences/blog/posts.rb +16 -0
- data/spec/models/spina/admin/conferences/blog/category_spec.rb +21 -0
- data/spec/models/spina/admin/conferences/blog/post_spec.rb +39 -0
- data/spec/rails_helper.rb +68 -0
- data/spec/spec_helper.rb +97 -0
- data/spec/support/capybara.rb +25 -0
- data/spec/support/controller_helpers.rb +25 -0
- data/spec/support/controller_routes.rb +13 -0
- data/spec/support/factory_bot.rb +5 -0
- data/spec/support/rails_controller_testing.rb +13 -0
- data/spec/support/system_tests.rb +11 -0
- data/spec/system/spina/admin/conferences/blog/posts_spec.rb +34 -0
- data/spec/system/support/image.png +0 -0
- metadata +508 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# Code is not reloaded between requests.
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Eager load code on boot. This eager loads most of Rails and
|
10
|
+
# your application in memory, allowing both threaded web servers
|
11
|
+
# and those relying on copy on write to perform better.
|
12
|
+
# Rake tasks automatically ignore this option for performance.
|
13
|
+
config.eager_load = true
|
14
|
+
|
15
|
+
# Full error reports are disabled and caching is turned on.
|
16
|
+
config.consider_all_requests_local = false
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
# Disable serving static files from the `/public` folder by default since
|
20
|
+
# Apache or NGINX already handles this.
|
21
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
22
|
+
|
23
|
+
# Compress JavaScripts and CSS.
|
24
|
+
config.assets.js_compressor = :uglifier
|
25
|
+
# config.assets.css_compressor = :sass
|
26
|
+
|
27
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
28
|
+
config.assets.compile = false
|
29
|
+
|
30
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
31
|
+
|
32
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
33
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
34
|
+
|
35
|
+
# Specifies the header that your server uses for sending files.
|
36
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
37
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
38
|
+
|
39
|
+
# Mount Action Cable outside main process or domain
|
40
|
+
# config.action_cable.mount_path = nil
|
41
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
42
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
43
|
+
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
46
|
+
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
50
|
+
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
config.log_tags = [:request_id]
|
53
|
+
|
54
|
+
# Use a different cache store in production.
|
55
|
+
# config.cache_store = :mem_cache_store
|
56
|
+
|
57
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
58
|
+
# config.active_job.queue_adapter = :resque
|
59
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
60
|
+
config.action_mailer.perform_caching = false
|
61
|
+
|
62
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
63
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
64
|
+
# config.action_mailer.raise_delivery_errors = false
|
65
|
+
|
66
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
67
|
+
# the I18n.default_locale when a translation cannot be found).
|
68
|
+
config.i18n.fallbacks = true
|
69
|
+
|
70
|
+
# Send deprecation notices to registered listeners.
|
71
|
+
config.active_support.deprecation = :notify
|
72
|
+
|
73
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
74
|
+
config.log_formatter = ::Logger::Formatter.new
|
75
|
+
|
76
|
+
# Use a different logger for distributed setups.
|
77
|
+
# require 'syslog/logger'
|
78
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
79
|
+
|
80
|
+
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
81
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
82
|
+
logger.formatter = config.log_formatter
|
83
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Do not dump schema after migrations.
|
87
|
+
config.active_record.dump_schema_after_migration = false
|
88
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# The test environment is used exclusively to run your application's
|
7
|
+
# test suite. You never need to work with it otherwise. Remember that
|
8
|
+
# your test database is "scratch space" for the test suite and is wiped
|
9
|
+
# and recreated between test runs. Don't rely on the data there!
|
10
|
+
config.cache_classes = true
|
11
|
+
|
12
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
13
|
+
# just for the purpose of running a single test. If you are using a tool that
|
14
|
+
# preloads Rails for running tests, you may have to set it to true.
|
15
|
+
config.eager_load = false
|
16
|
+
|
17
|
+
# Configure public file server for tests with Cache-Control for performance.
|
18
|
+
config.public_file_server.enabled = true
|
19
|
+
config.public_file_server.headers = {
|
20
|
+
'Cache-Control' => 'public, max-age=3600'
|
21
|
+
}
|
22
|
+
|
23
|
+
# Show full error reports and disable caching.
|
24
|
+
config.consider_all_requests_local = true
|
25
|
+
config.action_controller.perform_caching = false
|
26
|
+
|
27
|
+
# Raise exceptions instead of rendering exception templates.
|
28
|
+
config.action_dispatch.show_exceptions = false
|
29
|
+
|
30
|
+
# Disable request forgery protection in test environment.
|
31
|
+
config.action_controller.allow_forgery_protection = false
|
32
|
+
config.action_mailer.perform_caching = false
|
33
|
+
|
34
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
35
|
+
# The :test delivery method accumulates sent emails in the
|
36
|
+
# ActionMailer::Base.deliveries array.
|
37
|
+
config.action_mailer.delivery_method = :test
|
38
|
+
|
39
|
+
# Print deprecation notices to the stderr.
|
40
|
+
config.active_support.deprecation = :stderr
|
41
|
+
|
42
|
+
# Raises error for missing translations
|
43
|
+
# config.action_view.raise_on_missing_translations = true
|
44
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Version of your assets, change this if you want to expire all your assets.
|
6
|
+
Rails.application.config.assets.version = '1.0'
|
7
|
+
|
8
|
+
# Add additional assets to the asset load path
|
9
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
10
|
+
|
11
|
+
# Precompile additional assets.
|
12
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
13
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
6
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
7
|
+
|
8
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
9
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Specify a serializer for the signed and encrypted cookie jars.
|
6
|
+
# Valid options are :json, :marshal, and :hybrid.
|
7
|
+
Rails.application.config.action_dispatch.cookies_serializer = :json
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Add new inflection rules using the following format. Inflections
|
6
|
+
# are locale specific, and you may define rules for as many different
|
7
|
+
# locales as you wish. All of these examples are active by default:
|
8
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
9
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
10
|
+
# inflect.singular /^(ox)en/i, '\1'
|
11
|
+
# inflect.irregular 'person', 'people'
|
12
|
+
# inflect.uncountable %w( fish sheep )
|
13
|
+
# end
|
14
|
+
|
15
|
+
# These inflection rules are supported but not enabled by default:
|
16
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
17
|
+
# inflect.acronym 'RESTful'
|
18
|
+
# end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Mobility.configure do
|
4
|
+
plugins do
|
5
|
+
backend :table
|
6
|
+
active_record
|
7
|
+
reader
|
8
|
+
writer
|
9
|
+
backend_reader
|
10
|
+
query
|
11
|
+
cache
|
12
|
+
presence
|
13
|
+
fallbacks false # default to false, enable if passed fallbacks: true
|
14
|
+
default
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
#
|
5
|
+
# This file contains migration options to ease your Rails 5.0 upgrade.
|
6
|
+
#
|
7
|
+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
8
|
+
|
9
|
+
Rails.application.config.raise_on_unfiltered_parameters = true
|
10
|
+
|
11
|
+
# Enable per-form CSRF tokens. Previous versions had false.
|
12
|
+
Rails.application.config.action_controller.per_form_csrf_tokens = true
|
13
|
+
|
14
|
+
# Enable origin-checking CSRF mitigation. Previous versions had false.
|
15
|
+
Rails.application.config.action_controller.forgery_protection_origin_check = true
|
16
|
+
|
17
|
+
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
|
18
|
+
# Previous versions had false.
|
19
|
+
ActiveSupport.to_time_preserves_timezone = true
|
20
|
+
|
21
|
+
# Require `belongs_to` associations by default. Previous versions had false.
|
22
|
+
Rails.application.config.active_record.belongs_to_required_by_default = true
|
23
|
+
|
24
|
+
# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
|
25
|
+
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Spina.configure do |config|
|
4
|
+
# Set locales
|
5
|
+
config.locales = [:en]
|
6
|
+
# Run `rake spina:update_translations` after you add any new locale.
|
7
|
+
|
8
|
+
# Important Note
|
9
|
+
# ==============
|
10
|
+
|
11
|
+
# You MUST restart your server before changes to this file
|
12
|
+
# will take effect.
|
13
|
+
|
14
|
+
# Specify a backend path. Defaults to /admin.
|
15
|
+
# config.backend_path = 'admin'
|
16
|
+
|
17
|
+
# Pages Options
|
18
|
+
# ===============
|
19
|
+
|
20
|
+
# Note that you might need to remove cached asset after changing this value
|
21
|
+
# config.max_page_depth = 5
|
22
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
::Spina::Theme.register do |theme|
|
4
|
+
theme.name = 'default'
|
5
|
+
theme.title = 'Default Theme'
|
6
|
+
theme.plugins = ['conferences-blog']
|
7
|
+
|
8
|
+
theme.page_parts = [{
|
9
|
+
name: 'text',
|
10
|
+
title: 'Text',
|
11
|
+
partable_type: 'Spina::Text'
|
12
|
+
}]
|
13
|
+
|
14
|
+
theme.view_templates = [{
|
15
|
+
name: 'homepage',
|
16
|
+
title: 'Homepage',
|
17
|
+
page_parts: ['text']
|
18
|
+
}, {
|
19
|
+
name: 'show',
|
20
|
+
title: 'Default',
|
21
|
+
description: 'A simple page',
|
22
|
+
usage: 'Use for your content',
|
23
|
+
page_parts: ['text']
|
24
|
+
}]
|
25
|
+
|
26
|
+
theme.custom_pages = [{
|
27
|
+
name: 'homepage',
|
28
|
+
title: 'Homepage',
|
29
|
+
deletable: false,
|
30
|
+
view_template: 'homepage'
|
31
|
+
}]
|
32
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
6
|
+
# is enabled by default.
|
7
|
+
|
8
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
9
|
+
ActiveSupport.on_load(:action_controller) do
|
10
|
+
wrap_parameters format: [:json]
|
11
|
+
end
|
12
|
+
|
13
|
+
# To enable root element in JSON for ActiveRecord objects.
|
14
|
+
# ActiveSupport.on_load(:active_record) do
|
15
|
+
# self.include_root_in_json = true
|
16
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
4
|
+
# The `threads` method setting takes two numbers a minimum and maximum.
|
5
|
+
# Any libraries that use thread pools should be configured to match
|
6
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
7
|
+
# and maximum, this matches the default thread size of Active Record.
|
8
|
+
#
|
9
|
+
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
|
10
|
+
threads threads_count, threads_count
|
11
|
+
|
12
|
+
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
13
|
+
#
|
14
|
+
port ENV.fetch('PORT') { 3000 }
|
15
|
+
|
16
|
+
# Specifies the `environment` that Puma will run in.
|
17
|
+
#
|
18
|
+
environment ENV.fetch('RAILS_ENV') { 'development' }
|
19
|
+
|
20
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
21
|
+
# Workers are forked webserver processes. If using threads and workers together
|
22
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
23
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
24
|
+
# processes).
|
25
|
+
#
|
26
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
27
|
+
|
28
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
29
|
+
# This directive tells Puma to first boot the application and load code
|
30
|
+
# before forking the application. This takes advantage of Copy On Write
|
31
|
+
# process behavior so workers use less memory. If you use this option
|
32
|
+
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
33
|
+
# block.
|
34
|
+
#
|
35
|
+
# preload_app!
|
36
|
+
|
37
|
+
# The code in the `on_worker_boot` will be called if you are using
|
38
|
+
# clustered mode by specifying a number of `workers`. After each worker
|
39
|
+
# process is booted this block will be run, if you are using `preload_app!`
|
40
|
+
# option you will want to use this block to reconnect to any threads
|
41
|
+
# or connections that may have been created at application boot, Ruby
|
42
|
+
# cannot share connections between processes.
|
43
|
+
#
|
44
|
+
# on_worker_boot do
|
45
|
+
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
46
|
+
# end
|
47
|
+
|
48
|
+
# Allow puma to be restarted by `rails restart` command.
|
49
|
+
plugin :tmp_restart
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rails secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: fd5d2df257571268934314e116e2b0f653436a1829f0d07ba8f5200185b7a9370437196b4a14dd971e000cbffc6ff35c21f06ba22604b71e0807c230450573da
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 89be6b7795346d2da6b1008f5b1b301b1cfed4d8058dd0dd2a74f8370f4b73282a266beaf67bdc91c3c6bee1c0eb2dd55e8a833410803bb1d8fcec5403f2bfd5
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 1)
|
4
|
+
class CreateSpinaTables < ActiveRecord::Migration[4.2]
|
5
|
+
def change
|
6
|
+
create_table 'spina_accounts', force: :cascade do |t|
|
7
|
+
t.string 'name'
|
8
|
+
t.string 'address'
|
9
|
+
t.string 'postal_code'
|
10
|
+
t.string 'city'
|
11
|
+
t.string 'phone'
|
12
|
+
t.string 'email'
|
13
|
+
t.text 'preferences'
|
14
|
+
t.datetime 'created_at', null: false
|
15
|
+
t.datetime 'updated_at', null: false
|
16
|
+
t.boolean 'robots_allowed', default: false
|
17
|
+
end
|
18
|
+
|
19
|
+
create_table 'spina_attachment_collections', force: :cascade do |t|
|
20
|
+
t.datetime 'created_at', null: false
|
21
|
+
t.datetime 'updated_at', null: false
|
22
|
+
end
|
23
|
+
|
24
|
+
create_table 'spina_attachment_collections_attachments', force: :cascade do |t|
|
25
|
+
t.integer 'attachment_collection_id'
|
26
|
+
t.integer 'attachment_id'
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table 'spina_attachments', force: :cascade do |t|
|
30
|
+
t.string 'file'
|
31
|
+
t.datetime 'created_at', null: false
|
32
|
+
t.datetime 'updated_at', null: false
|
33
|
+
end
|
34
|
+
|
35
|
+
create_table 'spina_layout_parts', force: :cascade do |t|
|
36
|
+
t.string 'title'
|
37
|
+
t.string 'name'
|
38
|
+
t.integer 'layout_partable_id'
|
39
|
+
t.string 'layout_partable_type'
|
40
|
+
t.datetime 'created_at'
|
41
|
+
t.datetime 'updated_at'
|
42
|
+
t.integer 'account_id'
|
43
|
+
end
|
44
|
+
|
45
|
+
create_table 'spina_lines', force: :cascade do |t|
|
46
|
+
t.string 'content'
|
47
|
+
t.datetime 'created_at'
|
48
|
+
t.datetime 'updated_at'
|
49
|
+
end
|
50
|
+
|
51
|
+
create_table 'spina_page_parts', force: :cascade do |t|
|
52
|
+
t.string 'title'
|
53
|
+
t.string 'name'
|
54
|
+
t.datetime 'created_at', null: false
|
55
|
+
t.datetime 'updated_at', null: false
|
56
|
+
t.integer 'page_id'
|
57
|
+
t.integer 'page_partable_id'
|
58
|
+
t.string 'page_partable_type'
|
59
|
+
end
|
60
|
+
|
61
|
+
create_table 'spina_pages', force: :cascade do |t|
|
62
|
+
t.string 'title'
|
63
|
+
t.string 'menu_title'
|
64
|
+
t.string 'description'
|
65
|
+
t.boolean 'show_in_menu', default: true
|
66
|
+
t.string 'slug'
|
67
|
+
t.boolean 'deletable', default: true
|
68
|
+
t.datetime 'created_at', null: false
|
69
|
+
t.datetime 'updated_at', null: false
|
70
|
+
t.string 'name'
|
71
|
+
t.string 'seo_title'
|
72
|
+
t.boolean 'skip_to_first_child', default: false
|
73
|
+
t.string 'view_template'
|
74
|
+
t.string 'layout_template'
|
75
|
+
t.boolean 'draft', default: false
|
76
|
+
t.string 'link_url'
|
77
|
+
t.string 'ancestry'
|
78
|
+
t.integer 'position'
|
79
|
+
t.string 'materialized_path'
|
80
|
+
t.boolean 'active', default: true
|
81
|
+
end
|
82
|
+
|
83
|
+
create_table 'spina_structure_items', force: :cascade do |t|
|
84
|
+
t.integer 'structure_id'
|
85
|
+
t.integer 'position'
|
86
|
+
t.datetime 'created_at'
|
87
|
+
t.datetime 'updated_at'
|
88
|
+
end
|
89
|
+
|
90
|
+
add_index 'spina_structure_items', ['structure_id'], name: 'index_spina_structure_items_on_structure_id', using: :btree
|
91
|
+
|
92
|
+
create_table 'spina_structure_parts', force: :cascade do |t|
|
93
|
+
t.integer 'structure_item_id'
|
94
|
+
t.integer 'structure_partable_id'
|
95
|
+
t.string 'structure_partable_type'
|
96
|
+
t.string 'name'
|
97
|
+
t.string 'title'
|
98
|
+
t.datetime 'created_at'
|
99
|
+
t.datetime 'updated_at'
|
100
|
+
end
|
101
|
+
|
102
|
+
add_index 'spina_structure_parts', ['structure_item_id'], name: 'index_spina_structure_parts_on_structure_item_id', using: :btree
|
103
|
+
add_index 'spina_structure_parts', ['structure_partable_id'], name: 'index_spina_structure_parts_on_structure_partable_id', using: :btree
|
104
|
+
|
105
|
+
create_table 'spina_structures', force: :cascade do |t|
|
106
|
+
t.datetime 'created_at'
|
107
|
+
t.datetime 'updated_at'
|
108
|
+
end
|
109
|
+
|
110
|
+
create_table 'spina_texts', force: :cascade do |t|
|
111
|
+
t.text 'content'
|
112
|
+
t.datetime 'created_at'
|
113
|
+
t.datetime 'updated_at'
|
114
|
+
end
|
115
|
+
|
116
|
+
create_table 'spina_users', force: :cascade do |t|
|
117
|
+
t.string 'name'
|
118
|
+
t.string 'email'
|
119
|
+
t.string 'password_digest'
|
120
|
+
t.boolean 'admin', default: false
|
121
|
+
t.datetime 'created_at', null: false
|
122
|
+
t.datetime 'updated_at', null: false
|
123
|
+
t.datetime 'last_logged_in'
|
124
|
+
end
|
125
|
+
|
126
|
+
create_table 'spina_rewrite_rules', force: :cascade do |t|
|
127
|
+
t.string :old_path
|
128
|
+
t.string :new_path
|
129
|
+
t.timestamps
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 2)
|
4
|
+
class CreateSpinaTranslationTables < ActiveRecord::Migration[4.2]
|
5
|
+
def up
|
6
|
+
create_table 'spina_page_translations', force: :cascade do |t|
|
7
|
+
t.integer 'spina_page_id', null: false
|
8
|
+
t.string 'locale', null: false
|
9
|
+
t.string 'title'
|
10
|
+
t.string 'menu_title'
|
11
|
+
t.string 'description'
|
12
|
+
t.string 'seo_title'
|
13
|
+
t.string 'materialized_path'
|
14
|
+
t.datetime 'created_at', null: false
|
15
|
+
t.datetime 'updated_at', null: false
|
16
|
+
t.index ['locale'], name: 'index_spina_page_translations_on_locale'
|
17
|
+
t.index ['spina_page_id'], name: 'index_spina_page_translations_on_spina_page_id'
|
18
|
+
end
|
19
|
+
|
20
|
+
create_table 'spina_line_translations', force: :cascade do |t|
|
21
|
+
t.integer 'spina_line_id', null: false
|
22
|
+
t.string 'locale', null: false
|
23
|
+
t.string 'content'
|
24
|
+
t.datetime 'created_at', null: false
|
25
|
+
t.datetime 'updated_at', null: false
|
26
|
+
t.index ['locale'], name: 'index_spina_line_translations_on_locale'
|
27
|
+
t.index ['spina_line_id'], name: 'index_spina_line_translations_on_spina_line_id'
|
28
|
+
end
|
29
|
+
|
30
|
+
create_table 'spina_text_translations', force: :cascade do |t|
|
31
|
+
t.integer 'spina_text_id', null: false
|
32
|
+
t.string 'locale', null: false
|
33
|
+
t.text 'content'
|
34
|
+
t.datetime 'created_at', null: false
|
35
|
+
t.datetime 'updated_at', null: false
|
36
|
+
t.index ['locale'], name: 'index_spina_text_translations_on_locale'
|
37
|
+
t.index ['spina_text_id'], name: 'index_spina_text_translations_on_spina_text_id'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def down
|
42
|
+
drop_table 'spina_page_translations'
|
43
|
+
drop_table 'spina_text_translations'
|
44
|
+
drop_table 'spina_line_translations'
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 3)
|
4
|
+
class CreateSpinaNavigations < ActiveRecord::Migration[4.2]
|
5
|
+
def change
|
6
|
+
create_table 'spina_navigations', force: :cascade do |t|
|
7
|
+
t.string 'name', null: false
|
8
|
+
t.string 'label', null: false
|
9
|
+
t.boolean 'auto_add_pages', null: false, default: false
|
10
|
+
t.integer 'position', default: 0, null: false
|
11
|
+
t.timestamps
|
12
|
+
t.index ['name'], name: 'index_spina_navigations_on_name', unique: true, using: :btree
|
13
|
+
end
|
14
|
+
|
15
|
+
create_table 'spina_navigation_items', force: :cascade do |t|
|
16
|
+
t.integer 'page_id', null: false
|
17
|
+
t.integer 'navigation_id', null: false
|
18
|
+
t.integer 'position', default: 0, null: false
|
19
|
+
t.string 'ancestry'
|
20
|
+
t.timestamps
|
21
|
+
t.index %w[page_id navigation_id], name: 'index_spina_navigation_items_on_page_id_and_navigation_id', unique: true, using: :btree
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|