{% extends "base.html" %} {% block content %} <script> function edit_configuration(pk){ var csrf = $('input[name="csrfmiddlewaretoken"]').val(); $.ajax({ type: "POST", url: "/", data: { "target": pk, "create": 2, "csrfmiddlewaretoken": csrf}, beforeSend: function(request) { request.setRequestHeader("X-CSFRToken", csrf); } }).done(function(){ window.location.replace("/wf/"); }).fail(function(){}); } </script> {% for config in configurations %} <div class="detail_card"> <ul> <li>id: {{config.id}}</li> <li>name: {{config.name}}</li> <li>description: {{config.description}}</li> <li>resource: {{config.bundle}}</li> </ul> <div class="detail_btn_group"> <button style="display: none" class="btn" onclick="edit_configuration({{config.id}});">Edit</button> </div> </div> {% endfor %} {% endblock %}