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,132 @@
|
|
|
1
|
+
<div class="order-2 md:order-1 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
|
+
data-controller="collapsible-sidebar"
|
|
4
|
+
data-collapsible-sidebar-storage-key-value="<%= is_variant ? "page-variant-sidebar-#{resource.id}" : "page-sidebar-#{resource.id}" %>">
|
|
5
|
+
<div class="md:hidden flex items-center justify-between mb-4">
|
|
6
|
+
<h3 class="text-sm font-semibold text-gray-900">Details</h3>
|
|
7
|
+
<button type="button"
|
|
8
|
+
class="text-gray-500 hover:text-gray-700 cursor-pointer"
|
|
9
|
+
data-action="click->editor-mobile-sidebars#closeMeta">
|
|
10
|
+
<%= icon("close", css_class: "w-4 h-4") %>
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="space-y-6">
|
|
15
|
+
<div data-collapsible-sidebar-target="section" data-section-id="title-tag">
|
|
16
|
+
<button type="button"
|
|
17
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
18
|
+
data-role="section-toggle"
|
|
19
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
20
|
+
data-collapsible-sidebar-id-param="title-tag"
|
|
21
|
+
aria-expanded="true"
|
|
22
|
+
aria-controls="sidebar-section-title-tag">
|
|
23
|
+
<span class="text-sm font-medium text-gray-900">Title Tag</span>
|
|
24
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
25
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
26
|
+
</span>
|
|
27
|
+
</button>
|
|
28
|
+
<div data-role="section-content" id="sidebar-section-title-tag">
|
|
29
|
+
<%= form.text_field :title_tag, class: "w-full px-3 py-2 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-gray-900 focus:border-transparent text-sm", placeholder: "Fallbacks to page title if empty", autocomplete: "off" %>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div data-collapsible-sidebar-target="section" data-section-id="meta-description">
|
|
34
|
+
<button type="button"
|
|
35
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
36
|
+
data-role="section-toggle"
|
|
37
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
38
|
+
data-collapsible-sidebar-id-param="meta-description"
|
|
39
|
+
aria-expanded="true"
|
|
40
|
+
aria-controls="sidebar-section-meta-description">
|
|
41
|
+
<span class="text-sm font-medium text-gray-900">Meta Description</span>
|
|
42
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
43
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
44
|
+
</span>
|
|
45
|
+
</button>
|
|
46
|
+
<div data-role="section-content" id="sidebar-section-meta-description">
|
|
47
|
+
<%= form.text_area :meta_description, rows: 4, class: "w-full px-3 py-2 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-gray-900 focus:border-transparent text-sm resize-none", placeholder: "Brief description for SEO...", autocomplete: "off" %>
|
|
48
|
+
<p class="mt-2 text-xs text-gray-500">Recommended: 150-160 characters.</p>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div data-collapsible-sidebar-target="section" data-section-id="og-title" data-default-collapsed="true">
|
|
53
|
+
<button type="button"
|
|
54
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
55
|
+
data-role="section-toggle"
|
|
56
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
57
|
+
data-collapsible-sidebar-id-param="og-title"
|
|
58
|
+
aria-expanded="false"
|
|
59
|
+
aria-controls="sidebar-section-og-title">
|
|
60
|
+
<span class="text-sm font-medium text-gray-900">OG Title</span>
|
|
61
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 -rotate-90">
|
|
62
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
63
|
+
</span>
|
|
64
|
+
</button>
|
|
65
|
+
<div data-role="section-content" id="sidebar-section-og-title" class="hidden">
|
|
66
|
+
<%= form.text_field :og_title, class: "w-full px-3 py-2 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-gray-900 focus:border-transparent text-sm", placeholder: "Fallbacks to Title Tag / title if empty", autocomplete: "off" %>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<% if is_variant %>
|
|
71
|
+
<div data-collapsible-sidebar-target="section" data-section-id="language">
|
|
72
|
+
<button type="button"
|
|
73
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
74
|
+
data-role="section-toggle"
|
|
75
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
76
|
+
data-collapsible-sidebar-id-param="language"
|
|
77
|
+
aria-expanded="true"
|
|
78
|
+
aria-controls="sidebar-section-language">
|
|
79
|
+
<span class="text-sm font-medium text-gray-900">Language</span>
|
|
80
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
81
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
82
|
+
</span>
|
|
83
|
+
</button>
|
|
84
|
+
<div data-role="section-content" id="sidebar-section-language">
|
|
85
|
+
<%= form.text_field :language, disabled: true, value: resource.language&.name, class: "w-full px-3 py-2 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-gray-900 focus:border-transparent text-sm disabled:bg-gray-100" %>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<% else %>
|
|
89
|
+
<div data-collapsible-sidebar-target="section" data-section-id="url-slug">
|
|
90
|
+
<button type="button"
|
|
91
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
92
|
+
data-role="section-toggle"
|
|
93
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
94
|
+
data-collapsible-sidebar-id-param="url-slug"
|
|
95
|
+
aria-expanded="true"
|
|
96
|
+
aria-controls="sidebar-section-url-slug">
|
|
97
|
+
<span class="text-sm font-medium text-gray-900">URL Slug</span>
|
|
98
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
99
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
100
|
+
</span>
|
|
101
|
+
</button>
|
|
102
|
+
<div data-role="section-content" id="sidebar-section-url-slug">
|
|
103
|
+
<%= form.text_field :slug, class: "w-full px-3 py-2 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-gray-900 focus:border-transparent text-sm", placeholder: "page-url-slug", autocomplete: "off" %>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<% end %>
|
|
107
|
+
|
|
108
|
+
<div class="pt-4 border-t border-gray-100" data-collapsible-sidebar-target="section" data-section-id="timestamps">
|
|
109
|
+
<button type="button"
|
|
110
|
+
class="w-full flex items-center justify-between text-left mb-2 cursor-pointer"
|
|
111
|
+
data-role="section-toggle"
|
|
112
|
+
data-action="click->collapsible-sidebar#toggle"
|
|
113
|
+
data-collapsible-sidebar-id-param="timestamps"
|
|
114
|
+
aria-expanded="true"
|
|
115
|
+
aria-controls="sidebar-section-timestamps">
|
|
116
|
+
<span class="text-sm font-medium text-gray-900">Timestamps</span>
|
|
117
|
+
<span data-role="section-icon" class="inline-flex text-gray-400 transition-transform duration-200 rotate-0">
|
|
118
|
+
<%= icon("chevron-down", css_class: "w-4 h-4") %>
|
|
119
|
+
</span>
|
|
120
|
+
</button>
|
|
121
|
+
<div data-role="section-content" id="sidebar-section-timestamps">
|
|
122
|
+
<div class="text-sm text-gray-600 space-y-1">
|
|
123
|
+
<p><strong>Created:</strong> <%= admin_datetime(resource.created_at) %></p>
|
|
124
|
+
<p><strong>Updated:</strong> <%= admin_datetime(resource.updated_at) %></p>
|
|
125
|
+
<% if !is_variant && resource.page_snapshot.present? %>
|
|
126
|
+
<p><strong>Published:</strong> <%= admin_datetime(resource.page_snapshot.published_at) %></p>
|
|
127
|
+
<% end %>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<%= turbo_frame_tag (resource_type == "variant" ? "page_variant_actions" : "page_actions") do %>
|
|
2
|
+
<div class="space-y-3">
|
|
3
|
+
<% if resource_type == "page" %>
|
|
4
|
+
<% if resource.published? && resource.slug.present? %>
|
|
5
|
+
<%= link_to public_static_page_path(slug: resource.slug), target: "_blank", rel: "noopener", class: editor_button_classes do %>
|
|
6
|
+
<div class="flex items-center justify-center space-x-2">
|
|
7
|
+
<span>Open</span>
|
|
8
|
+
<%= icon("external-link", css_class: "w-4 h-4") %>
|
|
9
|
+
</div>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% elsif resource_type == "variant" && resource.published? && !resource.generating? %>
|
|
13
|
+
<%= link_to localized_public_static_page_path(locale: resource.language.html_lang, slug: resource.page.slug), target: "_blank", rel: "noopener", class: editor_button_classes do %>
|
|
14
|
+
<div class="flex items-center justify-center space-x-2">
|
|
15
|
+
<span>Open</span>
|
|
16
|
+
<%= icon("external-link", css_class: "w-4 h-4") %>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% end %>
|
|
20
|
+
|
|
21
|
+
<% unless resource_type == "variant" && resource.generating? %>
|
|
22
|
+
<% if resource.published? %>
|
|
23
|
+
<% if resource.unpublished_changes? %>
|
|
24
|
+
<%= link_to (resource_type == "variant" ? publish_page_variant_path(page, resource) : publish_page_path(resource)),
|
|
25
|
+
class: editor_button_classes(variant: :primary),
|
|
26
|
+
data: { turbo_method: :patch, publish_guard_target: "publishButton", action: "click->publish-guard#prevent" } do %>
|
|
27
|
+
Publish New Version
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
|
|
31
|
+
<%= link_to (resource_type == "variant" ? unpublish_page_variant_path(page, resource) : unpublish_page_path(resource)),
|
|
32
|
+
class: "#{editor_button_classes} #{'mb-4' if resource_type == 'variant'}",
|
|
33
|
+
data: { turbo_method: :patch } do %>
|
|
34
|
+
Unpublish
|
|
35
|
+
<% end %>
|
|
36
|
+
<% else %>
|
|
37
|
+
<%= link_to (resource_type == "variant" ? publish_page_variant_path(page, resource) : publish_page_path(resource)),
|
|
38
|
+
class: "#{editor_button_classes(variant: :primary)} #{'mb-4' if resource_type == 'variant'}",
|
|
39
|
+
data: { turbo_method: :patch, publish_guard_target: "publishButton", action: "click->publish-guard#prevent" } do %>
|
|
40
|
+
Publish Now
|
|
41
|
+
<% end %>
|
|
42
|
+
<% end %>
|
|
43
|
+
<% end %>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="mt-5 pt-3 pb-3 border-t border-gray-100">
|
|
47
|
+
<h4 class="text-sm font-semibold text-gray-900 mb-4">Current Status</h4>
|
|
48
|
+
<div class="space-y-3">
|
|
49
|
+
<% if resource.published? %>
|
|
50
|
+
<div class="flex items-start">
|
|
51
|
+
<div class="w-2 h-2 bg-green-400 rounded-full mt-2 mr-3 flex-shrink-0"></div>
|
|
52
|
+
<p class="text-sm text-gray-600">This <%= resource_type %> is published and visible to everyone</p>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<% if resource.unpublished_changes? %>
|
|
56
|
+
<div class="flex items-start">
|
|
57
|
+
<div class="w-2 h-2 bg-yellow-400 rounded-full mt-2 mr-3 flex-shrink-0"></div>
|
|
58
|
+
<p class="text-sm text-gray-600">You have unpublished changes. Click "Publish New Version" to make them live.</p>
|
|
59
|
+
</div>
|
|
60
|
+
<% end %>
|
|
61
|
+
<% else %>
|
|
62
|
+
<div class="flex items-start">
|
|
63
|
+
<div class="w-2 h-2 bg-gray-400 rounded-full mt-2 mr-3 flex-shrink-0"></div>
|
|
64
|
+
<p class="text-sm text-gray-600">This <%= resource_type %> is a draft and only visible to you</p>
|
|
65
|
+
</div>
|
|
66
|
+
<% end %>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<% end %>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<% content_for :title, "Template" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<%= render "postnhost/shared/elements/page_header",
|
|
5
|
+
title: "Template",
|
|
6
|
+
description: "Choose and preview the public website template." %>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
class="grid grid-cols-1 gap-6 xl:grid-cols-3"
|
|
10
|
+
data-controller="template-preview"
|
|
11
|
+
data-template-preview-base-url-value="<%= postnhost.root_path %>">
|
|
12
|
+
<section class="xl:col-span-1">
|
|
13
|
+
<%= form_with model: @template, url: template_path, method: :patch, class: "space-y-6" do |f| %>
|
|
14
|
+
<%= render "postnhost/shared/form_errors", resource: @template %>
|
|
15
|
+
|
|
16
|
+
<div class="rounded-xl border border-gray-200 p-4 space-y-4">
|
|
17
|
+
<h2 class="text-base font-medium text-gray-900">Template</h2>
|
|
18
|
+
<p class="text-sm text-gray-500">Choose a template. The preview updates before saving.</p>
|
|
19
|
+
|
|
20
|
+
<div class="grid grid-cols-1 gap-3">
|
|
21
|
+
<% cms_template_options.each do |label, value| %>
|
|
22
|
+
<label class="cursor-pointer rounded-xl border border-gray-200 p-3 transition-colors hover:border-gray-400 has-[:checked]:border-gray-900 has-[:checked]:bg-gray-50">
|
|
23
|
+
<div class="flex items-center gap-2">
|
|
24
|
+
<%= radio_button_tag "template[name]",
|
|
25
|
+
value,
|
|
26
|
+
@template.name == value,
|
|
27
|
+
class: "h-4 w-4 border-gray-300 text-gray-900 focus:ring-gray-900",
|
|
28
|
+
data: { action: "template-preview#update" } %>
|
|
29
|
+
<span class="text-sm font-medium text-gray-900"><%= label %></span>
|
|
30
|
+
</div>
|
|
31
|
+
</label>
|
|
32
|
+
<% end %>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<details class="group rounded-xl border border-gray-200 bg-gray-50 p-4">
|
|
37
|
+
<summary class="flex cursor-pointer list-none items-center justify-between gap-3">
|
|
38
|
+
<h2 class="text-base font-medium text-gray-900">Customize template files</h2>
|
|
39
|
+
<%= icon("chevron-down", css_class: "h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200 group-open:rotate-180") %>
|
|
40
|
+
</summary>
|
|
41
|
+
|
|
42
|
+
<div class="mt-3 space-y-3">
|
|
43
|
+
<p class="text-sm leading-6 text-gray-600">Run this command from the host Rails application to copy every public template and layout into your app:</p>
|
|
44
|
+
|
|
45
|
+
<code class="block overflow-x-auto rounded-lg bg-gray-900 px-3 py-2 text-xs leading-5 text-white">bin/rails g postnhost:views --views-scope=full</code>
|
|
46
|
+
|
|
47
|
+
<p class="text-sm leading-6 text-gray-600">
|
|
48
|
+
Edit the copied <code class="rounded bg-gray-200 px-1.5 py-0.5 text-xs font-mono text-gray-900">.html.erb</code> files under
|
|
49
|
+
<code class="rounded bg-gray-200 px-1.5 py-0.5 text-xs font-mono text-gray-900">app/views/postnhost/public/templates/</code>
|
|
50
|
+
and <code class="rounded bg-gray-200 px-1.5 py-0.5 text-xs font-mono text-gray-900">app/views/layouts/postnhost/public/templates/</code>.
|
|
51
|
+
Rails uses these host-app copies instead of the packaged engine views. The selection above still controls which template is active.
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
<div class="space-y-2 border-t border-gray-200 pt-3">
|
|
55
|
+
<p class="text-sm leading-6 text-gray-600">If your changes add new Tailwind classes, install and run the optional host Tailwind pipeline:</p>
|
|
56
|
+
<div class="space-y-1">
|
|
57
|
+
<code class="block overflow-x-auto rounded-lg bg-gray-900 px-3 py-2 text-xs leading-5 text-white">bin/rails g postnhost:tailwindcss:install</code>
|
|
58
|
+
<code class="block overflow-x-auto rounded-lg bg-gray-900 px-3 py-2 text-xs leading-5 text-white">bin/rails postnhost:tailwindcss:watch</code>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
<%= f.submit "Save Template", class: button_classes %>
|
|
65
|
+
<% end %>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<section class="relative xl:col-span-2">
|
|
69
|
+
<div
|
|
70
|
+
class="hidden absolute left-4 top-4 z-10 rounded-full border border-gray-200 bg-white px-3 py-1 text-xs font-medium text-gray-600 shadow-sm"
|
|
71
|
+
data-template-preview-target="status">
|
|
72
|
+
Loading preview...
|
|
73
|
+
</div>
|
|
74
|
+
<iframe
|
|
75
|
+
title="Website preview"
|
|
76
|
+
src="<%= postnhost.root_path(preview_template: @template.name) %>"
|
|
77
|
+
class="h-[760px] w-full rounded-xl border border-gray-200 bg-white"
|
|
78
|
+
loading="eager"
|
|
79
|
+
data-template-preview-target="iframe"
|
|
80
|
+
data-action="load->template-preview#loaded"></iframe>
|
|
81
|
+
</section>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class="<%= size_class %> <%= mobile_visibility_class %> flex-shrink-0 aspect-square bg-gray-100 rounded-full flex items-center justify-center overflow-hidden">
|
|
2
|
+
<% if author_avatar(user).present? %>
|
|
3
|
+
<%= image_tag author_avatar(user), class: "w-full h-full object-cover", alt: "Author Image" %>
|
|
4
|
+
<% elsif author_initials(user).present? %>
|
|
5
|
+
<span class="<%= text_size_class %> font-medium text-gray-600">
|
|
6
|
+
<%= author_initials(user) %>
|
|
7
|
+
</span>
|
|
8
|
+
<% end %>
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<%= form_with model: user, local: true, multipart: true, class: "space-y-6" do |form| %>
|
|
2
|
+
<%= render "postnhost/shared/elements/error_messages", resource: user %>
|
|
3
|
+
|
|
4
|
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 items-start">
|
|
5
|
+
<div class="order-1 lg:order-2 lg:col-span-1">
|
|
6
|
+
<div class="lg:sticky lg:top-6 space-y-6">
|
|
7
|
+
<%= render "postnhost/shared/elements/form_card" do %>
|
|
8
|
+
<div class="space-y-4">
|
|
9
|
+
<%= form.submit submit_text, class: "#{button_classes} w-full" %>
|
|
10
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
11
|
+
text: "Cancel",
|
|
12
|
+
url: cancel_url,
|
|
13
|
+
variant: :secondary,
|
|
14
|
+
extra_class: "w-full justify-center" %>
|
|
15
|
+
|
|
16
|
+
<% if local_assigns.fetch(:show_sign_out, false) %>
|
|
17
|
+
<div>
|
|
18
|
+
<%= button_to "Sign Out", session_path, method: :delete, class: "#{button_classes(variant: :secondary)} w-full" %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
22
|
+
<% end %>
|
|
23
|
+
|
|
24
|
+
<%= render "postnhost/shared/elements/form_card" do %>
|
|
25
|
+
<div class="space-y-2">
|
|
26
|
+
<h4 class="text-base font-medium text-gray-900">Credentials</h4>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div>
|
|
30
|
+
<%= form.label :password, class: form_label_classes %>
|
|
31
|
+
<%= form.password_field :password, autocomplete: "new-password", required: user.new_record?, class: form_input_classes %>
|
|
32
|
+
<p class="mt-1 text-xs text-gray-500">Leave blank to keep existing password when editing.</p>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div>
|
|
36
|
+
<%= form.label :password_confirmation, class: form_label_classes %>
|
|
37
|
+
<%= form.password_field :password_confirmation, autocomplete: "new-password", required: user.new_record?, class: form_input_classes %>
|
|
38
|
+
</div>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="order-2 lg:order-1 lg:col-span-2 space-y-6">
|
|
44
|
+
<%= render "postnhost/shared/elements/form_card" do %>
|
|
45
|
+
<div class="space-y-2">
|
|
46
|
+
<%= form.label :avatar_file, "Author Image", class: form_label_classes %>
|
|
47
|
+
<div class="flex items-center gap-4">
|
|
48
|
+
<%= render "postnhost/users/avatar",
|
|
49
|
+
user: user,
|
|
50
|
+
size_class: "w-16 h-16 min-w-16 min-h-16",
|
|
51
|
+
text_size_class: "text-base",
|
|
52
|
+
mobile_visibility_class: "flex" %>
|
|
53
|
+
<%= form.file_field :avatar_file, accept: "image/png,image/jpeg,image/gif,image/webp,image/heic", class: "#{form_input_classes} cursor-pointer" %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
58
|
+
<div>
|
|
59
|
+
<%= form.label :name, "Author Name", class: form_label_classes %>
|
|
60
|
+
<%= form.text_field :name, class: form_input_classes, placeholder: "Enter author name" %>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div>
|
|
64
|
+
<%= form.label :email, class: form_label_classes %>
|
|
65
|
+
<%= form.email_field :email, autocomplete: "email", required: true, class: form_input_classes, placeholder: "author@example.com" %>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
70
|
+
<div>
|
|
71
|
+
<%= form.label :position, class: form_label_classes %>
|
|
72
|
+
<%= form.text_field :position, class: form_input_classes, placeholder: "Editor in Chief" %>
|
|
73
|
+
<p class="mt-1 text-xs text-gray-500">If left blank, the default label "Author" will be used.</p>
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div>
|
|
78
|
+
<%= form.label :slug, "Slug", class: form_label_classes %>
|
|
79
|
+
<div class="flex">
|
|
80
|
+
<span class="inline-flex items-center px-4 py-3 border-r-0 border-gray-200 bg-gray-50 text-gray-500 text-sm font-medium rounded-l-xl">
|
|
81
|
+
authors/
|
|
82
|
+
</span>
|
|
83
|
+
<%= form.text_field :slug, class: "block w-full rounded-r-xl border-gray-200 bg-gray-50 px-4 py-3 text-sm font-medium text-gray-900 transition-all duration-200 focus:border-gray-900 focus:bg-white focus:ring-0", placeholder: "author-slug" %>
|
|
84
|
+
</div>
|
|
85
|
+
<p class="mt-1 text-xs text-gray-500">Auto-generated from Author Name. You can edit it before saving.</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div>
|
|
90
|
+
<%= form.label :bio, "BIO", class: form_label_classes %>
|
|
91
|
+
<%= form.text_area :bio, rows: 3, class: form_textarea_classes, placeholder: "Short biography shown on the public author profile." %>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<details class="group rounded-xl border border-gray-200 p-4">
|
|
95
|
+
<summary class="cursor-pointer list-none flex items-center justify-between">
|
|
96
|
+
<span class="text-base font-medium text-gray-900">Social Links</span>
|
|
97
|
+
<%= icon("chevron-down", css_class: "w-4 h-4 text-gray-400 transition-transform duration-200 group-open:rotate-180") %>
|
|
98
|
+
</summary>
|
|
99
|
+
<p class="mt-2 text-xs text-gray-500">Links shown on the public author profile.</p>
|
|
100
|
+
|
|
101
|
+
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
102
|
+
<div>
|
|
103
|
+
<%= form.label :website_url, "Website", class: form_label_classes %>
|
|
104
|
+
<%= form.url_field :website_url, class: form_input_classes, placeholder: "https://example.com" %>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div>
|
|
108
|
+
<%= form.label :x_url, "X", class: form_label_classes %>
|
|
109
|
+
<%= form.url_field :x_url, class: form_input_classes, placeholder: "https://x.com/username" %>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div>
|
|
113
|
+
<%= form.label :linkedin_url, "LinkedIn", class: form_label_classes %>
|
|
114
|
+
<%= form.url_field :linkedin_url, class: form_input_classes, placeholder: "https://linkedin.com/in/username" %>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div>
|
|
118
|
+
<%= form.label :facebook_url, "Facebook", class: form_label_classes %>
|
|
119
|
+
<%= form.url_field :facebook_url, class: form_input_classes, placeholder: "https://facebook.com/username" %>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div>
|
|
123
|
+
<%= form.label :youtube_url, "YouTube", class: form_label_classes %>
|
|
124
|
+
<%= form.url_field :youtube_url, class: form_input_classes, placeholder: "https://youtube.com/@channel" %>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div>
|
|
128
|
+
<%= form.label :instagram_url, "Instagram", class: form_label_classes %>
|
|
129
|
+
<%= form.url_field :instagram_url, class: form_input_classes, placeholder: "https://instagram.com/username" %>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div>
|
|
133
|
+
<%= form.label :threads_url, "Threads", class: form_label_classes %>
|
|
134
|
+
<%= form.url_field :threads_url, class: form_input_classes, placeholder: "https://threads.net/@username" %>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div>
|
|
138
|
+
<%= form.label :tiktok_url, "TikTok", class: form_label_classes %>
|
|
139
|
+
<%= form.url_field :tiktok_url, class: form_input_classes, placeholder: "https://tiktok.com/@username" %>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div>
|
|
143
|
+
<%= form.label :mastodon_url, "Mastodon", class: form_label_classes %>
|
|
144
|
+
<%= form.url_field :mastodon_url, class: form_input_classes, placeholder: "https://mastodon.social/@username" %>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div>
|
|
148
|
+
<%= form.label :bluesky_url, "Bluesky", class: form_label_classes %>
|
|
149
|
+
<%= form.url_field :bluesky_url, class: form_input_classes, placeholder: "https://bsky.app/profile/username" %>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div class="mt-4">
|
|
154
|
+
<%= form.submit submit_text, class: "#{button_classes} w-full md:w-auto" %>
|
|
155
|
+
</div>
|
|
156
|
+
</details>
|
|
157
|
+
<% end %>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<% end %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<% content_for :title, "Edit Author" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<%= render "postnhost/shared/elements/page_header",
|
|
5
|
+
title: "Edit Author",
|
|
6
|
+
description: "Update profile details and credentials",
|
|
7
|
+
stats: [
|
|
8
|
+
{ text: author_pages_enabled? ? "Slug: /authors/#{@user.slug}" : "Slug: #{@user.slug}", class: "" },
|
|
9
|
+
*(@user.slug.present? && author_pages_enabled? ? [{ text: "Open", url: public_author_path(@user.slug), icon: "external-link", target: "_blank" }] : [])
|
|
10
|
+
] do %>
|
|
11
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
12
|
+
text: "Back to Authors",
|
|
13
|
+
url: users_path,
|
|
14
|
+
variant: :secondary,
|
|
15
|
+
icon: "chevron-left",
|
|
16
|
+
extra_class: "w-full md:w-auto" %>
|
|
17
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
18
|
+
text: "Edit Schema",
|
|
19
|
+
url: schema_edit_user_path(@user),
|
|
20
|
+
variant: :secondary,
|
|
21
|
+
icon: "layers",
|
|
22
|
+
extra_class: "w-full md:w-auto" %>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<%= render "form", user: @user, submit_text: "Update", cancel_url: users_path, show_sign_out: (@user == current_user) %>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<% content_for :title, "Authors" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<%= render "postnhost/shared/elements/page_header",
|
|
5
|
+
title: "Authors",
|
|
6
|
+
description: "Manage author accounts and profile details for article attribution" do %>
|
|
7
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
8
|
+
text: "New Author",
|
|
9
|
+
url: new_user_path,
|
|
10
|
+
icon: "plus",
|
|
11
|
+
extra_class: "w-full md:w-auto" %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<% if @users.any? %>
|
|
15
|
+
<%= render "postnhost/shared/elements/table_container",
|
|
16
|
+
headers: [
|
|
17
|
+
{ text: "Author", class: "col-span-7" },
|
|
18
|
+
{ text: "Slug", class: "hidden md:block md:col-span-3" },
|
|
19
|
+
{ text: "Actions", class: "col-span-2 text-right" }
|
|
20
|
+
] do %>
|
|
21
|
+
<% @users.each do |user| %>
|
|
22
|
+
<div class="<%= table_row_classes %>">
|
|
23
|
+
<div class="grid grid-cols-12 gap-4 items-center">
|
|
24
|
+
<div class="col-span-10 md:col-span-7">
|
|
25
|
+
<%= link_to edit_user_path(user), class: "block group" do %>
|
|
26
|
+
<div class="flex items-center gap-3">
|
|
27
|
+
<%= render "postnhost/users/avatar",
|
|
28
|
+
user: user,
|
|
29
|
+
size_class: "w-10 h-10 min-w-10 min-h-10",
|
|
30
|
+
text_size_class: "text-sm",
|
|
31
|
+
mobile_visibility_class: "hidden md:flex" %>
|
|
32
|
+
<div>
|
|
33
|
+
<div class="font-medium text-gray-900 group-hover:text-gray-600 transition-colors">
|
|
34
|
+
<%= user.name %>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="text-sm text-gray-500 mt-0.5"><%= user.email %></div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="hidden md:block md:col-span-3">
|
|
43
|
+
<% if author_pages_enabled? %>
|
|
44
|
+
<%= link_to public_author_path(user.slug),
|
|
45
|
+
class: "text-sm text-gray-600 hover:text-gray-900 transition-colors inline-flex items-center gap-1 cursor-pointer",
|
|
46
|
+
target: "_blank",
|
|
47
|
+
rel: "noopener" do %>
|
|
48
|
+
<span>/authors/<%= user.slug %></span>
|
|
49
|
+
<%= icon("external-link", css_class: "w-3.5 h-3.5") %>
|
|
50
|
+
<% end %>
|
|
51
|
+
<% else %>
|
|
52
|
+
<span class="text-sm text-gray-500"><%= user.slug %></span>
|
|
53
|
+
<% end %>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="col-span-2 flex items-center justify-end space-x-2">
|
|
57
|
+
<%= render "postnhost/shared/elements/icon_button",
|
|
58
|
+
icon: "edit",
|
|
59
|
+
url: edit_user_path(user) %>
|
|
60
|
+
|
|
61
|
+
<% unless user == current_user %>
|
|
62
|
+
<%= render "postnhost/shared/elements/icon_button",
|
|
63
|
+
icon: "trash",
|
|
64
|
+
url: user_path(user),
|
|
65
|
+
variant: :danger,
|
|
66
|
+
data: {
|
|
67
|
+
turbo_method: :delete,
|
|
68
|
+
turbo_confirm: "Are you sure you want to remove this author? Their articles will be kept. Authors who own pages cannot be removed."
|
|
69
|
+
} %>
|
|
70
|
+
<% end %>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
<% else %>
|
|
77
|
+
<%= render "postnhost/shared/elements/empty_state",
|
|
78
|
+
icon: "users",
|
|
79
|
+
title: "No authors",
|
|
80
|
+
description: "Create your first author profile to start assigning article bylines." do %>
|
|
81
|
+
<%= render "postnhost/shared/elements/button_link",
|
|
82
|
+
text: "New Author",
|
|
83
|
+
url: new_user_path,
|
|
84
|
+
icon: "plus" %>
|
|
85
|
+
<% end %>
|
|
86
|
+
<% end %>
|
|
87
|
+
|
|
88
|
+
<div class="rounded-xl border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600">
|
|
89
|
+
Authors can be assigned to articles from the editor sidebar. You can add multiple authors per article.
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% content_for :title, "New Author" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<%= render "postnhost/shared/elements/form_page_header",
|
|
5
|
+
title: "New Author",
|
|
6
|
+
description: "Create a new author account for article attribution and CMS access" %>
|
|
7
|
+
|
|
8
|
+
<%= render "form", user: @user, submit_text: "Create", cancel_url: users_path %>
|
|
9
|
+
</div>
|