Skip to content

Commit cad09ed

Browse files
author
Alexei Bratuhin
committed
* initial project state - preparation for hackathon 1
1 parent 88b82c2 commit cad09ed

File tree

8 files changed

+457
-233
lines changed

8 files changed

+457
-233
lines changed

.gitignore

+29-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
# Logs
2-
logs
3-
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
14-
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# node-waf configuration
20-
.lock-wscript
21-
22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
24-
25-
# Dependency directory
26-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27-
node_modules
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27+
node_modules
28+
29+
bower_components

LICENSE

+204-204
Large diffs are not rendered by default.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# planningpoker
2-
Learning by doing - planning poker using modern web development frameworks.
1+
# planningpoker
2+
Learning by doing - planning poker using modern web development frameworks.

app/poker.css

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.card { /* to show the back of the card, hide the front */
2+
position: relative;
3+
background-color:#036;
4+
border:1px solid #666;
5+
font-size: 20px;
6+
float: left;
7+
width: 3.8em;
8+
height: 5em;
9+
}
10+
11+
.card .front {
12+
background-color: #fff;
13+
color: #000;
14+
position: absolute;
15+
width: 100%;
16+
height: 100%;
17+
}
18+
19+
.card .corner {
20+
position: absolute;
21+
font-size: .5em;
22+
left: 0.25em;
23+
top: 0.25em;
24+
}
25+
.card .cornerBR {
26+
left: auto;
27+
top: auto;
28+
right: 0.25em;
29+
bottom: 0.25em;
30+
}
31+
32+
.card .flip {
33+
-webkit-transform: rotate(180deg);
34+
-moz-transform: rotate(180deg);
35+
/*filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);*/
36+
writing-mode: tb-rl;
37+
}
38+
39+
.card .red {
40+
color: #f00;
41+
}
42+
43+
.card .suit {
44+
position: absolute;
45+
z-index:2;
46+
}
47+
/* large center Ace style suit */
48+
.card .suit0 {
49+
font-size: 3em;
50+
left: 0.35em;
51+
top: 0.1em;
52+
}
53+
54+
.card .face {
55+
position: absolute;
56+
z-index:1;
57+
border: 1px solid #000;
58+
left: 0.6em;
59+
top: 0.45em;
60+
width: 2.5em;
61+
height: 4.em;
62+
}

app/poker.html

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!DOCTYPE html>
2+
<html ng-app="poker">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>Planning Poker</title>
7+
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.css">
8+
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap-theme.css">
9+
<link rel="stylesheet" href="poker.css">
10+
<script src="../bower_components/jquery/dist/jquery.js"></script>
11+
<script src="../bower_components/bootstrap/dist/js/bootstrap.js"></script>
12+
<script src="../bower_components/angular/angular.js"></script>
13+
<script src="../bower_components/angular-route/angular-route.js"></script>
14+
<script src="poker.js"></script>
15+
<script type="text/ng-template" id="card.html">
16+
<div class="card" ng-click="pokerCtrl.sendEstimate(pokerCtrl.id, pokerCtrl.name, card);"><div class="front"><div class="corner">{{card}}</div><div class="suit suit0">{{card}}</div><div class="corner cornerBR flip">{{card}}</div></div></div>
17+
</script>
18+
<script type="text/ng-template" id="estimate.html">
19+
<div class="estimate" >
20+
{{estimate.id}}, {{estimate.name}}, {{estimate.estimate}}.
21+
</div>
22+
</script>
23+
</head>
24+
<body>
25+
26+
<div class="container" >
27+
<h1>Welcome to Planning Poker</h1>
28+
</div>
29+
30+
<div class="container" >
31+
<div class="col-lg-6" ng-controller="PokerController as pokerCtrl" >
32+
<div class="row">
33+
<h2>Poll</h2>
34+
</div>
35+
<div class="row">
36+
You are <input type="text" placeholder="Your name" ng-model="pokerCtrl.name" /> with id {{pokerCtrl.id}}.
37+
</div>
38+
<div class="row">
39+
Currently estimating: {{pokerCtrl.story}}.
40+
</div>
41+
<div class="row">
42+
Your estmimate:
43+
</div>
44+
<div class="row">
45+
<div ng-repeat="card in pokerCtrl.cards">
46+
<ng-include src="'card.html'">
47+
</ng-include>
48+
</div>
49+
</div>
50+
</div>
51+
52+
53+
<div class="col-lg-6" ng-controller="PokerOverviewController as overviewCtrl">
54+
<div class="row" >
55+
<h2>Overview</h2>
56+
</div>
57+
<div class="row" ng-repeat="estimate in overviewCtrl.currentPoll.poll">
58+
<ng-include src="'estimate.html'">
59+
</ng-include>
60+
</div>
61+
</div>
62+
63+
64+
<div class="col-lg-6" ng-controller="PokerSmController as smCtrl">
65+
<div class="row" >
66+
<h2>ScrumMaster</h2>
67+
</div>
68+
<div class="row" >
69+
<input type="text" placeholder="Next story" ng-model="smCtrl.story" />
70+
<button type="submit" class="btn btn-default" ng-click="smCtrl.nextStory(smCtrl.story)">Proceed</button>
71+
</div>
72+
</div>
73+
</div>
74+
75+
76+
77+
</body>
78+
</html>

app/poker.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
angular.module('poker', ['ngRoute'])
2+
.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
3+
$locationProvider.html5Mode({
4+
enabled: true,
5+
requireBase: false
6+
});
7+
}])
8+
.controller('PokerController', ['$window', '$scope', '$location', function ($window, $scope, $location) {
9+
var pokerCtrl = this;
10+
11+
var getId = function() {
12+
return 1;
13+
}
14+
15+
var getStory = function () {
16+
return 'How long will it take to finish the project?';
17+
}
18+
19+
this.id = getId();
20+
this.name = '';
21+
this.story = getStory();
22+
this.estimate = NaN;
23+
this.cards = ['0', '½', '1', '2', '3', '5', '8', '13', '21', '∞', '?'];
24+
25+
this.sendEstimate = function (id, name, card) {console.log(name + ' with id ' + id + ' sends estimate: ' + card);};
26+
}])
27+
.controller('PokerOverviewController', function ($scope, $http) {
28+
var getCurrentPoll = function() {
29+
return {
30+
/*"story": "How long will it take to finish the project?",*/
31+
"poll": [
32+
{"id": 1, "name": "Alexei", "estimate": "1"},
33+
{"id": 2, "name": "Andrej", "estimate": "2"},
34+
{"id": 3, "name": "SM", "estimate": "1"},
35+
{"id": 4, "name": "OZe", "estimate": "5"},
36+
{"id": 5, "name": "Remote", "estimate": "0"}]
37+
};
38+
}
39+
40+
this.currentPoll = getCurrentPoll();
41+
})
42+
.controller('PokerSmController', function ($scope, $http) {
43+
this.story = '';
44+
this.nextStory = function(story) {
45+
console.log('proceeding to next story: ' + story);
46+
}
47+
})
48+
;

bower.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "planningpoker",
3+
"version": "1.0.0",
4+
"license": "EPL-1.0",
5+
"ignore": [
6+
"**/.*",
7+
"node_modules",
8+
"bower_components",
9+
"test",
10+
"tests"
11+
],
12+
"dependencies": {
13+
"angular-route": "~1.4.4",
14+
"angular": "~1.4.4",
15+
"bootstrap": "~3.3.5",
16+
"jquery": "~2.1.4"
17+
}
18+
}

package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "planningpoker",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"dependencies": {
7+
"bower": "^1.4.1",
8+
"express": "^4.13.3"
9+
},
10+
"devDependencies": {},
11+
"scripts": {
12+
"test": "echo \"Error: no test specified\" && exit 1"
13+
},
14+
"author": "",
15+
"license": "EPL-1.0"
16+
}

0 commit comments

Comments
 (0)