Alkemist v1.0.1-rc Alkemist.Config

This module encapsulates all config.exs options

Usage:

config.exs:

config :alkemist, Alkemist,

# required - set your app's Ecto Repo
repo: MyApp.Repo,

# required - set your app's cache_folder, should be named the same as your Web Interface Module
web_interface: "MyAppWeb",

# required when using the auto generated code
router_helpers: MyAppWeb.Router.Helpers,

# set a prefix on the global level - this will be prepended to the auto-generated routes if it is set
route_prefix: :admin,

# Set a custom logo (optional), must be placed in the asset folder.
logo: "logo.svg",

# Set a custom title or brand name (optional)
title: "MyApp",

# implement a custom Authorization Provider (optional)
authorization_provider: MyApp.Authorization,

# custom implementations for search and pagination (optional)
query: [
  search: Alkemist.Query.Search,
  paginate: Alkemist.Query.Paginate
],

# use custom views (optional)
views: [
  # use a custom layout view, default is {Alkemist.LayoutView, "app.html"}
  layout: {MyAppWeb.LayoutView, "app.html"},

  # custom view partial for the right header menu, default {Alkemist.LayoutView, "_right_header.html"}
  right_header: {MyAppWeb.SharedView, "header_right.html"},

  # custom view partial for the left header menu, default {Alkemist.LayoutView, "_left_header.html"}
  left_header: {MyAppWeb.SharedView, "header_left.html"}

  # custom view partial for the sidebar to render the left menu, default `{Alkemist.LayoutView, "_sidebar_navigation.html"}`
  sidebar: {MyAppWeb.SharedView, "sidebar.html"},

  # custom view partial for the right sidebar. By default it renders the filters
  aside: {MyAppWeb.SharedView, "aside.html"}

  # use a custom css
  styles: {MyApp.SharedView, "styles.html"}

  # use a custom js
  scripts: {MyApp.SharedView, "scripts.html"}
],

# Render custom form templates for filter and new/edit forms
decorators: [
  filter: {MyApp.SearchView, :filter_decorator},
  form: {MyApp.FormView, :form_field_decorator}
]

Link to this section Summary

Functions

Returns the configured authorization provider from alkemist configuration

Returns the decorator for given areaa

Returns the decorator for form fields

Returns a value from the configuration or the default value

Returns the configured layout from alkemist configuration or the default

Returns the pagination provider to use by default

Returns the configured Repo from alkemist configuration

Returns the prefix or scope for the routes

Returns the configured router helpers from alkemist configuration

Returns the search hook to use by default

Link to this section Functions

Link to this function authorization_provider(application \\ :alkemist)

Returns the configured authorization provider from alkemist configuration

Link to this function filter_decorator(application \\ :alkemist)

Returns the decorator for given areaa

Link to this function form_field_decorator(application \\ :alkemist)

Returns the decorator for form fields

Link to this function get(key, application \\ :alkemist)

Returns a value from the configuration or the default value

Link to this function layout(application \\ :alkemist)

Returns the configured layout from alkemist configuration or the default

Link to this function pagination_provider(application \\ :alkemist)

Returns the pagination provider to use by default

Link to this function repo(application \\ :alkemist)

Returns the configured Repo from alkemist configuration

Link to this function route_prefix(application \\ :alkemist)

Returns the prefix or scope for the routes

Link to this function router_helpers(application \\ :alkemist)

Returns the configured router helpers from alkemist configuration

Link to this function search_provider(application \\ :alkemist)

Returns the search hook to use by default