Merge pull request #139 from SamStudio8/master

Improved users web code
This commit is contained in:
Luke Slater 2013-01-15 12:48:41 -08:00
commit e0d3073ee5
2 changed files with 11 additions and 37 deletions

View File

@ -58,8 +58,10 @@ var pages = function(dbot) {
userData.inactive.sort(userSort); userData.inactive.sort(userSort);
userData.offline.sort(userSort); userData.offline.sort(userSort);
var userDataSorted = (userData.active.concat(userData.inactive)).concat(userData.offline);
res.render('users', { 'name': dbot.config.name, 'connection': connection, res.render('users', { 'name': dbot.config.name, 'connection': connection,
'channel': channel, 'nicks': userData }); 'channel': channel, 'nicks': userDataSorted });
} else { } else {
res.render_core('error', { 'name': dbot.config.name, 'message': 'No such connection or channel.' }); res.render_core('error', { 'name': dbot.config.name, 'message': 'No such connection or channel.' });
} }

View File

@ -15,47 +15,19 @@ block content
th Verbosity th Verbosity
th Mentions th Mentions
tbody tbody
-each nick in nicks.active -each nick in nicks
tr tr
td td
a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary) a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary)
#{nick.display} #{nick.display}
span span
span.label.label-success Active if nick.online
td if nick.active
#{nick.fields.lines.data} span.label.label-success Active
td else
#{nick.fields.words.data} span.label.label-important Inactive
td else
#{nick.fields.lincent.data} span.label Offline
td
#{nick.fields.wpl.data}
td
#{nick.fields.in_mentions.data}
-each nick in nicks.inactive
tr
td
a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary)
#{nick.display}
span
span.label.label-important Inactive
td
#{nick.fields.lines.data}
td
#{nick.fields.words.data}
td
#{nick.fields.lincent.data}
td
#{nick.fields.wpl.data}
td
#{nick.fields.in_mentions.data}
-each nick in nicks.offline
tr
td
a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary)
#{nick.display}
span
span.label Offline
td td
#{nick.fields.lines.data} #{nick.fields.lines.data}
td td