As of 01/15/15 this project is deprecated in favor of Plumage
Feather is an example of a Couchapp, and can be used to create JSON endpoints for all sorts of data.
You'll need to have
CouchDB installed. Run
npm install
for dependencies.
- copy
couch_config.sample.json
tocouch_config.json
and update the values - copy
_attachments/js/config.sample.js
to_attachments/js/config.js
and update the values - run
grunt mkcouchdb:public
to create a new database from your configuration - run
grunt couchapp:public
to populate the database you created - go to http:///<db_name>/_design/<db_name>/index.html and begin inputting data
NOTE: I'm currently using a patched version of grunt-couchapp
because the
version on npm doesn't allow basic auth. I'll remove and re-add to
package.json
if the pull request is accepted.
Fill in your db info in the Gruntfile under couch_config
. Run grunt mkcouchdb
to create the database and grunt rmcouchdb
to remove it. If you
want to use a different database name, you'll also need to edit app.js
.
You can edit the CMS functionality in _attachments
. Feather uses backbone.js.
You can also set up custom views to use as API endpoints in app.js
.
Example data where you have fields of lot, plan, elevation, reverse, x and y.
This is what you could run in the console if you have same 100+ sites to fill in based off your generated data from the site map plotter.
var sites = [
{"lot":"imaginary-1","plan":1,"elevation":"A","reverse":true,"x":669,"y":367},
{"lot":"imaginary-2","plan":3,"elevation":"C","reverse":false,"x":668,"y":400},
{"lot":"imaginary-3","plan":2,"elevation":"A","reverse":true,"x":668,"y":434},
{"lot":"imaginary-4","plan":3,"elevation":"A","reverse":true,"x":666,"y":465},
{"lot":"imaginary-5","plan":2,"elevation":"C","reverse":false,"x":670,"y":499},
];
for(var i = 0; i < sites.length; i++) {
$('#addItem').click();
}
$('form.item').each(function(i, obj) {
$(this).find('input[name="lot"]').attr('value', sites[i]['lot']);
$(this).find('input[name="plan"]').attr('value', sites[i]['plan']);
$(this).find('input[name="x"]').attr('value', sites[i]['x']);
$(this).find('input[name="y"]').attr('value', sites[i]['y']);
$(this).find('input[name="elevation"]').attr('value', sites[i]['elevation']);
if(sites[i]['reverse']) {
$(this).find('input[name="reverse"]').prop('checked', true);
}
$(this).find('option[value="available"]').prop('selected', true);
$(this).find('button.submit').click();
});
###License
MIT