adminable

Allows creating admin interfaces through implementing the `Adminable` behaviour

Latest version: 0.5.0 registry icon
Maintenance score
0
Safety score
0
Popularity score
73
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.5.0 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.1 0 0 0 0 0
0.3.0 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.1 0 0 0 0 0
0.1.0 0 0 0 0 0

Stability
Latest release:

0.5.0 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



Adminable

Create admin interfaces for Ecto Schemas in Phoenix apps

Based on blog post here

Installation

If available in Hex, the package can be installed by adding adminable to your list of dependencies in mix.exs:

def deps do
  [
    {:adminable, "~> 0.3.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/adminable.

Configuration

  • Add use Adminable to your Ecto Schema

    defmodule MyApp.User do
      use Ecto.Schema
      import Ecto.{Query, Changeset}, warn: false
      use Adminable
    
      ...
    end
  • optionally implement fields/0, create_changeset/2 and edit_changeset/2

  • Forward to Adminable.Router

scope "/admin" do
  pipe_through [:browser, :my, :other, :pipelines]

  forward("/", Adminable.Plug, [
    otp_app: :my_app,
    repo: MyApp.Repo,
    schemas: [MyApp.User],
    view_module: MyAppWeb.Adminable.AdminView,
    layout: {MyAppWeb.LayoutView, "app.html"}
  ])
end

Arguments

  • otp_app - Your app
  • repo - Your app's Repo
  • schemas - The schemas to make Admin sections for
  • view_module - (Optional) The view_module to use to display pages. Uses Adminable's view module by default. You can export the view to modify using mix adminable.gen.view MyWebModule
  • layout - (Optional) The layout to use

Exporting View and Templates

To export Adminable's AdminView and templates for modification, run:

mix adminable.gen.view MyWebModule