old_contents: function (doc, req) {
      // !json templates.page
  
      var mustache = require("vendor/couchapp/lib/mustache");
  
      var path;
      if (typeof(req.path[5]) === 'undefined') {
          path = "../"
      } else {
          path = "../../"
      }
  
      data = {
          attachment_path: path,
          version: 1.0,
          errormessage: "hey",
          cipherdata: typeof(req.path[5])
      }
      return mustache.to_html(this.templates.page, data);
  }
  
new_contents: function (doc, req) {
      // !json templates.page
  
      var mustache = require("vendor/couchapp/lib/mustache");
  
      var path, cipherdata, errormessage;
  
      if (req.raw_path.substr(-4) == 'main') {
          path = "../";
      } else {
          path = "../../";
      }
  
      if (doc) {
          cipherdata = doc.content;
      } else {
          cipherdata = null;
      }
  
      data = {
          attachment_path: path,
          version: 1.0,
          cipherdata: cipherdata
      }
      return mustache.to_html(this.templates.page, data);
  }
  
subject: Fix path to main app