2020-03-01 16:36:49 +00:00
|
|
|
{% extends "member/profile_detail.html" %}
|
2020-02-28 12:37:31 +00:00
|
|
|
{% load i18n static pretty_money django_tables2 crispy_forms_tags %}
|
|
|
|
|
2020-03-01 16:36:49 +00:00
|
|
|
{% block profile_content %}
|
2020-03-25 17:00:40 +00:00
|
|
|
{% include "member/alias_update.html"%}
|
2020-02-28 12:37:31 +00:00
|
|
|
{% endblock %}
|
2020-03-26 16:48:17 +00:00
|
|
|
|
|
|
|
{% block extrajavascript %}
|
|
|
|
<script>
|
|
|
|
function create_alias(note_id){
|
|
|
|
$.post("/api/note/alias/",
|
|
|
|
{
|
|
|
|
"csrfmiddlewaretoken": CSRF_TOKEN,
|
|
|
|
"name": $("#alias_input").val(),
|
|
|
|
"note": note_id
|
|
|
|
}
|
|
|
|
).done(function(){
|
|
|
|
$("#alias_table").load("{% url 'member:user_alias' object.pk %} #alias_table");
|
|
|
|
})
|
|
|
|
.fail(function(xhr, textStatus, error){
|
|
|
|
addMsg(xhr.responseJSON.name[0],'danger');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// on click of button "delete" , call the API
|
|
|
|
function delete_button(button_id){
|
|
|
|
$.ajax({
|
|
|
|
url:"/api/note/alias/"+button_id+"/",
|
|
|
|
method:"DELETE",
|
|
|
|
headers: {"X-CSRFTOKEN": CSRF_TOKEN}
|
|
|
|
})
|
|
|
|
.done(function(){
|
|
|
|
addMsg('{% trans "alias successfully deleted "%}','success');
|
|
|
|
$("#alias_table").load("{% url 'member:user_alias' object.pk %} #alias_table");
|
|
|
|
})
|
|
|
|
.fail(function(){
|
|
|
|
addMsg(' {% trans "Unable to delete alias "%} #' + button_id,'danger' )
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock%}
|