formage-admin

1.4.9 • Public • Published

Formage Admin

Bootstraped admin forms for Mongoose, originally forked from mongoose-admin.

Usage

npm install formage-admin

var admin = require('formage-admin').init(app, express);

Also, look at \example directory.

Some Options

// model options
model.label = 'My Songs';
model.singular = 'Song';
model.static = {
   js: [ '/js/songs.js' ],
   css: ['/css/songs.css' ]
};
model.formage = {
    filters: ['artist', 'year'],
    
    // Additional actions on this model
    actions: [
       {
          value: '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'],
    
    // 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']
};
 
// one-document models
model.single = true;
 
// field options
field.label = 'Song Title';

Sponsors

Package Sidebar

Install

npm i formage-admin

Weekly Downloads

41

Version

1.4.9

License

none

Last publish

Collaborators

  • ishai
  • amarfel
  • refack