From ae821d0696be63c31bd5a325298cfa8eee3b48cb Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 9 Feb 2012 22:21:05 +0100 Subject: occupation-refresh-button with nice js spinner --- src/templates/apps/room/list.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/templates/apps/room/list.html') diff --git a/src/templates/apps/room/list.html b/src/templates/apps/room/list.html index a21848f..34f5b6e 100644 --- a/src/templates/apps/room/list.html +++ b/src/templates/apps/room/list.html @@ -12,6 +12,15 @@ animated: true, autoHeight: false }); + $(".occupation").click(function(e) { + $(this).find(".occupation-info").first().load("{% prefix %}/api/room/"+$(this).parents('.room').first().attr('id')+"/occupation") + }); + $(".occupation").ajaxStart(function() { + $(".occupation > span.ui-icon-refresh").removeClass("ui-icon-refresh").removeClass("ui-icon").addClass("spinner").spin("custom"); + }).ajaxStop(function() { + $(".occupation > span.spinner").spin(false); + $(".occupation > span.spinner").addClass("ui-icon-refresh").addClass("ui-icon").removeClass("spinner"); + }); {% endblock %} {% block meta %} {% if tags %} @@ -24,7 +33,7 @@ {% if rooms %}
{% for r in rooms %} -
+

{{r.name}}

{% tags_for_object r as tags %} @@ -33,7 +42,7 @@
  • » Tags: {% for tag in tags %}{{tag}}{% endfor %} {%if edit %}... manage room tags{%endif%}
  • » Created by {{r.creator}} {{r.timecreated|datehumanize}}.
  • -
  • » {%if r.nusers%}There are {{r.nusers}} users present, {{r.nhosts}} of whom are hosts.{%else%}The room is currently unoccupied.{%endif%}
  • +
  • » {%if r.nusers%}There are {{r.nusers}} users present, {{r.nhosts}} of whom are hosts.{%else%}The room is currently unoccupied.{%endif%}
  • {% if r.self_cleaning %}
  • » Room will be reset when empty.
  • {%else%}
  • » Room state is preserved between sessions.
  • {% endif %} {% if r.allow_host %}
  • » First participant can elect to become host.
  • {% endif %} {% if r.lastvisited %}
  • » Last visited {{r.lastvisited|datehumanize}}
  • {%endif%} -- cgit v1.1