postnhost 0.0.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +33 -0
- data/{LICENSE.txt → LICENSE} +6 -6
- data/README.md +343 -15
- data/Rakefile +66 -6
- data/app/assets/builds/postnhost/application.css +2 -0
- data/app/assets/builds/postnhost/application.js +50190 -0
- data/app/assets/config/postnhost_manifest.js +2 -0
- data/app/assets/images/postnhost/demo.webp +0 -0
- data/app/assets/images/postnhost/icons/alert-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-left-long.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-left.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right-end-on-rectangle.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right-long.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right.svg +3 -0
- data/app/assets/images/postnhost/icons/bars.svg +3 -0
- data/app/assets/images/postnhost/icons/bluesky.svg +3 -0
- data/app/assets/images/postnhost/icons/check-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-down-small.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-down.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-left.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-right.svg +3 -0
- data/app/assets/images/postnhost/icons/clock.svg +3 -0
- data/app/assets/images/postnhost/icons/close.svg +3 -0
- data/app/assets/images/postnhost/icons/code-bracket.svg +3 -0
- data/app/assets/images/postnhost/icons/document-text.svg +3 -0
- data/app/assets/images/postnhost/icons/drag-handle.svg +8 -0
- data/app/assets/images/postnhost/icons/edit.svg +3 -0
- data/app/assets/images/postnhost/icons/external-link.svg +3 -0
- data/app/assets/images/postnhost/icons/eye.svg +4 -0
- data/app/assets/images/postnhost/icons/facebook.svg +3 -0
- data/app/assets/images/postnhost/icons/folder.svg +3 -0
- data/app/assets/images/postnhost/icons/image.svg +3 -0
- data/app/assets/images/postnhost/icons/info-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/instagram.svg +3 -0
- data/app/assets/images/postnhost/icons/language.svg +3 -0
- data/app/assets/images/postnhost/icons/layers.svg +3 -0
- data/app/assets/images/postnhost/icons/lightning.svg +3 -0
- data/app/assets/images/postnhost/icons/linkedin.svg +3 -0
- data/app/assets/images/postnhost/icons/logout.svg +3 -0
- data/app/assets/images/postnhost/icons/magnifying-glass.svg +3 -0
- data/app/assets/images/postnhost/icons/mastodon.svg +3 -0
- data/app/assets/images/postnhost/icons/menu.svg +3 -0
- data/app/assets/images/postnhost/icons/plus.svg +3 -0
- data/app/assets/images/postnhost/icons/schedule.svg +3 -0
- data/app/assets/images/postnhost/icons/settings.svg +4 -0
- data/app/assets/images/postnhost/icons/sparkles.svg +3 -0
- data/app/assets/images/postnhost/icons/spinner.svg +4 -0
- data/app/assets/images/postnhost/icons/threads.svg +3 -0
- data/app/assets/images/postnhost/icons/tiktok.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-center.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-left.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-right.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/apply-link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/blockquote.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/bold.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/bullet-list.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/code-block.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/code.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/heading-2.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/heading-3.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/image-add.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/italic.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/ordered-list.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/redo.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/remove-link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/strike.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/table.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/underline.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/undo.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/youtube.svg +4 -0
- data/app/assets/images/postnhost/icons/translate.svg +3 -0
- data/app/assets/images/postnhost/icons/trash.svg +3 -0
- data/app/assets/images/postnhost/icons/user.svg +4 -0
- data/app/assets/images/postnhost/icons/users.svg +3 -0
- data/app/assets/images/postnhost/icons/warning.svg +3 -0
- data/app/assets/images/postnhost/icons/x.svg +3 -0
- data/app/assets/images/postnhost/icons/youtube.svg +3 -0
- data/app/assets/images/postnhost/logo.webp +0 -0
- data/app/assets/images/postnhost/og-image.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/08-how-to-control-suggested-articles-and-top-picks-01-discovery-controls.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/09-all-about-authors-in-postnhost-01-author-profile.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/09-all-about-authors-in-postnhost-02-multiple-authors.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/11-how-to-schedule-an-article-for-publication-01-timezone.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/11-how-to-schedule-an-article-for-publication-02-scheduled-article.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/12-how-article-version-history-and-restores-work-01-version-history.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/13-how-to-add-and-manage-languages-01-language-management.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/14-how-to-translate-articles-pages-and-categories-01-translation-options.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/14-how-to-translate-articles-pages-and-categories-02-ai-language-selection.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/16-how-to-add-navigation-links-01-navigation-builder.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/16-how-to-add-navigation-links-02-external-link-settings.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/17-how-to-add-a-logo-and-default-og-image-01-assets-settings.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/19-how-to-customize-public-text-for-each-language-01-i18n-overrides.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-01-site-schema.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-02-author-schema-defaults.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-03-author-schema-advanced-fields.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/08-suggested-articles-and-top-picks.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/09-authors.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/11-scheduling.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/12-version-history.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/13-languages.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/14-translations.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/16-navigation-links.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/17-logo-and-default-og-image.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/19-public-text-for-each-language.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/20-structured-data-and-sitemap-seo.webp +0 -0
- data/app/assets/stylesheets/application.tailwind.css +347 -0
- data/app/assets/stylesheets/postnhost/application.css +15 -0
- data/app/assets/xsl/sitemap.xsl +64 -0
- data/app/controllers/concerns/postnhost/authentication.rb +59 -0
- data/app/controllers/concerns/postnhost/canonical_first_page_redirect.rb +14 -0
- data/app/controllers/concerns/postnhost/language_switcher.rb +42 -0
- data/app/controllers/concerns/postnhost/onboarding/access_control.rb +57 -0
- data/app/controllers/concerns/postnhost/onboarding/step_assignment.rb +55 -0
- data/app/controllers/concerns/postnhost/public_footer_data.rb +103 -0
- data/app/controllers/concerns/postnhost/public_http_caching.rb +35 -0
- data/app/controllers/concerns/postnhost/public_page_size.rb +17 -0
- data/app/controllers/concerns/postnhost/public_template_resolvable.rb +44 -0
- data/app/controllers/concerns/postnhost/settings/i18n_manageable.rb +61 -0
- data/app/controllers/concerns/postnhost/settings/navigation_manageable.rb +118 -0
- data/app/controllers/concerns/postnhost/settings/schema_manageable.rb +140 -0
- data/app/controllers/concerns/postnhost/users/schema_manageable.rb +119 -0
- data/app/controllers/postnhost/application_controller.rb +37 -0
- data/app/controllers/postnhost/article_variants_controller.rb +138 -0
- data/app/controllers/postnhost/articles/cover_images_controller.rb +35 -0
- data/app/controllers/postnhost/articles/images_controller.rb +28 -0
- data/app/controllers/postnhost/articles/translations_controller.rb +26 -0
- data/app/controllers/postnhost/articles_controller.rb +130 -0
- data/app/controllers/postnhost/categories/translations_controller.rb +24 -0
- data/app/controllers/postnhost/categories_controller.rb +59 -0
- data/app/controllers/postnhost/category_variants_controller.rb +69 -0
- data/app/controllers/postnhost/languages_controller.rb +66 -0
- data/app/controllers/postnhost/onboarding_controller.rb +70 -0
- data/app/controllers/postnhost/page_variants_controller.rb +136 -0
- data/app/controllers/postnhost/pages/images_controller.rb +28 -0
- data/app/controllers/postnhost/pages/translations_controller.rb +26 -0
- data/app/controllers/postnhost/pages_controller.rb +95 -0
- data/app/controllers/postnhost/public/articles_controller.rb +135 -0
- data/app/controllers/postnhost/public/authors_controller.rb +57 -0
- data/app/controllers/postnhost/public/categories_controller.rb +61 -0
- data/app/controllers/postnhost/public/static_pages_controller.rb +77 -0
- data/app/controllers/postnhost/public_controller.rb +32 -0
- data/app/controllers/postnhost/sessions_controller.rb +37 -0
- data/app/controllers/postnhost/settings/site_scripts_controller.rb +61 -0
- data/app/controllers/postnhost/settings_controller.rb +63 -0
- data/app/controllers/postnhost/sitemap_controller.rb +17 -0
- data/app/controllers/postnhost/templates_controller.rb +26 -0
- data/app/controllers/postnhost/users_controller.rb +112 -0
- data/app/helpers/postnhost/application_helper.rb +236 -0
- data/app/helpers/postnhost/article_helper.rb +41 -0
- data/app/helpers/postnhost/category_helper.rb +52 -0
- data/app/helpers/postnhost/common_css_helper.rb +97 -0
- data/app/helpers/postnhost/navigation_helper.rb +148 -0
- data/app/helpers/postnhost/pagy_helper.rb +103 -0
- data/app/helpers/postnhost/public_pages_helper.rb +287 -0
- data/app/helpers/postnhost/schema_helper.rb +102 -0
- data/app/helpers/postnhost/seo_helper.rb +428 -0
- data/app/helpers/postnhost/settings_helper.rb +79 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/ai_translation_controller.js +42 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/author_manager_controller.js +96 -0
- data/app/javascript/controllers/auto_save_controller.js +244 -0
- data/app/javascript/controllers/bulk_selection_controller.js +74 -0
- data/app/javascript/controllers/burger_controller.js +20 -0
- data/app/javascript/controllers/category_manager_controller.js +99 -0
- data/app/javascript/controllers/collapsible_sidebar_controller.js +87 -0
- data/app/javascript/controllers/cover_image_upload_controller.js +164 -0
- data/app/javascript/controllers/dropdown_controller.js +38 -0
- data/app/javascript/controllers/editor_mobile_sidebars_controller.js +36 -0
- data/app/javascript/controllers/file_auto_submit_controller.js +23 -0
- data/app/javascript/controllers/flash_message_controller.js +40 -0
- data/app/javascript/controllers/index.js +71 -0
- data/app/javascript/controllers/navigation_builder_controller.js +463 -0
- data/app/javascript/controllers/public_mobile_nav_controller.js +26 -0
- data/app/javascript/controllers/publish_guard_controller.js +47 -0
- data/app/javascript/controllers/reading_progress_controller.js +38 -0
- data/app/javascript/controllers/schedule_manager_controller.js +87 -0
- data/app/javascript/controllers/suggestion_manager_controller.js +99 -0
- data/app/javascript/controllers/template_preview_controller.js +34 -0
- data/app/javascript/controllers/tiptap_editor_controller.js +812 -0
- data/app/javascript/controllers/title_field_controller.js +17 -0
- data/app/javascript/helpers/auto_save_state.js +47 -0
- data/app/javascript/helpers/code_highlighting.js +48 -0
- data/app/javascript/helpers/dom_helpers.js +109 -0
- data/app/javascript/helpers/style_helpers.js +168 -0
- data/app/jobs/postnhost/application_job.rb +9 -0
- data/app/jobs/postnhost/scheduled_article_job.rb +13 -0
- data/app/jobs/postnhost/translation/article_variant_job.rb +17 -0
- data/app/jobs/postnhost/translation/category_variant_job.rb +17 -0
- data/app/jobs/postnhost/translation/page_variant_job.rb +17 -0
- data/app/models/concerns/postnhost/article/image_uploadable.rb +11 -0
- data/app/models/concerns/postnhost/excerpt_optimizable.rb +57 -0
- data/app/models/concerns/postnhost/inline_image_uploadable.rb +40 -0
- data/app/models/concerns/postnhost/page/image_uploadable.rb +11 -0
- data/app/models/concerns/postnhost/primary_language_guard.rb +18 -0
- data/app/models/concerns/postnhost/public_revision_touch.rb +15 -0
- data/app/models/concerns/postnhost/schema_localizable.rb +28 -0
- data/app/models/postnhost/application_record.rb +5 -0
- data/app/models/postnhost/article.rb +142 -0
- data/app/models/postnhost/article_author.rb +20 -0
- data/app/models/postnhost/article_category.rb +8 -0
- data/app/models/postnhost/article_suggestion.rb +19 -0
- data/app/models/postnhost/article_variant.rb +28 -0
- data/app/models/postnhost/category.rb +34 -0
- data/app/models/postnhost/category_variant.rb +24 -0
- data/app/models/postnhost/language.rb +38 -0
- data/app/models/postnhost/navigation.rb +76 -0
- data/app/models/postnhost/navigation_item.rb +100 -0
- data/app/models/postnhost/page.rb +63 -0
- data/app/models/postnhost/page_variant.rb +26 -0
- data/app/models/postnhost/public_site_revision.rb +24 -0
- data/app/models/postnhost/published_cover_image.rb +28 -0
- data/app/models/postnhost/setting.rb +116 -0
- data/app/models/postnhost/site_script.rb +11 -0
- data/app/models/postnhost/snapshot/article.rb +142 -0
- data/app/models/postnhost/snapshot/article_author.rb +11 -0
- data/app/models/postnhost/snapshot/article_category.rb +10 -0
- data/app/models/postnhost/snapshot/article_suggestion.rb +11 -0
- data/app/models/postnhost/snapshot/article_variant.rb +60 -0
- data/app/models/postnhost/snapshot/page.rb +33 -0
- data/app/models/postnhost/snapshot/page_variant.rb +41 -0
- data/app/models/postnhost/template.rb +20 -0
- data/app/models/postnhost/user.rb +63 -0
- data/app/models/postnhost/version.rb +7 -0
- data/app/services/postnhost/base_service.rb +17 -0
- data/app/services/postnhost/constraints/public_locale_constraint.rb +9 -0
- data/app/services/postnhost/constraints/public_route_constraint.rb +19 -0
- data/app/services/postnhost/onboarding/step_processor.rb +27 -0
- data/app/services/postnhost/onboarding/steps/base.rb +52 -0
- data/app/services/postnhost/onboarding/steps/choose_languages.rb +66 -0
- data/app/services/postnhost/onboarding/steps/complete_post_install_checklist.rb +12 -0
- data/app/services/postnhost/onboarding/steps/create_admin_account.rb +28 -0
- data/app/services/postnhost/onboarding/steps/finish_setup.rb +27 -0
- data/app/services/postnhost/onboarding/steps/set_site_metadata.rb +70 -0
- data/app/services/postnhost/public_navigation_targets.rb +67 -0
- data/app/services/postnhost/public_request_context.rb +101 -0
- data/app/services/postnhost/publishing/article_variants/publish.rb +26 -0
- data/app/services/postnhost/publishing/article_variants/publish_many.rb +23 -0
- data/app/services/postnhost/publishing/article_variants/snapshot_writer.rb +44 -0
- data/app/services/postnhost/publishing/article_variants/unpublish.rb +27 -0
- data/app/services/postnhost/publishing/article_variants/unpublish_many.rb +23 -0
- data/app/services/postnhost/publishing/articles/publish.rb +25 -0
- data/app/services/postnhost/publishing/articles/publish_scheduled.rb +42 -0
- data/app/services/postnhost/publishing/articles/snapshot_writer.rb +84 -0
- data/app/services/postnhost/publishing/articles/unpublish.rb +26 -0
- data/app/services/postnhost/publishing/bulk_transition.rb +63 -0
- data/app/services/postnhost/publishing/error.rb +12 -0
- data/app/services/postnhost/publishing/page_variants/publish.rb +26 -0
- data/app/services/postnhost/publishing/page_variants/publish_many.rb +23 -0
- data/app/services/postnhost/publishing/page_variants/snapshot_writer.rb +41 -0
- data/app/services/postnhost/publishing/page_variants/unpublish.rb +27 -0
- data/app/services/postnhost/publishing/page_variants/unpublish_many.rb +23 -0
- data/app/services/postnhost/publishing/pages/publish.rb +25 -0
- data/app/services/postnhost/publishing/pages/snapshot_writer.rb +38 -0
- data/app/services/postnhost/publishing/pages/unpublish.rb +26 -0
- data/app/services/postnhost/publishing/revision.rb +37 -0
- data/app/services/postnhost/publishing/route_validator.rb +41 -0
- data/app/services/postnhost/publishing/versions/restore_draft.rb +64 -0
- data/app/services/postnhost/service_result.rb +7 -0
- data/app/services/postnhost/sitemap_builder.rb +395 -0
- data/app/services/postnhost/translation/article_variant_translator.rb +102 -0
- data/app/services/postnhost/translation/category_variant_translator.rb +92 -0
- data/app/services/postnhost/translation/content_translator.rb +119 -0
- data/app/services/postnhost/translation/openai_llm_client.rb +30 -0
- data/app/services/postnhost/translation/page_variant_translator.rb +55 -0
- data/app/uploaders/base_uploader.rb +26 -0
- data/app/uploaders/cover_image_uploader.rb +31 -0
- data/app/uploaders/postnhost/avatar_uploader.rb +17 -0
- data/app/uploaders/postnhost/inline_article_image_uploader.rb +38 -0
- data/app/uploaders/postnhost/inline_page_image_uploader.rb +38 -0
- data/app/uploaders/postnhost/setting_asset_uploader.rb +18 -0
- data/app/views/layouts/postnhost/_favicon.html.erb +6 -0
- data/app/views/layouts/postnhost/_footer.html.erb +67 -0
- data/app/views/layouts/postnhost/_header.html.erb +89 -0
- data/app/views/layouts/postnhost/_sidebar.html.erb +72 -0
- data/app/views/layouts/postnhost/application.html.erb +23 -0
- data/app/views/layouts/postnhost/articles.html.erb +34 -0
- data/app/views/layouts/postnhost/product.html.erb +36 -0
- data/app/views/layouts/postnhost/public/templates/default.html.erb +110 -0
- data/app/views/layouts/postnhost/public/templates/swiss-editorial.html.erb +213 -0
- data/app/views/layouts/postnhost/public/templates/workspace-journal.html.erb +231 -0
- data/app/views/layouts/postnhost/public_header/_dashboard_sign_in.html.erb +14 -0
- data/app/views/layouts/postnhost/public_header/_language_switcher.html.erb +43 -0
- data/app/views/layouts/postnhost/public_header/_logo.html.erb +9 -0
- data/app/views/postnhost/article_variants/_variants_list.html.erb +82 -0
- data/app/views/postnhost/article_variants/edit.html.erb +48 -0
- data/app/views/postnhost/article_variants/index.html.erb +128 -0
- data/app/views/postnhost/article_variants/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/article_variants/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/article_variants/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/_author_manager.html.erb +38 -0
- data/app/views/postnhost/articles/_category_manager.html.erb +42 -0
- data/app/views/postnhost/articles/_cover_image_upload.html.erb +82 -0
- data/app/views/postnhost/articles/_suggestion_manager.html.erb +43 -0
- data/app/views/postnhost/articles/_version_snapshot.html.erb +10 -0
- data/app/views/postnhost/articles/edit.html.erb +51 -0
- data/app/views/postnhost/articles/index.html.erb +132 -0
- data/app/views/postnhost/articles/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/version_preview.html.erb +17 -0
- data/app/views/postnhost/articles/versions.html.erb +68 -0
- data/app/views/postnhost/categories/edit.html.erb +77 -0
- data/app/views/postnhost/categories/index.html.erb +80 -0
- data/app/views/postnhost/categories/new.html.erb +50 -0
- data/app/views/postnhost/categories/show.html.erb +99 -0
- data/app/views/postnhost/category_variants/_category_variants_list.html.erb +67 -0
- data/app/views/postnhost/category_variants/_form.html.erb +29 -0
- data/app/views/postnhost/category_variants/edit.html.erb +21 -0
- data/app/views/postnhost/category_variants/index.html.erb +82 -0
- data/app/views/postnhost/category_variants/new.html.erb +21 -0
- data/app/views/postnhost/languages/edit.html.erb +45 -0
- data/app/views/postnhost/languages/index.html.erb +86 -0
- data/app/views/postnhost/languages/new.html.erb +45 -0
- data/app/views/postnhost/languages/show.html.erb +156 -0
- data/app/views/postnhost/onboarding/_post_install_checklist.html.erb +40 -0
- data/app/views/postnhost/onboarding/_step_1.html.erb +42 -0
- data/app/views/postnhost/onboarding/_step_2.html.erb +38 -0
- data/app/views/postnhost/onboarding/_step_3.html.erb +62 -0
- data/app/views/postnhost/onboarding/_step_4.html.erb +26 -0
- data/app/views/postnhost/onboarding/show.html.erb +51 -0
- data/app/views/postnhost/page_variants/_variants_list.html.erb +82 -0
- data/app/views/postnhost/page_variants/edit.html.erb +50 -0
- data/app/views/postnhost/page_variants/index.html.erb +128 -0
- data/app/views/postnhost/page_variants/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/page_variants/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/page_variants/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/pages/edit.html.erb +50 -0
- data/app/views/postnhost/pages/index.html.erb +110 -0
- data/app/views/postnhost/pages/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/pages/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/public/articles/content_for/_index.html.erb +30 -0
- data/app/views/postnhost/public/articles/content_for/_preview.html.erb +9 -0
- data/app/views/postnhost/public/articles/content_for/_show.html.erb +24 -0
- data/app/views/postnhost/public/authors/content_for/_show.html.erb +24 -0
- data/app/views/postnhost/public/categories/content_for/_index.html.erb +29 -0
- data/app/views/postnhost/public/static_pages/content_for/_show.html.erb +19 -0
- data/app/views/postnhost/public/templates/default/articles/_article_card.html.erb +37 -0
- data/app/views/postnhost/public/templates/default/articles/_search_form.html.erb +12 -0
- data/app/views/postnhost/public/templates/default/articles/_suggestions.html.erb +44 -0
- data/app/views/postnhost/public/templates/default/articles/_top_picks.html.erb +42 -0
- data/app/views/postnhost/public/templates/default/articles/index.html.erb +53 -0
- data/app/views/postnhost/public/templates/default/articles/preview.html.erb +102 -0
- data/app/views/postnhost/public/templates/default/articles/show.html.erb +111 -0
- data/app/views/postnhost/public/templates/default/authors/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/default/authors/_profile_block.html.erb +29 -0
- data/app/views/postnhost/public/templates/default/authors/show.html.erb +36 -0
- data/app/views/postnhost/public/templates/default/categories/_article_card.html.erb +34 -0
- data/app/views/postnhost/public/templates/default/categories/index.html.erb +48 -0
- data/app/views/postnhost/public/templates/default/shared/_article_authors.html.erb +24 -0
- data/app/views/postnhost/public/templates/default/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/default/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/default/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/default/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/default/static_pages/show.html.erb +22 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_search_form.html.erb +19 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_suggestions.html.erb +42 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_top_picks.html.erb +38 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/index.html.erb +133 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/preview.html.erb +42 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/show.html.erb +100 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/_article_card.html.erb +27 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/_profile_block.html.erb +32 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/show.html.erb +31 -0
- data/app/views/postnhost/public/templates/swiss-editorial/categories/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/swiss-editorial/categories/index.html.erb +88 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_article_authors.html.erb +26 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/swiss-editorial/static_pages/show.html.erb +17 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_article_card.html.erb +44 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_search_form.html.erb +19 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_suggestions.html.erb +49 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_top_picks.html.erb +34 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/index.html.erb +69 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/preview.html.erb +113 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/show.html.erb +120 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/_article_card.html.erb +1 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/_profile_block.html.erb +32 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/show.html.erb +33 -0
- data/app/views/postnhost/public/templates/workspace-journal/categories/_article_card.html.erb +1 -0
- data/app/views/postnhost/public/templates/workspace-journal/categories/index.html.erb +58 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_article_authors.html.erb +27 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_article_card.html.erb +44 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_category_navigation.html.erb +10 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/workspace-journal/static_pages/show.html.erb +17 -0
- data/app/views/postnhost/sessions/new.html.erb +59 -0
- data/app/views/postnhost/settings/edit.html.erb +68 -0
- data/app/views/postnhost/settings/sections/_assets.html.erb +40 -0
- data/app/views/postnhost/settings/sections/_feature_flags.html.erb +43 -0
- data/app/views/postnhost/settings/sections/_i18n.html.erb +57 -0
- data/app/views/postnhost/settings/sections/_navigation.html.erb +98 -0
- data/app/views/postnhost/settings/sections/_schema.html.erb +253 -0
- data/app/views/postnhost/settings/sections/_scripts.html.erb +79 -0
- data/app/views/postnhost/settings/sections/_site.html.erb +41 -0
- data/app/views/postnhost/settings/sections/_timezone.html.erb +19 -0
- data/app/views/postnhost/shared/_ai_translation_modal.html.erb +85 -0
- data/app/views/postnhost/shared/_flash_messages.html.erb +27 -0
- data/app/views/postnhost/shared/_form_errors.html.erb +22 -0
- data/app/views/postnhost/shared/_seo_meta_tags.html.erb +70 -0
- data/app/views/postnhost/shared/_structured_data.html.erb +5 -0
- data/app/views/postnhost/shared/articles/_action_buttons.html.erb +87 -0
- data/app/views/postnhost/shared/articles/_cover_image_preview.html.erb +30 -0
- data/app/views/postnhost/shared/articles/_editor_column.html.erb +15 -0
- data/app/views/postnhost/shared/articles/_editor_column_preview.html.erb +33 -0
- data/app/views/postnhost/shared/articles/_error_messages.html.erb +23 -0
- data/app/views/postnhost/shared/articles/_meta_sidebar.html.erb +322 -0
- data/app/views/postnhost/shared/articles/_meta_sidebar_preview.html.erb +29 -0
- data/app/views/postnhost/shared/articles/_post_actions.html.erb +105 -0
- data/app/views/postnhost/shared/articles/_schedule_actions.html.erb +51 -0
- data/app/views/postnhost/shared/articles/_tiptap_editor.html.erb +225 -0
- data/app/views/postnhost/shared/articles/_title_field.html.erb +9 -0
- data/app/views/postnhost/shared/articles/_version_action_buttons.html.erb +35 -0
- data/app/views/postnhost/shared/elements/_button.html.erb +20 -0
- data/app/views/postnhost/shared/elements/_button_link.html.erb +24 -0
- data/app/views/postnhost/shared/elements/_empty_state.html.erb +22 -0
- data/app/views/postnhost/shared/elements/_error_messages.html.erb +28 -0
- data/app/views/postnhost/shared/elements/_form_card.html.erb +10 -0
- data/app/views/postnhost/shared/elements/_form_page_header.html.erb +21 -0
- data/app/views/postnhost/shared/elements/_icon_button.html.erb +17 -0
- data/app/views/postnhost/shared/elements/_page_header.html.erb +40 -0
- data/app/views/postnhost/shared/elements/_table_container.html.erb +23 -0
- data/app/views/postnhost/shared/pages/_action_buttons.html.erb +84 -0
- data/app/views/postnhost/shared/pages/_meta_sidebar.html.erb +132 -0
- data/app/views/postnhost/shared/pages/_post_actions.html.erb +69 -0
- data/app/views/postnhost/templates/edit.html.erb +83 -0
- data/app/views/postnhost/users/_avatar.html.erb +9 -0
- data/app/views/postnhost/users/_form.html.erb +160 -0
- data/app/views/postnhost/users/edit.html.erb +26 -0
- data/app/views/postnhost/users/index.html.erb +91 -0
- data/app/views/postnhost/users/new.html.erb +9 -0
- data/app/views/postnhost/users/schema_edit.html.erb +175 -0
- data/config/locales/de.yml +55 -0
- data/config/locales/en.yml +88 -0
- data/config/locales/es.yml +58 -0
- data/config/locales/fr.yml +55 -0
- data/config/locales/ja.yml +55 -0
- data/config/locales/ko.yml +55 -0
- data/config/locales/pl.yml +55 -0
- data/config/locales/pt.yml +55 -0
- data/config/locales/ru.yml +55 -0
- data/config/routes.rb +112 -0
- data/db/migrate/20250822213820_create_users.rb +29 -0
- data/db/migrate/20250822214046_create_categories.rb +15 -0
- data/db/migrate/20250822214106_create_languages.rb +16 -0
- data/db/migrate/20250822214148_create_articles.rb +34 -0
- data/db/migrate/20250822214217_create_article_variants.rb +24 -0
- data/db/migrate/20250929091137_create_article_categories.rb +12 -0
- data/db/migrate/20251013204200_create_versions.rb +40 -0
- data/db/migrate/20260106074532_create_article_suggestions.rb +13 -0
- data/db/migrate/20260108110506_create_category_variants.rb +15 -0
- data/db/migrate/20260308130000_create_settings.rb +23 -0
- data/db/migrate/20260323113000_create_pages.rb +19 -0
- data/db/migrate/20260414100000_create_article_authors.rb +14 -0
- data/db/migrate/20260512100000_create_templates.rb +9 -0
- data/db/migrate/20260520110001_create_navigations.rb +9 -0
- data/db/migrate/20260520110002_create_navigation_items.rb +22 -0
- data/db/migrate/20260528000002_create_page_variants.rb +20 -0
- data/db/migrate/20260709090000_create_snapshots.rb +154 -0
- data/db/migrate/20260726130000_create_site_scripts.rb +11 -0
- data/lib/generators/postnhost/install/install_generator.rb +55 -0
- data/lib/generators/postnhost/install/templates/carrierwave.rb +17 -0
- data/lib/generators/postnhost/install/templates/postnhost.rb +36 -0
- data/lib/generators/postnhost/locale/locale_generator.rb +36 -0
- data/lib/generators/postnhost/static_pages/static_pages_generator.rb +47 -0
- data/lib/generators/postnhost/tailwindcss/install_generator.rb +100 -0
- data/lib/generators/postnhost/tailwindcss/templates/host.tailwind.css +4 -0
- data/lib/generators/postnhost/user/user_generator.rb +36 -0
- data/lib/generators/postnhost/views/views_generator.rb +140 -0
- data/lib/postnhost/configuration.rb +64 -0
- data/lib/postnhost/css_build.rb +68 -0
- data/lib/postnhost/css_scope.rb +77 -0
- data/lib/postnhost/engine.rb +57 -0
- data/lib/postnhost/sample_data.rb +865 -0
- data/lib/postnhost/settings/i18n_overrides.rb +137 -0
- data/lib/postnhost/settings/i18n_patch.rb +18 -0
- data/lib/postnhost/tailwind_compiler.rb +75 -0
- data/lib/postnhost/tailwind_input.rb +32 -0
- data/lib/postnhost/version.rb +1 -3
- data/lib/postnhost.rb +26 -3
- data/lib/tasks/postnhost_snapshots.rake +77 -0
- data/lib/tasks/postnhost_tasks.rake +71 -0
- metadata +679 -21
- data/.github/workflows/main.yml +0 -27
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.rubocop.yml +0 -8
- data/Gemfile +0 -13
- data/bin/console +0 -11
- data/bin/setup +0 -8
- data/postnhost.gemspec +0 -31
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!-- AI Translation Modal -->
|
|
2
|
+
<dialog data-dialog-target="dialog" class="bg-white rounded-2xl shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto">
|
|
3
|
+
<div class="p-8">
|
|
4
|
+
<!-- Modal Header -->
|
|
5
|
+
<div class="flex items-center justify-between mb-8">
|
|
6
|
+
<div>
|
|
7
|
+
<h2 class="text-2xl font-semibold text-gray-900">Translate with AI</h2>
|
|
8
|
+
<% if postnhost_openai_api_key_configured? %>
|
|
9
|
+
<p class="text-gray-600 mt-1">Select languages to translate "<%= subject_title %>" using AI.</p>
|
|
10
|
+
<% else %>
|
|
11
|
+
<p class="text-gray-600 mt-1">AI translation requires an OpenAI API key.</p>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
<button data-action="dialog#close" class="text-gray-400 hover:text-gray-600 transition-colors cursor-pointer">
|
|
15
|
+
<%= icon("close", css_class: "w-6 h-6") %>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<% unless postnhost_openai_api_key_configured? %>
|
|
20
|
+
<div class="rounded-xl border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm text-yellow-900 space-y-3">
|
|
21
|
+
<p class="font-medium">openai_api_key is not configured</p>
|
|
22
|
+
<p class="text-yellow-950">
|
|
23
|
+
Set <code class="rounded bg-yellow-100 px-1.5 py-0.5 text-xs font-mono text-yellow-950">config.openai_api_key</code>
|
|
24
|
+
in <code class="rounded bg-yellow-100 px-1.5 py-0.5 text-xs font-mono text-yellow-950">config/initializers/postnhost.rb</code>,
|
|
25
|
+
or add <code class="rounded bg-yellow-100 px-1.5 py-0.5 text-xs font-mono text-yellow-950">postnhost.openai_access_token</code>
|
|
26
|
+
to your Rails credentials (<code class="rounded bg-yellow-100 px-1.5 py-0.5 text-xs font-mono text-yellow-950">bin/rails credentials:edit</code>).
|
|
27
|
+
See the <a href="https://github.com/postnhost/postnhost/blob/main/README.md" target="_blank" class="text-yellow-950 hover:text-yellow-700">README</a> for details.
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="flex items-center justify-end space-x-4 pt-6 border-t border-gray-200 mt-8">
|
|
31
|
+
<button type="button" data-action="dialog#close" class="<%= button_classes(variant: :secondary) %> cursor-pointer">
|
|
32
|
+
Close
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
<% else %>
|
|
36
|
+
<%= form_with url: form_url, method: :post, data: { turbo: false } do |f| %>
|
|
37
|
+
<!-- Language Selection -->
|
|
38
|
+
<div class="mb-8">
|
|
39
|
+
<div class="flex items-center justify-between mb-6">
|
|
40
|
+
<h3 class="text-lg font-medium text-gray-900">Available Languages</h3>
|
|
41
|
+
<div class="flex space-x-3">
|
|
42
|
+
<button type="button" data-action="click->ai-translation#selectAll" class="text-sm text-gray-600 hover:text-gray-900 transition-colors cursor-pointer">Select All</button>
|
|
43
|
+
<span class="text-gray-300">|</span>
|
|
44
|
+
<button type="button" data-action="click->ai-translation#selectNone" class="text-sm text-gray-600 hover:text-gray-900 transition-colors cursor-pointer">Select None</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 max-h-80 overflow-y-auto">
|
|
49
|
+
<% available_languages.each do |language| %>
|
|
50
|
+
<label class="flex items-center p-4 border border-gray-200 rounded-xl hover:bg-gray-50 hover:border-gray-300 cursor-pointer transition-all duration-200">
|
|
51
|
+
<input
|
|
52
|
+
type="checkbox"
|
|
53
|
+
name="language_ids[]"
|
|
54
|
+
value="<%= language.id %>"
|
|
55
|
+
data-ai-translation-target="checkbox"
|
|
56
|
+
data-action="change->ai-translation#toggleCheckbox"
|
|
57
|
+
class="h-4 w-4 text-gray-900 border-gray-300 rounded focus:ring-gray-900 focus:ring-2"
|
|
58
|
+
>
|
|
59
|
+
<div class="ml-4">
|
|
60
|
+
<div class="text-sm font-medium text-gray-900"><%= language.name %></div>
|
|
61
|
+
<div class="text-xs text-gray-500"><%= language.html_lang %></div>
|
|
62
|
+
</div>
|
|
63
|
+
</label>
|
|
64
|
+
<% end %>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<!-- Action Buttons -->
|
|
69
|
+
<div class="flex items-center justify-end space-x-4 pt-6 border-t border-gray-200">
|
|
70
|
+
<button type="button" data-action="dialog#close" class="<%= button_classes(variant: :secondary) %>">
|
|
71
|
+
Cancel
|
|
72
|
+
</button>
|
|
73
|
+
<button
|
|
74
|
+
type="submit"
|
|
75
|
+
data-ai-translation-target="submitButton"
|
|
76
|
+
disabled
|
|
77
|
+
class="<%= button_classes(disabled: true) %>"
|
|
78
|
+
>
|
|
79
|
+
Select languages to translate
|
|
80
|
+
</button>
|
|
81
|
+
</div>
|
|
82
|
+
<% end %>
|
|
83
|
+
<% end %>
|
|
84
|
+
</div>
|
|
85
|
+
</dialog>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<% flash.each do |type, message| %>
|
|
2
|
+
<% unless message.nil? %>
|
|
3
|
+
<div data-controller="flash-message" data-flash-message-target="message" class="<%= flash_class(type) %> px-3 py-2 rounded-lg font-medium relative text-sm max-w-md mx-auto" role="alert" data-turbo-temporary>
|
|
4
|
+
<div class="flex items-center">
|
|
5
|
+
<div class="flex-shrink-0">
|
|
6
|
+
<% if type.to_s == 'notice' %>
|
|
7
|
+
<%= icon("info-circle", css_class: "h-4 w-4 text-blue-600") %>
|
|
8
|
+
<% elsif type.to_s == 'success' %>
|
|
9
|
+
<%= icon("check-circle", css_class: "h-4 w-4 text-green-600") %>
|
|
10
|
+
<% elsif type.to_s == 'error' %>
|
|
11
|
+
<%= icon("alert-circle", css_class: "h-4 w-4 text-red-600") %>
|
|
12
|
+
<% elsif type.to_s == 'alert' %>
|
|
13
|
+
<%= icon("warning", css_class: "h-4 w-4 text-yellow-600") %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="ml-2 flex-1">
|
|
17
|
+
<%= message.html_safe %>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<!-- Close Button -->
|
|
22
|
+
<button type="button" data-action="click->flash-message#close" class="absolute top-2.5 right-3 text-gray-400 hover:text-gray-600 transition-colors duration-200 cursor-pointer">
|
|
23
|
+
<%= icon("close", css_class: "w-3 h-3") %>
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<% if resource.errors.any? %>
|
|
2
|
+
<div id="error_explanation" class="bg-red-50 border border-red-200 text-red-800 px-5 py-4 rounded-2xl mb-6 font-medium" data-turbo-temporary>
|
|
3
|
+
<div class="flex items-start">
|
|
4
|
+
<div class="flex-shrink-0">
|
|
5
|
+
<%= icon("alert-circle", css_class: "h-5 w-5 text-red-600 mt-0.5") %>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="ml-3 flex-1">
|
|
8
|
+
<h3 class="text-sm font-semibold text-red-800 mb-2">
|
|
9
|
+
<%= pluralize(resource.errors.count, "error") %> prohibited this from being saved:
|
|
10
|
+
</h3>
|
|
11
|
+
<ul class="text-sm space-y-1">
|
|
12
|
+
<% resource.errors.full_messages.each do |message| %>
|
|
13
|
+
<li class="flex items-start">
|
|
14
|
+
<span class="inline-block w-1.5 h-1.5 bg-red-400 rounded-full mt-2 mr-2 flex-shrink-0"></span>
|
|
15
|
+
<%= message %>
|
|
16
|
+
</li>
|
|
17
|
+
<% end %>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<% end %>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<!-- Basic Meta Tags -->
|
|
2
|
+
<title data-turbo-track="reload"><%= page_title %></title>
|
|
3
|
+
<% if render_description_meta_tags? %>
|
|
4
|
+
<meta name="description" content="<%= meta_description_content %>" data-turbo-track="reload">
|
|
5
|
+
<% end %>
|
|
6
|
+
<meta name="robots" content="<%= robots_content %>" data-turbo-track="reload">
|
|
7
|
+
|
|
8
|
+
<!-- Canonical URL -->
|
|
9
|
+
<link rel="canonical" href="<%= canonical_url %>" data-turbo-track="reload">
|
|
10
|
+
|
|
11
|
+
<!-- Open Graph tags -->
|
|
12
|
+
<meta property="og:title" content="<%= og_title %>" data-turbo-track="reload">
|
|
13
|
+
<% if render_description_meta_tags? %>
|
|
14
|
+
<meta property="og:description" content="<%= meta_description_content %>" data-turbo-track="reload">
|
|
15
|
+
<% end %>
|
|
16
|
+
<meta property="og:url" content="<%= page_url %>" data-turbo-track="reload">
|
|
17
|
+
<meta property="og:type" content="<%= @article ? 'article' : 'website' %>" data-turbo-track="reload">
|
|
18
|
+
<meta property="og:site_name" content="<%= schema_site_name %>" data-turbo-track="reload">
|
|
19
|
+
<% if article_cover_for_seo(@article) %>
|
|
20
|
+
<meta property="og:image" content="<%= article_cover_for_seo(@article).cover_image.url %>" data-turbo-track="reload">
|
|
21
|
+
<meta property="og:image:secure_url" content="<%= article_cover_for_seo(@article).cover_image.url %>" data-turbo-track="reload">
|
|
22
|
+
<meta property="og:image:width" content="1200" data-turbo-track="reload">
|
|
23
|
+
<meta property="og:image:height" content="630" data-turbo-track="reload">
|
|
24
|
+
<% if article_cover_for_seo(@article).cover_image_alt.present? %>
|
|
25
|
+
<meta property="og:image:alt" content="<%= article_cover_for_seo(@article).cover_image_alt %>" data-turbo-track="reload">
|
|
26
|
+
<% end %>
|
|
27
|
+
<% else %>
|
|
28
|
+
<meta property="og:image" content="<%= setting_og_image_absolute_url %>" data-turbo-track="reload">
|
|
29
|
+
<meta property="og:image:secure_url" content="<%= setting_og_image_absolute_url %>" data-turbo-track="reload">
|
|
30
|
+
<meta property="og:image:width" content="1200" data-turbo-track="reload">
|
|
31
|
+
<meta property="og:image:height" content="630" data-turbo-track="reload">
|
|
32
|
+
<meta property="og:image:alt" content="postnhost - Modern blogging platform" data-turbo-track="reload">
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<!-- Twitter Card data -->
|
|
36
|
+
<meta name="twitter:card" content="summary_large_image" data-turbo-track="reload">
|
|
37
|
+
<meta name="twitter:title" content="<%= page_title %>" data-turbo-track="reload">
|
|
38
|
+
<% if render_description_meta_tags? %>
|
|
39
|
+
<meta name="twitter:description" content="<%= meta_description_content %>" data-turbo-track="reload">
|
|
40
|
+
<% end %>
|
|
41
|
+
<meta name="twitter:url" content="<%= page_url %>" data-turbo-track="reload">
|
|
42
|
+
<% if article_cover_for_seo(@article) %>
|
|
43
|
+
<meta name="twitter:image" content="<%= article_cover_for_seo(@article).cover_image.url %>" data-turbo-track="reload">
|
|
44
|
+
<% if article_cover_for_seo(@article).cover_image_alt.present? %>
|
|
45
|
+
<meta name="twitter:image:alt" content="<%= article_cover_for_seo(@article).cover_image_alt %>" data-turbo-track="reload">
|
|
46
|
+
<% end %>
|
|
47
|
+
<% else %>
|
|
48
|
+
<meta name="twitter:image" content="<%= setting_og_image_absolute_url %>" data-turbo-track="reload">
|
|
49
|
+
<meta name="twitter:image:alt" content="postnhost - Modern blogging platform" data-turbo-track="reload">
|
|
50
|
+
<% end %>
|
|
51
|
+
|
|
52
|
+
<!-- Article specific meta tags -->
|
|
53
|
+
<% if @article %>
|
|
54
|
+
<% if @article.is_a?(Postnhost::Snapshot::Article) %>
|
|
55
|
+
<meta property="article:published_time" content="<%= @article.published_at.iso8601 %>" data-turbo-track="reload">
|
|
56
|
+
<% end %>
|
|
57
|
+
<meta property="article:modified_time" content="<%= @article.updated_at.iso8601 %>" data-turbo-track="reload">
|
|
58
|
+
<% article_authors(@article).each do |author| %>
|
|
59
|
+
<% if author_pages_enabled? %>
|
|
60
|
+
<meta property="article:author" content="<%= language_author_url(author.slug, @current_language) %>" data-turbo-track="reload">
|
|
61
|
+
<% end %>
|
|
62
|
+
<meta name="author" content="<%= author_name(author) %>" data-turbo-track="reload">
|
|
63
|
+
<% end %>
|
|
64
|
+
<% if @article.categories.any? %>
|
|
65
|
+
<meta property="article:section" content="<%= @article.categories.first.name %>" data-turbo-track="reload">
|
|
66
|
+
<% end %>
|
|
67
|
+
<% end %>
|
|
68
|
+
|
|
69
|
+
<!-- Hreflang tags -->
|
|
70
|
+
<%= yield :hreflang if content_for?(:hreflang) %>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<div class="order-2 md:order-3 hidden md:block w-full md:w-1/5 bg-white border border-gray-200 p-4 md:p-6 border-t-0 md:sticky md:top-0 md:self-start md:min-h-screen"
|
|
2
|
+
data-editor-mobile-sidebars-target="<%= local_assigns[:mobile_target] %>">
|
|
3
|
+
<div class="md:hidden flex items-center justify-between mb-4">
|
|
4
|
+
<h3 class="text-sm font-semibold text-gray-900">Actions</h3>
|
|
5
|
+
<button type="button"
|
|
6
|
+
class="text-gray-500 hover:text-gray-700 cursor-pointer"
|
|
7
|
+
data-action="click->editor-mobile-sidebars#closeActions">
|
|
8
|
+
<%= icon("close", css_class: "w-4 h-4") %>
|
|
9
|
+
</button>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="space-y-4">
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
data-auto-save-target="saveButton"
|
|
15
|
+
data-action="click->auto-save#save"
|
|
16
|
+
disabled
|
|
17
|
+
class="w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium cursor-pointer opacity-50">
|
|
18
|
+
Saved
|
|
19
|
+
</button>
|
|
20
|
+
|
|
21
|
+
<% if is_variant %>
|
|
22
|
+
<%= link_to edit_article_path(article), class: "w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium text-center block cursor-pointer" do %>
|
|
23
|
+
<div class="flex items-center justify-center space-x-2">
|
|
24
|
+
<%= icon("arrow-left", css_class: "w-4 h-4") %>
|
|
25
|
+
<span>Back to Original</span>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
29
|
+
<div class="border-b border-gray-100 pb-4">
|
|
30
|
+
<%= link_to article_variants_path(article), data: { turbo_prefetch: false }, class: "w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium text-center block cursor-pointer" do %>
|
|
31
|
+
<div class="flex items-center justify-center space-x-2">
|
|
32
|
+
<%= icon("language", css_class: "w-4 h-4") %>
|
|
33
|
+
<span>All Translations</span>
|
|
34
|
+
</div>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
<% else %>
|
|
38
|
+
<div class="border-b border-gray-100 pb-4">
|
|
39
|
+
<%= link_to article_variants_path(article), data: { turbo_prefetch: false }, class: "w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium text-center block" do %>
|
|
40
|
+
<div class="flex items-center justify-center space-x-2">
|
|
41
|
+
<%= icon("language", css_class: "w-4 h-4") %>
|
|
42
|
+
<span>Translations</span>
|
|
43
|
+
<% if article.article_variants.any? %>
|
|
44
|
+
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-gray-200 text-gray-800">
|
|
45
|
+
<%= article.article_variants_count %>
|
|
46
|
+
</span>
|
|
47
|
+
<% end %>
|
|
48
|
+
</div>
|
|
49
|
+
<% end %>
|
|
50
|
+
</div>
|
|
51
|
+
<% end %>
|
|
52
|
+
|
|
53
|
+
<%= render "postnhost/shared/articles/post_actions",
|
|
54
|
+
resource: resource,
|
|
55
|
+
resource_type: resource_type,
|
|
56
|
+
article: article,
|
|
57
|
+
form: local_assigns[:form] %>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div class="pt-4">
|
|
61
|
+
<% if is_variant %>
|
|
62
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
63
|
+
text: "Delete",
|
|
64
|
+
url: article_variant_path(article, resource),
|
|
65
|
+
variant: :danger,
|
|
66
|
+
icon: "trash",
|
|
67
|
+
extra_class: "w-full",
|
|
68
|
+
data: {
|
|
69
|
+
turbo_method: :delete,
|
|
70
|
+
turbo_confirm: "Are you sure you want to delete this variant? This action cannot be undone."
|
|
71
|
+
} %>
|
|
72
|
+
<% else %>
|
|
73
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
74
|
+
text: "Delete",
|
|
75
|
+
url: resource,
|
|
76
|
+
variant: :danger,
|
|
77
|
+
icon: "trash",
|
|
78
|
+
extra_class: "w-full",
|
|
79
|
+
data: {
|
|
80
|
+
turbo_method: :delete,
|
|
81
|
+
turbo_confirm: "Are you sure you want to delete this article? This action cannot be undone."
|
|
82
|
+
} %>
|
|
83
|
+
<% end %>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div class="px-6 py-4 border-b border-gray-100 <%= 'hidden' unless article.cover_image? %>"
|
|
2
|
+
data-controller="collapsible-sidebar"
|
|
3
|
+
data-collapsible-sidebar-storage-key-value="article-cover-image-preview-<%= article.id %>">
|
|
4
|
+
<div data-collapsible-sidebar-target="section" data-section-id="cover-image-preview">
|
|
5
|
+
<button type="button"
|
|
6
|
+
class="inline-flex items-center text-left mb-2 cursor-pointer"
|
|
7
|
+
data-role="section-toggle"
|
|
8
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
9
|
+
data-collapsible-sidebar-id-param="cover-image-preview"
|
|
10
|
+
aria-expanded="true"
|
|
11
|
+
aria-controls="cover-image-preview-section-<%= article.id %>">
|
|
12
|
+
<span class="text-sm font-medium text-gray-900">Cover Image (ogimage)</span>
|
|
13
|
+
<span data-role="section-icon" class="ml-1 inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
14
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
15
|
+
</span>
|
|
16
|
+
</button>
|
|
17
|
+
|
|
18
|
+
<!-- Preview with Alt Text -->
|
|
19
|
+
<div class="space-y-2" data-role="section-content" id="cover-image-preview-section-<%= article.id %>">
|
|
20
|
+
<div class="relative">
|
|
21
|
+
<%= image_tag(article.cover_image? ? article.cover_image.url : '',
|
|
22
|
+
alt: article.cover_image_alt,
|
|
23
|
+
width: 1200,
|
|
24
|
+
height: 630,
|
|
25
|
+
class: "w-full object-cover") %>
|
|
26
|
+
</div>
|
|
27
|
+
<%= form.text_field :cover_image_alt, value: article.cover_image_alt.presence, class: "#{'hidden' unless article.cover_image_alt.presence} w-full px-3 py-1.5 border border-gray-200 rounded-lg text-xs bg-gray-100 cursor-not-allowed", disabled: true, readonly: true %>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div class="order-3 md:order-2 w-full md:w-3/5 bg-white border-t border-b border-gray-200 border-t-0">
|
|
2
|
+
<% if is_variant %>
|
|
3
|
+
<%= render 'postnhost/shared/articles/cover_image_preview', form: form, article: article %>
|
|
4
|
+
<% else %>
|
|
5
|
+
<%= render 'postnhost/articles/cover_image_upload', form: form, article: article %>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<%= render 'postnhost/shared/articles/title_field', form: form, placeholder: placeholder %>
|
|
9
|
+
|
|
10
|
+
<%= render 'postnhost/shared/articles/tiptap_editor',
|
|
11
|
+
form: form,
|
|
12
|
+
content: content,
|
|
13
|
+
resource_type: 'article',
|
|
14
|
+
resource_id: article.id %>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div class="w-full md:w-3/5 bg-white border-t border-b border-gray-200 border-t-0">
|
|
2
|
+
<!-- Cover Image (Read-only) -->
|
|
3
|
+
<div class="px-6 py-4 border-b border-gray-100 <%= 'hidden' unless article.cover_image? %>">
|
|
4
|
+
<div class="space-y-2">
|
|
5
|
+
<div class="relative">
|
|
6
|
+
<%= image_tag(article.cover_image? ? article.cover_image.url : '',
|
|
7
|
+
alt: article.cover_image_alt,
|
|
8
|
+
width: 1200,
|
|
9
|
+
height: 630,
|
|
10
|
+
class: "w-full object-cover") %>
|
|
11
|
+
</div>
|
|
12
|
+
<% if article.cover_image_alt.present? %>
|
|
13
|
+
<div class="w-full px-3 py-1.5 border border-gray-200 rounded-lg text-xs bg-gray-50 text-gray-700">
|
|
14
|
+
<%= article.cover_image_alt %>
|
|
15
|
+
</div>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- Title Field (Read-only) -->
|
|
21
|
+
<div class="px-6 py-6 border-b border-gray-100">
|
|
22
|
+
<div class="w-full text-4xl font-bold text-gray-900 p-0 bg-transparent leading-tight">
|
|
23
|
+
<%= article.title %>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- Content (Read-only) -->
|
|
28
|
+
<div class="min-h-[400px] p-4">
|
|
29
|
+
<div class="prose max-w-none">
|
|
30
|
+
<%= render_article_content(content) %>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<% if resource.errors.any? %>
|
|
2
|
+
<div class="mb-6 bg-red-50 border border-red-200 rounded-2xl p-6">
|
|
3
|
+
<div class="flex">
|
|
4
|
+
<div class="flex-shrink-0">
|
|
5
|
+
<div class="w-8 h-8 bg-red-100 rounded-lg flex items-center justify-center">
|
|
6
|
+
<%= icon("alert-circle", css_class: "w-4 h-4 text-red-600") %>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="ml-4">
|
|
10
|
+
<h3 class="text-sm font-semibold text-red-800">
|
|
11
|
+
<%= pluralize(resource.errors.count, "error") %> prevented this <%= resource_type %> from being saved:
|
|
12
|
+
</h3>
|
|
13
|
+
<div class="mt-2 text-sm text-red-700">
|
|
14
|
+
<ul class="list-disc pl-5 space-y-1">
|
|
15
|
+
<% resource.errors.full_messages.each do |message| %>
|
|
16
|
+
<li><%= message %></li>
|
|
17
|
+
<% end %>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<% end %>
|