Löschen von Nachrichten aus dem Archiv implementiert. Dies Löst #2
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
<th>Date</th>
|
||||
<th>From</th>
|
||||
<th>Subject</th>
|
||||
«if (data.moderator)»
|
||||
<th>Actions</th>
|
||||
«endif»
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -16,6 +16,10 @@ function dropList(listEmail){
|
||||
$.post('/api/list/drop',{list:listEmail},showListResult,'json');
|
||||
}
|
||||
|
||||
function dropMail(mailId){
|
||||
$.post('/api/mail/drop',{message_id:mailId},showListResult,'json');
|
||||
}
|
||||
|
||||
function dropMember(userEmail,listEmail){
|
||||
$.post('/api/list/drop_member',{list:listEmail,email:userEmail},reload,'json');
|
||||
}
|
||||
@@ -78,6 +82,8 @@ function showList(listEmail){
|
||||
|
||||
function showListArchive(data){
|
||||
console.log(data);
|
||||
let moderator = data.archive.moderator;
|
||||
console.log('moderator: ',moderator);
|
||||
let posts = data.archive.posts;
|
||||
for (let time in posts){
|
||||
let post = posts[time];
|
||||
@@ -86,6 +92,9 @@ function showListArchive(data){
|
||||
$('<td/>').html('<a href="'+url+'">'+post.date+'</a>').appendTo(row);
|
||||
$('<td/>').html('<a href="'+url+'">'+post.from_name+'</a>').appendTo(row);
|
||||
$('<td/>').html('<a href="'+url+'">'+post.subject+'</a>').appendTo(row);
|
||||
if (moderator){
|
||||
$('<button/>',{onclick:"dropMail('"+post.id+"');"}).text('Delete').appendTo($('<td/>')).appendTo(row);
|
||||
}
|
||||
row.appendTo($('#archive table'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user