From c669b6550661b00a4e11002e4a13fdee831ab831 Mon Sep 17 00:00:00 2001 From: Pomke Date: Fri, 7 Mar 2014 17:12:36 +1100 Subject: [PATCH] refactored to use angular, users come from users.json, details are demand-loaded from github, added github icons --- css/style.css | 4 ++ index.html | 112 ++++++------------------------------------------- js/polyhack.js | 18 ++++++++ js/users.json | 22 ++++++++++ 4 files changed, 57 insertions(+), 99 deletions(-) create mode 100644 js/polyhack.js create mode 100644 js/users.json diff --git a/css/style.css b/css/style.css index 37d88e8..ebe50f4 100644 --- a/css/style.css +++ b/css/style.css @@ -252,6 +252,10 @@ table.plain tbody > tr:nth-child(odd) > th { background: transparent; } +table img.avatar { + height: 30px; +} + /* ====================================================== 1 - Header ====================================================== */ diff --git a/index.html b/index.html index aabe162..238ce14 100644 --- a/index.html +++ b/index.html @@ -22,9 +22,13 @@ ================================================== --> + + + - +
@@ -62,109 +66,19 @@
Members
- +
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
- Name Location Language Focus
[Neurotic]Melbourne, AustraliaGo, Clojure, J/Ruby
andrebuchananMelbourne, AustraliaNode.js
aussiegeekMelbourne, AustraliaRuby, Go
blackdogVietnamHaskell, Ansible, not-Javascript, not-Go.
bulkanMelbourne, AustraliaNode.js
cgiffardSydney/Canberra, AustraliaNode.js, Erlang
deoxxaMelbourne, AustraliaNode.js, C
eugenewareMelbourne, AustraliaNode.js
joshwnjMelbourne, AustraliaNode.js, PHP
michaelnealeBlue Mountains, AustraliaErlang, Clojure, Scala, Bash, Haskell, Bash, Go, Javascript.
nicholasfMelbourne, AustraliaElixir, Javascript, post Ruby, post Java.
ockeMelbourne, AustraliaJavascript, PHP
PomkeMelbourne, AustraliaJavascript, Python
rkstedmanCambridge, MANode.js
robzolkosMelbourne, AustraliaRuby, Node.js, Javascript, Go -
rvaggNSW, AustraliaNode.js
SomeoneWeirdMelbourne, AustraliaJavascript, Go
timoxleySingaporeNode.js
wao-enderBratislava, SlovakiaNode.js
{{user.nick}}{{details[user.github].location}}{{user.lang}}
diff --git a/js/polyhack.js b/js/polyhack.js new file mode 100644 index 0000000..5b34ee6 --- /dev/null +++ b/js/polyhack.js @@ -0,0 +1,18 @@ +var Poly = angular.module('poly', []); + +Poly.controller('UserListController', function($scope, $http, $q) { + + $http.get('./js/users.json').then(function(res) { + $scope.details = {}; + $scope.users = res.data; + var git = []; + angular.forEach($scope.users, function(u) { + git.push($http.get('https://api.github.com/users/'+u.github)); + }); + $q.all(git).then(function(res) { + angular.forEach(res, function(item) { + $scope.details[item.data.login] = item.data; + }); + }); + }); +}); diff --git a/js/users.json b/js/users.json new file mode 100644 index 0000000..5346600 --- /dev/null +++ b/js/users.json @@ -0,0 +1,22 @@ +[ + { "github" : "markmandel", "nick" : "[Neurotic]", "lang" : "Go, Clojure, J/Ruby" }, + { "github" : "andrebuchanan", "nick" : "andrebuchanan", "lang" : "Node.js" }, + { "github" : "aussiegeek", "nick" : "aussiegeek", "lang" : "Ruby, Go" }, + { "github" : "mwotton", "nick" : "blackdog", "lang" : "Haskell, Ansible, not-Javascript, not-Go." }, + { "github" : "bulkan", "nick" : "bulkan", "lang" : "Node.js" }, + { "github" : "cgiffard", "nick" : "cgiffard", "lang" : "Node.js, Erlang" }, + { "github" : "deoxxa", "nick" : "deoxxa", "lang" : "Node.js, C" }, + { "github" : "eugeneware", "nick" : "eugeneware", "lang" : "Node.js" }, + { "github" : "joshwnj", "nick" : "joshwnj", "lang" : "Node.js, PHP" }, + { "github" : "michaelneale", "nick" : "michaelneale", "lang" : "Erlang, Clojure, Scala, Bash, Haskell, Bash, Go, Javascript." }, + { "github" : "nicholasf", "nick" : "nicholasf", "lang" : "Elixir, Javascript, post Ruby, post Java." }, + { "github" : "ocke", "nick" : "ocke", "lang" : "Javascript, PHP" }, + { "github" : "pomke", "nick" : "pomke", "lang" : "Javascript, Python" }, + { "github" : "rkstedman", "nick" : "rkstedman", "lang" : "Node.js" }, + { "github" : "robzolkos", "nick" : "robzolkos", "lang" : "Ruby, Node.js, Javascript, Go" }, + { "github" : "rvagg", "nick" : "rvagg", "lang" : "Node.js" }, + { "github" : "SomeoneWeird", "nick" : "SomeoneWeird", "lang" : "Javascript, Go" }, + { "github" : "timoxley", "nick" : "timoxley", "lang" : "Node.js" }, + { "github" : "yangwao", "nick" : "wao-ender", "lang" : "Node.js" } +] +