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,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 4)
|
4
|
+
class AddPasswordResetTokenToSpinaUsers < ActiveRecord::Migration[5.0]
|
5
|
+
def change
|
6
|
+
add_column :spina_users, :password_reset_token, :string
|
7
|
+
add_column :spina_users, :password_reset_sent_at, :datetime
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 5)
|
4
|
+
class RemoveTranslatedColumns < ActiveRecord::Migration[5.0]
|
5
|
+
def change
|
6
|
+
remove_column :spina_lines, :content
|
7
|
+
remove_column :spina_texts, :content
|
8
|
+
remove_column :spina_pages, :title
|
9
|
+
remove_column :spina_pages, :menu_title
|
10
|
+
remove_column :spina_pages, :description
|
11
|
+
remove_column :spina_pages, :seo_title
|
12
|
+
remove_column :spina_pages, :materialized_path
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 7)
|
4
|
+
class CreateSpinaSettings < ActiveRecord::Migration[5.0]
|
5
|
+
def change
|
6
|
+
create_table :spina_settings do |t|
|
7
|
+
t.string :plugin
|
8
|
+
t.jsonb :preferences, default: {}
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index :spina_settings, :plugin
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 9)
|
4
|
+
class CreateSpinaImages < ActiveRecord::Migration[5.2]
|
5
|
+
def change
|
6
|
+
create_table :spina_images do |t|
|
7
|
+
t.integer :media_folder_id
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :spina_images, :media_folder_id
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 10)
|
4
|
+
class CreateSpinaImageCollections < ActiveRecord::Migration[5.2]
|
5
|
+
def change
|
6
|
+
create_table :spina_image_collections, &:timestamps
|
7
|
+
|
8
|
+
create_table 'spina_image_collections_images', id: :serial, force: :cascade do |t|
|
9
|
+
t.integer 'image_collection_id'
|
10
|
+
t.integer 'image_id'
|
11
|
+
t.integer 'position'
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :spina_image_collections_images, :image_collection_id
|
15
|
+
add_index :spina_image_collections_images, :image_id
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This migration comes from spina (originally 11)
|
4
|
+
class CreateSpinaResources < ActiveRecord::Migration[5.1]
|
5
|
+
def change
|
6
|
+
create_table :spina_resources do |t|
|
7
|
+
t.string :name, null: false, unique: true
|
8
|
+
t.string :label
|
9
|
+
t.string :view_template
|
10
|
+
t.integer :parent_page_id
|
11
|
+
t.string :order_by
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
add_column :spina_pages, :resource_id, :integer, null: true
|
15
|
+
add_index :spina_pages, :resource_id
|
16
|
+
add_index :spina_resources, :parent_page_id
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,288 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
+
# migrations use external dependencies or application code.
|
10
|
+
#
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(version: 2019_05_13_103739) do
|
14
|
+
|
15
|
+
# These are extensions that must be enabled in order to support this database
|
16
|
+
enable_extension "plpgsql"
|
17
|
+
|
18
|
+
create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|
|
19
|
+
t.string "slug", null: false
|
20
|
+
t.integer "sluggable_id", null: false
|
21
|
+
t.string "sluggable_type", limit: 50
|
22
|
+
t.string "scope"
|
23
|
+
t.datetime "created_at"
|
24
|
+
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
25
|
+
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
26
|
+
t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
|
27
|
+
t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
|
28
|
+
end
|
29
|
+
|
30
|
+
create_table "spina_accounts", id: :serial, force: :cascade do |t|
|
31
|
+
t.string "name"
|
32
|
+
t.string "address"
|
33
|
+
t.string "postal_code"
|
34
|
+
t.string "city"
|
35
|
+
t.string "phone"
|
36
|
+
t.string "email"
|
37
|
+
t.text "preferences"
|
38
|
+
t.datetime "created_at", null: false
|
39
|
+
t.datetime "updated_at", null: false
|
40
|
+
t.boolean "robots_allowed", default: false
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table "spina_attachment_collections", id: :serial, force: :cascade do |t|
|
44
|
+
t.datetime "created_at", null: false
|
45
|
+
t.datetime "updated_at", null: false
|
46
|
+
end
|
47
|
+
|
48
|
+
create_table "spina_attachment_collections_attachments", id: :serial, force: :cascade do |t|
|
49
|
+
t.integer "attachment_collection_id"
|
50
|
+
t.integer "attachment_id"
|
51
|
+
end
|
52
|
+
|
53
|
+
create_table "spina_attachments", id: :serial, force: :cascade do |t|
|
54
|
+
t.string "file"
|
55
|
+
t.datetime "created_at", null: false
|
56
|
+
t.datetime "updated_at", null: false
|
57
|
+
end
|
58
|
+
|
59
|
+
create_table "spina_blog_categories", id: :serial, force: :cascade do |t|
|
60
|
+
t.string "name"
|
61
|
+
t.string "slug"
|
62
|
+
t.datetime "created_at", null: false
|
63
|
+
t.datetime "updated_at", null: false
|
64
|
+
t.index ["slug"], name: "index_spina_blog_categories_on_slug"
|
65
|
+
end
|
66
|
+
|
67
|
+
create_table "spina_blog_posts", id: :serial, force: :cascade do |t|
|
68
|
+
t.string "title"
|
69
|
+
t.text "excerpt"
|
70
|
+
t.text "content"
|
71
|
+
t.integer "image_id"
|
72
|
+
t.boolean "draft"
|
73
|
+
t.datetime "published_at"
|
74
|
+
t.string "slug"
|
75
|
+
t.integer "user_id"
|
76
|
+
t.datetime "created_at", null: false
|
77
|
+
t.datetime "updated_at", null: false
|
78
|
+
t.integer "category_id"
|
79
|
+
t.boolean "featured", default: false
|
80
|
+
t.string "seo_title"
|
81
|
+
t.text "description"
|
82
|
+
t.index ["category_id"], name: "index_spina_blog_posts_on_category_id"
|
83
|
+
t.index ["image_id"], name: "index_spina_blog_posts_on_image_id"
|
84
|
+
t.index ["slug"], name: "index_spina_blog_posts_on_slug"
|
85
|
+
t.index ["user_id"], name: "index_spina_blog_posts_on_user_id"
|
86
|
+
end
|
87
|
+
|
88
|
+
create_table "spina_image_collections", force: :cascade do |t|
|
89
|
+
t.datetime "created_at", null: false
|
90
|
+
t.datetime "updated_at", null: false
|
91
|
+
end
|
92
|
+
|
93
|
+
create_table "spina_image_collections_images", id: :serial, force: :cascade do |t|
|
94
|
+
t.integer "image_collection_id"
|
95
|
+
t.integer "image_id"
|
96
|
+
t.integer "position"
|
97
|
+
t.index ["image_collection_id"], name: "index_spina_image_collections_images_on_image_collection_id"
|
98
|
+
t.index ["image_id"], name: "index_spina_image_collections_images_on_image_id"
|
99
|
+
end
|
100
|
+
|
101
|
+
create_table "spina_images", force: :cascade do |t|
|
102
|
+
t.integer "media_folder_id"
|
103
|
+
t.datetime "created_at", null: false
|
104
|
+
t.datetime "updated_at", null: false
|
105
|
+
t.index ["media_folder_id"], name: "index_spina_images_on_media_folder_id"
|
106
|
+
end
|
107
|
+
|
108
|
+
create_table "spina_layout_parts", id: :serial, force: :cascade do |t|
|
109
|
+
t.string "title"
|
110
|
+
t.string "name"
|
111
|
+
t.integer "layout_partable_id"
|
112
|
+
t.string "layout_partable_type"
|
113
|
+
t.datetime "created_at"
|
114
|
+
t.datetime "updated_at"
|
115
|
+
t.integer "account_id"
|
116
|
+
end
|
117
|
+
|
118
|
+
create_table "spina_line_translations", id: :serial, force: :cascade do |t|
|
119
|
+
t.integer "spina_line_id", null: false
|
120
|
+
t.string "locale", null: false
|
121
|
+
t.string "content"
|
122
|
+
t.datetime "created_at", null: false
|
123
|
+
t.datetime "updated_at", null: false
|
124
|
+
t.index ["locale"], name: "index_spina_line_translations_on_locale"
|
125
|
+
t.index ["spina_line_id"], name: "index_spina_line_translations_on_spina_line_id"
|
126
|
+
end
|
127
|
+
|
128
|
+
create_table "spina_lines", id: :serial, force: :cascade do |t|
|
129
|
+
t.datetime "created_at"
|
130
|
+
t.datetime "updated_at"
|
131
|
+
end
|
132
|
+
|
133
|
+
create_table "spina_media_folders", force: :cascade do |t|
|
134
|
+
t.string "name"
|
135
|
+
t.datetime "created_at", null: false
|
136
|
+
t.datetime "updated_at", null: false
|
137
|
+
end
|
138
|
+
|
139
|
+
create_table "spina_navigation_items", id: :serial, force: :cascade do |t|
|
140
|
+
t.integer "page_id", null: false
|
141
|
+
t.integer "navigation_id", null: false
|
142
|
+
t.integer "position", default: 0, null: false
|
143
|
+
t.string "ancestry"
|
144
|
+
t.datetime "created_at"
|
145
|
+
t.datetime "updated_at"
|
146
|
+
t.index ["page_id", "navigation_id"], name: "index_spina_navigation_items_on_page_id_and_navigation_id", unique: true
|
147
|
+
end
|
148
|
+
|
149
|
+
create_table "spina_navigations", id: :serial, force: :cascade do |t|
|
150
|
+
t.string "name", null: false
|
151
|
+
t.string "label", null: false
|
152
|
+
t.boolean "auto_add_pages", default: false, null: false
|
153
|
+
t.integer "position", default: 0, null: false
|
154
|
+
t.datetime "created_at"
|
155
|
+
t.datetime "updated_at"
|
156
|
+
t.index ["name"], name: "index_spina_navigations_on_name", unique: true
|
157
|
+
end
|
158
|
+
|
159
|
+
create_table "spina_options", id: :serial, force: :cascade do |t|
|
160
|
+
t.string "value"
|
161
|
+
t.datetime "created_at", null: false
|
162
|
+
t.datetime "updated_at", null: false
|
163
|
+
end
|
164
|
+
|
165
|
+
create_table "spina_page_parts", id: :serial, force: :cascade do |t|
|
166
|
+
t.string "title"
|
167
|
+
t.string "name"
|
168
|
+
t.datetime "created_at", null: false
|
169
|
+
t.datetime "updated_at", null: false
|
170
|
+
t.integer "page_id"
|
171
|
+
t.integer "page_partable_id"
|
172
|
+
t.string "page_partable_type"
|
173
|
+
end
|
174
|
+
|
175
|
+
create_table "spina_page_translations", id: :serial, force: :cascade do |t|
|
176
|
+
t.integer "spina_page_id", null: false
|
177
|
+
t.string "locale", null: false
|
178
|
+
t.string "title"
|
179
|
+
t.string "menu_title"
|
180
|
+
t.string "description"
|
181
|
+
t.string "seo_title"
|
182
|
+
t.string "materialized_path"
|
183
|
+
t.datetime "created_at", null: false
|
184
|
+
t.datetime "updated_at", null: false
|
185
|
+
t.index ["locale"], name: "index_spina_page_translations_on_locale"
|
186
|
+
t.index ["spina_page_id"], name: "index_spina_page_translations_on_spina_page_id"
|
187
|
+
end
|
188
|
+
|
189
|
+
create_table "spina_pages", id: :serial, force: :cascade do |t|
|
190
|
+
t.boolean "show_in_menu", default: true
|
191
|
+
t.string "slug"
|
192
|
+
t.boolean "deletable", default: true
|
193
|
+
t.datetime "created_at", null: false
|
194
|
+
t.datetime "updated_at", null: false
|
195
|
+
t.string "name"
|
196
|
+
t.boolean "skip_to_first_child", default: false
|
197
|
+
t.string "view_template"
|
198
|
+
t.string "layout_template"
|
199
|
+
t.boolean "draft", default: false
|
200
|
+
t.string "link_url"
|
201
|
+
t.string "ancestry"
|
202
|
+
t.integer "position"
|
203
|
+
t.boolean "active", default: true
|
204
|
+
t.integer "resource_id"
|
205
|
+
t.index ["resource_id"], name: "index_spina_pages_on_resource_id"
|
206
|
+
end
|
207
|
+
|
208
|
+
create_table "spina_resources", force: :cascade do |t|
|
209
|
+
t.string "name", null: false
|
210
|
+
t.string "label"
|
211
|
+
t.string "view_template"
|
212
|
+
t.integer "parent_page_id"
|
213
|
+
t.string "order_by"
|
214
|
+
t.datetime "created_at", null: false
|
215
|
+
t.datetime "updated_at", null: false
|
216
|
+
t.index ["parent_page_id"], name: "index_spina_resources_on_parent_page_id"
|
217
|
+
end
|
218
|
+
|
219
|
+
create_table "spina_rewrite_rules", id: :serial, force: :cascade do |t|
|
220
|
+
t.string "old_path"
|
221
|
+
t.string "new_path"
|
222
|
+
t.datetime "created_at"
|
223
|
+
t.datetime "updated_at"
|
224
|
+
end
|
225
|
+
|
226
|
+
create_table "spina_settings", id: :serial, force: :cascade do |t|
|
227
|
+
t.string "plugin"
|
228
|
+
t.jsonb "preferences", default: {}
|
229
|
+
t.datetime "created_at", null: false
|
230
|
+
t.datetime "updated_at", null: false
|
231
|
+
t.index ["plugin"], name: "index_spina_settings_on_plugin"
|
232
|
+
end
|
233
|
+
|
234
|
+
create_table "spina_structure_items", id: :serial, force: :cascade do |t|
|
235
|
+
t.integer "structure_id"
|
236
|
+
t.integer "position"
|
237
|
+
t.datetime "created_at"
|
238
|
+
t.datetime "updated_at"
|
239
|
+
t.index ["structure_id"], name: "index_spina_structure_items_on_structure_id"
|
240
|
+
end
|
241
|
+
|
242
|
+
create_table "spina_structure_parts", id: :serial, force: :cascade do |t|
|
243
|
+
t.integer "structure_item_id"
|
244
|
+
t.integer "structure_partable_id"
|
245
|
+
t.string "structure_partable_type"
|
246
|
+
t.string "name"
|
247
|
+
t.string "title"
|
248
|
+
t.datetime "created_at"
|
249
|
+
t.datetime "updated_at"
|
250
|
+
t.index ["structure_item_id"], name: "index_spina_structure_parts_on_structure_item_id"
|
251
|
+
t.index ["structure_partable_id"], name: "index_spina_structure_parts_on_structure_partable_id"
|
252
|
+
end
|
253
|
+
|
254
|
+
create_table "spina_structures", id: :serial, force: :cascade do |t|
|
255
|
+
t.datetime "created_at"
|
256
|
+
t.datetime "updated_at"
|
257
|
+
end
|
258
|
+
|
259
|
+
create_table "spina_text_translations", id: :serial, force: :cascade do |t|
|
260
|
+
t.integer "spina_text_id", null: false
|
261
|
+
t.string "locale", null: false
|
262
|
+
t.text "content"
|
263
|
+
t.datetime "created_at", null: false
|
264
|
+
t.datetime "updated_at", null: false
|
265
|
+
t.index ["locale"], name: "index_spina_text_translations_on_locale"
|
266
|
+
t.index ["spina_text_id"], name: "index_spina_text_translations_on_spina_text_id"
|
267
|
+
end
|
268
|
+
|
269
|
+
create_table "spina_texts", id: :serial, force: :cascade do |t|
|
270
|
+
t.datetime "created_at"
|
271
|
+
t.datetime "updated_at"
|
272
|
+
end
|
273
|
+
|
274
|
+
create_table "spina_users", id: :serial, force: :cascade do |t|
|
275
|
+
t.string "name"
|
276
|
+
t.string "email"
|
277
|
+
t.string "password_digest"
|
278
|
+
t.boolean "admin", default: false
|
279
|
+
t.datetime "created_at", null: false
|
280
|
+
t.datetime "updated_at", null: false
|
281
|
+
t.datetime "last_logged_in"
|
282
|
+
t.string "password_reset_token"
|
283
|
+
t.datetime "password_reset_sent_at"
|
284
|
+
end
|
285
|
+
|
286
|
+
add_foreign_key "spina_blog_posts", "spina_images", column: "image_id"
|
287
|
+
add_foreign_key "spina_blog_posts", "spina_users", column: "user_id"
|
288
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :spina_blog_category, class: Spina::Admin::Conferences::Blog::Category do
|
5
|
+
sequence(:name) { |n| "Category #{n}" }
|
6
|
+
|
7
|
+
factory :invalid_spina_blog_category do
|
8
|
+
name { nil }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :spina_blog_post, class: Spina::Admin::Conferences::Blog::Post do
|
5
|
+
sequence(:title) { |n| "Blog Post #{n}" }
|
6
|
+
content { 'Some content for my post' }
|
7
|
+
association :category, factory: :spina_blog_category
|
8
|
+
|
9
|
+
seo_title { 'Some title for SEO' }
|
10
|
+
description { 'Some description for SEO' }
|
11
|
+
|
12
|
+
factory :invalid_spina_blog_post do
|
13
|
+
title { nil }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
module Spina::Admin::Conferences::Blog
|
6
|
+
RSpec.describe Category, type: :model do
|
7
|
+
let(:category) { build(:spina_blog_category) }
|
8
|
+
|
9
|
+
subject { category }
|
10
|
+
|
11
|
+
it { is_expected.to be_valid }
|
12
|
+
it { expect { category.save }.to change(Spina::Admin::Conferences::Blog::Category, :count).by(1) }
|
13
|
+
|
14
|
+
context 'with invalid attributes' do
|
15
|
+
let(:category) { build(:invalid_spina_blog_category) }
|
16
|
+
|
17
|
+
it { is_expected.to_not be_valid }
|
18
|
+
it { expect { category.save }.to_not change(Spina::Admin::Conferences::Blog::Category, :count) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|