gamesystem_detail.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {% extends "base.html" %}
  2. {% block page_title %}{{object.name}}{% endblock %}
  3. {% block title %}{{object.name}}{% endblock %}
  4. {% block head_extra %}
  5. <script>
  6. $(document).ready(function () {
  7. console.log('Loading this code');
  8. $('#{{object.retropie_slug}}-update-form').submit(function(event){
  9. console.log('Form submitted');
  10. event.preventDefault();
  11. $.ajax({
  12. url : '/library/update/?game_systems={{object.retropie_slug}}',
  13. type : "GET",
  14. success : function(json) {
  15. $('#{{object.retropie_slug}}-update-form').html("<button id='library-update-btn' class='btn btn-warning my-2 my-sm-0' type='submit' disabled>Update {{object.name}}</button>");
  16. console.log(json);
  17. },
  18. error : function(xhr,errmsg,err) {
  19. console.log(xhr.status + ": " + xhr.responseText);
  20. }
  21. });
  22. });
  23. });
  24. </script>
  25. {% endblock %}
  26. {% block content %}
  27. <h4>Browsing {{object_list.count}} games</h4>
  28. <form id="{{object.retropie_slug}}-update-form" class="my-2 my-lg-0" method="get">
  29. <button id="{{object.retropie_slug}}-update-btn" class="btn btn-warning my-2 my-sm-0" type="submit" {% if update_in_progress %}disabled{% endif %}>Update {{object.name}}</button>
  30. </form>
  31. &nbsp;
  32. <div class="d-flex flex-column">
  33. <div class="image-grid-container">
  34. {% for game in object_list %}
  35. {% include "games/_game_card.html" %}
  36. {% endfor %}
  37. </div>
  38. </div>
  39. {% include "games/_pagination.html" %}
  40. {% endblock %}