whoisonline.tpl 2.0 KB

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