Coder Social home page Coder Social logo

dbachrach / formage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from node4good/formage

0.0 2.0 0.0 6.62 MB

Bootstraped Admin GUI addon for mongoose, jugglingdb, or just as a form generator

Home Page: formage.io

License: MIT License

CSS 4.06% JavaScript 91.98% HTML 3.95%

formage's Introduction

Formage

Bootstraped Admin GUI addon for Mongoose, JugglingDB, or just as a form generator. Originally forked from mongoose-admin.

Build Status

NPM

Example Usage

var express = require('express'),
    app = express();

require('formage').init(app, express, models]);

Look at the \example directory.

Options

// Site-wide options, and their default values
require('formage').init(app, express, models, {
    title: 'Admin',
    root: '/admin',
    default_section: 'main',
    username: 'admin',
    password: 'admin',
    admin_users_gui: true
});

Model options

var model = new mongoose.model('songs', schema);

// external files specific to this model
model.header_lines = [
   '<script src="/js/songs.js"></script>',
   '<style href="/css/songs.css"></style>'
];

model.formage = {
    // one-document models
    is_single: true,

    // labels
    label: 'My Songs',
    singular: 'Song',

    filters: ['artist', 'year'],

    // additional actions on this model
    actions: [
       {
          id: 'release',
          label: 'Release',
          func: function (user, ids, callback) {
             console.log('You just released songs ' + ids);
             callback();
          }
       }
    ],

    // list of fields to be displayed by formage for this model
    list: ['number', 'title', 'album', 'artist', 'year'],
    
    // order documents, save order in this field (type: Number)
    sortable: 'order',

    // list of order fields
    order_by: ['-year', 'album', 'number'],

    // list of fields that must be populated
    // (see http://mongoosejs.com/docs/api.html#document_Document-populate)
    list_populate: ['album'],

    // list of fields on which full-text search is available
    search: ['title', 'album', 'artist']
};

Fields

Formage comes with the following built-in fields, but custom fields can be written if needed.

You can pass options to the underlying fields and widgets:

var schema = new mongoose.Schema({
    artist: { type: String, label: 'Who made it?' },
    location: { type: Schema.Types.GeoPoint, widget_options: { lang: 'nl' }}
});

(The map widget lang setting is a two-letter ISO 639-1 code.)

Hmm

License

MIT

Sponsor

formage's People

Contributors

alonronin avatar comartmit avatar dbachrach avatar eyy avatar ishai avatar jlopezr avatar laurentvb avatar leonardoalifraco avatar leweaver avatar mediabounds avatar moul avatar rogerz avatar

Watchers

 avatar  avatar

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.