GithubHelp home page GithubHelp logo

oldhammade / adminable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from revelrylabs/adminable

0.0 1.0 0.0 88 KB

Allows creating admin interfaces through implementing the `Adminable` behaviour

License: MIT License

Elixir 75.53% Shell 3.04% HTML 21.43%

adminable's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.