diff options
author | Leif Johansson <leifj@sunet.se> | 2012-02-09 22:21:05 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-02-09 22:21:05 +0100 |
commit | ae821d0696be63c31bd5a325298cfa8eee3b48cb (patch) | |
tree | 03a9f067827825b7a86db9ddd41ed0ac336c67e5 /src/templates | |
parent | 1b769af104c1d1c8d41cb6b0482c7eb67b7b8517 (diff) |
occupation-refresh-button with nice js spinner
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/apps/room/list.html | 13 | ||||
-rw-r--r-- | src/templates/base.html | 2 |
2 files changed, 13 insertions, 2 deletions
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 %} <div id="rooms"> {% for r in rooms %} - <div id="{{r.id}}"> + <div class="room" id="{{r.id}}"> <h3><a href="#{{r.id}}" class="listheader">{{r.name}}</a></h3> <div> {% tags_for_object r as tags %} @@ -33,7 +42,7 @@ <ul class="nlist square" style="padding-left: 2px;"> <li>» Tags: {% for tag in tags %}<a style="margin-right: 5px;" class="ui-widget" href="{% prefix %}/room/+{{tag}}">{{tag}}</a>{% endfor %} {%if edit %}<a style="font-size: 75%;" href="{% prefix %}/room/{{r.id}}/tag"><em>... manage room tags</em></a>{%endif%}</li> <li>» Created by {{r.creator}} {{r.timecreated|datehumanize}}.</li> - <li>» {%if r.nusers%}There are {{r.nusers}} users present, {{r.nhosts}} of whom are hosts.{%else%}The room is currently unoccupied.{%endif%}</li> + <li>» <span class="occupation"><span class="occupation-info">{%if r.nusers%}There are {{r.nusers}} users present, {{r.nhosts}} of whom are hosts.{%else%}The room is currently unoccupied.{%endif%}</span><span class="ui-icon ui-icon-refresh"></span></span></li> {% if r.self_cleaning %}<li>» Room will be reset when empty.</li>{%else%}<li>» Room state is preserved between sessions.</li>{% endif %} {% if r.allow_host %}<li>» First participant can elect to become host.</li>{% endif %} {% if r.lastvisited %}<li>» Last visited {{r.lastvisited|datehumanize}}</li>{%endif%} diff --git a/src/templates/base.html b/src/templates/base.html index e0b3ac4..6b6d19b 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -18,6 +18,8 @@ <script type="text/javascript" src="{% prefix %}/site-media/js/jquery.meetingtools.js"></script> <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="{% prefix %}/site-media/js/excanvas.min.js"></script><![endif]--> <script type="text/javascript" src="{% prefix %}/site-media/js/jquery.flot.min.js"></script> + <script type="text/javascript" src="{% prefix %}/site-media/js/spin.min.js"></script> + <script type="text/javascript" src="{% prefix %}/site-media/js/jquery.spin.js"></script> <!--[if IE]> <link href="css/sunet-ie6.css" rel="stylesheet" type="text/css" /> <![endif]--> |