Module: Archangel

Extended by:
ActionView::Helpers::TagHelper, ActionView::Helpers::TranslationHelper
Defined in:
lib/archangel.rb,
app/models/archangel/page.rb,
app/models/archangel/site.rb,
app/models/archangel/user.rb,
app/models/archangel/asset.rb,
app/models/archangel/entry.rb,
app/models/archangel/field.rb,
app/models/archangel/design.rb,
app/models/archangel/widget.rb,
app/models/archangel/metatag.rb,
app/inputs/archangel/role_input.rb,
app/models/archangel/collection.rb,
app/inputs/archangel/theme_input.rb,
app/helpers/archangel/flash_helper.rb,
app/inputs/archangel/wysiwyg_input.rb,
app/jobs/archangel/application_job.rb,
app/policies/archangel/page_policy.rb,
app/policies/archangel/site_policy.rb,
app/policies/archangel/user_policy.rb,
app/inputs/archangel/language_input.rb,
app/policies/archangel/asset_policy.rb,
app/policies/archangel/entry_policy.rb,
app/policies/archangel/design_policy.rb,
app/policies/archangel/widget_policy.rb,
app/services/archangel/render_service.rb,
app/uploaders/archangel/logo_uploader.rb,
app/inputs/archangel/date_picker_input.rb,
app/inputs/archangel/time_picker_input.rb,
app/uploaders/archangel/asset_uploader.rb,
app/models/archangel/application_record.rb,
app/uploaders/archangel/avatar_uploader.rb,
app/helpers/archangel/application_helper.rb,
app/inputs/archangel/meta_keywords_input.rb,
app/mailers/archangel/application_mailer.rb,
app/policies/archangel/collection_policy.rb,
app/controllers/archangel/auth_controller.rb,
app/policies/archangel/application_policy.rb,
app/inputs/archangel/date_time_picker_input.rb,
app/controllers/archangel/backend_controller.rb,
app/services/archangel/design_render_service.rb,
app/uploaders/archangel/application_uploader.rb,
app/controllers/archangel/frontend_controller.rb,
app/inputs/archangel/field_classification_input.rb,
app/controllers/archangel/application_controller.rb,
app/controllers/archangel/backend/pages_controller.rb,
app/controllers/archangel/backend/sites_controller.rb,
app/controllers/archangel/backend/users_controller.rb,
app/controllers/archangel/backend/assets_controller.rb,
app/controllers/archangel/frontend/pages_controller.rb,
app/controllers/archangel/backend/designs_controller.rb,
app/controllers/archangel/backend/entries_controller.rb,
app/controllers/archangel/backend/widgets_controller.rb,
app/controllers/archangel/backend/profiles_controller.rb,
app/controllers/archangel/auth/registrations_controller.rb,
app/controllers/archangel/backend/dashboards_controller.rb,
app/controllers/archangel/frontend/homepages_controller.rb,
app/controllers/archangel/backend/collections_controller.rb,
app/controllers/concerns/archangel/controllers/themable_concern.rb,
app/controllers/concerns/archangel/controllers/actionable_concern.rb,
app/controllers/concerns/archangel/controllers/metatagable_concern.rb,
app/controllers/concerns/archangel/controllers/paginatable_concern.rb,
app/controllers/concerns/archangel/controllers/resourceful_concern.rb,
app/controllers/concerns/archangel/controllers/authorizable_concern.rb,
app/controllers/concerns/archangel/controllers/authenticatable_concern.rb,
app/controllers/concerns/archangel/controllers/skip_authorizable_concern.rb,
lib/archangel/i18n.rb,
lib/archangel/config.rb,
lib/archangel/engine.rb,
lib/archangel/version.rb,
lib/archangel/liquid/drop.rb,
lib/archangel/liquid_view.rb,
lib/archangel/constants/role.rb,
lib/archangel/constants/theme.rb,
lib/archangel/constants/language.rb,
lib/archangel/liquid/tags/gist_tag.rb,
lib/archangel/application_responder.rb,
lib/archangel/commands/base_command.rb,
lib/archangel/liquid/tags/asset_tag.rb,
lib/archangel/liquid/tags/vimeo_tag.rb,
lib/archangel/commands/theme_command.rb,
lib/archangel/liquid/drops/page_drop.rb,
lib/archangel/liquid/drops/site_drop.rb,
lib/archangel/liquid/tags/locale_tag.rb,
lib/archangel/liquid/tags/widget_tag.rb,
lib/archangel/liquid/tags/noembed_tag.rb,
lib/archangel/liquid/tags/youtube_tag.rb,
lib/archangel/liquid/tags/meta_tags_tag.rb,
lib/archangel/theme/themable_controller.rb,
lib/archangel/commands/extension_command.rb,
lib/archangel/liquid/tags/collection_tag.rb,
lib/archangel/liquid/tags/application_tag.rb,
lib/archangel/liquid/filters/link_to_filter.rb,
lib/archangel/liquid/tags/collectionfor_tag.rb,
lib/archangel/liquid/tags/csrf_meta_tags_tag.rb,
lib/archangel/liquid/tags/text_direction_tag.rb,
lib/archangel/liquid/tags/theme_javascript_tag.rb,
lib/archangel/liquid/tags/theme_stylesheet_tag.rb,
lib/generators/archangel/dummy/dummy_generator.rb,
lib/generators/archangel/install/install_generator.rb

Overview

See Also:

Defined Under Namespace

Modules: ApplicationHelper, Auth, Backend, Commands, Controllers, FlashHelper, Frontend, Generators, Liquid, Theme Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationPolicy, ApplicationRecord, ApplicationResponder, ApplicationUploader, Asset, AssetPolicy, AssetUploader, AuthController, AvatarUploader, BackendController, Collection, CollectionPolicy, Config, DatePickerInput, DateTimePickerInput, Design, DesignPolicy, DesignRenderService, Engine, Entry, EntryPolicy, Field, FieldClassificationInput, FrontendController, LanguageInput, LiquidView, LogoUploader, MetaKeywordsInput, Metatag, Page, PagePolicy, RenderService, RoleInput, Site, SitePolicy, ThemeInput, TimePickerInput, User, UserPolicy, Widget, WidgetPolicy, WysiwygInput

Constant Summary collapse

VERSION =

Archangel gem version

"0.3.0"
ROLES =

Available roles constant

%w[admin editor].freeze
ROLE_DEFAULT =

Default role constant

ROLES.last.freeze
THEME_DIRECTORIES =

Theme directories constant

[Archangel::Engine.root, Rails.root].freeze
THEMES =

Theme names constant

Dir["app/themes/*/"].map { |dir| File.basename(dir) }.freeze
THEME_DEFAULT =

Default theme constant

"default"
LANGUAGES =

Available languages constant

%w[en].freeze
LANGUAGE_DEFAULT =

Default language constant

LANGUAGES.first.freeze

Class Method Summary collapse

Class Method Details

.configObject Also known as: configuration

Application configurations

Example

Archangel.config.backend_path #=> "backend"
Archangel.config[:backend_path] #=> "backend"
Archangel.config["backend_path"] #=> "backend"

Returns:

  • (Object)

    application configurations


71
72
73
# File 'lib/archangel.rb', line 71

def config
  @config ||= Config.new
end

.reserved_page_keywordsArray

Reserved keywords for page slugs

This is an array keywords that are not allowed to be used for Page slugs.

Example

Archangel.reserved_page_keywords #=> ["auth", "backend", ""]

Returns:

  • (Array)

    reserved keywords for page slugs


97
98
99
# File 'lib/archangel.rb', line 97

def reserved_page_keywords
  %i[auth_path backend_path frontend_path]
end

.themesArray

Available themes

Example

Archangel.themes #=> ["default"]
Archangel.themes #=> ["default", "my_theme"]

Returns:

  • (Array)

    available themes


84
85
86
# File 'lib/archangel.rb', line 84

def themes
  [THEME_DEFAULT] + THEMES
end

.translate(*args) ⇒ String Also known as: t

Translate

Example

# config/locales/en.yml
en:
  archangel:
    hello: Hello
    foo:
      bar: Bar

Archangel.translate(:hello) #=> "Hello"
Archangel.translate(:bar, scope: :foo) #=> "Bar"
Archangel.t(:hello) #=> "Hello"
Archangel.t(:bar, scope: :foo) #=> "Bar"
I18n.t(:hello, scope: :archangel) #=> "Hello"
I18n.translate(:hello, scope: :archangel) #=> "Hello"

Parameters:

  • args (String, Array)

    translation parameters

Returns:

  • (String)

    the translated string


32
33
34
35
36
37
38
# File 'lib/archangel/i18n.rb', line 32

def translate(*args)
  options = args.extract_options!
  options[:scope] = [*options[:scope]].unshift(:archangel)
  args << options

  super(*args)
end

.versionString

Archangel version

Returns:

  • (String)

    current version


17
18
19
# File 'lib/archangel/version.rb', line 17

def self.version
  VERSION
end