From 97b27e4d78703ef9870b9cbb5389bf64feb5827a Mon Sep 17 00:00:00 2001 From: Sam Nicholls Date: Fri, 25 Jan 2013 20:14:44 +0000 Subject: [PATCH] Prevent profile breaking if no stats are returned [Fix #81] --- views/profile/profile.jade | 49 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/views/profile/profile.jade b/views/profile/profile.jade index 8588105..8ea224b 100644 --- a/views/profile/profile.jade +++ b/views/profile/profile.jade @@ -71,27 +71,28 @@ block content th Verbosity th Mentions tbody - for chan, key in stats - if stats.hasOwnProperty(key) - tr - td - a(href='/users/'+connection+'/'+encodeURIComponent(key)) - #{key} - span - if chan.online - if chan.active.active - span.label.label-success.tip(data-original-title="#{chan.active.ago}", data-placement="right") Active - else - span.label.label-important.tip(data-original-title="#{chan.active.ago}", data-placement="right") Inactive - else - span.label.tip(data-original-title="#{chan.active.ago}", data-placement="right") Offline - td - #{chan.fields.lines.data} - td - #{chan.fields.words.data} - td - #{chan.fields.lincent.data} - td - #{chan.fields.wpl.data} - td - #{chan.fields.in_mentions.data} + if stats + for chan, key in stats + if stats.hasOwnProperty(key) + tr + td + a(href='/users/'+connection+'/'+encodeURIComponent(key)) + #{key} + span + if chan.online + if chan.active.active + span.label.label-success.tip(data-original-title="#{chan.active.ago}", data-placement="right") Active + else + span.label.label-important.tip(data-original-title="#{chan.active.ago}", data-placement="right") Inactive + else + span.label.tip(data-original-title="#{chan.active.ago}", data-placement="right") Offline + td + #{chan.fields.lines.data} + td + #{chan.fields.words.data} + td + #{chan.fields.lincent.data} + td + #{chan.fields.wpl.data} + td + #{chan.fields.in_mentions.data}