storytime 2.1.6 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +54 -0
- data/.gitignore +2 -1
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Gemfile +5 -3
- data/Gemfile.lock +414 -425
- data/Guardfile +1 -1
- data/app/assets/fonts/storytime-icons.eot +0 -0
- data/app/assets/fonts/storytime-icons.svg +23 -0
- data/app/assets/fonts/storytime-icons.ttf +0 -0
- data/app/assets/fonts/storytime-icons.woff +0 -0
- data/app/assets/javascripts/storytime/application.js +1 -8
- data/app/assets/javascripts/storytime/off_canvas.coffee +16 -0
- data/app/assets/javascripts/storytime/wysiwyg.js.coffee +9 -7
- data/app/assets/stylesheets/storytime/_buttons.scss +33 -0
- data/app/assets/stylesheets/storytime/_list-group.scss +1 -1
- data/app/assets/stylesheets/storytime/application.scss +14 -2
- data/app/assets/stylesheets/storytime/icons.scss +5 -5
- data/app/assets/stylesheets/storytime/leather/_buttons.scss +31 -0
- data/app/assets/stylesheets/storytime/leather/_devise.scss +72 -0
- data/app/assets/stylesheets/storytime/leather/_grid.scss +19 -0
- data/app/assets/stylesheets/storytime/leather/_list_groups.scss +33 -0
- data/app/assets/stylesheets/storytime/leather/_nav_menus.scss +125 -0
- data/app/assets/stylesheets/storytime/leather/_navbar_transparent.scss +23 -0
- data/app/assets/stylesheets/storytime/leather/_off_canvas.scss +109 -0
- data/app/assets/stylesheets/storytime/leather/_scroll_panels.scss +85 -0
- data/app/assets/stylesheets/storytime/leather/_toggle_columns.scss +23 -0
- data/app/assets/stylesheets/storytime/leather/_typography.scss +12 -0
- data/app/assets/stylesheets/storytime/leather/_utilities.scss +54 -0
- data/app/assets/stylesheets/storytime/leather/_variables.scss +8 -0
- data/app/assets/stylesheets/storytime/posts.scss +9 -1
- data/app/controllers/storytime/application_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/blog_posts_controller.rb +5 -3
- data/app/controllers/storytime/dashboard/blogs_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/media_controller.rb +4 -4
- data/app/controllers/storytime/dashboard/memberships_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/pages_controller.rb +26 -6
- data/app/controllers/storytime/dashboard/posts_controller.rb +30 -5
- data/app/controllers/storytime/dashboard/subscriptions_controller.rb +1 -1
- data/app/controllers/storytime/pages_controller.rb +31 -1
- data/app/controllers/storytime/posts_controller.rb +1 -1
- data/app/controllers/storytime/subscriptions_controller.rb +5 -1
- data/app/helpers/storytime/application_helper.rb +0 -4
- data/app/models/concerns/storytime/post_featured_images.rb +2 -2
- data/app/models/concerns/storytime/post_partial_inheritance.rb +2 -2
- data/app/models/storytime/autosave.rb +1 -1
- data/app/models/storytime/comment.rb +1 -1
- data/app/models/storytime/media.rb +1 -1
- data/app/models/storytime/membership.rb +2 -2
- data/app/models/storytime/post.rb +7 -3
- data/app/models/storytime/site.rb +4 -6
- data/app/models/storytime/snippet.rb +12 -1
- data/app/models/storytime/subscription.rb +2 -2
- data/app/models/storytime/version.rb +1 -1
- data/app/policies/storytime/post_policy.rb +1 -1
- data/app/views/storytime/dashboard/_navigation.html.erb +0 -9
- data/app/views/storytime/dashboard/blog_posts/_form.html.erb +5 -1
- data/app/views/storytime/dashboard/blogs/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/blogs/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/blogs/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/media/_gallery.html.erb +1 -1
- data/app/views/storytime/dashboard/media/_modal.html.erb +2 -2
- data/app/views/storytime/dashboard/media/show.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/_edit.html.erb +1 -1
- data/app/views/storytime/dashboard/memberships/_index.html.erb +3 -3
- data/app/views/storytime/dashboard/memberships/_new.html.erb +1 -1
- data/app/views/storytime/dashboard/memberships/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/save.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/pages/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_directory.html.erb +18 -0
- data/app/views/storytime/dashboard/posts/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_list.html.erb +2 -26
- data/app/views/storytime/dashboard/posts/_new_button.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_post.html.erb +28 -0
- data/app/views/storytime/dashboard/posts/_sorts.html.erb +21 -0
- data/app/views/storytime/dashboard/posts/index.html.erb +5 -3
- data/app/views/storytime/dashboard/roles/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/roles/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/sites/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/sites/site.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/_index.html.erb +1 -1
- data/app/views/storytime/dashboard/snippets/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/subscriptions/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/subscriptions/_index.html.erb +2 -2
- data/app/views/storytime/dashboard/subscriptions/form.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/subscriptions/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/versions/_versions_info.html.erb +1 -1
- data/app/views/storytime/posts/show.html.erb +6 -0
- data/app/views/storytime/sites/_google_analytics_code.html.erb +5 -8
- data/config/initializers/assets.rb +2 -1
- data/config/initializers/friendly_id.rb +1 -1
- data/config/initializers/url_for_patch.rb +19 -8
- data/config/locales/devise.zh-CN.yml +59 -0
- data/config/locales/kaminari.zh-CN.yml +17 -0
- data/config/locales/simple_form.zh-CN.yml +26 -0
- data/config/locales/zh-CN.yml +141 -0
- data/config/routes.rb +2 -4
- data/db/migrate/20140501174341_create_storytime_posts.rb +1 -1
- data/db/migrate/20140509191309_create_friendly_id_slugs.rb +1 -1
- data/db/migrate/20140511200849_create_storytime_media.rb +1 -1
- data/db/migrate/20140513161233_create_storytime_sites.rb +1 -1
- data/db/migrate/20140514200234_create_storytime_tags.rb +1 -1
- data/db/migrate/20140514200304_create_storytime_taggings.rb +1 -1
- data/db/migrate/20140516141252_create_storytime_versions.rb +1 -1
- data/db/migrate/20140521190606_create_storytime_roles.rb +1 -1
- data/db/migrate/20140521191048_add_storytime_role_id_to_users.rb +1 -1
- data/db/migrate/20140521191728_create_storytime_permissions.rb +1 -1
- data/db/migrate/20140521191744_create_storytime_actions.rb +1 -1
- data/db/migrate/20140813014447_create_storytime_comments.rb +1 -1
- data/db/migrate/20140813130534_add_storytime_name_to_users.rb +1 -1
- data/db/migrate/20140916183056_create_storytime_autosaves.rb +1 -1
- data/db/migrate/20141020213343_add_secondary_media_id_to_storytime_post.rb +1 -1
- data/db/migrate/20141021073356_create_storytime_snippets.rb +1 -1
- data/db/migrate/20141111164439_create_storytime_subscriptions.rb +1 -1
- data/db/migrate/20150122200805_add_title_and_content_index_to_storytime_post.rb +1 -1
- data/db/migrate/20150128185746_seed_new_actions_and_permissions.rb +1 -1
- data/db/migrate/20150129215308_add_site_id_to_storytime_subscription.rb +1 -1
- data/db/migrate/20150206201847_add_site_id_to_storytime_post.rb +1 -1
- data/db/migrate/20150206201919_add_site_id_to_storytime_snippet.rb +1 -1
- data/db/migrate/20150206201931_add_site_id_to_storytime_tag.rb +1 -1
- data/db/migrate/20150206205256_add_notification_fields_to_storytime_post.rb +1 -1
- data/db/migrate/20150216211257_add_subdomain_to_storytime_sites.rb +1 -1
- data/db/migrate/20150216225045_add_site_to_storytime_media.rb +1 -1
- data/db/migrate/20150219210528_remove_root_page_content_from_storytime_sites.rb +1 -1
- data/db/migrate/20150220184902_add_blog_id_to_posts.rb +1 -1
- data/db/migrate/20150224192138_add_homepage_path_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224193151_add_subscription_email_from_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224193551_add_layout_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224194559_add_disqus_forum_shortname_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224212453_remove_homepage_path_from_storytime_sites.rb +1 -1
- data/db/migrate/20150225143516_add_site_id_to_storytime_autosaves.rb +1 -1
- data/db/migrate/20150225143826_add_site_id_to_storytime_comments.rb +1 -1
- data/db/migrate/20150225145119_add_site_id_to_storytime_versions.rb +1 -1
- data/db/migrate/20150225145316_add_site_id_to_storytime_taggings.rb +1 -1
- data/db/migrate/20150225145608_update_storytime_site_id_columns.rb +1 -1
- data/db/migrate/20150225164232_add_site_id_to_storytime_permissions.rb +1 -1
- data/db/migrate/20150225212917_create_storytime_memberships.rb +1 -1
- data/db/migrate/20150225213535_create_memberships_for_storytime_users.rb +1 -1
- data/db/migrate/20150226201739_add_custom_domain_to_storytime_sites.rb +1 -1
- data/db/migrate/20150302171500_add_site_id_to_storytime_media.rb +1 -1
- data/db/migrate/20150302171722_set_site_layout.rb +1 -1
- data/db/migrate/20150302185138_remove_storytime_role_id_from_users.rb +1 -1
- data/db/migrate/20150302192525_transfer_posts_to_blogs.rb +1 -1
- data/db/migrate/20150302192759_seed_permissions.rb +1 -1
- data/db/migrate/20150331162329_add_discourse_name_to_storytime_sites.rb +1 -1
- data/db/migrate/20150402161427_remove_subdomain_from_storytime_site.rb +1 -1
- data/db/migrate/20150520181115_create_storytime_navigations.rb +1 -1
- data/db/migrate/20150520185227_create_storytime_links.rb +1 -1
- data/db/migrate/20150520190700_add_position_to_storytime_links.rb +1 -1
- data/db/migrate/20150529192058_add_url_to_storytime_links.rb +1 -1
- data/db/migrate/20260408001637_add_canonical_url_to_storytime_posts.rb +5 -0
- data/db/migrate/20260701000000_sanitize_existing_storytime_snippets.rb +22 -0
- data/lib/storytime/cli/install.rb +2 -20
- data/lib/storytime/concerns/action_controller_extension.rb +36 -0
- data/lib/storytime/constraints/page_constraint.rb +8 -2
- data/lib/storytime/engine.rb +3 -5
- data/lib/storytime/migrators/v1.rb +3 -3
- data/lib/storytime/post_notifier.rb +1 -1
- data/lib/storytime/post_url_handler.rb +18 -5
- data/lib/storytime/storytime_helpers.rb +4 -0
- data/lib/storytime/version.rb +1 -1
- data/lib/storytime.rb +1 -1
- data/spec/controllers/dashboard_controller_spec.rb +5 -6
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/config/database.yml +3 -3
- data/spec/dummy/config/initializers/devise.rb +1 -1
- data/spec/dummy/db/migrate/20140530185250_devise_create_users.rb +1 -1
- data/spec/dummy/db/migrate/20150127172846_create_widgets.rb +1 -1
- data/spec/dummy/db/migrate/20150206203824_add_video_url_to_storytime_posts.rb +1 -1
- data/spec/dummy/db/schema.rb +226 -244
- data/spec/factories/action_factories.rb +3 -3
- data/spec/factories/comment_factories.rb +1 -1
- data/spec/factories/media_factories.rb +1 -1
- data/spec/factories/membership_factories.rb +1 -1
- data/spec/factories/navigation_factories.rb +3 -3
- data/spec/factories/permission_factories.rb +1 -1
- data/spec/factories/post_factories.rb +2 -2
- data/spec/factories/role_factories.rb +11 -11
- data/spec/factories/site_factories.rb +3 -3
- data/spec/factories/snippet_factories.rb +1 -1
- data/spec/factories/subscription_factories.rb +1 -1
- data/spec/factories/user_factories.rb +2 -2
- data/spec/factories/widget_factories.rb +2 -2
- data/spec/features/blogs_spec.rb +7 -7
- data/spec/features/comments_spec.rb +11 -11
- data/spec/features/dashboard/media_spec.rb +17 -11
- data/spec/features/dashboard/memberships_spec.rb +13 -19
- data/spec/features/dashboard/navigations_spec.rb +1 -1
- data/spec/features/dashboard/pages_spec.rb +8 -8
- data/spec/features/dashboard/posts_spec.rb +19 -19
- data/spec/features/dashboard/sites_spec.rb +1 -1
- data/spec/features/dashboard/snippets_spec.rb +3 -3
- data/spec/features/dashboard/subscription_spec.rb +2 -2
- data/spec/features/pages_spec.rb +3 -3
- data/spec/features/posts_spec.rb +2 -2
- data/spec/features/subscription_spec.rb +3 -3
- data/spec/importers/wordpress_spec.rb +1 -1
- data/spec/lib/mysql_fulltext_search_adapter_spec.rb +3 -3
- data/spec/lib/mysql_search_adapter_spec.rb +3 -3
- data/spec/lib/postgres_search_adapter_spec.rb +3 -3
- data/spec/lib/sqlite3_search_adapter_spec.rb +3 -3
- data/spec/lib/storytime/constraints/page_constraint_spec.rb +40 -0
- data/spec/lib/storytime_helpers_spec.rb +2 -2
- data/spec/models/navigation_spec.rb +3 -3
- data/spec/models/post_spec.rb +29 -29
- data/spec/models/snippet_spec.rb +31 -0
- data/spec/models/subscription_spec.rb +4 -4
- data/spec/models/tagging_spec.rb +14 -14
- data/spec/models/version_spec.rb +29 -29
- data/spec/policies/comment_policy_spec.rb +11 -11
- data/spec/policies/post_policy_spec.rb +13 -13
- data/spec/requests/pages_spec.rb +37 -0
- data/spec/requests/routings_spec.rb +14 -15
- data/spec/spec_helper.rb +8 -15
- data/spec/support/domains.rb +2 -2
- data/spec/support/feature_macros.rb +5 -5
- data/spec/support/pundit_matcher.rb +3 -3
- data/storytime.gemspec +15 -20
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +195 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +169 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/codemirror.js +8922 -0
- data/vendor/assets/javascripts/medium-editor.min.js +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/solarized.css +169 -0
- data/vendor/assets/stylesheets/codemirror.css +347 -0
- metadata +94 -134
- data/config/initializers/storytime_admin.rb +0 -5
- data/config/spring.rb +0 -1
- data/spec/dummy/app/controllers/storytime_admin/widgets_controller.rb +0 -5
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
data/spec/dummy/db/schema.rb
CHANGED
|
@@ -1,255 +1,237 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
5
4
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# from scratch.
|
|
10
|
-
#
|
|
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.
|
|
11
10
|
#
|
|
12
11
|
# It's strongly recommended that you check this file into your version control system.
|
|
13
12
|
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
|
15
|
-
|
|
13
|
+
ActiveRecord::Schema[8.1].define(version: 2026_07_01_000000) do
|
|
16
14
|
# These are extensions that must be enabled in order to support this database
|
|
17
|
-
enable_extension "plpgsql"
|
|
18
|
-
|
|
19
|
-
create_table "friendly_id_slugs", force: :cascade do |t|
|
|
20
|
-
t.
|
|
21
|
-
t.
|
|
22
|
-
t.string
|
|
23
|
-
t.
|
|
24
|
-
t.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
t.string
|
|
34
|
-
t.string
|
|
35
|
-
t.datetime "
|
|
36
|
-
t.
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
t.text
|
|
43
|
-
t.
|
|
44
|
-
t.
|
|
45
|
-
t.datetime "
|
|
46
|
-
t.
|
|
47
|
-
t.
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
t.
|
|
55
|
-
t.
|
|
56
|
-
t.integer
|
|
57
|
-
t.
|
|
58
|
-
t.
|
|
59
|
-
t.
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
t.
|
|
68
|
-
t.
|
|
69
|
-
t.
|
|
70
|
-
t.string
|
|
71
|
-
t.
|
|
72
|
-
t.
|
|
73
|
-
t.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
t.
|
|
83
|
-
t.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
t.
|
|
94
|
-
t.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
t.integer
|
|
108
|
-
t.datetime "created_at",
|
|
109
|
-
t.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
t.
|
|
119
|
-
t.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
t.
|
|
128
|
-
t.
|
|
129
|
-
t.
|
|
130
|
-
t.string
|
|
131
|
-
t.
|
|
132
|
-
t.
|
|
133
|
-
t.datetime "
|
|
134
|
-
t.integer
|
|
135
|
-
t.
|
|
136
|
-
t.
|
|
137
|
-
t.
|
|
138
|
-
t.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
t.datetime "
|
|
143
|
-
t.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
t.string
|
|
152
|
-
t.
|
|
153
|
-
t.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
t.
|
|
160
|
-
t.integer
|
|
161
|
-
t.
|
|
162
|
-
t.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
t.
|
|
167
|
-
t.
|
|
168
|
-
t.
|
|
169
|
-
t.
|
|
170
|
-
t.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
t.
|
|
178
|
-
t.
|
|
179
|
-
t.
|
|
180
|
-
t.datetime "updated_at"
|
|
181
|
-
t.
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
t.
|
|
188
|
-
t.
|
|
189
|
-
t.
|
|
190
|
-
t.
|
|
191
|
-
t.
|
|
192
|
-
t.
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
t.integer
|
|
199
|
-
t.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
t.
|
|
211
|
-
t.
|
|
212
|
-
t.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
t.
|
|
218
|
-
t.
|
|
219
|
-
t.
|
|
220
|
-
t.string
|
|
221
|
-
t.datetime "
|
|
222
|
-
t.
|
|
223
|
-
t.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
t.datetime "
|
|
235
|
-
t.
|
|
236
|
-
t.
|
|
237
|
-
t.datetime "current_sign_in_at"
|
|
238
|
-
t.datetime "last_sign_in_at"
|
|
239
|
-
t.string "current_sign_in_ip"
|
|
240
|
-
t.string "last_sign_in_ip"
|
|
241
|
-
t.datetime "created_at"
|
|
242
|
-
t.datetime "updated_at"
|
|
243
|
-
t.string "storytime_name"
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
|
247
|
-
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
|
|
248
|
-
|
|
249
|
-
create_table "widgets", force: :cascade do |t|
|
|
250
|
-
t.string "name"
|
|
251
|
-
t.datetime "created_at"
|
|
252
|
-
t.datetime "updated_at"
|
|
15
|
+
enable_extension "pg_catalog.plpgsql"
|
|
16
|
+
|
|
17
|
+
create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|
|
|
18
|
+
t.datetime "created_at", precision: nil
|
|
19
|
+
t.string "scope"
|
|
20
|
+
t.string "slug", null: false
|
|
21
|
+
t.integer "sluggable_id", null: false
|
|
22
|
+
t.string "sluggable_type", limit: 50
|
|
23
|
+
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
|
24
|
+
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
|
25
|
+
t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
|
|
26
|
+
t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
create_table "storytime_actions", id: :serial, force: :cascade do |t|
|
|
30
|
+
t.datetime "created_at", precision: nil
|
|
31
|
+
t.string "guid"
|
|
32
|
+
t.string "name"
|
|
33
|
+
t.datetime "updated_at", precision: nil
|
|
34
|
+
t.index ["guid"], name: "index_storytime_actions_on_guid"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
create_table "storytime_autosaves", id: :serial, force: :cascade do |t|
|
|
38
|
+
t.integer "autosavable_id"
|
|
39
|
+
t.string "autosavable_type"
|
|
40
|
+
t.text "content"
|
|
41
|
+
t.datetime "created_at", precision: nil
|
|
42
|
+
t.integer "site_id"
|
|
43
|
+
t.datetime "updated_at", precision: nil
|
|
44
|
+
t.index ["autosavable_type", "autosavable_id"], name: "autosavable_index"
|
|
45
|
+
t.index ["site_id"], name: "index_storytime_autosaves_on_site_id"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
create_table "storytime_comments", id: :serial, force: :cascade do |t|
|
|
49
|
+
t.text "content"
|
|
50
|
+
t.datetime "created_at", precision: nil
|
|
51
|
+
t.integer "post_id"
|
|
52
|
+
t.integer "site_id"
|
|
53
|
+
t.datetime "updated_at", precision: nil
|
|
54
|
+
t.integer "user_id"
|
|
55
|
+
t.index ["post_id"], name: "index_storytime_comments_on_post_id"
|
|
56
|
+
t.index ["site_id"], name: "index_storytime_comments_on_site_id"
|
|
57
|
+
t.index ["user_id"], name: "index_storytime_comments_on_user_id"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
create_table "storytime_links", id: :serial, force: :cascade do |t|
|
|
61
|
+
t.datetime "created_at", precision: nil, null: false
|
|
62
|
+
t.integer "linkable_id"
|
|
63
|
+
t.string "linkable_type"
|
|
64
|
+
t.integer "position"
|
|
65
|
+
t.integer "storytime_navigation_id"
|
|
66
|
+
t.string "text"
|
|
67
|
+
t.datetime "updated_at", precision: nil, null: false
|
|
68
|
+
t.string "url"
|
|
69
|
+
t.index ["linkable_type", "linkable_id"], name: "index_storytime_links_on_linkable_type_and_linkable_id"
|
|
70
|
+
t.index ["position"], name: "index_storytime_links_on_position"
|
|
71
|
+
t.index ["storytime_navigation_id"], name: "index_storytime_links_on_storytime_navigation_id"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
create_table "storytime_media", id: :serial, force: :cascade do |t|
|
|
75
|
+
t.datetime "created_at", precision: nil
|
|
76
|
+
t.string "file"
|
|
77
|
+
t.integer "site_id"
|
|
78
|
+
t.datetime "updated_at", precision: nil
|
|
79
|
+
t.integer "user_id"
|
|
80
|
+
t.index ["site_id"], name: "index_storytime_media_on_site_id"
|
|
81
|
+
t.index ["user_id"], name: "index_storytime_media_on_user_id"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
create_table "storytime_memberships", id: :serial, force: :cascade do |t|
|
|
85
|
+
t.datetime "created_at", precision: nil
|
|
86
|
+
t.integer "site_id"
|
|
87
|
+
t.integer "storytime_role_id"
|
|
88
|
+
t.datetime "updated_at", precision: nil
|
|
89
|
+
t.integer "user_id"
|
|
90
|
+
t.index ["site_id"], name: "index_storytime_memberships_on_site_id"
|
|
91
|
+
t.index ["storytime_role_id"], name: "index_storytime_memberships_on_storytime_role_id"
|
|
92
|
+
t.index ["user_id"], name: "index_storytime_memberships_on_user_id"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
create_table "storytime_navigations", id: :serial, force: :cascade do |t|
|
|
96
|
+
t.datetime "created_at", precision: nil, null: false
|
|
97
|
+
t.string "handle"
|
|
98
|
+
t.string "name"
|
|
99
|
+
t.integer "site_id"
|
|
100
|
+
t.datetime "updated_at", precision: nil, null: false
|
|
101
|
+
t.index ["site_id"], name: "index_storytime_navigations_on_site_id"
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
create_table "storytime_permissions", id: :serial, force: :cascade do |t|
|
|
105
|
+
t.integer "action_id"
|
|
106
|
+
t.datetime "created_at", precision: nil
|
|
107
|
+
t.integer "role_id"
|
|
108
|
+
t.integer "site_id"
|
|
109
|
+
t.datetime "updated_at", precision: nil
|
|
110
|
+
t.index ["action_id"], name: "index_storytime_permissions_on_action_id"
|
|
111
|
+
t.index ["role_id"], name: "index_storytime_permissions_on_role_id"
|
|
112
|
+
t.index ["site_id"], name: "index_storytime_permissions_on_site_id"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
create_table "storytime_posts", id: :serial, force: :cascade do |t|
|
|
116
|
+
t.integer "blog_id"
|
|
117
|
+
t.string "canonical_url"
|
|
118
|
+
t.text "content"
|
|
119
|
+
t.datetime "created_at", precision: nil
|
|
120
|
+
t.text "excerpt"
|
|
121
|
+
t.boolean "featured", default: false
|
|
122
|
+
t.integer "featured_media_id"
|
|
123
|
+
t.boolean "notifications_enabled", default: false
|
|
124
|
+
t.datetime "notifications_sent_at", precision: nil
|
|
125
|
+
t.datetime "published_at", precision: nil
|
|
126
|
+
t.integer "secondary_media_id"
|
|
127
|
+
t.integer "site_id"
|
|
128
|
+
t.string "slug"
|
|
129
|
+
t.string "title"
|
|
130
|
+
t.string "type"
|
|
131
|
+
t.datetime "updated_at", precision: nil
|
|
132
|
+
t.integer "user_id"
|
|
133
|
+
t.string "video_url"
|
|
134
|
+
t.index ["blog_id"], name: "index_storytime_posts_on_blog_id"
|
|
135
|
+
t.index ["slug"], name: "index_storytime_posts_on_slug"
|
|
136
|
+
t.index ["user_id"], name: "index_storytime_posts_on_user_id"
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
create_table "storytime_roles", id: :serial, force: :cascade do |t|
|
|
140
|
+
t.datetime "created_at", precision: nil
|
|
141
|
+
t.string "name"
|
|
142
|
+
t.datetime "updated_at", precision: nil
|
|
143
|
+
t.index ["name"], name: "index_storytime_roles_on_name"
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
create_table "storytime_sites", id: :serial, force: :cascade do |t|
|
|
147
|
+
t.datetime "created_at", precision: nil
|
|
148
|
+
t.string "custom_domain"
|
|
149
|
+
t.string "discourse_name"
|
|
150
|
+
t.string "disqus_forum_shortname"
|
|
151
|
+
t.string "ga_tracking_id"
|
|
152
|
+
t.string "layout"
|
|
153
|
+
t.integer "post_slug_style", default: 0
|
|
154
|
+
t.integer "root_post_id"
|
|
155
|
+
t.string "subscription_email_from"
|
|
156
|
+
t.string "title"
|
|
157
|
+
t.datetime "updated_at", precision: nil
|
|
158
|
+
t.integer "user_id"
|
|
159
|
+
t.index ["root_post_id"], name: "index_storytime_sites_on_root_post_id"
|
|
160
|
+
t.index ["user_id"], name: "index_storytime_sites_on_user_id"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
create_table "storytime_snippets", id: :serial, force: :cascade do |t|
|
|
164
|
+
t.text "content"
|
|
165
|
+
t.datetime "created_at", precision: nil
|
|
166
|
+
t.string "name"
|
|
167
|
+
t.integer "site_id"
|
|
168
|
+
t.datetime "updated_at", precision: nil
|
|
169
|
+
t.index ["name"], name: "index_storytime_snippets_on_name"
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
create_table "storytime_subscriptions", id: :serial, force: :cascade do |t|
|
|
173
|
+
t.datetime "created_at", precision: nil
|
|
174
|
+
t.string "email"
|
|
175
|
+
t.integer "site_id"
|
|
176
|
+
t.boolean "subscribed", default: true
|
|
177
|
+
t.string "token"
|
|
178
|
+
t.datetime "updated_at", precision: nil
|
|
179
|
+
t.index ["token"], name: "index_storytime_subscriptions_on_token"
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
create_table "storytime_taggings", id: :serial, force: :cascade do |t|
|
|
183
|
+
t.datetime "created_at", precision: nil
|
|
184
|
+
t.integer "post_id"
|
|
185
|
+
t.integer "site_id"
|
|
186
|
+
t.integer "tag_id"
|
|
187
|
+
t.datetime "updated_at", precision: nil
|
|
188
|
+
t.index ["post_id"], name: "index_storytime_taggings_on_post_id"
|
|
189
|
+
t.index ["site_id"], name: "index_storytime_taggings_on_site_id"
|
|
190
|
+
t.index ["tag_id"], name: "index_storytime_taggings_on_tag_id"
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
create_table "storytime_tags", id: :serial, force: :cascade do |t|
|
|
194
|
+
t.datetime "created_at", precision: nil
|
|
195
|
+
t.string "name"
|
|
196
|
+
t.integer "site_id"
|
|
197
|
+
t.datetime "updated_at", precision: nil
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
create_table "storytime_versions", id: :serial, force: :cascade do |t|
|
|
201
|
+
t.text "content"
|
|
202
|
+
t.datetime "created_at", precision: nil
|
|
203
|
+
t.integer "site_id"
|
|
204
|
+
t.datetime "updated_at", precision: nil
|
|
205
|
+
t.integer "user_id"
|
|
206
|
+
t.integer "versionable_id"
|
|
207
|
+
t.string "versionable_type"
|
|
208
|
+
t.index ["site_id"], name: "index_storytime_versions_on_site_id"
|
|
209
|
+
t.index ["user_id"], name: "index_storytime_versions_on_user_id"
|
|
210
|
+
t.index ["versionable_type", "versionable_id"], name: "versionable_index"
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
create_table "users", id: :serial, force: :cascade do |t|
|
|
214
|
+
t.datetime "created_at", precision: nil
|
|
215
|
+
t.datetime "current_sign_in_at", precision: nil
|
|
216
|
+
t.string "current_sign_in_ip"
|
|
217
|
+
t.string "email", default: "", null: false
|
|
218
|
+
t.string "encrypted_password", default: "", null: false
|
|
219
|
+
t.datetime "last_sign_in_at", precision: nil
|
|
220
|
+
t.string "last_sign_in_ip"
|
|
221
|
+
t.datetime "remember_created_at", precision: nil
|
|
222
|
+
t.datetime "reset_password_sent_at", precision: nil
|
|
223
|
+
t.string "reset_password_token"
|
|
224
|
+
t.integer "sign_in_count", default: 0, null: false
|
|
225
|
+
t.string "storytime_name"
|
|
226
|
+
t.datetime "updated_at", precision: nil
|
|
227
|
+
t.index ["email"], name: "index_users_on_email", unique: true
|
|
228
|
+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
create_table "widgets", id: :serial, force: :cascade do |t|
|
|
232
|
+
t.datetime "created_at", precision: nil
|
|
233
|
+
t.string "name"
|
|
234
|
+
t.datetime "updated_at", precision: nil
|
|
253
235
|
end
|
|
254
236
|
|
|
255
237
|
add_foreign_key "storytime_links", "storytime_navigations"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
FactoryBot.define do
|
|
2
2
|
factory :post, class: Storytime::BlogPost do
|
|
3
3
|
user
|
|
4
4
|
sequence(:title) { |i| "Post ##{i}" }
|
|
5
5
|
sequence(:draft_content) { |i| "Post ##{i}. It was a dark and stormy night. The End." }
|
|
6
6
|
sequence(:content) { |i| "Post ##{i}. It was a dark and stormy night. The End." }
|
|
7
7
|
sequence(:excerpt) { |i| "Post ##{i}. It was a dark and stormy night." }
|
|
8
|
-
tag_list [""]
|
|
8
|
+
tag_list { [""] }
|
|
9
9
|
published_at { Time.now }
|
|
10
10
|
|
|
11
11
|
factory :page, class: Storytime::Page do
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
FactoryBot.define do
|
|
2
2
|
factory :role, class: Storytime::Role do
|
|
3
|
-
name 'writer'
|
|
3
|
+
name { 'writer' }
|
|
4
4
|
|
|
5
5
|
factory :writer_role, class: Storytime::Role do
|
|
6
|
-
name 'writer'
|
|
6
|
+
name { 'writer' }
|
|
7
7
|
|
|
8
8
|
after(:create) do |role, evaluator|
|
|
9
9
|
["Publish Own Posts/Pages"].each do |name|
|
|
10
|
-
action =
|
|
11
|
-
|
|
10
|
+
action = FactoryBot.create(:action, name: name)
|
|
11
|
+
FactoryBot.create(:permission, role: role, action: action)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
factory :editor_role, class: Storytime::Role do
|
|
17
|
-
name 'editor'
|
|
17
|
+
name { 'editor' }
|
|
18
18
|
|
|
19
19
|
after(:create) do |role, evaluator|
|
|
20
20
|
["Publish Own Posts/Pages", "Manage Others' Posts/Pages"].each do |name|
|
|
21
|
-
action =
|
|
22
|
-
|
|
21
|
+
action = FactoryBot.create(:action, name: name)
|
|
22
|
+
FactoryBot.create(:permission, role: role, action: action)
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
factory :admin_role, class: Storytime::Role do
|
|
28
|
-
name 'admin'
|
|
28
|
+
name { 'admin' }
|
|
29
29
|
|
|
30
30
|
after(:create) do |role, evaluator|
|
|
31
31
|
["Publish Own Posts/Pages", "Manage Others' Posts/Pages", "Manage Site Settings", "Manage Users"].each do |name|
|
|
32
|
-
action =
|
|
33
|
-
|
|
32
|
+
action = FactoryBot.create(:action, name: name)
|
|
33
|
+
FactoryBot.create(:permission, role: role, action: action)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
FactoryBot.define do
|
|
2
2
|
factory :site, class: Storytime::Site do
|
|
3
3
|
sequence(:title) {|i| "Site Title #{i}"}
|
|
4
|
-
subscription_email_from "notifications@site.com"
|
|
4
|
+
subscription_email_from { "notifications@site.com" }
|
|
5
5
|
sequence(:custom_domain){|i| "site-#{i}.lvh.me" }
|
|
6
|
-
post_slug_style 0
|
|
6
|
+
post_slug_style { 0 }
|
|
7
7
|
end
|
|
8
8
|
end
|