Module: Maglev
- Defined in:
- lib/maglev/i18n.rb,
lib/maglev.rb,
lib/maglev/config.rb,
lib/maglev/engine.rb,
lib/maglev/errors.rb,
lib/maglev/version.rb,
app/models/maglev/page.rb,
app/models/maglev/site.rb,
app/models/maglev/asset.rb,
app/models/maglev/theme.rb,
app/models/maglev/section.rb,
lib/maglev/active_storage.rb,
app/models/maglev/page_path.rb,
app/models/maglev/static_page.rb,
lib/maglev/preview_constraint.rb,
app/services/maglev/clone_page.rb,
app/services/maglev/fetch_page.rb,
app/services/maglev/fetch_site.rb,
app/jobs/maglev/application_job.rb,
app/services/maglev/fetch_style.rb,
app/services/maglev/fetch_theme.rb,
app/services/maglev/setup_pages.rb,
app/components/maglev/tag_helper.rb,
app/helpers/maglev/editor_helper.rb,
app/services/maglev/get_base_url.rb,
app/services/maglev/persist_page.rb,
app/services/maglev/search_pages.rb,
app/helpers/maglev/sitemap_helper.rb,
app/services/maglev/app_container.rb,
app/services/maglev/generate_site.rb,
app/components/maglev/content/base.rb,
app/components/maglev/content/icon.rb,
app/components/maglev/content/link.rb,
app/components/maglev/content/text.rb,
app/services/maglev/extract_locale.rb,
lib/maglev/theme_filesystem_loader.rb,
app/components/maglev/content/color.rb,
app/components/maglev/content/image.rb,
app/components/maglev/base_component.rb,
app/components/maglev/content/select.rb,
app/components/maglev/page_component.rb,
app/models/maglev/application_record.rb,
app/components/maglev/block_component.rb,
app/components/maglev/content/builder.rb,
app/controllers/maglev/api_controller.rb,
app/helpers/maglev/application_helper.rb,
app/mailers/maglev/application_mailer.rb,
app/services/maglev/get_page_fullpath.rb,
app/services/maglev/get_page_sections.rb,
lib/generators/maglev/theme_generator.rb,
app/components/maglev/content/checkbox.rb,
app/helpers/maglev/admin/themes_helper.rb,
app/helpers/maglev/page_preview_helper.rb,
app/services/maglev/fetch_static_pages.rb,
app/services/maglev/fetch_theme_layout.rb,
app/components/maglev/section_component.rb,
app/models/concerns/maglev/translatable.rb,
app/services/maglev/change_site_locales.rb,
app/services/maglev/fetch_sections_path.rb,
lib/generators/maglev/install_generator.rb,
lib/generators/maglev/section_generator.rb,
app/controllers/maglev/assets_controller.rb,
app/controllers/maglev/editor_controller.rb,
app/validators/maglev/presence_validator.rb,
app/controllers/maglev/sitemap_controller.rb,
app/services/maglev/fetch_collection_items.rb,
app/services/maglev/get_page_section_names.rb,
app/validators/maglev/collection_validator.rb,
app/controllers/maglev/api/pages_controller.rb,
app/controllers/maglev/api/sites_controller.rb,
app/controllers/concerns/maglev/json_concern.rb,
app/controllers/maglev/admin/base_controller.rb,
app/controllers/maglev/api/assets_controller.rb,
app/components/maglev/content/collection_item.rb,
app/controllers/maglev/application_controller.rb,
app/controllers/maglev/admin/themes_controller.rb,
app/controllers/maglev/page_preview_controller.rb,
app/services/maglev/persist_section_screenshot.rb,
app/controllers/concerns/maglev/fetchers_concern.rb,
app/controllers/concerns/maglev/services_concern.rb,
app/services/maglev/fetch_section_screenshot_url.rb,
app/controllers/concerns/maglev/rendering_concern.rb,
app/controllers/concerns/maglev/ui_locale_concern.rb,
app/controllers/maglev/admin/dashboard_controller.rb,
app/controllers/maglev/api/page_clones_controller.rb,
app/helpers/maglev/admin/sections/previews_helper.rb,
app/services/maglev/fetch_section_screenshot_path.rb,
app/controllers/maglev/api/publications_controller.rb,
app/controllers/concerns/maglev/back_action_concern.rb,
app/controllers/concerns/maglev/authentication_concern.rb,
app/controllers/concerns/maglev/content_locale_concern.rb,
app/controllers/maglev/api/collection_items_controller.rb,
app/controllers/maglev/admin/sections/previews_controller.rb,
app/controllers/concerns/maglev/standalone_sections_concern.rb,
app/controllers/maglev/admin/sections/screenshots_controller.rb
Overview
Add support for ‘translates(*attributes)` macro, which uses JSONB to store translations of the specified attrs.
Defined Under Namespace
Modules: ActiveStorage, Admin, Api, ApplicationHelper, AuthenticationConcern, BackActionConcern, Content, ContentLocaleConcern, EditorHelper, Errors, FetchersConcern, I18n, JsonConcern, PagePreviewHelper, RenderingConcern, SectionsConcern, ServicesConcern, SitemapHelper, StandaloneSectionsConcern, TagHelper, Translatable, UiLocaleConcern Classes: ApiController, AppContainer, ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, Asset, AssetsController, BaseComponent, BlockComponent, ChangeSiteLocales, ClonePage, CollectionValidator, Config, EditorController, Engine, ExtractLocale, FetchCollectionItems, FetchPage, FetchSectionScreenshotPath, FetchSectionScreenshotUrl, FetchSectionsPath, FetchSite, FetchStaticPages, FetchStyle, FetchTheme, FetchThemeLayout, GenerateSite, GetBaseUrl, GetPageFullpath, GetPageSectionNames, GetPageSections, InstallGenerator, Page, PageComponent, PagePath, PagePreviewController, PersistPage, PersistSectionScreenshot, PresenceValidator, PreviewConstraint, SearchPages, Section, SectionComponent, SectionGenerator, ServiceContext, SetupPages, Site, SitemapController, StaticPage, Theme, ThemeFilesystemLoader, ThemeGenerator
Constant Summary collapse
- ROOT_PATH =
Pathname.new(File.join(__dir__, '..'))
- VERSION =
'1.2.1'
Class Attribute Summary collapse
-
.local_themes ⇒ Object
Returns the value of attribute local_themes.
Class Method Summary collapse
-
.config ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize.
-
.configure {|config| ... } ⇒ Object
rubocop:enable Metrics/MethodLength, Metrics/AbcSize.
- .services(overrides = {}) ⇒ Object
- .uploader ⇒ Object
Class Attribute Details
.local_themes ⇒ Object
Returns the value of attribute local_themes.
19 20 21 |
# File 'lib/maglev.rb', line 19 def local_themes @local_themes end |
Class Method Details
.config ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/maglev.rb', line 22 def config @config ||= Config.new.tap do |c| c.title = 'Maglev - EDITOR' c.favicon = nil c.logo = nil c.primary_color = '#7E6EDB' c.uploader = 'active_storage' c.site_publishable = false c.preview_host = nil c.asset_host = Rails.application.config.action_controller.asset_host c.ui_locale = nil c.back_action = nil c.services = {} c.default_site_locales = [{ label: 'English', prefix: 'en' }] c.is_authenticated = ->(_site) { !Rails.env.production? } c.admin_username = nil c.admin_password = nil c.static_pages = [] c.reserved_paths = [] end end |
.configure {|config| ... } ⇒ Object
rubocop:enable Metrics/MethodLength, Metrics/AbcSize
45 46 47 |
# File 'lib/maglev.rb', line 45 def configure yield config end |
.services(overrides = {}) ⇒ Object
54 55 56 |
# File 'lib/maglev.rb', line 54 def services(overrides = {}) ::Maglev::AppContainer.new(config.services.merge(overrides)).call end |
.uploader ⇒ Object
49 50 51 52 |
# File 'lib/maglev.rb', line 49 def uploader require_relative "maglev/#{config.uploader}" const_get("::Maglev::#{config.uploader.to_s.classify}") end |