All pastes #2087178 Raw Edit

Someone

public text v1 · immutable
#2087178 ·published 2011-10-05 18:39 UTC
rendered paste body
function (head, req) {
  var Mustache = require("vendor/couchapp/lib/mustache");

  start({
    "headers": { "Content-Type": "text/html" }
  });

  var stash   = {};
  while (row = getRow()) {
    var affair = row.key;

    if (row.key == affair ) {
      var actions = [];
      actions.push(row.value[0]);
      stash.actions = actions;
      send(Mustache.to_html(this.templates.nextaction, stash));
    } else {
      stash.affair = affair;
      actions = [];
      //stash.nextaction = action;
      send(Mustache.to_html(this.templates.nextaction, stash));
    }
  }
}