whoisonline.tpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {% extends 'layout/layout_1_col.tpl'|get_template %}
  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. <div id="user-list" class="row">
  19. {{ whoisonline }}
  20. </div>
  21. <div class="col-md-12">
  22. <a class="btn btn-large btn-default" id="link_load_more_items" data_link="2" >{{ 'More' | get_lang }}</a>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <script>
  28. $(document).ready(function() {
  29. $("#link_load_more_items").click(function() {
  30. page = $("#link_load_more_items").attr("data_link");
  31. $.ajax({
  32. beforeSend: function() {
  33. $("#link_load_more_items").html("{{ 'Loading' | get_lang|escape('js') }} <em class='fa fa-spinner fa-pulse fa-fw'></em>");
  34. },
  35. type: "GET",
  36. url: "main/inc/ajax/online.ajax.php?a=load_online_user",
  37. data: "online_page_nr=" + page,
  38. success: function(data) {
  39. if (data != "end") {
  40. $("#link_load_more_items").attr("data_link", parseInt(page) + 1);
  41. $("#user-list").append(data);
  42. $("#link_load_more_items").html("{{ 'More' | get_lang|escape('js')}}");
  43. } else {
  44. $("#link_load_more_items").remove();
  45. }
  46. }
  47. });
  48. });
  49. });
  50. </script>
  51. {% endblock %}