Add scripts to create myops-getqueryview:
[myops.git] / web / query / evently / account / loggedIn / data.js
1 function(e, r) {
2   var app = $$(this).app;
3   var path = app.require("vendor/couchapp/lib/path").init(app.req);
4   var data = {
5     name : r.userCtx.name,
6     uri_name : encodeURIComponent(r.userCtx.name),
7     auth_db : encodeURIComponent(r.info.authentication_db) 
8   };
9   if (r.userCtx.roles.indexOf("_admin") != -1 || r.userCtx.roles.indexOf("author") != -1) {
10     if (app.req.path.indexOf("post-page") == -1) {
11       data.postPath = path.show("edit")+"/";
12       data.postMessage = "New post.";
13     } else {
14       data.postPath = path.show("edit", app.req.query.startkey[0]);
15       data.postMessage = "Edit this post.";
16     }    
17   }
18   return data;
19 }