Add tag delete button to specific tag page.

On the main tag listing, for child tags, you only get an unlink
button on hover. So if you want to delete a child tag you'd have to
unlink, then refresh, then delete. Now you can just go to its page
and delete it there.
master
voussoir 2020-02-27 14:57:27 -08:00
parent 3f2cde02e1
commit 9ac91d3850
2 changed files with 24 additions and 0 deletions

View File

@ -281,6 +281,18 @@ function remove_synonym(tag_name, syn_name, callback)
common.post(url, data, callback);
}
api.tags.callback_go_to_tags =
function callback_go_to_tags(response)
{
if (response["meta"]["status"] == 200)
{
window.location.href = "/tags";
}
else
{
console.log(response);
}
}
/**************************************************************************************************/
api.users = {};

View File

@ -125,6 +125,18 @@ h2, h3
</pre>
</div>
<button class="green_button editor_toolbox_placeholder">Edit</button>
<button
class="red_button button_with_confirm"
data-onclick="api.tags.delete('{{specific_tag.name}}', api.tags.callback_go_to_tags);"
data-prompt="Delete Tag?"
data-confirm="Delete"
data-confirm-class="red_button"
data-cancel-class="gray_button"
>
Delete
</button>
</div>
{% set parents = specific_tag.get_parents() %}