changeset 20:a8887fb93676

hide share data from the public. bug in links filter box Ignore-this: 2a390b207b8e9c8d430acd268b6d765d
author Drew Perttula <drewp@bigasterisk.com>
date Sun, 17 Mar 2013 01:03:43 -0700
parents 9fc1f5c8aa4e
children 8008ec2fd763
files lookup.py static/links.js template/links.jade.mustache
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lookup.py	Sun Mar 17 00:49:27 2013 -0700
+++ b/lookup.py	Sun Mar 17 01:03:43 2013 -0700
@@ -153,6 +153,7 @@
     data['toRoot'] = toRoot
     data['allTags'] = allTags(user)
     data['user'] = user
+    data['showPrivateData'] = (user == getUser()[0])
 
     data['pageTags'] = [{"word":t} for t in tags]
     data['stats']['template'] = 'TEMPLATETIME'
--- a/static/links.js	Sun Mar 17 00:49:27 2013 -0700
+++ b/static/links.js	Sun Mar 17 01:03:43 2013 -0700
@@ -86,9 +86,11 @@
         console.log("ch", ev.val);
     },
     initSelection: function (element, callback) {
-           var data = [];
+        var data = [];
         $(element.val().split(",")).each(function () {
-            data.push({id: this, text: this});
+            if (this != "") {
+                data.push({id: this, text: this});
+            }
         });
         callback(data);
     }
--- a/template/links.jade.mustache	Sun Mar 17 00:49:27 2013 -0700
+++ b/template/links.jade.mustache	Sun Mar 17 01:03:43 2013 -0700
@@ -37,12 +37,14 @@
         a(href="{{href}}") {{href}}
       .modified
         | Modified: {{t}}
+      {{#showPrivateData}}
       .shareWith
         | Share with:
         {{#shareWith}}
         span.person
           | {{label}}
         {{/shareWith}}
+      {{/showPrivateData}}
       .edit
         a(href="{{toRoot}}/{{editLink}}") Edit