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
@@ -1,155 +1,161 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<div class="post_field post_excerpt">
|
16
|
-
<small>
|
17
|
-
<div class="pull-right" id="excerpt_character_limit" data-limit="<%= Storytime.post_excerpt_character_limit %>"></div>
|
18
|
-
</small>
|
19
|
-
<%= f.input :excerpt, required: false %>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
|
23
|
-
<div class="post_field post_content">
|
24
|
-
<%= f.input :draft_content, as: :text, input_html: { rows: 20, class: "summernote" }, label: "Content" %>
|
1
|
+
<div>
|
2
|
+
<div id="versions-panel" class="collapse post-action-panel">
|
3
|
+
<div style="padding: 20px;">
|
4
|
+
<div class="container-fluid">
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-md-8 col-md-offset-2">
|
7
|
+
<ul class="list-group" style="margin: 0;">
|
8
|
+
<%= render partial: 'storytime/dashboard/versions/version.html.erb', collection: @post.versions.order(created_at: :desc), locals: { versionable: @post } %>
|
9
|
+
</ul>
|
10
|
+
<%= link_to "Done", '#', class: "btn btn-primary btn-outline pull-right", style: "margin-top: 10px; margin-right: 15px;", data: { toggle: 'collapse', target: '#versions-panel' } %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
25
15
|
</div>
|
26
16
|
|
17
|
+
<%= simple_form_for [:dashboard, @post], html: { class: "post-form #{@post.new_record? ? 'new-post-form' : 'edit-post-form'}", data: { :"autosave-url" => (url_for([:dashboard, @post, :autosaves]) unless @post.new_record?), :"post-type" => current_post_type.type_name.tableize.singularize } } do |f| %>
|
27
18
|
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
<%= hidden_field_tag :type, @post.type_name %>
|
20
|
+
<% if Pundit.policy(current_user, @post).publish? %>
|
21
|
+
<%= f.input :published, as: :hidden, input_html: { id: "post_published" } %>
|
22
|
+
<% end %>
|
31
23
|
|
24
|
+
<div id="post-advanced-settings" class="collapse post-action-panel">
|
25
|
+
<div style="padding: 20px;">
|
26
|
+
<div class="container-fluid">
|
27
|
+
<div class="row">
|
28
|
+
<div class="col-md-8 col-md-offset-2">
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<div class="panel-heading">
|
37
|
-
<h4 class="panel-title">
|
38
|
-
<span class="glyphicon glyphicon-picture"></span>
|
39
|
-
<a data-toggle="collapse" href="#post_featured_images">
|
40
|
-
<%= t('dashboard.posts.featured_images') %>
|
41
|
-
</a>
|
42
|
-
</h4>
|
43
|
-
</div>
|
44
|
-
<div id="post_featured_images" class="panel-collapse collapse">
|
45
|
-
<div class="panel-body">
|
46
|
-
|
47
|
-
<div class="col-md-6">
|
48
|
-
<%= f.input :featured_media_id, as: :hidden, input_html: { id: "featured_media_id" } %>
|
30
|
+
<% if lookup_context.template_exists?("storytime/dashboard/posts/_#{@post.type_name}_fields") %>
|
31
|
+
<%= render("storytime/dashboard/posts/#{@post.type_name}_fields", f: f) %>
|
32
|
+
<% end %>
|
49
33
|
|
50
|
-
|
51
|
-
<
|
34
|
+
<% unless @post.is_a?(Storytime::Page) || @post.is_a?(Storytime::Blog) %>
|
35
|
+
<div class="post_field post_excerpt character-limit">
|
36
|
+
<small>
|
37
|
+
<div class="pull-right character-limit-display" data-limit="<%= Storytime.post_excerpt_character_limit %>"></div>
|
38
|
+
</small>
|
39
|
+
<%= f.input :excerpt, required: false, input_html: { class: "character-limit-input" } %>
|
40
|
+
</div>
|
52
41
|
|
53
|
-
<div
|
54
|
-
<%=
|
42
|
+
<div class="post_field post_tags">
|
43
|
+
<%= f.association :tags, input_html: { name: "#{@post.class.name.split('::').last.tableize.singularize}[tag_list][]", class: 'chosen-select tags-input', multiple: true } %>
|
55
44
|
</div>
|
45
|
+
<% end %>
|
56
46
|
|
57
|
-
|
58
|
-
|
47
|
+
<div class="row">
|
48
|
+
<div class="col-sm-6">
|
49
|
+
<%= f.input :slug, input_html: { value: (@post.persisted? ? @post.slug : nil) } %>
|
50
|
+
</div>
|
51
|
+
<div class="col-sm-6">
|
52
|
+
<%= f.input :published_at, as: :date_time_picker, label: "Publish Date/Time", input_html: { style: "display: inline;" } %>
|
59
53
|
</div>
|
60
54
|
</div>
|
55
|
+
|
56
|
+
<hr>
|
61
57
|
|
62
|
-
<
|
63
|
-
<%=
|
64
|
-
</button>
|
65
|
-
</div>
|
66
|
-
|
67
|
-
<div class="col-md-6">
|
68
|
-
<%= f.input :secondary_media_id, as: :hidden, input_html: { id: "secondary_media_id" } %>
|
69
|
-
|
70
|
-
<div class="featured_image_block center-block">
|
71
|
-
<span class="glyphicon glyphicon-picture select_featured_image" style="<% if @post.secondary_media %>display: none<% end %>"></span>
|
58
|
+
<div class="post_actions">
|
59
|
+
<%= link_to "Cancel", '#', class: "btn btn-default", data: { toggle: 'collapse', target: '#post-advanced-settings' } %>
|
72
60
|
|
73
|
-
<div
|
74
|
-
<%=
|
61
|
+
<div class="pull-right">
|
62
|
+
<%= f.submit "Save Draft", id: "save-draft-submit", class: "btn btn-default save" unless @post.published? %>
|
63
|
+
<%= f.submit "Publish", class: "btn btn-primary btn-outline publish", publish: true unless @post.published? %>
|
64
|
+
<%= f.submit "Update", class: "btn btn-primary btn-outline save" if @post.published? %>
|
75
65
|
</div>
|
66
|
+
|
67
|
+
<% unless @post.is_a?(Storytime::Page) || @post.is_a?(Storytime::Blog) %>
|
68
|
+
<div class="notify_subscribers_checkbox pull-right">
|
69
|
+
<%= f.input :notifications_enabled, as: :boolean, label: "Notify subscribers of new post" unless @post.published? %>
|
70
|
+
</div>
|
71
|
+
<% end %>
|
76
72
|
|
77
|
-
<div class="select_featured_image" <% if @post.secondary_media %>style="display: none"<% end %>>
|
78
|
-
<%= link_to "Select Secondary Image", "#", class: "btn btn-primary", id: "secondary_media_button" %>
|
79
|
-
</div>
|
80
73
|
</div>
|
81
|
-
|
82
|
-
<button type="button" class="btn btn-danger remove_featured_image center-block" <% unless @post.secondary_media %>style="display: none"<% end %>>
|
83
|
-
<%= t('dashboard.posts.remove_image') %>
|
84
|
-
</button>
|
85
74
|
</div>
|
86
|
-
|
87
75
|
</div>
|
88
76
|
</div>
|
89
77
|
</div>
|
90
|
-
|
91
|
-
|
92
|
-
<% if
|
93
|
-
<div class="panel panel
|
94
|
-
<div
|
95
|
-
<
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<% if Storytime.enable_file_upload && !@post.is_a?(Storytime::Page) && !@post.is_a?(Storytime::Blog) %>
|
81
|
+
<div class="collapse post-action-panel" id="featured-images-panel">
|
82
|
+
<div style="padding: 20px;">
|
83
|
+
<div class="container-fluid">
|
84
|
+
<div class="row">
|
85
|
+
<div class="col-md-8 col-md-offset-2">
|
86
|
+
<div class="row">
|
87
|
+
<div class="col-sm-10 col-sm-offset-1">
|
88
|
+
<div class="row">
|
89
|
+
<div class="col-sm-6">
|
90
|
+
<div class="well text-center featured_image_block <%= 'has-image' if @post.featured_media %>">
|
91
|
+
<%= f.input :featured_media_id, as: :hidden, input_html: { id: "featured_media_id" } %>
|
92
|
+
<div id="featured_media_container" class="image_container">
|
93
|
+
<%= image_tag @post.featured_media.file_url(:thumb), id: "featured_media_image" if @post.featured_media %>
|
94
|
+
</div>
|
95
|
+
<button type="button" class="btn btn-danger btn-block remove_featured_image">
|
96
|
+
<%= t('dashboard.posts.remove_image') %>
|
97
|
+
</button>
|
98
|
+
<i class="icon-st-icons-images select_featured_image"></i>
|
99
|
+
<div class="select_featured_image">
|
100
|
+
<%= link_to "Select Featured Image", "#", class: "btn btn-primary btn-outline text-lighter", id: "featured_media_button" %>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<div class="col-sm-6">
|
105
|
+
<div class="well text-center featured_image_block <%= 'has-image' if @post.secondary_media %>">
|
106
|
+
<%= f.input :secondary_media_id, as: :hidden, input_html: { id: "secondary_media_id" } %>
|
107
|
+
<div id="secondary_media_container" class="image_container">
|
108
|
+
<%= image_tag @post.secondary_media.file_url(:thumb), id: "secondary_media_image" if @post.secondary_media %>
|
109
|
+
</div>
|
110
|
+
<button type="button" class="btn btn-danger btn-block remove_featured_image">
|
111
|
+
<%= t('dashboard.posts.remove_image') %>
|
112
|
+
</button>
|
113
|
+
<i class="icon-st-icons-images select_featured_image"></i>
|
114
|
+
<div class="select_featured_image">
|
115
|
+
<%= link_to "Select Secondary Image", "#", class: "btn btn-primary btn-outline text-lighter", id: "secondary_media_button" %>
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<%= link_to "Done", '#', class: "btn btn-primary btn-outline pull-right", style: "margin-top: 10px;", data: { toggle: 'collapse', target: '#featured-images-panel' } %>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
</div>
|
104
125
|
</div>
|
105
126
|
</div>
|
106
127
|
</div>
|
107
128
|
<% end %>
|
129
|
+
|
130
|
+
<div class="container-fluid editor">
|
131
|
+
<div class="row">
|
132
|
+
<div class="col-md-8 col-md-offset-2">
|
133
|
+
|
134
|
+
<%= autosave_info @post if @post.persisted? %>
|
135
|
+
|
136
|
+
<%= f.error_notification if false %>
|
137
|
+
|
138
|
+
<div class="character-limit">
|
139
|
+
<span id="title_character_limit" class="text-muted character-limit-display" data-limit="<%= Storytime.post_title_character_limit %>"></span>
|
140
|
+
<h2 contenteditable="true" id="post-title-input" style="outline: none; margin-top: 0;" class="contenteditable character-limit-contenteditable" data-input="#<%= @post.class.name.split('::').last.tableize.singularize %>_title" placeholder="Title" autofocus="autofocus"><%= @post.title %></h2>
|
141
|
+
<%= f.input :title, as: :hidden, input_html: { class: "character-limit-input" } %>
|
142
|
+
</div>
|
143
|
+
<% if @post.errors[:title].present? %>
|
144
|
+
<span class="has-error">
|
145
|
+
<span class="help-block"><%= @post.errors[:title][0] %></span>
|
146
|
+
</span>
|
147
|
+
<% end %>
|
108
148
|
|
109
|
-
|
110
|
-
|
111
|
-
<h4 class="panel-title">
|
112
|
-
<span class="glyphicon glyphicon-cog"></span>
|
113
|
-
<a data-toggle="collapse" href="#post_advanced_settings">
|
114
|
-
<%= t('dashboard.posts.advanced_settings') %>
|
115
|
-
</a>
|
116
|
-
</h4>
|
117
|
-
</div>
|
118
|
-
<div id="post_advanced_settings" class="panel-collapse collapse">
|
119
|
-
<div class="panel-body">
|
120
|
-
|
121
|
-
<%= f.input :slug %>
|
122
|
-
|
123
|
-
<%= f.input :published_at, as: :date_time_picker, input_html: { style: "display: inline" } if @post.published? %>
|
149
|
+
<!-- Do not add any extra whitespace inside this div. It gets copied into the post content. -->
|
150
|
+
<div class="medium-editor" data-input="#<%= @post.class.name.split('::').last.tableize.singularize %>_draft_content" id="medium-editor-post" contenteditable='true' style="outline: none; margin-top: 30px;"><%= raw @post.draft_content %></div>
|
124
151
|
|
125
152
|
</div>
|
126
153
|
</div>
|
127
154
|
</div>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<hr>
|
131
|
-
|
132
|
-
<div class="post_actions">
|
133
|
-
<% if @post.persisted? %>
|
134
|
-
<%= link_to 'Delete', url_for([:dashboard, @post]), method: :delete, data: { confirm: t('common.are_you_sure_you_want_to_delete', resource_name: @post.human_name) }, class: "btn btn-danger" %>
|
135
|
-
<%= link_to "Preview", post_path(@post, preview: true), class: "btn btn-info", id: "preview_post", target: "_blank" %>
|
136
|
-
<% else %>
|
137
|
-
<button id="preview_post" class="btn btn-info">Preview</button>
|
138
|
-
<% end %>
|
139
155
|
|
140
|
-
<%= f.
|
141
|
-
|
142
|
-
<div class="pull-right">
|
143
|
-
<%= f.submit "Publish", class: "btn btn-primary publish", publish: true unless @post.published? %>
|
144
|
-
<%= f.submit "Update", class: "btn btn-default save" if @post.published? %>
|
145
|
-
</div>
|
156
|
+
<%= f.input :draft_content, as: :text, label: false, input_html: { class: "codemirror draft-content-input" } %>
|
146
157
|
|
147
|
-
|
148
|
-
|
149
|
-
<%= f.input :send_subscriber_email, as: :boolean, label: "Notify subscribers of new post" unless @post.published? %>
|
150
|
-
</div>
|
151
|
-
|
152
|
-
</div>
|
153
|
-
<% end %>
|
158
|
+
<% end %>
|
159
|
+
</div>
|
154
160
|
|
155
161
|
<%= render "storytime/dashboard/media/modal" if Storytime.enable_file_upload %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div class="scroll-panel-header" style="top: 65px;">
|
2
|
+
<div id="image-tools-panel" class="">
|
3
|
+
<div class="container-fluid">
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-md-8 col-md-offset-2">
|
6
|
+
<div id="medium-image-button">
|
7
|
+
<%= link_to "Insert Image", "#", class: "btn btn-sm btn-default insert-media-button"%>
|
8
|
+
<span id="draft_last_saved_at"></span>
|
9
|
+
</div>
|
10
|
+
<div class='medium-image-controls'>
|
11
|
+
<div class='row'>
|
12
|
+
<div class='col-xs-3'>
|
13
|
+
<input type='text' id='medium-image-width' placeholder='Width' class='form-control input-sm' />
|
14
|
+
</div>
|
15
|
+
<div class='col-xs-3'>
|
16
|
+
<input type='text' id='medium-image-height' placeholder='Height' class='form-control input-sm' />
|
17
|
+
</div>
|
18
|
+
<div class='col-xs-6'>
|
19
|
+
<div class='btn-group btn-group-sm'>
|
20
|
+
<a href='#' class='btn btn-default medium-image-float' data-float='left'><i class='fa fa-align-left'></i></a>
|
21
|
+
<a href='#' class='btn btn-default medium-image-float' data-float='none'><i class='fa fa-align-justify'></i></a>
|
22
|
+
<a href='#' class='btn btn-default medium-image-float' data-float='right'><i class='fa fa-align-right'></i></a>
|
23
|
+
<a href='#' class='btn btn-default medium-image-delete'><i class='fa fa-trash-o'></i></a>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @blog.title %>
|
@@ -1,25 +1,24 @@
|
|
1
|
-
<div
|
2
|
-
|
3
|
-
<%=
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</div>
|
1
|
+
<div class="list-group">
|
2
|
+
<% @posts.each do |post| %>
|
3
|
+
<%= link_to [:edit, :dashboard, post], id: "#{post.class.to_s.downcase.split("::").last}_#{post.id}", class: "list-group-item" do %>
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-md-8">
|
6
|
+
<h4><%= post.title %></h4>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<p class="text-muted">
|
11
|
+
<% if post.published? && post.published_at <= Time.now %>
|
12
|
+
Published <%= time_ago_in_words post.published_at %> ago
|
13
|
+
<% elsif post.published? %>
|
14
|
+
Scheduled to publish on <%= post.published_at.strftime("%B %e at %l:%M %p") %>
|
15
|
+
<% else %>
|
16
|
+
Last edited <%= time_ago_in_words post.updated_at %> ago
|
17
|
+
<% end %>
|
18
|
+
</p>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
<div class="pagination-wrapper">
|
23
|
+
<%= paginate @posts, param_name: "page_number" %>
|
25
24
|
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="btn-group pull-right">
|
2
|
+
<button type="button" class="btn btn-primary btn-outline btn-sm dropdown-toggle" data-toggle="dropdown">
|
3
|
+
New <span class="caret"></span>
|
4
|
+
</button>
|
5
|
+
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
6
|
+
<% Storytime.post_types.reject{|type| %w[Storytime::Post Storytime::Page Storytime::Blog].include? type }.each do |post_type| %>
|
7
|
+
<li><%= link_to "#{post_type.split('::').last.titleize}", [:new, :dashboard, @blog, post_type.split("::").last.tableize.singularize] %></li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
</div>
|
@@ -1,17 +1,60 @@
|
|
1
|
-
<%=
|
1
|
+
<div id="main" class="wysiwyg" data-post-id="<%= @post.slug || @post.id %>" data-preview="<%= params[:preview] %>">
|
2
|
+
<div class="scroll-panel">
|
3
|
+
<div class="scroll-panel-header">
|
4
|
+
<div class="pull-left">
|
5
|
+
<%= link_to "#", class: "btn btn-default btn-icon", data: { toggle: "off-canvas", target: "#dashboard-nav" } do %>
|
6
|
+
<i class="icon-st-icons-st-logo"></i>
|
7
|
+
<% end %>
|
8
|
+
<% if @post.is_a?(Storytime::Page) || @post.is_a?(Storytime::Blog) %>
|
9
|
+
<%= link_to [:dashboard, current_post_type], class: "btn btn-default btn-scroll-panel-header" do %>
|
10
|
+
<%= icon('angle-left') %>
|
11
|
+
<span class="hidden-xs"><%= current_post_type.type_name.pluralize.titleize %></span>
|
12
|
+
<% end %>
|
13
|
+
<% else %>
|
14
|
+
<%= link_to [:dashboard, @post.blog, :blog_page_post_index], class: "btn btn-default btn-scroll-panel-header" do %>
|
15
|
+
<%= icon('angle-left') %>
|
16
|
+
<span class="hidden-xs"><%= @post.blog.title %></span>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<div class="pull-right">
|
21
|
+
<%= link_to "#", class: "btn btn-default btn-icon margin-right", data: { toggle: "codemirror" } do %>
|
22
|
+
<i class="fa fa-code" style="top: -1px;"></i>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<% if Storytime.enable_file_upload && !@post.is_a?(Storytime::Page) && !@post.is_a?(Storytime::Blog) %>
|
26
|
+
<%= link_to '#', class: "btn btn-default btn-icon margin-right", data: { toggle: "collapse", target: '#featured-images-panel' } do %>
|
27
|
+
<i class="icon-st-icons-images"></i>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
2
30
|
|
3
|
-
<div
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
31
|
+
<div class="btn-group margin-right">
|
32
|
+
<button type="button" class="btn btn-default btn-icon dropdown-toggle" id="post-utilities" data-toggle="dropdown" aria-expanded="false">
|
33
|
+
<i class="icon-st-icons-utilitymenu"></i>
|
34
|
+
</button>
|
35
|
+
<ul class="dropdown-menu dropdown-menu-right" role="menu" style="top: 125%;">
|
36
|
+
<li>
|
37
|
+
<%= link_to '#', data: { toggle: 'collapse', target: '#versions-panel' } do %>
|
38
|
+
<i class="icon-st-icons-versions"></i>
|
39
|
+
History
|
40
|
+
<% end %>
|
41
|
+
</li>
|
42
|
+
<li>
|
43
|
+
<%= link_to url_for([:dashboard, @post]), method: :delete, data: { confirm: t('common.are_you_sure_you_want_to_delete', resource_name: @post.human_name) } do %>
|
44
|
+
<i class="icon-st-icons-delete"></i>
|
45
|
+
Delete
|
46
|
+
<% end %>
|
47
|
+
</li>
|
48
|
+
</ul>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<%= link_to "Preview", post_path(@post, preview: true), class: "btn btn-sm btn-primary btn-outline margin-right margin-left", id: "preview_post", target: "_blank" %>
|
52
|
+
|
53
|
+
<%= link_to (@post.published? ? "Update" : "Save / Publish"), "#", class: 'btn btn-primary btn-sm btn-outline', data: { toggle: 'collapse', target: '#post-advanced-settings' }, id: "advanced-settings-panel-toggle" %>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<%= render 'image_toolbar' %>
|
57
|
+
<div class="scroll-panel-body" style="top: 130px;">
|
15
58
|
<%= render 'form' %>
|
16
59
|
</div>
|
17
60
|
</div>
|
@@ -1,13 +1,62 @@
|
|
1
|
-
|
1
|
+
<div id="main">
|
2
|
+
<div class="scroll-panel">
|
3
|
+
<div class="scroll-panel-header">
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
<%= link_to "#", class: "btn btn-default btn-icon pull-left visible-xs visible-sm", data: { toggle: "off-canvas", target: "#dashboard-nav" } do %>
|
6
|
+
<i class="icon-st-icons-st-logo"></i>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if @blog %>
|
10
|
+
<div class="pull-right">
|
7
11
|
|
8
|
-
|
12
|
+
<div class="btn-group margin-right" style="margin-right: 10px;">
|
13
|
+
<button type="button" class="btn btn-default btn-icon dropdown-toggle" id="post-utilities" data-toggle="dropdown" aria-expanded="false">
|
14
|
+
<i class="icon-st-icons-utilitymenu"></i>
|
15
|
+
</button>
|
16
|
+
<ul class="dropdown-menu dropdown-menu-right" role="menu" style="top: 125%;">
|
17
|
+
<li>
|
18
|
+
<%= link_to [:edit, :dashboard, @blog], remote: true, class: "storytime-modal-trigger" do %>
|
19
|
+
<i class="icon-st-icons-settings"></i>
|
20
|
+
Blog Settings
|
21
|
+
<% end %>
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
<%= link_to url_for([:dashboard, @blog]), method: :delete, data: { confirm: t('common.are_you_sure_you_want_to_delete', resource_name: @blog.human_name) } do %>
|
25
|
+
<i class="icon-st-icons-delete"></i>
|
26
|
+
Delete
|
27
|
+
<% end %>
|
28
|
+
</li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
9
31
|
|
10
|
-
|
32
|
+
<%= render "new_button" %>
|
33
|
+
</div>
|
34
|
+
<% else %>
|
35
|
+
<%= render "new_button" %>
|
36
|
+
<% end %>
|
37
|
+
<h3 class="scroll-panel-title">
|
38
|
+
<%= render "index_title" %>
|
39
|
+
</h3>
|
40
|
+
</div>
|
41
|
+
<div class="scroll-panel-body">
|
42
|
+
<ul class="nav nav-tabs">
|
43
|
+
<li role="presentation" class="<%= 'active' unless params[:published] == 'true' %>">
|
44
|
+
<% if @blog %>
|
45
|
+
<%= link_to "Drafts", [:dashboard, @blog, :blog_page_post_index, published: nil] %>
|
46
|
+
<% else %>
|
47
|
+
<%= link_to "Drafts", [:dashboard, current_post_type] %>
|
48
|
+
<% end %>
|
49
|
+
</li>
|
50
|
+
<li role="presentation" class="<%= 'active' if params[:published] == 'true' %>">
|
51
|
+
<% if @blog %>
|
52
|
+
<%= link_to "Published", [:dashboard, @blog, :blog_page_post_index, published: 'true'] %>
|
53
|
+
<% else %>
|
54
|
+
<%= link_to "Published", [:dashboard, current_post_type, published: 'true'] %>
|
55
|
+
<% end %>
|
56
|
+
|
57
|
+
</li>
|
58
|
+
</ul>
|
59
|
+
<%= render 'list' %>
|
11
60
|
</div>
|
12
61
|
</div>
|
13
62
|
</div>
|
@@ -1,12 +1,33 @@
|
|
1
|
-
|
1
|
+
<div id="main" class="wysiwyg">
|
2
|
+
<div class="scroll-panel">
|
3
|
+
<div class="scroll-panel-header">
|
4
|
+
<div class="pull-left">
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%= link_to "#", class: "btn btn-default btn-icon", data: { toggle: "off-canvas", target: "#dashboard-nav" } do %>
|
7
|
+
<i class="icon-st-icons-st-logo"></i>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= link_to [:dashboard, current_post_type], class: "btn btn-default btn-scroll-panel-header" do %>
|
11
|
+
<%= icon('angle-left') %>
|
12
|
+
<span class="hidden-xs"><%= @post.human_name.pluralize %></span>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
<div class="pull-right">
|
16
|
+
<%= link_to "#", class: "btn btn-default btn-icon margin-right", data: { toggle: "codemirror" } do %>
|
17
|
+
<i class="fa fa-code" style="top: -1px;"></i>
|
18
|
+
<% end %>
|
19
|
+
<% if Storytime.enable_file_upload && !@post.is_a?(Storytime::Page) && !@post.is_a?(Storytime::Blog) %>
|
20
|
+
<%= link_to '#', class: "btn btn-default btn-icon margin-right", data: { toggle: "collapse", target: '#featured-images-panel' } do %>
|
21
|
+
<i class="icon-st-icons-images"></i>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<button id="preview_post" class="btn btn-primary btn-outline btn-sm margin-right">Preview</button>
|
25
|
+
<%= link_to "Save / Publish", "#", class: 'btn btn-primary btn-sm btn-outline', data: { toggle: 'collapse', target: '#post-advanced-settings' } %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
<%= render 'image_toolbar' %>
|
29
|
+
<div class="scroll-panel-body" style="top: 130px;" data-top="130px">
|
30
|
+
<%= render "form" %>
|
10
31
|
</div>
|
11
32
|
</div>
|
12
33
|
</div>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%= form_tag update_multiple_dashboard_roles_path, method: :patch, remote: true, class: "storytime-modal-form" do %>
|
2
|
+
<div class="scroll-panel">
|
3
|
+
<div class="scroll-panel-header">
|
4
|
+
<button type="button" class="close pull-left" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
5
|
+
<%= submit_tag t('dashboard.sites.save_button'), class: "btn btn-sm btn-primary btn-outline pull-right" %>
|
6
|
+
<h3 class="scroll-panel-title">
|
7
|
+
Permissions
|
8
|
+
</h3>
|
9
|
+
</div>
|
10
|
+
<div class="scroll-panel-body">
|
11
|
+
|
12
|
+
<%= render 'storytime/dashboard/settings_tabs.html.erb' %>
|
13
|
+
|
14
|
+
<table class="table table-hover">
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<td></td>
|
18
|
+
<% @roles.each do |role| %>
|
19
|
+
<td class="text-center text-danger">
|
20
|
+
<%= role.label %>
|
21
|
+
<%= hidden_field_tag "roles[#{role.id}][allowed_action_ids][]", nil %>
|
22
|
+
</td>
|
23
|
+
<% end %>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
<tbody>
|
27
|
+
<% @actions.each do |action| %>
|
28
|
+
<tr>
|
29
|
+
<td><%= action.name %></td>
|
30
|
+
<% @roles.each do |role| %>
|
31
|
+
<td class="text-center">
|
32
|
+
<input <%= 'checked' if role.allowed_action_ids.include?(action.id) %> class="check_boxes optional" id="roles_<%= role.id %>_allowed_action_ids_<%= action.id %>" name="roles[<%= role.id %>][allowed_action_ids][]" type="checkbox" value="<%= action.id %>">
|
33
|
+
</td>
|
34
|
+
<% end %>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.html render(partial: "storytime/dashboard/roles/form.html.erb")
|