implement feed deletion

master
Benjamin 'blindCoder' Schieder 2017-04-22 20:55:50 +02:00
parent 647d913dba
commit 564c0f52b5
3 changed files with 16 additions and 2 deletions

View File

@ -22,7 +22,11 @@ sub fill_content {
my @param_feeds;
my $count = 0;
foreach my $feed (@feeds){
FEED: foreach my $feed (@feeds){
if ($main::FORM{delete} and "x".$main::FORM{delete} eq "x".$feed->{data}->{ID}){
$feed->delete();
next FEED;
}
my %r;
$count++;
$r{"count"} = $count;

View File

@ -0,0 +1,9 @@
function TweetodonOnReady(){
$("a.deleteFeed").on("click", function(){
var btn = $(this);
if (confirm("Really delete this feed?")){
var l = "index.pl?mode=Dashboard&delete="+btn.data("id");
document.location.href=l;
}
});
}

View File

@ -49,11 +49,12 @@
<td><TMPL_VAR NAME="count"></td>
<td><TMPL_VAR NAME="url"></td>
<td><a class="btn btn-default" href="index.pl?mode=EditFeed&id=<TMPL_VAR NAME="ID">">Edit</a></td>
<td><a class="btn btn-danger">Delete</a></td>
<td><a class="btn btn-danger deleteFeed" href="#" data-id="<TMPL_VAR NAME="ID">">Delete</a></td>
</tr>
</TMPL_LOOP>
</tbody>
</table>
<a class="btn btn-primary">Add new feed</a>
</div>
</div>
</div>