Modified configs so that templates are rendered. Functionality and styling are NOT complete (need to change css framework)

This commit is contained in:
Matthew Smith
2019-10-01 18:10:34 +01:00
parent 1df971bbba
commit 6cff7c090c
13 changed files with 77 additions and 30 deletions

View File

@@ -4,7 +4,7 @@
{% block title %}Asset {{ object.asset_id }}{% endblock %}
{% block main %}
{% block content %}
<h4>
{% if edit and object %}
@@ -294,7 +294,26 @@
{% endblock %}
{% block script %}
{% block js %}
<script>
function updateAsset() {
$.ajax({
url: "{% url 'ajax_asset_update' %}", // the endpoint
type: "POST", // http method
data: {
form: $('#asset_update_form').serialize()
},
traditional: true,
success: function (data) {
// console.log(data);
window.location.href = data['url'];
},
error: function (xhr) { console.log(xhr.status + ": " + xhr.responseText) }
});
}
</script>
{# <script>#}
{# $('#asset_update_form').on('submit', function(event){#}
@@ -323,5 +342,4 @@
M.updateTextFields();
})
</script>
{% endblock %}