delettion

This commit is contained in:
gauthiier
2019-12-26 11:42:35 +01:00
parent 45393ec97d
commit f159ac9454
8 changed files with 152 additions and 307 deletions
+5
View File
@@ -48,6 +48,11 @@ def tags_w_lists():
if a == "dump":
if sel.commit_from_selection():
return "done"
if a == "delete":
if sel.delete_url(data.get('tag'), data.get('url')):
return "ok"
return "-"
@app.route('/report')
def report():
+4
View File
@@ -36,3 +36,7 @@ bb {
width: 100%;
margin-top: 0.5em;
}
li button {
margin-top: 0em;
}
+9
View File
@@ -17,6 +17,15 @@ $(document).ready(function(){
});
});
$('.del').click(function(e) {
var li = $(this).parent("li");
$.post('/tags_w_lists', {'action': 'delete', 'tag': li.data("tag"), 'url': li.data("url")}, function(d) {
if(d === 'ok') {
location.reload();
}
});
});
$('#new').click(function(e) {
var v = $(this).text();
console.log(v)
+1 -1
View File
@@ -23,7 +23,7 @@
<lists>
<ul>
{% for h in v.lists %}
<li><a href="{{h.url}}" target="_blank">{{h.subject}}</a> -- <i>{{h.author_name}}</i></li>
<li data-tag="{{v.tag}}" data-url="{{h.url}}"><a href="{{h.url}}" target="_blank">{{h.subject}}</a> -- <i>{{h.author_name}}</i> <button class="del">del</button></li>
{% endfor %}
</ul>
</lists>