|
@@ -3,6 +3,29 @@
|
|
|
|
|
|
{% block title %}{{object.name}}{% endblock %}
|
|
|
|
|
|
+{% block extra_head %}
|
|
|
+ <script>
|
|
|
+ $('#library-update-form').on('submit', function(event){
|
|
|
+ event.preventDefault();
|
|
|
+ console.log("form submitted!") // sanity check
|
|
|
+ $.ajax({
|
|
|
+ url : "library/update/",
|
|
|
+ type : "GET",
|
|
|
+ // handle a successful response
|
|
|
+ success : function(json) {
|
|
|
+ $('#library-update-form').html("<button id='library-update-btn' class='btn btn-secondary my-2 my-sm-0' type='submit' disabled>Update</button>");
|
|
|
+ console.log(json); // log the returned json to the console
|
|
|
+ },
|
|
|
+
|
|
|
+ // handle a non-successful response
|
|
|
+ error : function(xhr,errmsg,err) {
|
|
|
+ console.log(xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
{% block content %}
|
|
|
<h4>Browsing {{object_list.count}} games</h4>
|
|
|
|