forked from GitHub/dbot
		
	Merge pull request #123 from SamStudio8/master
Add stats to userlist [#117]
This commit is contained in:
		
						commit
						4a2d28ce95
					
				| @ -33,26 +33,27 @@ var pages = function(dbot) { | ||||
|                     if(channelUsers[i] == dbot.config.name){ | ||||
|                         continue; | ||||
|                     } | ||||
| 
 | ||||
|                     var user = dbot.api.stats.getUserStats(connection, channelUsers[i], channel); | ||||
|                     if(onlineNicks.hasOwnProperty(channelUsers[i])){ | ||||
|                         var user = dbot.api.users.resolveUser(connection, channelUsers[i]); | ||||
|                         if(dbot.api.stats.isActive({'server': connection, | ||||
|                                                     'user': user, | ||||
|                                                     'user': channelUsers[i], | ||||
|                                                     'channel': channel | ||||
|                         })){ | ||||
|                             userData.active.push(channelUsers[i]); | ||||
|                             userData.active.push(user); | ||||
|                         } | ||||
|                         else{ | ||||
|                             userData.inactive.push(channelUsers[i]); | ||||
|                             userData.inactive.push(user); | ||||
|                         } | ||||
|                     } | ||||
|                     else{ | ||||
|                         userData.offline.push(channelUsers[i]); | ||||
|                         userData.offline.push(user); | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 var userSort = function(a, b){ | ||||
|                     var x = a.toLowerCase(); | ||||
|                     var y = b.toLowerCase(); | ||||
|                     var x = a.display.toLowerCase(); | ||||
|                     var y = b.display.toLowerCase(); | ||||
|                     if(x > y) return 1; | ||||
|                     if(x < y) return -1; | ||||
|                     return 0; | ||||
|  | ||||
| @ -14,3 +14,12 @@ wget http://twitter.github.com/bootstrap/assets/bootstrap.zip | ||||
| unzip bootstrap.zip | ||||
| rm bootstrap.zip | ||||
| ``` | ||||
| ###d3.js | ||||
| ``` | ||||
| cd depressionbot/public/ | ||||
| mkdir d3 | ||||
| cd d3 | ||||
| wget http://d3js.org/d3.v3.zip | ||||
| unzip d3.v3.zip | ||||
| rm d3.v3.zip | ||||
| ``` | ||||
|  | ||||
| @ -14,5 +14,6 @@ html(lang='en') | ||||
|             div#main | ||||
|                 block content | ||||
|     script(type="text/javascript", src="/bootstrap/js/bootstrap.min.js") | ||||
|     script(type="text/javascript", src="/d3/d3.v3.min.js") | ||||
|     script(type="text/javascript", src="/script.js") | ||||
| 
 | ||||
|  | ||||
| @ -7,26 +7,62 @@ block content | ||||
|     div#row | ||||
|         table.table.table-striped | ||||
|             thead | ||||
|                 tr: th Users | ||||
|                 tr | ||||
|                   th Users | ||||
|                   th Lines | ||||
|                   th Words | ||||
|                   th Lincent | ||||
|                   th Verbosity | ||||
|                   th Mentions | ||||
|             tbody | ||||
|               -each nick in nicks.active | ||||
|                 tr | ||||
|                   td | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick) | ||||
|                         #{nick} | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary) | ||||
|                         #{nick.display} | ||||
|                       span  | ||||
|                       span.label.label-success Active | ||||
|                   td | ||||
|                       #{nick.total_lines} | ||||
|                   td | ||||
|                       #{nick.total_words} | ||||
|                   td | ||||
|                       #{nick.lincent} | ||||
|                   td | ||||
|                       #{nick.wpl} | ||||
|                   td | ||||
|                       #{nick.in_mentions} | ||||
|               -each nick in nicks.inactive | ||||
|                 tr | ||||
|                   td | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick) | ||||
|                         #{nick} | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary) | ||||
|                         #{nick.display} | ||||
|                       span    | ||||
|                       span.label.label-important Inactive  | ||||
|                   td | ||||
|                       #{nick.total_lines} | ||||
|                   td | ||||
|                       #{nick.total_words} | ||||
|                   td | ||||
|                       #{nick.lincent} | ||||
|                   td | ||||
|                       #{nick.wpl} | ||||
|                   td | ||||
|                       #{nick.in_mentions} | ||||
|               -each nick in nicks.offline | ||||
|                 tr | ||||
|                   td | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick) | ||||
|                         #{nick} | ||||
|                       a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick.primary) | ||||
|                         #{nick.display} | ||||
|                       span    | ||||
|                       span.label Offline | ||||
|                   td | ||||
|                       #{nick.total_lines} | ||||
|                   td | ||||
|                       #{nick.total_words} | ||||
|                   td | ||||
|                       #{nick.lincent} | ||||
|                   td | ||||
|                       #{nick.wpl} | ||||
|                   td | ||||
|                       #{nick.in_mentions} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Luke Slater
						Luke Slater