Formage
Bootstraped Admin GUI addon for Mongoose, JugglingDB, or just as a form generator. Originally forked from mongoose-admin.
Example Usage
var express = app = ; ;
Look at the \example
directory.
Options
// Site-wide options, and their default values;
Model options
var model = 'songs' schema; // external files specific to this modelmodelheader_lines = '<script src="/js/songs.js"></script>' '<style href="/css/songs.css"></style>'; modelformage = // 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' { console; ; } // 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.
- String
- Boolean
- Number
- Date
- Time
- Enum (select2)
- Ref (select2)
- Text (
<textarea>
) - HTML (ckeditor)
- FilePicker (File Picker)
- Picture (Cloudinary)
- GeoPoint (Google Maps)
You can pass options to the underlying fields and widgets:
var schema = artist: type: String label: 'Who made it?' location: type: SchemaTypesGeoPoint widget_options: lang: 'nl' ;
(The map widget lang setting is a two-letter ISO 639-1 code.)
Hmm
License
MIT