whoisonline.tpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {% extends template ~ "/layout/layout_1_col.tpl" %}
  2. {% block content %}
  3. <div class="row">
  4. <div class="col-md-12">
  5. {% if social_search %}
  6. <div class="search-user">
  7. <div class="panel panel-default">
  8. <div class="panel-heading">
  9. {{ 'SearchUsers' | get_lang}}
  10. </div>
  11. <div class="panel-body">
  12. {{ social_search }}
  13. </div>
  14. </div>
  15. </div>
  16. {% endif %}
  17. <div id="whoisonline">
  18. {{ whoisonline }}
  19. </div>
  20. </div>
  21. </div>
  22. <script>
  23. $(document).ready(function() {
  24. $('#whoisonline').on('click', 'a#link_load_more_items', function() {
  25. page = $("#link_load_more_items").attr("data_link");
  26. $.ajax({
  27. beforeSend: function(objeto) {
  28. $("#display_response_id").html('<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>');
  29. },
  30. type: "GET",
  31. url: "main/inc/ajax/online.ajax.php?a=load_online_user",
  32. data: "online_page_nr="+page,
  33. success: function(data) {
  34. $("#display_response_id").html('');
  35. if (data != "end") {
  36. $("#link_load_more_items").remove();
  37. var last = $("#whoisonline");
  38. last.append(data);
  39. } else {
  40. $("#link_load_more_items").remove();
  41. }
  42. }
  43. });
  44. });
  45. });
  46. </script>
  47. {% endblock %}