diff options
author | Dan McGee <dan@archlinux.org> | 2014-12-02 15:13:24 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-12-02 15:13:24 -0600 |
commit | 0fc409ef089ed35f545d0f9fdef53f42bbe5be50 (patch) | |
tree | 612cee1866b64df400f0b8c3609ebe5e0252063a | |
parent | 92437ffb21b42c5e2b58af496448f64e8292442b (diff) |
Make dev stats section look better when loading
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | templates/devel/index.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/templates/devel/index.html b/templates/devel/index.html index 147917a0..e9330734 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -157,8 +157,11 @@ </ul> </div>{# #dev-dashboard #} -<div id='stats-area'> - <p>Enable Javascript to get more useful info here.</p> +<div id="stats-area"> + <div class="box"> + <h2>Developer Stats</h2> + <p id="stats-message">Enable JavaScript to get more useful info here.</p> + </div> </div> {% endblock %} @@ -167,8 +170,12 @@ <script type="text/javascript" src="{% static "archweb.js" %}"></script> <script type="text/javascript"> $(document).ready(function() { - $("#stats-area").html('<p>Loading stats…</p>'); - $("#stats-area").load('stats/', function() { + $("#stats-message").html('Loading developer stats…'); + $("#stats-area").load('stats/', function(response, status, xhr) { + if (status === 'error' || status === 'timeout') { + $("#stats-message").html('Developer stats loading encountered an error. Sorry.'); + return; + } var settings = { widgets: ['zebra'], sortList: [[0,0]], |