postnhost 0.0.0 → 0.1.0
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 +25 -0
- data/{LICENSE.txt → LICENSE} +6 -6
- data/README.md +341 -15
- data/Rakefile +38 -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 +343 -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 +247 -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 +56 -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 +97 -0
- data/lib/generators/postnhost/tailwindcss/templates/host.tailwind.css +7 -0
- data/lib/generators/postnhost/tailwindcss/templates/tailwind.config.js +8 -0
- data/lib/generators/postnhost/user/user_generator.rb +36 -0
- data/lib/generators/postnhost/views/views_generator.rb +142 -0
- data/lib/postnhost/configuration.rb +64 -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/version.rb +1 -3
- data/lib/postnhost.rb +26 -3
- data/lib/tasks/postnhost_snapshots.rake +77 -0
- data/lib/tasks/postnhost_tasks.rake +96 -0
- metadata +662 -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,35 @@
|
|
|
1
|
+
<% if pagy.pages > 1 %>
|
|
2
|
+
<nav class="flex items-center justify-center space-x-2" aria-label="<%= t('postnhost.public.pagination.navigation', default: 'Pagination') %>">
|
|
3
|
+
<% if pagy.previous %>
|
|
4
|
+
<%= link_to pagination_url(pagy, pagy.previous), class: "inline-flex items-center justify-center p-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 cursor-pointer", aria: { label: t("postnhost.public.pagination.previous") } do %>
|
|
5
|
+
<%= icon("chevron-left", css_class: "h-5 w-5") %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% else %>
|
|
8
|
+
<span class="inline-flex items-center justify-center p-2 text-sm font-medium text-gray-600 bg-gray-100 border border-gray-200 rounded-lg cursor-not-allowed opacity-50" role="link" aria-label="<%= t('postnhost.public.pagination.previous') %>" aria-disabled="true">
|
|
9
|
+
<%= icon("chevron-left", css_class: "h-5 w-5") %>
|
|
10
|
+
</span>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<% pagination_series(pagy).each do |item| %>
|
|
14
|
+
<% if item.is_a?(Integer) %>
|
|
15
|
+
<% if item == pagy.page %>
|
|
16
|
+
<span class="px-3 py-2 text-sm font-medium text-white bg-gray-900 border border-gray-900 rounded-lg" aria-current="page"><%= item %></span>
|
|
17
|
+
<% else %>
|
|
18
|
+
<%= link_to item, pagination_url(pagy, item), class: "px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 cursor-pointer" %>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% elsif item == :gap %>
|
|
21
|
+
<span class="px-3 py-2 text-sm font-medium text-gray-300">…</span>
|
|
22
|
+
<% end %>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<% if pagy.next %>
|
|
26
|
+
<%= link_to pagination_url(pagy, pagy.next), class: "inline-flex items-center justify-center p-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 cursor-pointer", aria: { label: t("postnhost.public.pagination.next") } do %>
|
|
27
|
+
<%= icon("chevron-right", css_class: "h-5 w-5") %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% else %>
|
|
30
|
+
<span class="inline-flex items-center justify-center p-2 text-sm font-medium text-gray-600 bg-gray-100 border border-gray-200 rounded-lg cursor-not-allowed opacity-50" role="link" aria-label="<%= t('postnhost.public.pagination.next') %>" aria-disabled="true">
|
|
31
|
+
<%= icon("chevron-right", css_class: "h-5 w-5") %>
|
|
32
|
+
</span>
|
|
33
|
+
<% end %>
|
|
34
|
+
</nav>
|
|
35
|
+
<% end %>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% if publication.cover_image? %>
|
|
2
|
+
<%= image_tag publication.cover_image.thumbnail.url,
|
|
3
|
+
loading: index.to_i < 3 ? "eager" : "lazy",
|
|
4
|
+
fetchpriority: index.to_i < 3 ? "high" : "auto",
|
|
5
|
+
alt: publication.cover_image_alt.presence || publication.title,
|
|
6
|
+
width: 520,
|
|
7
|
+
height: 273,
|
|
8
|
+
class: local_assigns.fetch(:image_class, "w-full h-48 object-cover") %>
|
|
9
|
+
<% end %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<%= render "postnhost/public/static_pages/content_for/show" %>
|
|
2
|
+
|
|
3
|
+
<div class="bg-white border-b border-gray-200">
|
|
4
|
+
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
|
|
5
|
+
<h1 class="text-4xl md:text-5xl font-bold text-gray-900 leading-tight">
|
|
6
|
+
<%= @content.title %>
|
|
7
|
+
</h1>
|
|
8
|
+
<% if @content.meta_description.present? %>
|
|
9
|
+
<p class="mt-4 text-lg text-gray-600">
|
|
10
|
+
<%= @content.meta_description %>
|
|
11
|
+
</p>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<article class="bg-white">
|
|
17
|
+
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
18
|
+
<div class="prose prose-gray max-w-none py-8">
|
|
19
|
+
<%= render_article_content(@content.content) %>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</article>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<article class="flex flex-col gap-3 break-words">
|
|
2
|
+
<% if category_article(item).cover_image? %>
|
|
3
|
+
<%= link_to category_article_url(item), class: "block cursor-pointer", "aria-label": t("postnhost.public.blog.read_article_aria_label", title: item.title) do %>
|
|
4
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/thumbnail_cover_image", publication: category_article(item), index: local_assigns.fetch(:index) { item_counter + local_assigns.fetch(:index_offset, 0) } %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<% if category_article(item).categories.any? %>
|
|
9
|
+
<%= link_to "— #{localized_category_name(category_article(item).categories.first, @current_language)}",
|
|
10
|
+
language_category_path(category_article(item).categories.first.slug, @current_language),
|
|
11
|
+
class: "text-[11px] font-semibold uppercase text-[#d4322c] hover:text-[#a4221d] cursor-pointer" %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= link_to category_article_url(item), class: "group block cursor-pointer" do %>
|
|
15
|
+
<h3 class="text-[22px] font-semibold leading-tight text-[#0a0a0a] group-hover:text-[#d4322c]">
|
|
16
|
+
<%= item.title %>
|
|
17
|
+
</h3>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
20
|
+
<div class="mt-auto flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] font-medium uppercase text-[#6b6b6b]">
|
|
21
|
+
<% if author_name(category_article_author_user(item)).present? %>
|
|
22
|
+
<span>
|
|
23
|
+
<%= author_name(category_article_author_user(item)) %>
|
|
24
|
+
</span>
|
|
25
|
+
<% end %>
|
|
26
|
+
<span><%= l category_article(item).published_at.to_date, format: :long %></span>
|
|
27
|
+
</div>
|
|
28
|
+
</article>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="mx-auto max-w-4xl text-center">
|
|
2
|
+
<h1 class="break-words text-[42px] font-extrabold leading-[0.95] sm:text-[56px] md:text-[84px]">
|
|
3
|
+
<%= public_search_page? ? public_articles_index_heading : t("postnhost.public.search.submit") %>
|
|
4
|
+
</h1>
|
|
5
|
+
|
|
6
|
+
<%= form_with url: language_search_path(@current_language), method: :get, local: true, class: "mt-10" do %>
|
|
7
|
+
<label for="public-blog-search" class="sr-only"><%= t("postnhost.public.search.submit") %></label>
|
|
8
|
+
<div class="flex items-end gap-4 border-b-2 border-[#0a0a0a] pb-3">
|
|
9
|
+
<%= text_field_tag :s,
|
|
10
|
+
public_search_query,
|
|
11
|
+
id: "public-blog-search",
|
|
12
|
+
placeholder: t("postnhost.public.search.input_placeholder"),
|
|
13
|
+
class: "w-full border-0 bg-transparent px-0 text-left text-[20px] text-[#0a0a0a] placeholder:text-[#6b6b6b] focus:outline-none focus:ring-0" %>
|
|
14
|
+
<button type="submit" class="inline-flex items-center justify-center p-2 text-[#0a0a0a] hover:text-[#d4322c] cursor-pointer" aria-label="<%= t("postnhost.public.search.submit") %>">
|
|
15
|
+
<%= icon("magnifying-glass", css_class: "size-5 shrink-0") %>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<% cache [public_site_revision, @article, @actual_language, "swiss-editorial_suggestions"] do %>
|
|
2
|
+
<% if @article.suggestions_for(language: @actual_language).any? %>
|
|
3
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-24">
|
|
4
|
+
<div class="mb-8 flex items-baseline justify-between border-b-2 border-[#0a0a0a] pb-4">
|
|
5
|
+
<h2 class="text-[40px] font-bold leading-none"><%= t("postnhost.public.blog.read_more") %></h2>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="grid grid-cols-1 gap-x-6 gap-y-12 md:grid-cols-3">
|
|
9
|
+
<% @article.suggestions_for(language: @actual_language).each_with_index do |suggestion, index| %>
|
|
10
|
+
<% cache [public_site_revision, suggestion, article_authors_cache_key(suggestion), "swiss-editorial_suggestion_card"] do %>
|
|
11
|
+
<article class="flex flex-col gap-3 break-words">
|
|
12
|
+
<% if suggestion.cover_image? %>
|
|
13
|
+
<%= link_to public_article_path(suggestion.slug), class: "block cursor-pointer", "aria-label": t("postnhost.public.blog.read_article_aria_label", title: suggestion.title) do %>
|
|
14
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/thumbnail_cover_image", publication: suggestion, index: index %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
<% if suggestion.categories.any? %>
|
|
19
|
+
<%= link_to "— #{localized_category_name(suggestion.categories.first, @current_language)}",
|
|
20
|
+
language_category_path(suggestion.categories.first.slug, @current_language),
|
|
21
|
+
class: "text-[11px] font-semibold uppercase text-[#d4322c] hover:text-[#a4221d] cursor-pointer" %>
|
|
22
|
+
<% end %>
|
|
23
|
+
|
|
24
|
+
<%= link_to public_article_path(suggestion.slug), class: "group block cursor-pointer" do %>
|
|
25
|
+
<h3 class="text-[22px] font-semibold leading-tight text-[#0a0a0a] group-hover:text-[#d4322c]">
|
|
26
|
+
<%= suggestion.title %>
|
|
27
|
+
</h3>
|
|
28
|
+
<% end %>
|
|
29
|
+
|
|
30
|
+
<div class="mt-auto flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] font-medium uppercase text-[#6b6b6b]">
|
|
31
|
+
<% if article_authors(suggestion).any? %>
|
|
32
|
+
<span><%= author_name(article_authors(suggestion).first) %></span>
|
|
33
|
+
<% end %>
|
|
34
|
+
<span><%= l suggestion.published_at.to_date, format: :long %></span>
|
|
35
|
+
</div>
|
|
36
|
+
</article>
|
|
37
|
+
<% end %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
<% end %>
|
|
42
|
+
<% end %>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<% if top_pick_articles.any? && !public_search_page? && !paginated_public_page? %>
|
|
2
|
+
<aside class="lg:col-span-4 lg:border-l lg:border-[#d9d9d9] lg:pl-8">
|
|
3
|
+
<div class="mb-8 border-t-2 border-[#d4322c] pt-[18px]">
|
|
4
|
+
<span class="text-[12px] font-bold uppercase tracking-[0.16em] text-[#d4322c]"><%= t("postnhost.public.blog.top_picks") %></span>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<% top_pick_articles.each_with_index do |item, index| %>
|
|
8
|
+
<% cache [public_site_revision, item, article_authors_cache_key(item), "swiss-editorial_top_pick"] do %>
|
|
9
|
+
<article class="<%= index < top_pick_articles.size - 1 ? "mb-8 border-b border-[#d9d9d9] pb-6" : "mb-8" %>">
|
|
10
|
+
<% if category_article(item).categories.any? %>
|
|
11
|
+
<span class="text-[11px] font-bold uppercase tracking-[0.16em] text-[#d4322c]">
|
|
12
|
+
— <%= localized_category_name(category_article(item).categories.first, @current_language) %>
|
|
13
|
+
</span>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= link_to category_article_url(item), class: "group mt-1 block cursor-pointer" do %>
|
|
17
|
+
<h3 class="text-[22px] font-semibold leading-tight tracking-[-0.02em] text-[#0a0a0a] group-hover:text-[#d4322c]">
|
|
18
|
+
<%= item.title %>
|
|
19
|
+
</h3>
|
|
20
|
+
<% end %>
|
|
21
|
+
|
|
22
|
+
<% if article_excerpt(item).present? %>
|
|
23
|
+
<p class="mt-2 text-[13px] leading-[1.5] text-[#6b6b6b]">
|
|
24
|
+
<%= article_excerpt(item) %>
|
|
25
|
+
</p>
|
|
26
|
+
<% end %>
|
|
27
|
+
|
|
28
|
+
<p class="mt-2 text-[11px] font-medium uppercase tracking-[0.12em] text-[#6b6b6b]">
|
|
29
|
+
<% if author_name(category_article_author_user(item)).present? %>
|
|
30
|
+
<%= author_name(category_article_author_user(item)) %> ·
|
|
31
|
+
<% end %>
|
|
32
|
+
<%= l category_article(item).published_at.to_date, format: :long %>
|
|
33
|
+
</p>
|
|
34
|
+
</article>
|
|
35
|
+
<% end %>
|
|
36
|
+
<% end %>
|
|
37
|
+
</aside>
|
|
38
|
+
<% end %>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<%= render "postnhost/public/articles/content_for/index" %>
|
|
2
|
+
|
|
3
|
+
<% if public_search_endpoint? %>
|
|
4
|
+
<section class="mx-auto max-w-[1440px] px-6 py-14">
|
|
5
|
+
<%= render "postnhost/public/templates/swiss-editorial/articles/search_form" %>
|
|
6
|
+
</section>
|
|
7
|
+
|
|
8
|
+
<% if category_articles.any? %>
|
|
9
|
+
<section class="mx-auto max-w-[1440px] px-6">
|
|
10
|
+
<div class="mb-8 flex items-baseline justify-between border-b-2 border-[#0a0a0a] pb-4">
|
|
11
|
+
<h2 class="text-[40px] font-bold leading-none"><%= public_articles_index_heading %></h2>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="grid grid-cols-1 gap-x-8 gap-y-12 md:grid-cols-3">
|
|
15
|
+
<%= render partial: "postnhost/public/templates/swiss-editorial/articles/article_card",
|
|
16
|
+
collection: category_articles,
|
|
17
|
+
as: :item,
|
|
18
|
+
cached: ->(item) { [public_site_revision, item, article_authors_cache_key(item), "swiss-editorial_search_card"] } %>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="pt-12">
|
|
22
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/pagination", pagy: @pagy %>
|
|
23
|
+
</div>
|
|
24
|
+
</section>
|
|
25
|
+
<% else %>
|
|
26
|
+
<section class="mx-auto max-w-[1440px] px-6 pb-20 text-center">
|
|
27
|
+
<div class="border-y border-[#d9d9d9] py-14">
|
|
28
|
+
<h2 class="text-[40px] font-bold leading-tight"><%= t("postnhost.public.blog.no_articles") %></h2>
|
|
29
|
+
<p class="mt-4 text-[18px] text-[#6b6b6b]"><%= t("postnhost.public.blog.no_articles_description") %></p>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
32
|
+
<% end %>
|
|
33
|
+
<% elsif category_articles.any? %>
|
|
34
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-12">
|
|
35
|
+
<div class="grid grid-cols-1 gap-8 lg:grid-cols-12 lg:items-center">
|
|
36
|
+
<div class="lg:col-span-7">
|
|
37
|
+
<% cache [public_site_revision, category_articles.first, article_authors_cache_key(category_articles.first), "swiss-editorial_hero"] do %>
|
|
38
|
+
<div class="text-[11px] font-bold uppercase text-[#d4322c]">
|
|
39
|
+
<% if category_article(category_articles.first).categories.any? %>
|
|
40
|
+
<%= localized_category_name(category_article(category_articles.first).categories.first, @current_language) %>
|
|
41
|
+
<% end %>
|
|
42
|
+
</div>
|
|
43
|
+
<%= link_to category_article_url(category_articles.first), class: "group block cursor-pointer" do %>
|
|
44
|
+
<h1 class="mt-2 max-w-4xl break-words text-[42px] font-extrabold leading-[0.95] text-[#0a0a0a] group-hover:text-[#d4322c] sm:text-[58px] md:text-[78px] lg:text-[96px] xl:text-[112px]">
|
|
45
|
+
<%= category_articles.first.title %>
|
|
46
|
+
</h1>
|
|
47
|
+
<% if article_excerpt(category_articles.first).present? %>
|
|
48
|
+
<p class="mt-6 max-w-2xl text-[21px] leading-8 text-[#1f1f1f]">
|
|
49
|
+
<%= article_excerpt(category_articles.first) %>
|
|
50
|
+
</p>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% end %>
|
|
53
|
+
<div class="mt-8 flex flex-wrap items-center gap-x-6 gap-y-2 border-y border-[#d9d9d9] py-4 text-[12px] font-medium uppercase text-[#6b6b6b]">
|
|
54
|
+
<% if author_name(category_article_author_user(category_articles.first)).present? %>
|
|
55
|
+
<span><%= author_name(category_article_author_user(category_articles.first)) %></span>
|
|
56
|
+
<% end %>
|
|
57
|
+
<span><%= l category_article(category_articles.first).published_at.to_date, format: :long %></span>
|
|
58
|
+
</div>
|
|
59
|
+
<% end %>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<% if category_article(category_articles.first).cover_image? %>
|
|
63
|
+
<div class="border-y border-[#d9d9d9] py-4 lg:col-span-5 lg:self-center">
|
|
64
|
+
<%= link_to category_article_url(category_articles.first), class: "block cursor-pointer" do %>
|
|
65
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/thumbnail_cover_image", publication: category_article(category_articles.first), index: 0 %>
|
|
66
|
+
<% end %>
|
|
67
|
+
</div>
|
|
68
|
+
<% end %>
|
|
69
|
+
</div>
|
|
70
|
+
</section>
|
|
71
|
+
|
|
72
|
+
<% if category_articles.drop(1).any? %>
|
|
73
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-12">
|
|
74
|
+
<div class="mb-8 flex items-baseline justify-between border-b-2 border-[#0a0a0a] pb-4">
|
|
75
|
+
<h2 class="text-[40px] font-bold leading-none"><%= public_blog_heading %></h2>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="grid grid-cols-1 gap-8 md:grid-cols-3">
|
|
79
|
+
<%= render partial: "postnhost/public/templates/swiss-editorial/articles/article_card",
|
|
80
|
+
collection: category_articles.drop(1).first(3),
|
|
81
|
+
as: :item,
|
|
82
|
+
cached: ->(item) { [public_site_revision, item, article_authors_cache_key(item), "swiss-editorial_top_story"] },
|
|
83
|
+
locals: { index_offset: 1 } %>
|
|
84
|
+
</div>
|
|
85
|
+
</section>
|
|
86
|
+
<% end %>
|
|
87
|
+
|
|
88
|
+
<% if category_articles.drop(4).any? %>
|
|
89
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-20">
|
|
90
|
+
<div class="grid grid-cols-1 gap-10 lg:grid-cols-12">
|
|
91
|
+
<div class="lg:col-span-8">
|
|
92
|
+
<div class="mb-0 flex items-baseline justify-between border-b-2 border-[#0a0a0a] pb-4">
|
|
93
|
+
<h2 class="text-[40px] font-bold leading-none"><%= t("postnhost.public.blog.browse_all_articles") %></h2>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<% category_articles.drop(4).each_with_index do |item, index| %>
|
|
97
|
+
<% cache [public_site_revision, item, article_authors_cache_key(item), "swiss-editorial_latest"] do %>
|
|
98
|
+
<article class="border-t border-[#d9d9d9] py-5">
|
|
99
|
+
<div class="mb-2 text-[11px] font-bold uppercase text-[#d4322c]">
|
|
100
|
+
<% if category_article(item).categories.any? %>
|
|
101
|
+
<%= localized_category_name(category_article(item).categories.first, @current_language) %>
|
|
102
|
+
<% end %>
|
|
103
|
+
</div>
|
|
104
|
+
<%= link_to category_article_url(item), class: "group block cursor-pointer" do %>
|
|
105
|
+
<h3 class="break-words text-[22px] font-semibold leading-tight group-hover:text-[#d4322c] sm:text-[28px]"><%= item.title %></h3>
|
|
106
|
+
<% end %>
|
|
107
|
+
<p class="mt-2 text-[11px] font-medium uppercase text-[#6b6b6b]">
|
|
108
|
+
<% if author_name(category_article_author_user(item)).present? %>
|
|
109
|
+
<%= author_name(category_article_author_user(item)) %> ·
|
|
110
|
+
<% end %>
|
|
111
|
+
<%= l category_article(item).published_at.to_date, format: :long %>
|
|
112
|
+
</p>
|
|
113
|
+
</article>
|
|
114
|
+
<% end %>
|
|
115
|
+
<% end %>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<%= render "postnhost/public/templates/swiss-editorial/articles/top_picks" %>
|
|
119
|
+
</div>
|
|
120
|
+
</section>
|
|
121
|
+
<% end %>
|
|
122
|
+
|
|
123
|
+
<div class="mx-auto max-w-[1440px] px-6 pt-12">
|
|
124
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/pagination", pagy: @pagy %>
|
|
125
|
+
</div>
|
|
126
|
+
<% else %>
|
|
127
|
+
<section class="mx-auto max-w-[1440px] px-6 py-24 text-center">
|
|
128
|
+
<div class="border-y border-[#d9d9d9] py-14">
|
|
129
|
+
<h1 class="text-[40px] font-bold leading-tight"><%= t("postnhost.public.blog.no_articles") %></h1>
|
|
130
|
+
<p class="mt-4 text-[18px] text-[#6b6b6b]"><%= t("postnhost.public.blog.no_articles_description") %></p>
|
|
131
|
+
</div>
|
|
132
|
+
</section>
|
|
133
|
+
<% end %>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<%= render "postnhost/public/articles/content_for/preview" %>
|
|
2
|
+
|
|
3
|
+
<article class="bg-[#fafaf7]">
|
|
4
|
+
<header class="mx-auto max-w-[1440px] px-6 pb-10 pt-20">
|
|
5
|
+
<div class="grid grid-cols-1 lg:grid-cols-12">
|
|
6
|
+
<div class="lg:col-span-8 lg:col-start-3">
|
|
7
|
+
<% if @article.categories.any? %>
|
|
8
|
+
<div class="text-[11px] font-bold uppercase text-[#d4322c]">
|
|
9
|
+
<%= localized_category_name(@article.categories.first, @current_language) %>
|
|
10
|
+
</div>
|
|
11
|
+
<% end %>
|
|
12
|
+
<h1 class="mt-3 break-words text-[42px] font-extrabold leading-[0.95] sm:text-[56px] md:text-[84px]"><%= @content.title %></h1>
|
|
13
|
+
|
|
14
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/article_authors", authors: article_authors(@article), current_language: @current_language %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</header>
|
|
18
|
+
|
|
19
|
+
<% if @content.cover_image? %>
|
|
20
|
+
<div class="mx-auto max-w-[1180px] px-6">
|
|
21
|
+
<div class="border-y border-[#d9d9d9] py-6">
|
|
22
|
+
<%= image_tag @content.cover_image.url,
|
|
23
|
+
loading: "eager",
|
|
24
|
+
fetchpriority: "high",
|
|
25
|
+
alt: @content.cover_image_alt.presence || @content.title,
|
|
26
|
+
width: 1200,
|
|
27
|
+
height: 630,
|
|
28
|
+
srcset: "#{@content.cover_image.thumbnail.url} 520w, #{@content.cover_image.medium.url} 1024w, #{@content.cover_image.url} 1200w",
|
|
29
|
+
sizes: "(max-width: 639px) 100vw, (max-width: 1279px) 90vw, 1200px",
|
|
30
|
+
class: "h-auto w-full" %>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<div class="mx-auto max-w-[1440px] px-6 pt-10">
|
|
36
|
+
<div class="grid grid-cols-1 gap-12 lg:grid-cols-12">
|
|
37
|
+
<div class="prose prose-zinc max-w-none prose-headings:font-semibold prose-headings:leading-tight prose-a:text-[#d4322c] prose-blockquote:border-l-[#d4322c] lg:col-span-7 lg:col-start-3">
|
|
38
|
+
<%= render_article_content(@content.content) %>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</article>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<%= render "postnhost/public/articles/content_for/show" %>
|
|
2
|
+
|
|
3
|
+
<article class="bg-[#fafaf7]">
|
|
4
|
+
<header class="mx-auto max-w-[1440px] px-6 pb-10 pt-20">
|
|
5
|
+
<div class="grid grid-cols-1 lg:grid-cols-12">
|
|
6
|
+
<div class="lg:col-span-8 lg:col-start-3">
|
|
7
|
+
<% if @article.categories.any? %>
|
|
8
|
+
<div class="text-[11px] font-bold uppercase text-[#d4322c]">
|
|
9
|
+
<%= localized_category_name(@article.categories.first, @current_language) %>
|
|
10
|
+
</div>
|
|
11
|
+
<% end %>
|
|
12
|
+
<h1 class="mt-3 break-words text-[42px] font-extrabold leading-[0.95] sm:text-[56px] md:text-[84px]"><%= @content.title %></h1>
|
|
13
|
+
|
|
14
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/article_authors", authors: article_authors(@article), current_language: @current_language, published_at: @article.published_at %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</header>
|
|
18
|
+
|
|
19
|
+
<% if @article.cover_image? %>
|
|
20
|
+
<div class="mx-auto max-w-[1180px] px-6">
|
|
21
|
+
<div class="border-y border-[#d9d9d9] py-6">
|
|
22
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/hero_cover_image", publication: @article, alt_text: @content.title %>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
<% if user_signed_in? %>
|
|
28
|
+
<div class="mx-auto max-w-[1440px] px-6 pt-6 text-center">
|
|
29
|
+
<%= link_to(@article_variant.present? ? edit_article_variant_path(@article.article_id, @article_variant.article_variant_id) : edit_article_path(@article.article_id),
|
|
30
|
+
data: { turbo_prefetch: false },
|
|
31
|
+
class: "inline-flex items-center border border-[#0a0a0a] px-4 py-2 text-[12px] font-semibold uppercase text-[#0a0a0a] hover:bg-[#0a0a0a] hover:text-[#fafaf7] cursor-pointer") do %>
|
|
32
|
+
<%= icon("edit", css_class: "mr-2 h-4 w-4") %>
|
|
33
|
+
Edit
|
|
34
|
+
<% end %>
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
37
|
+
|
|
38
|
+
<div class="mx-auto max-w-[1440px] px-6 pt-10">
|
|
39
|
+
<div class="grid grid-cols-1 gap-12 lg:grid-cols-12">
|
|
40
|
+
<div class="prose prose-zinc max-w-none prose-headings:font-semibold prose-headings:leading-tight prose-a:text-[#d4322c] prose-blockquote:border-l-[#d4322c] lg:col-span-7 lg:col-start-3">
|
|
41
|
+
<%= render_article_content(@content.content) %>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<aside class="lg:col-span-2">
|
|
45
|
+
<div class="sticky top-36 space-y-8">
|
|
46
|
+
<% if @article.categories.any? %>
|
|
47
|
+
<div class="border-t-2 border-[#0a0a0a] pt-4">
|
|
48
|
+
<div class="space-y-2">
|
|
49
|
+
<% @article.categories.each do |category| %>
|
|
50
|
+
<%= link_to localized_category_name(category, @current_language),
|
|
51
|
+
language_category_path(category.slug, @current_language),
|
|
52
|
+
class: "block text-[13px] leading-5 text-[#6b6b6b] hover:text-[#d4322c] cursor-pointer" %>
|
|
53
|
+
<% end %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<% end %>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
</aside>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</article>
|
|
63
|
+
|
|
64
|
+
<% if @available_variants.count > 1 || (@article.published? && @available_variants.any?) %>
|
|
65
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-12">
|
|
66
|
+
<div class="border-y border-[#d9d9d9] py-6">
|
|
67
|
+
<p class="mb-4 text-[12px] font-bold uppercase text-[#0a0a0a]"><%= t("postnhost.public.blog.available_in_languages") %></p>
|
|
68
|
+
<div class="flex flex-wrap gap-2">
|
|
69
|
+
<% if @article.published? %>
|
|
70
|
+
<%= link_to public_article_path(@article.slug), class: "border px-3 py-2 text-[12px] font-semibold uppercase #{@content == @article ? 'border-[#0a0a0a] bg-[#0a0a0a] text-[#fafaf7]' : 'border-[#d9d9d9] text-[#0a0a0a] hover:border-[#0a0a0a]'} cursor-pointer" do %>
|
|
71
|
+
<%= @primary_language.name %>
|
|
72
|
+
<% end %>
|
|
73
|
+
<% end %>
|
|
74
|
+
<% @available_variants.each do |variant| %>
|
|
75
|
+
<%= link_to localized_public_article_path(variant.language.html_lang, @article.slug), class: "border px-3 py-2 text-[12px] font-semibold uppercase #{@content == variant ? 'border-[#0a0a0a] bg-[#0a0a0a] text-[#fafaf7]' : 'border-[#d9d9d9] text-[#0a0a0a] hover:border-[#0a0a0a]'} cursor-pointer" do %>
|
|
76
|
+
<%= variant.language.name %>
|
|
77
|
+
<% end %>
|
|
78
|
+
<% end %>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</section>
|
|
82
|
+
<% end %>
|
|
83
|
+
|
|
84
|
+
<%= render "postnhost/public/templates/swiss-editorial/articles/suggestions" %>
|
|
85
|
+
|
|
86
|
+
<div class="mx-auto max-w-[1440px] px-6 pt-12">
|
|
87
|
+
<div class="flex flex-col gap-4 border-t border-[#d9d9d9] pt-8 sm:flex-row sm:items-center sm:justify-between">
|
|
88
|
+
<%= link_to language_root_path(@current_language), class: "inline-flex items-center text-[12px] font-semibold uppercase text-[#6b6b6b] hover:text-[#d4322c] cursor-pointer" do %>
|
|
89
|
+
<%= icon("arrow-left-long", css_class: "mr-2 h-4 w-4") %>
|
|
90
|
+
<%= t("postnhost.public.blog.back_to_articles") %>
|
|
91
|
+
<% end %>
|
|
92
|
+
|
|
93
|
+
<% if @article.categories.any? %>
|
|
94
|
+
<%= link_to language_category_path(@article.categories.first.slug, @current_language), class: "inline-flex items-center text-[12px] font-semibold uppercase text-[#6b6b6b] hover:text-[#d4322c] cursor-pointer" do %>
|
|
95
|
+
<%= t("postnhost.public.blog.more_in_category", category: localized_category_name(@article.categories.first, @current_language)) %>
|
|
96
|
+
<%= icon("arrow-right-long", css_class: "ml-2 h-4 w-4") %>
|
|
97
|
+
<% end %>
|
|
98
|
+
<% end %>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<article class="border-t border-[#d9d9d9] py-5 break-words">
|
|
2
|
+
<% if category_article(item).cover_image? %>
|
|
3
|
+
<%= link_to category_article_url(item), class: "mb-4 block cursor-pointer", "aria-label": t("postnhost.public.blog.read_article_aria_label", title: item.title) do %>
|
|
4
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/thumbnail_cover_image", publication: category_article(item), index: local_assigns.fetch(:index) { item_counter + local_assigns.fetch(:index_offset, 0) } %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<div class="mb-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] font-semibold uppercase text-[#6b6b6b]">
|
|
9
|
+
<% if category_article(item).categories.any? %>
|
|
10
|
+
<%= link_to "— #{localized_category_name(category_article(item).categories.first, @current_language)}",
|
|
11
|
+
language_category_path(category_article(item).categories.first.slug, @current_language),
|
|
12
|
+
class: "text-[#d4322c] hover:text-[#a4221d] cursor-pointer" %>
|
|
13
|
+
<% end %>
|
|
14
|
+
<span><%= l category_article(item).published_at.to_date, format: :long %></span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<%= link_to category_article_url(item), class: "group block cursor-pointer", "aria-label": t("postnhost.public.blog.read_article_aria_label", title: item.title) do %>
|
|
18
|
+
<h3 class="text-[22px] font-semibold leading-tight text-[#0a0a0a] group-hover:text-[#d4322c] sm:text-[24px]">
|
|
19
|
+
<%= item.title %>
|
|
20
|
+
</h3>
|
|
21
|
+
<% if article_excerpt(item).present? %>
|
|
22
|
+
<p class="mt-2 text-[15px] leading-6 text-[#1f1f1f] line-clamp-2">
|
|
23
|
+
<%= article_excerpt(item) %>
|
|
24
|
+
</p>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% end %>
|
|
27
|
+
</article>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<section class="grid grid-cols-1 gap-8 md:grid-cols-12">
|
|
2
|
+
<div class="md:col-span-3">
|
|
3
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/author_avatar", user: author, size_class: "aspect-square w-full max-w-[260px]", text_size_class: "text-5xl" %>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="md:col-span-9 md:pl-8">
|
|
7
|
+
<h1 class="break-words text-[42px] font-extrabold leading-[0.95] sm:text-[58px] md:text-[96px]"><%= author_name(author) %></h1>
|
|
8
|
+
|
|
9
|
+
<% if author.position.present? %>
|
|
10
|
+
<p class="mt-5 text-[12px] font-semibold uppercase text-[#6b6b6b]"><%= author.position %></p>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<% if author.bio.present? %>
|
|
14
|
+
<p class="mt-6 max-w-3xl text-[21px] leading-8 text-[#1f1f1f]"><%= author.bio %></p>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<% if author_social_links(author).any? %>
|
|
18
|
+
<div class="mt-8 flex flex-wrap gap-x-6 gap-y-3 border-t border-[#d9d9d9] pt-6">
|
|
19
|
+
<% author_social_links(author).each do |social| %>
|
|
20
|
+
<%= link_to social[:url],
|
|
21
|
+
target: "_blank",
|
|
22
|
+
rel: "noopener noreferrer",
|
|
23
|
+
class: "inline-flex items-center text-[#0a0a0a] hover:text-[#d4322c] cursor-pointer",
|
|
24
|
+
aria: { label: social[:label] },
|
|
25
|
+
title: social[:label] do %>
|
|
26
|
+
<%= icon(social[:icon], css_class: "h-4 w-4") %>
|
|
27
|
+
<% end %>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
30
|
+
<% end %>
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<%= render "postnhost/public/authors/content_for/show" %>
|
|
2
|
+
|
|
3
|
+
<div class="mx-auto max-w-[1440px] px-6 py-20">
|
|
4
|
+
<%= render "postnhost/public/templates/swiss-editorial/authors/profile_block", author: @author %>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<section class="mx-auto max-w-[1440px] px-6 pt-8">
|
|
8
|
+
<div class="grid grid-cols-1 gap-10 lg:grid-cols-12">
|
|
9
|
+
<div class="lg:col-span-8 lg:col-start-3">
|
|
10
|
+
<div class="mb-0 flex items-baseline justify-between border-b-2 border-[#0a0a0a] pb-4">
|
|
11
|
+
<h2 class="text-[40px] font-bold leading-none"><%= t("postnhost.public.authors.latest_from_author") %></h2>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<% if category_articles.any? %>
|
|
15
|
+
<%= render partial: "postnhost/public/templates/swiss-editorial/authors/article_card",
|
|
16
|
+
collection: category_articles,
|
|
17
|
+
as: :item,
|
|
18
|
+
cached: ->(item) { [public_site_revision, item, "author_card"] } %>
|
|
19
|
+
|
|
20
|
+
<div class="pt-8">
|
|
21
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/pagination", pagy: @pagy %>
|
|
22
|
+
</div>
|
|
23
|
+
<% else %>
|
|
24
|
+
<div class="border-b border-[#d9d9d9] py-14 text-center">
|
|
25
|
+
<h3 class="text-[32px] font-bold leading-tight"><%= t("postnhost.public.authors.no_articles") %></h3>
|
|
26
|
+
<p class="mt-3 text-[#6b6b6b]"><%= t("postnhost.public.authors.no_articles_description") %></p>
|
|
27
|
+
</div>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<article class="flex flex-col gap-3 break-words">
|
|
2
|
+
<% if category_article(item).cover_image? %>
|
|
3
|
+
<%= link_to category_article_url(item), class: "block cursor-pointer", "aria-label": t("postnhost.public.blog.read_article_aria_label", title: item.title) do %>
|
|
4
|
+
<%= render "postnhost/public/templates/swiss-editorial/shared/thumbnail_cover_image", publication: category_article(item), index: local_assigns.fetch(:index) { item_counter + local_assigns.fetch(:index_offset, 0) } %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% end %>
|
|
7
|
+
|
|
8
|
+
<% if category_article(item).categories.any? %>
|
|
9
|
+
<%= link_to "— #{localized_category_name(category_article(item).categories.first, @current_language)}",
|
|
10
|
+
language_category_path(category_article(item).categories.first.slug, @current_language),
|
|
11
|
+
class: "text-[11px] font-semibold uppercase text-[#d4322c] hover:text-[#a4221d] cursor-pointer" %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= link_to category_article_url(item), class: "group block cursor-pointer" do %>
|
|
15
|
+
<h3 class="text-[22px] font-semibold leading-tight text-[#0a0a0a] group-hover:text-[#d4322c]">
|
|
16
|
+
<%= item.title %>
|
|
17
|
+
</h3>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
20
|
+
<div class="mt-auto flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] font-medium uppercase text-[#6b6b6b]">
|
|
21
|
+
<% if author_name(category_article_author_user(item)).present? %>
|
|
22
|
+
<span>
|
|
23
|
+
<%= author_name(category_article_author_user(item)) %>
|
|
24
|
+
</span>
|
|
25
|
+
<% end %>
|
|
26
|
+
<span><%= l category_article(item).published_at.to_date, format: :long %></span>
|
|
27
|
+
</div>
|
|
28
|
+
</article>
|