diff --git a/static/paper_list.js b/static/paper_list.js index 69c91cd..30458f5 100644 --- a/static/paper_list.js +++ b/static/paper_list.js @@ -14,6 +14,7 @@ const UTag = props => { const Paper = props => { const p = props.paper; + const adder = () => fetch("/add/" + p.id + "/" + prompt("tag to add to this paper:")) .then(response => console.log(response.text())); const subber = () => fetch("/sub/" + p.id + "/" + prompt("tag to subtract from this paper:")) @@ -22,6 +23,18 @@ const Paper = props => { const similar_url = "/?rank=pid&pid=" + p.id; const inspect_url = "/inspect?pid=" + p.id; + // if the user is logged in then we can show add/sub buttons + let utag_controls = null; + if(user) { + utag_controls = ( +
+
+
+
-
+ {utags} +
+ ) + } + return (
{p.weight.toFixed(2)}
@@ -29,11 +42,7 @@ const Paper = props => {
{p.authors}
{p.time}
{p.tags}
-
-
+
-
-
- {utags} -
+ {utag_controls}
{p.summary}
similar
inspect
diff --git a/templates/base.html b/templates/base.html index 902bdef..02f8fdf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -10,6 +10,9 @@ + {% block variables %} {% endblock %}