add ability to remove a tag from a paper as well
This commit is contained in:
@@ -14,19 +14,24 @@ const UTag = props => {
|
||||
|
||||
const Paper = props => {
|
||||
const p = props.paper;
|
||||
const adder = () => fetch("/add/" + p.id + "/" + prompt("tag name:"))
|
||||
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:"))
|
||||
.then(response => console.log(response.text()));
|
||||
const utags = p.utags.map((utxt, ix) => <UTag key={ix} tag={utxt} />);
|
||||
const similar_url = "/?rank=tags&pid=" + p.id;
|
||||
return (
|
||||
<div class='rel_paper'>
|
||||
<div class="rel_add" onClick={adder}>+</div>
|
||||
<div class="rel_score">{p.weight.toFixed(2)}</div>
|
||||
<div class='rel_title'><a href={'http://arxiv.org/abs/' + p.id}>{p.title}</a></div>
|
||||
<div class='rel_authors'>{p.authors}</div>
|
||||
<div class="rel_time">{p.time}</div>
|
||||
<div class='rel_tags'>{p.tags}</div>
|
||||
<div class='rel_utags'>{utags}</div>
|
||||
<div class='rel_utags'>
|
||||
<div class="rel_utag rel_utag_add" onClick={adder}>+</div>
|
||||
<div class="rel_utag rel_utag_sub" onClick={subber}>-</div>
|
||||
{utags}
|
||||
</div>
|
||||
<div class='rel_abs'>{p.summary}</div>
|
||||
<div class='rel_more'><a href={similar_url}>similar</a></div>
|
||||
</div>
|
||||
@@ -64,7 +69,7 @@ const TagList = props => {
|
||||
.then(response => console.log(response.text()));
|
||||
return (
|
||||
<div>
|
||||
<div class="rel_del" onClick={deleter}>-</div>
|
||||
<div class="rel_tag" onClick={deleter}>-</div>
|
||||
<div id="tagList" class="rel_utags">
|
||||
{tlst}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user