|
@@ -11,7 +11,26 @@
|
|
|
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.10/clipboard.min.js"></script>
|
|
|
+ <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>
|
|
|
|
|
|
<style type="text/css">
|
|
|
dl {
|
|
@@ -89,7 +108,11 @@
|
|
|
</ul>
|
|
|
<form class="form-inline my-2 my-lg-0" method="get" action="{% url 'search:search' %}">
|
|
|
<input class="form-control mr-sm-2" name="q" type="search" placeholder="Search" aria-label="Search">
|
|
|
- <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
|
|
+ <button class="btn btn-primary my-2 my-sm-0" type="submit">Search</button>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <form id="library-update-form" class="form-inline my-2 my-lg-0" method="get" action="{% url 'games:game_library_update' %}">
|
|
|
+ <button id="library-update-btn" class="btn btn-warning my-2 my-sm-0" type="submit" {% if update_in_progress %}disabled{% endif %}>Update</button>
|
|
|
</form>
|
|
|
</div>
|
|
|
<a class="nav-link" href="{% url 'account_logout' %}">Logout<span class="sr-only"></span></a>
|