fix: [term_management] delete emails

This commit is contained in:
Terrtia 2018-11-08 10:41:37 +01:00
parent 0adb8b4624
commit 4e906ff841
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 16 additions and 12 deletions

View file

@ -459,7 +459,7 @@ def delete_terms_email():
if term is not None and email is not None:
r_serv_term.srem(TrackedTermsNotificationEmailsPrefix_Name + term, email)
return 'sucess'
return redirect(url_for('terms.terms_management'))
else:
return 'None args', 400

View file

@ -190,7 +190,11 @@
</p></td>
<td>
{% for email in notificationEMailTermMapping[set] %}
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email"><span class="glyphicon glyphicon-trash" style="color:Red;" onclick="delete_email('{{set}}', '{{email}}')"></span></div>
<a href="{{ url_for('terms.delete_terms_email') }}?email={{email}}&term={{set}}">
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email">
<span class="glyphicon glyphicon-trash" style="color:Red;" ></span>
</div>
</a>
{{ email }}
<br>
{% endfor %}
@ -263,7 +267,11 @@
</p></td>
<td>
{% for email in notificationEMailTermMapping[regex] %}
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email"><span class="glyphicon glyphicon-trash" style="color:Red;" onclick="delete_email('{{regex}}', '{{email}}')"></span></div>
<a href="{{ url_for('terms.delete_terms_email') }}?email={{email}}&term={{regex}}">
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email">
<span class="glyphicon glyphicon-trash" style="color:Red;"></span>
</div>
</a>
{{ email }}
<br>
{% endfor %}
@ -336,7 +344,11 @@
</p></td>
<td>
{% for email in notificationEMailTermMapping[term] %}
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email"><span class="glyphicon glyphicon-trash" style="color:Red;" onclick="delete_email('{{term}}', '{{email}}')"></span></div>
<a href="{{ url_for('terms.delete_terms_email') }}?email={{email}}&term={{term}}">
<div class="btn-link btn-interaction pull-right mouse_pointer" data-toggle="tooltip" data-placement="left" data-original-title="Remove this email">
<span class="glyphicon glyphicon-trash" style="color:Red;"></span>
</div>
</a>
{{ email }}
<br>
{% endfor %}
@ -576,12 +588,4 @@ function perform_operation(){
});
}
}
function delete_email(term, email){
$.get("{{ url_for('terms.delete_terms_email') }}", { term: term, email: email }, function(data, status){
if(status == "success") {
window.location.reload(false);
}
});
}
</script>