storytime 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +448 -0
- data/Guardfile +24 -0
- data/MIT-LICENSE +1 -1
- data/README.md +160 -0
- data/app/assets/{javascripts/storytime/subscriptions.js → images/storytime/.keep} +0 -0
- data/app/assets/images/storytime/storytime-logo-nav-light.png +0 -0
- data/app/assets/images/storytime/storytime-logo-nav.png +0 -0
- data/app/assets/images/storytime/storytime-logo.png +0 -0
- data/app/assets/javascripts/storytime/application.js +11 -3
- data/app/assets/javascripts/storytime/base.js.coffee +44 -6
- data/app/assets/javascripts/storytime/blog_posts.js.coffee +16 -0
- data/app/assets/javascripts/storytime/blogs.js.coffee +18 -0
- data/app/assets/javascripts/storytime/character_counter.js.coffee +26 -0
- data/app/assets/javascripts/storytime/contenteditable.js.coffee +15 -0
- data/app/assets/javascripts/storytime/custom_posts.js.coffee +16 -0
- data/app/assets/javascripts/storytime/editor.js.coffee +50 -134
- data/app/assets/javascripts/storytime/media.js.coffee +91 -22
- data/app/assets/javascripts/storytime/pages.js.coffee +16 -0
- data/app/assets/javascripts/storytime/posts.js.coffee +28 -1
- data/app/assets/javascripts/storytime/sites.js.coffee +1 -16
- data/app/assets/javascripts/storytime/snippets.js.coffee +6 -3
- data/app/assets/javascripts/storytime/tags.js.coffee +17 -0
- data/app/assets/javascripts/storytime/users.js.coffee +10 -0
- data/app/assets/javascripts/storytime/wysiwyg.js.coffee +183 -0
- data/app/assets/stylesheets/storytime/_buttons.scss +70 -0
- data/app/assets/stylesheets/storytime/_dropdowns.scss +5 -0
- data/app/assets/stylesheets/storytime/_forms.scss +3 -0
- data/app/assets/stylesheets/storytime/_list-group.scss +13 -0
- data/app/assets/stylesheets/storytime/_pagination.scss +14 -0
- data/app/assets/stylesheets/storytime/_panels.scss +8 -0
- data/app/assets/stylesheets/storytime/_tabs.scss +38 -0
- data/app/assets/stylesheets/storytime/_type.scss +13 -0
- data/app/assets/stylesheets/storytime/_wells.scss +14 -0
- data/app/assets/stylesheets/storytime/admin.scss +42 -0
- data/app/assets/stylesheets/storytime/application.scss +75 -0
- data/app/assets/stylesheets/storytime/{comments.css.scss → comments.scss} +0 -0
- data/app/assets/stylesheets/storytime/icons.scss +79 -0
- data/app/assets/stylesheets/storytime/layout.scss +21 -0
- data/app/assets/stylesheets/storytime/media.scss +65 -0
- data/app/assets/stylesheets/storytime/modals.scss +46 -0
- data/app/assets/stylesheets/storytime/navigation.scss +137 -0
- data/app/assets/stylesheets/storytime/posts.scss +76 -0
- data/app/assets/stylesheets/storytime/scroll-panels.scss +19 -0
- data/app/assets/stylesheets/storytime/snippets.scss +11 -0
- data/app/assets/stylesheets/storytime/{sites.css.scss → subscriptions.scss} +0 -0
- data/app/assets/stylesheets/storytime/versions.scss +21 -0
- data/app/controllers/storytime/application_controller.rb +36 -16
- data/app/controllers/storytime/blog_homepage_controller.rb +10 -0
- data/app/controllers/storytime/blogs_controller.rb +56 -0
- data/app/controllers/storytime/comments_controller.rb +5 -1
- data/app/controllers/storytime/dashboard/autosaves_controller.rb +7 -3
- data/app/controllers/storytime/dashboard/blog_posts_controller.rb +60 -0
- data/app/controllers/storytime/dashboard/blogs_controller.rb +66 -0
- data/app/controllers/storytime/dashboard/custom_posts_controller.rb +51 -0
- data/app/controllers/storytime/dashboard/media_controller.rb +9 -7
- data/app/controllers/storytime/dashboard/memberships_controller.rb +49 -0
- data/app/controllers/storytime/dashboard/pages_controller.rb +24 -0
- data/app/controllers/storytime/dashboard/posts_controller.rb +29 -38
- data/app/controllers/storytime/dashboard/roles_controller.rb +16 -2
- data/app/controllers/storytime/dashboard/sites_controller.rb +25 -11
- data/app/controllers/storytime/dashboard/snippets_controller.rb +19 -14
- data/app/controllers/storytime/dashboard/subscriptions_controller.rb +9 -5
- data/app/controllers/storytime/dashboard/users_controller.rb +24 -22
- data/app/controllers/storytime/dashboard_controller.rb +9 -3
- data/app/controllers/storytime/homepage_controller.rb +10 -0
- data/app/controllers/storytime/pages_controller.rb +30 -13
- data/app/controllers/storytime/posts_controller.rb +22 -53
- data/app/controllers/storytime/subscriptions_controller.rb +5 -4
- data/app/helpers/storytime/application_helper.rb +28 -7
- data/app/helpers/storytime/dashboard/sites_helper.rb +2 -5
- data/app/helpers/storytime/subscriptions_helper.rb +0 -7
- data/app/inputs/date_time_picker_input.rb +1 -1
- data/app/mailers/storytime/subscription_mailer.rb +1 -3
- data/app/models/concerns/storytime/post_comments.rb +17 -0
- data/app/models/concerns/storytime/post_excerpt.rb +14 -0
- data/app/models/concerns/storytime/post_featured_images.rb +8 -0
- data/app/models/concerns/storytime/post_partial_inheritance.rb +29 -0
- data/app/models/concerns/storytime/post_tags.rb +41 -0
- data/app/models/concerns/storytime/scoped_to_site.rb +11 -0
- data/app/models/storytime/action.rb +1 -0
- data/app/models/storytime/autosave.rb +7 -1
- data/app/models/storytime/blog.rb +16 -0
- data/app/models/storytime/blog_post.rb +12 -1
- data/app/models/storytime/comment.rb +4 -1
- data/app/models/storytime/media.rb +2 -0
- data/app/models/storytime/membership.rb +17 -0
- data/app/models/storytime/page.rb +0 -5
- data/app/models/storytime/permission.rb +26 -20
- data/app/models/storytime/post.rb +29 -82
- data/app/models/storytime/role.rb +12 -0
- data/app/models/storytime/site.rb +42 -12
- data/app/models/storytime/snippet.rb +3 -0
- data/app/models/storytime/subscription.rb +2 -1
- data/app/models/storytime/tag.rb +5 -1
- data/app/models/storytime/tagging.rb +1 -0
- data/app/models/storytime/version.rb +1 -0
- data/app/policies/admin_policy.rb +30 -0
- data/app/policies/storytime/comment_policy.rb +5 -1
- data/app/policies/storytime/membership_policy.rb +32 -0
- data/app/policies/storytime/post_policy.rb +6 -4
- data/app/policies/storytime/site_policy.rb +7 -2
- data/app/policies/storytime/snippet_policy.rb +3 -2
- data/app/policies/storytime/subscription_policy.rb +3 -2
- data/app/policies/user_policy.rb +2 -5
- data/app/views/kaminari/_first_page.html.erb +13 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +13 -0
- data/app/views/kaminari/_next_page.html.erb +13 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +24 -0
- data/app/views/kaminari/_prev_page.html.erb +13 -0
- data/app/views/layouts/storytime/application.html.erb +1 -1
- data/app/views/layouts/storytime/dashboard.html.erb +22 -6
- data/app/views/storytime/application/storytime/_disqus_comment_counts.html.erb +14 -0
- data/app/views/storytime/application/storytime/_header.html.erb +3 -4
- data/app/views/storytime/application/storytime/_navigation.html.erb +14 -1
- data/app/views/storytime/blogs/_tags.html.erb +3 -0
- data/app/views/storytime/{posts/index.atom.builder → blogs/show.atom.builder} +1 -1
- data/app/views/storytime/{posts/index.html.erb → blogs/show.html.erb} +1 -1
- data/app/views/storytime/comments/_discourse.html.erb +18 -0
- data/app/views/storytime/comments/_disqus.html.erb +2 -2
- data/app/views/storytime/comments/_form.html.erb +2 -2
- data/app/views/storytime/dashboard/_navigation.html.erb +109 -41
- data/app/views/storytime/dashboard/_settings_tabs.html.erb +32 -0
- data/app/views/storytime/dashboard/autosaves/_autosave_info.html.erb +7 -4
- data/app/views/storytime/dashboard/blog_posts/_form.html.erb +157 -0
- data/app/views/storytime/dashboard/blog_posts/edit.html.erb +55 -0
- data/app/views/storytime/dashboard/blog_posts/new.html.erb +31 -0
- data/app/views/storytime/dashboard/blogs/_blog.html.erb +3 -0
- data/app/views/storytime/dashboard/blogs/_form.html.erb +25 -0
- data/app/views/storytime/dashboard/blogs/edit.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/blogs/index.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/blogs/new.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/media/_form.html.erb +3 -3
- data/app/views/storytime/dashboard/media/{_gallery.html → _gallery.html.erb} +7 -4
- data/app/views/storytime/dashboard/media/_media.html.erb +6 -13
- data/app/views/storytime/dashboard/media/_modal.html.erb +3 -3
- data/app/views/storytime/dashboard/media/index.html.erb +15 -5
- data/app/views/storytime/dashboard/memberships/_form.html.erb +12 -0
- data/app/views/storytime/dashboard/memberships/_index.html.erb +39 -0
- data/app/views/storytime/dashboard/memberships/_membership.html.erb +12 -0
- data/app/views/storytime/dashboard/memberships/index.json.jbuilder +2 -0
- data/app/views/storytime/dashboard/memberships/save.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/pages/_form.html.erb +88 -0
- data/app/views/storytime/dashboard/pages/_index_title.html.erb +1 -0
- data/app/views/storytime/dashboard/pages/_new_button.html.erb +1 -0
- data/app/views/storytime/dashboard/pages/edit.html.erb +49 -0
- data/app/views/storytime/dashboard/pages/new.html.erb +28 -0
- data/app/views/storytime/dashboard/posts/_form.html.erb +128 -122
- data/app/views/storytime/dashboard/posts/_image_toolbar.html.erb +32 -0
- data/app/views/storytime/dashboard/posts/_index_title.html.erb +1 -0
- data/app/views/storytime/dashboard/posts/_list.html.erb +23 -24
- data/app/views/storytime/dashboard/posts/_new_button.html.erb +10 -0
- data/app/views/storytime/dashboard/posts/edit.html.erb +56 -13
- data/app/views/storytime/dashboard/posts/index.html.erb +56 -7
- data/app/views/storytime/dashboard/posts/new.html.erb +29 -8
- data/app/views/storytime/dashboard/roles/_form.html.erb +41 -0
- data/app/views/storytime/dashboard/roles/edit.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/sites/_form.html.erb +31 -15
- data/app/views/storytime/dashboard/sites/new.html.erb +21 -8
- data/app/views/storytime/dashboard/sites/site.json.jbuilder +2 -0
- data/app/views/storytime/dashboard/snippets/_form.html.erb +26 -12
- data/app/views/storytime/dashboard/snippets/_index.html.erb +17 -0
- data/app/views/storytime/dashboard/snippets/_snippet.html.erb +12 -0
- data/app/views/storytime/dashboard/snippets/edit.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/snippets/index.json.jbuilder +4 -0
- data/app/views/storytime/dashboard/snippets/new.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/subscriptions/_form.html.erb +19 -0
- data/app/views/storytime/dashboard/subscriptions/_index.html.erb +19 -0
- data/app/views/storytime/dashboard/subscriptions/_subscription.html.erb +9 -10
- data/app/views/storytime/dashboard/subscriptions/form.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/subscriptions/index.json.jbuilder +1 -0
- data/app/views/storytime/dashboard/users/_edit.html.erb +26 -0
- data/app/views/storytime/dashboard/users/_new.html.erb +25 -0
- data/app/views/storytime/dashboard/users/edit.json.jbuilder +2 -0
- data/app/views/storytime/dashboard/users/new.json.jbuilder +2 -0
- data/app/views/storytime/dashboard/versions/_version.html.erb +14 -0
- data/app/views/storytime/dashboard/versions/_versions_info.html.erb +1 -16
- data/app/views/storytime/pages/show.html.erb +1 -1
- data/app/views/storytime/posts/_post.html.erb +8 -0
- data/app/views/storytime/posts/_tags.html.erb +1 -1
- data/app/views/storytime/posts/show.html.erb +1 -1
- data/app/views/storytime/sites/_google_analytics_code.html.erb +2 -2
- data/app/views/storytime/snippets/_snippet.html.erb +9 -0
- data/app/views/storytime/subscription_mailer/new_post_email.html.erb +2 -2
- data/app/views/storytime/subscription_mailer/new_post_email.text.erb +2 -2
- data/app/views/storytime/subscriptions/_form.html.erb +0 -1
- data/app/views/storytime/subscriptions/_modal.html.erb +18 -10
- data/bin/rails +12 -0
- data/bin/storytime +4 -0
- data/circle.yml +3 -0
- data/config/initializers/storytime_admin.rb +3 -0
- data/config/initializers/url_for_patch.rb +2 -37
- data/config/locales/en.yml +33 -13
- data/config/routes.rb +47 -19
- data/db/migrate/20150128185746_seed_new_actions_and_permissions.rb +9 -0
- data/db/migrate/20150206201847_add_site_id_to_storytime_post.rb +7 -0
- data/db/migrate/20150206201919_add_site_id_to_storytime_snippet.rb +7 -0
- data/db/migrate/20150206201931_add_site_id_to_storytime_tag.rb +7 -0
- data/db/migrate/20150206205256_add_notification_fields_to_storytime_post.rb +6 -0
- data/db/migrate/20150216211257_add_subdomain_to_storytime_sites.rb +5 -0
- data/db/migrate/20150216225045_add_site_to_storytime_media.rb +6 -0
- data/db/migrate/20150219210528_remove_root_page_content_from_storytime_sites.rb +12 -0
- data/db/migrate/20150220184902_add_blog_id_to_posts.rb +6 -0
- data/db/migrate/20150224192138_add_homepage_path_to_storytime_sites.rb +5 -0
- data/db/migrate/20150224193151_add_subscription_email_from_to_storytime_sites.rb +5 -0
- data/db/migrate/20150224193551_add_layout_to_storytime_sites.rb +5 -0
- data/db/migrate/20150224194559_add_disqus_forum_shortname_to_storytime_sites.rb +5 -0
- data/db/migrate/20150224212453_remove_homepage_path_from_storytime_sites.rb +5 -0
- data/db/migrate/20150225143516_add_site_id_to_storytime_autosaves.rb +6 -0
- data/db/migrate/20150225143826_add_site_id_to_storytime_comments.rb +6 -0
- data/db/migrate/20150225145119_add_site_id_to_storytime_versions.rb +6 -0
- data/db/migrate/20150225145316_add_site_id_to_storytime_taggings.rb +6 -0
- data/db/migrate/20150225145608_update_storytime_site_id_columns.rb +11 -0
- data/db/migrate/20150225164232_add_site_id_to_storytime_permissions.rb +6 -0
- data/db/migrate/20150225212917_create_storytime_memberships.rb +11 -0
- data/db/migrate/20150225213535_create_memberships_for_storytime_users.rb +8 -0
- data/db/migrate/20150226201739_add_custom_domain_to_storytime_sites.rb +5 -0
- data/db/migrate/20150302171500_add_site_id_to_storytime_media.rb +8 -0
- data/db/migrate/20150302171722_set_site_layout.rb +8 -0
- data/db/migrate/20150302185138_remove_storytime_role_id_from_users.rb +5 -0
- data/db/migrate/20150302192525_transfer_posts_to_blogs.rb +8 -0
- data/db/migrate/20150302192759_seed_permissions.rb +9 -0
- data/db/migrate/20150331162329_add_discourse_name_to_storytime_sites.rb +5 -0
- data/db/migrate/20150402161427_remove_subdomain_from_storytime_site.rb +5 -0
- data/lib/generators/storytime/install_generator.rb +17 -0
- data/lib/generators/storytime/views_generator.rb +21 -9
- data/lib/generators/templates/storytime.rb +70 -27
- data/lib/storytime/cli/install.rb +274 -0
- data/lib/storytime/cli.rb +28 -0
- data/lib/storytime/concerns/current_site.rb +10 -0
- data/lib/storytime/concerns/has_versions.rb +22 -3
- data/lib/storytime/concerns/storytime_user.rb +31 -7
- data/lib/storytime/constraints/blog_constraint.rb +11 -0
- data/lib/storytime/constraints/blog_homepage_constraint.rb +11 -0
- data/lib/storytime/constraints/page_constraint.rb +13 -0
- data/lib/storytime/constraints/page_homepage_constraint.rb +11 -0
- data/lib/storytime/engine.rb +43 -14
- data/lib/storytime/generators/initializer.rb +45 -0
- data/lib/storytime/migrators/v1.rb +122 -0
- data/lib/storytime/post_notifier.rb +19 -0
- data/lib/storytime/post_url_handler.rb +47 -0
- data/lib/storytime/storytime_helpers.rb +12 -0
- data/lib/storytime/version.rb +1 -1
- data/lib/storytime.rb +57 -56
- data/screenshots/admin.png +0 -0
- data/screenshots/media.png +0 -0
- data/screenshots/page-list.png +0 -0
- data/screenshots/post-editor.png +0 -0
- data/screenshots/site-settings.png +0 -0
- data/screenshots/text-snippets.png +0 -0
- data/screenshots/user-management.png +0 -0
- data/spec/controllers/dashboard_controller_spec.rb +3 -1
- data/{app/assets/stylesheets/storytime/subscriptions.css.scss → spec/dummy/app/assets/images/.keep} +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +3 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -1
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/storytime_admin/widgets_controller.rb +5 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/user.rb +5 -1
- data/spec/dummy/app/models/video_post.rb +2 -0
- data/spec/dummy/app/models/widget.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +1 -1
- data/spec/dummy/app/views/storytime/dashboard/posts/_video_post_fields.html.erb +1 -0
- data/spec/dummy/app/views/widgets/storytime/dashboard/admin/_headers.html.erb +1 -0
- data/spec/dummy/app/views/widgets/storytime/dashboard/admin/_row.html.erb +1 -0
- data/spec/dummy/config/database.yml +9 -5
- data/spec/dummy/config/environments/test.rb +1 -0
- data/spec/dummy/config/initializers/devise.rb +1 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/initializers/storytime.rb +7 -14
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150127172846_create_widgets.rb +9 -0
- data/spec/dummy/db/migrate/20150206203824_add_video_url_to_storytime_posts.rb +5 -0
- data/spec/dummy/db/schema.rb +76 -21
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/factories/comment_factories.rb +1 -0
- data/spec/factories/membership_factories.rb +7 -0
- data/spec/factories/site_factories.rb +3 -2
- data/spec/factories/user_factories.rb +3 -3
- data/spec/factories/widget_factories.rb +5 -0
- data/spec/features/blogs_spec.rb +28 -0
- data/spec/features/comments_spec.rb +8 -9
- data/spec/features/dashboard/media_spec.rb +14 -30
- data/spec/features/dashboard/memberships_spec.rb +58 -0
- data/spec/features/dashboard/pages_spec.rb +67 -44
- data/spec/features/dashboard/posts_spec.rb +84 -62
- data/spec/features/dashboard/sites_spec.rb +28 -23
- data/spec/features/dashboard/snippets_spec.rb +44 -44
- data/spec/features/dashboard/subscription_spec.rb +36 -28
- data/spec/features/dashboard/users_spec.rb +48 -29
- data/spec/features/pages_spec.rb +2 -2
- data/spec/features/posts_spec.rb +2 -20
- data/spec/features/subscription_spec.rb +4 -4
- data/spec/models/post_spec.rb +26 -17
- data/spec/policies/comment_policy_spec.rb +22 -6
- data/spec/policies/post_policy_spec.rb +21 -3
- data/spec/requests/routings_spec.rb +27 -17
- data/spec/spec_helper.rb +12 -1
- data/spec/support/database_cleaner.rb +5 -5
- data/spec/support/domains.rb +18 -0
- data/spec/support/feature_macros.rb +18 -9
- data/storytime.gemspec +59 -0
- data/vendor/assets/javascripts/.DS_Store +0 -0
- data/vendor/assets/javascripts/codemirror/modes/css.js +717 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +120 -0
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +686 -0
- data/vendor/assets/javascripts/codemirror/modes/liquid.js +40 -0
- data/vendor/assets/javascripts/codemirror/modes/overlay.js +85 -0
- data/vendor/assets/javascripts/codemirror/{xml.js → modes/xml.js} +2 -2
- data/vendor/assets/javascripts/medium-editor.min.js +2450 -0
- data/vendor/assets/javascripts/phantom_js_bind_polyfill.js +24 -0
- data/vendor/assets/javascripts/tidy.js +30 -0
- data/vendor/assets/stylesheets/.DS_Store +0 -0
- data/vendor/assets/stylesheets/chosen-bootstrap-3.css +148 -0
- data/vendor/assets/stylesheets/{chosen.css.scss → chosen.scss} +1 -1
- data/vendor/assets/stylesheets/disable-transitions-for-test-env.css +7 -0
- data/vendor/assets/stylesheets/medium-editor-default.min.css +1 -0
- data/vendor/assets/stylesheets/medium-editor.min.css +1 -0
- metadata +297 -47
- data/app/assets/stylesheets/storytime/admin.css.scss +0 -121
- data/app/assets/stylesheets/storytime/application.css.scss +0 -22
- data/app/assets/stylesheets/storytime/layout.css.scss +0 -17
- data/app/assets/stylesheets/storytime/media.css.scss +0 -68
- data/app/assets/stylesheets/storytime/pagination.css.scss +0 -4
- data/app/assets/stylesheets/storytime/posts.css.scss +0 -30
- data/app/assets/stylesheets/storytime/versions.css.scss +0 -21
- data/app/helpers/storytime/dashboard/posts_helper.rb +0 -21
- data/app/views/storytime/blog_posts/_blog_post.html.erb +0 -8
- data/app/views/storytime/dashboard/posts/_basic_new_post_button.html.erb +0 -3
- data/app/views/storytime/dashboard/posts/_new_post_dropdown_button.html.erb +0 -10
- data/app/views/storytime/dashboard/sites/edit.html.erb +0 -25
- data/app/views/storytime/dashboard/snippets/_list.html.erb +0 -21
- data/app/views/storytime/dashboard/snippets/edit.html.erb +0 -13
- data/app/views/storytime/dashboard/snippets/index.html.erb +0 -13
- data/app/views/storytime/dashboard/snippets/new.html.erb +0 -12
- data/app/views/storytime/dashboard/subscriptions/edit.html.erb +0 -10
- data/app/views/storytime/dashboard/subscriptions/index.html.erb +0 -19
- data/app/views/storytime/dashboard/subscriptions/new.html.erb +0 -9
- data/app/views/storytime/dashboard/users/_user.html.erb +0 -11
- data/app/views/storytime/dashboard/users/edit.html.erb +0 -10
- data/app/views/storytime/dashboard/users/index.html.erb +0 -22
- data/app/views/storytime/dashboard/users/new.html.erb +0 -11
- data/spec/lib/storytime_spec.rb +0 -23
- data/vendor/assets/javascripts/codemirror/codemirror.js +0 -7831
- data/vendor/assets/javascripts/summernote.js +0 -5338
- data/vendor/assets/stylesheets/codemirror/codemirror.css +0 -309
- data/vendor/assets/stylesheets/codemirror/monokai.css +0 -31
- data/vendor/assets/stylesheets/summernote.css +0 -1
data/config/locales/en.yml
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
en:
|
2
2
|
common:
|
3
3
|
are_you_sure_you_want_to_delete: "Are you sure you want to delete this %{resource_name}?"
|
4
|
-
|
4
|
+
|
5
5
|
flash:
|
6
|
+
admin:
|
7
|
+
create:
|
8
|
+
success: "%{resource_name} successfully created."
|
9
|
+
update:
|
10
|
+
success: "%{resource_name} successfully updated."
|
11
|
+
blogs:
|
12
|
+
destroy:
|
13
|
+
success: "Blog successfully deleted."
|
6
14
|
comments:
|
7
15
|
create:
|
8
16
|
success: "Comment successfully created."
|
@@ -20,6 +28,8 @@ en:
|
|
20
28
|
success: "Site successfully created."
|
21
29
|
update:
|
22
30
|
success: "Site successfully updated."
|
31
|
+
destroy:
|
32
|
+
success: "Site successfully deleted."
|
23
33
|
snippets:
|
24
34
|
create:
|
25
35
|
success: "Text snippet successfully created."
|
@@ -46,34 +56,38 @@ en:
|
|
46
56
|
roles:
|
47
57
|
update:
|
48
58
|
success: "Permissions successfully updated."
|
49
|
-
|
59
|
+
|
50
60
|
simple_form:
|
51
61
|
labels:
|
52
62
|
site:
|
53
63
|
post_slug_style: "Post URL Style"
|
54
|
-
root_page_content: "Home Page Content"
|
55
64
|
ga_tracking_id: "Google Analytics Tracking ID"
|
56
65
|
comment:
|
57
66
|
content: "Comment Content"
|
58
67
|
user:
|
59
68
|
storytime_name: "Name"
|
60
|
-
|
69
|
+
|
61
70
|
footer:
|
62
71
|
attribute: 'Powered by <a href="http://www.github.com/FlyoverWorks/storytime" target="_blank">Storytime</a>.'
|
63
|
-
|
72
|
+
|
64
73
|
dashboard:
|
74
|
+
admin:
|
75
|
+
unconfigured_model: "You are attempting to access an admin page for a model that has not been configured in Storytime."
|
65
76
|
sites:
|
66
|
-
new: "
|
67
|
-
|
68
|
-
|
69
|
-
|
77
|
+
new: "Set Up Your Site"
|
78
|
+
root_post_id_label: "Homepage"
|
79
|
+
root_post_id_hint: "Select a page or blog to display at the path where Storytime is mounted. Leave blank to use a view from the host app."
|
80
|
+
subscription_email_from_label: "Email address to send subscription emails from"
|
70
81
|
edit: "Site Settings"
|
71
82
|
basic_info: "Basic Info"
|
72
83
|
permissions: "Permissions"
|
73
|
-
save_permissions: "Save
|
84
|
+
save_permissions: "Save"
|
85
|
+
save_button: "Save"
|
86
|
+
layout_hint: "Leave blank to use the default Storytime site layout"
|
87
|
+
domain_hint: "Enter the full domain of your site (e.g. www.example.com)"
|
74
88
|
users:
|
75
89
|
users_header: "Users"
|
76
|
-
create_new_user: "New
|
90
|
+
create_new_user: "New"
|
77
91
|
edit_user_button: "Edit"
|
78
92
|
edit_user_header: "Edit User"
|
79
93
|
email: "Email"
|
@@ -87,8 +101,8 @@ en:
|
|
87
101
|
select_media_from_file: "Select"
|
88
102
|
posts:
|
89
103
|
autosaves:
|
90
|
-
available: "There is an autosave of this %{resource} that
|
91
|
-
view_autosave: "View the autosave
|
104
|
+
available: "There is an autosave of this %{resource} that is newer than the version below."
|
105
|
+
view_autosave: "View the autosave"
|
92
106
|
select_or_create: "Select a %{resource} to Edit"
|
93
107
|
create_post: "Create One"
|
94
108
|
additional_fields: "Additional Fields"
|
@@ -102,3 +116,9 @@ en:
|
|
102
116
|
title: "Storytime"
|
103
117
|
subscribe_to: "Subscribe to %{site_name}"
|
104
118
|
subscribe_modal_msg: "Stay up-to-date with %{site_name} by signing up for our mailing list!"
|
119
|
+
|
120
|
+
pagination:
|
121
|
+
first: "<i class='fa fa-caret-left'></i><i class='fa fa-caret-left'></i>"
|
122
|
+
previous: "<i class='fa fa-caret-left'></i>"
|
123
|
+
next: "<i class='fa fa-caret-right'></i>"
|
124
|
+
last: "<i class='fa fa-caret-right'></i><i class='fa fa-caret-right'></i>"
|
data/config/routes.rb
CHANGED
@@ -1,43 +1,71 @@
|
|
1
|
-
|
1
|
+
Storytime::Engine.routes.draw do
|
2
2
|
resources :comments
|
3
3
|
resources :subscriptions, only: [:create]
|
4
4
|
get "subscriptions/unsubscribe", to: "subscriptions#destroy", as: "unsubscribe_mailing_list"
|
5
5
|
|
6
|
+
concern :autosavable do
|
7
|
+
resources :autosaves, only: :create
|
8
|
+
end
|
9
|
+
|
10
|
+
concern :commentable do
|
11
|
+
resources :comments, only: [:create, :destroy]
|
12
|
+
end
|
13
|
+
|
6
14
|
namespace :dashboard, :path => Storytime.dashboard_namespace_path do
|
7
|
-
get "/", to: "
|
8
|
-
resources :sites, only: [:new, :edit, :update, :create]
|
9
|
-
|
10
|
-
|
15
|
+
get "/", to: "pages#index"
|
16
|
+
resources :sites, only: [:new, :edit, :update, :create, :destroy]
|
17
|
+
|
18
|
+
resources :pages, except: :show, concerns: :autosavable
|
19
|
+
resources :blogs, except: [:index, :show], concerns: :autosavable do
|
20
|
+
# override route names so they don't conflict with resources :blog_posts
|
21
|
+
resources :posts, as: :blog_page_post, only: [:index]
|
22
|
+
|
23
|
+
resources :blog_posts, shallow: true, except: :show, concerns: :autosavable
|
24
|
+
Storytime.post_types.reject{|type| %w[Storytime::Page Storytime::Blog Storytime::BlogPost].include?(type) }.each do |post_type|
|
25
|
+
resources post_type.tableize.to_sym, controller: "custom_posts", only: [:new, :create]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create / Update / Delete pages, blog_posts, custom_post_types
|
30
|
+
Storytime.post_types.reject{|type| %w[Storytime::Page Storytime::Blog Storytime::BlogPost].include?(type) }.each do |post_type|
|
31
|
+
resources post_type.tableize.to_sym, controller: "custom_posts", only: [:edit, :update, :destroy], concerns: :autosavable
|
11
32
|
end
|
33
|
+
|
12
34
|
resources :snippets, except: [:show]
|
13
35
|
resources :media, except: [:show, :edit, :update]
|
14
36
|
resources :imports, only: [:new, :create]
|
15
37
|
resources :subscriptions
|
16
|
-
resources :users, path: Storytime.user_class_underscore.pluralize
|
17
|
-
resources :
|
38
|
+
resources :users, path: Storytime.user_class_underscore.pluralize, only: [:new, :create, :edit, :update]
|
39
|
+
resources :memberships, only: [:index, :create, :destroy]
|
40
|
+
resources :roles do
|
18
41
|
collection do
|
42
|
+
get :edit_multiple
|
19
43
|
patch :update_multiple
|
20
44
|
end
|
21
45
|
end
|
22
46
|
end
|
23
47
|
|
48
|
+
mount StorytimeAdmin::Engine => Storytime.dashboard_namespace_path
|
49
|
+
|
50
|
+
# TODO: HOW DO WE DEAL WITH THIS WHEN THERE ARE MULTIPLE BLOG PAGES?
|
24
51
|
get 'tags/:tag', to: 'posts#index', as: :tag
|
25
52
|
|
26
|
-
get
|
27
|
-
|
53
|
+
get "/", to: "blog_homepage#show", constraints: Storytime::Constraints::BlogHomepageConstraint.new
|
54
|
+
get "/", to: "homepage#show", constraints: Storytime::Constraints::PageHomepageConstraint.new
|
28
55
|
|
29
|
-
|
30
|
-
|
31
|
-
|
56
|
+
resources :blogs, only: :show, path: "/", constraints: Storytime::Constraints::BlogConstraint.new
|
57
|
+
resources :pages, only: :show, path: "/", constraints: Storytime::Constraints::PageConstraint.new
|
58
|
+
resources :posts, only: [], concerns: :commentable
|
59
|
+
|
60
|
+
Storytime.post_types.each do |post_type|
|
61
|
+
constraints ->(request){ request.params[:component_1] != "assets" } do
|
62
|
+
resources post_type.split("::").last.tableize, path: "(/:component_1(/:component_2(/:component_3)))/", only: :show, controller: "posts"
|
63
|
+
end
|
32
64
|
end
|
33
65
|
|
34
|
-
|
35
|
-
|
36
|
-
resources :pages, only: :show, path: "/"
|
66
|
+
constraints ->(request){ request.params[:component_1] != "assets" } do
|
67
|
+
resources :posts, path: "(/:component_1(/:component_2(/:component_3)))/", only: :show
|
37
68
|
end
|
38
69
|
|
39
|
-
|
40
|
-
resources :posts, only: nil do
|
41
|
-
resources :comments, only: [:create, :destroy]
|
42
|
-
end
|
70
|
+
root to: "application#setup"
|
43
71
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class RemoveRootPageContentFromStorytimeSites < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
Storytime::Migrators::V1.create_default_blog_for_sites
|
4
|
+
|
5
|
+
remove_column :storytime_sites, :root_page_content
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
Storytime::Blog.destroy_all
|
10
|
+
add_column :storytime_sites, :root_page_content, :integer, default: 0
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class UpdateStorytimeSiteIdColumns < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
Storytime::Migrators::V1.add_site_id_to_autosaves
|
4
|
+
Storytime::Migrators::V1.add_site_id_to_comments
|
5
|
+
Storytime::Migrators::V1.add_site_id_to_versions
|
6
|
+
Storytime::Migrators::V1.add_site_id_to_taggings
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateStorytimeMemberships < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :storytime_memberships do |t|
|
4
|
+
t.references :user, index: true
|
5
|
+
t.references :storytime_role, index: true
|
6
|
+
t.references :site, index: true
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -7,6 +7,23 @@ module Storytime
|
|
7
7
|
|
8
8
|
desc "Creates a Storytime initializer for your application."
|
9
9
|
|
10
|
+
def set_local_assigns
|
11
|
+
@user_class = 'User'
|
12
|
+
@dashboard_namespace_path = '/storytime'
|
13
|
+
@post_types = ['CustomPostType']
|
14
|
+
@post_title_character_limit = 100
|
15
|
+
@post_excerpt_character_limit = 500
|
16
|
+
@email_regexp = '/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/'
|
17
|
+
@search_adapter = "''"
|
18
|
+
@enable_file_upload = true
|
19
|
+
@aws_region = "ENV['STORYTIME_AWS_REGION']"
|
20
|
+
@aws_access_key_id = "ENV['STORYTIME_AWS_ACCESS_KEY_ID']"
|
21
|
+
@aws_secret_key = "ENV['STORYTIME_AWS_SECRET_KEY']"
|
22
|
+
@s3_bucket = 'my-s3-bucket'
|
23
|
+
@prod_media_storage = ':s3'
|
24
|
+
@dev_media_storage = ':file'
|
25
|
+
end
|
26
|
+
|
10
27
|
def copy_initializer
|
11
28
|
template "storytime.rb", "config/initializers/storytime.rb"
|
12
29
|
end
|
@@ -9,6 +9,8 @@ module Storytime
|
|
9
9
|
argument :scope, :required => false, :default => nil,
|
10
10
|
:desc => "The scope to copy views to"
|
11
11
|
|
12
|
+
class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (application, blog_posts, blogs, comments, dashboard, pages, posts, sites, snippets, subscription_mailer, subscriptions)"
|
13
|
+
|
12
14
|
public_task :copy_views
|
13
15
|
end
|
14
16
|
|
@@ -18,6 +20,25 @@ module Storytime
|
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
23
|
+
def copy_views
|
24
|
+
if options[:views]
|
25
|
+
options[:views].each do |directory|
|
26
|
+
view_directory directory.to_sym
|
27
|
+
end
|
28
|
+
else
|
29
|
+
view_directory :application
|
30
|
+
view_directory :blog_posts
|
31
|
+
view_directory :blogs
|
32
|
+
view_directory :comments
|
33
|
+
view_directory :pages
|
34
|
+
view_directory :posts
|
35
|
+
view_directory :sites
|
36
|
+
view_directory :snippets
|
37
|
+
view_directory :subscription_mailer
|
38
|
+
view_directory :subscriptions
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
21
42
|
protected
|
22
43
|
|
23
44
|
def view_directory(name, _target_path=nil)
|
@@ -39,15 +60,6 @@ module Storytime
|
|
39
60
|
|
40
61
|
argument :scope, :required => false, :default => nil,
|
41
62
|
:desc => "The scope to copy views to"
|
42
|
-
|
43
|
-
def copy_views
|
44
|
-
view_directory :application
|
45
|
-
view_directory :blog_posts
|
46
|
-
view_directory :comments
|
47
|
-
view_directory :pages
|
48
|
-
view_directory :posts
|
49
|
-
view_directory :sites
|
50
|
-
end
|
51
63
|
end
|
52
64
|
end
|
53
65
|
end
|