-
Notifications
You must be signed in to change notification settings - Fork 0
/
players.html
108 lines (89 loc) · 3.26 KB
/
players.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<html>
<head>
<title>Fifa manager</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" media="screen" title="no title" charset="utf-8">
<style media="screen">
body {
padding-top: 20px;
padding-bottom: 20px;
}
</style>
</head>
<body>
<div class="container">
<!-- Static navbar -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Fifa manager</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html">Home</a></li>
<li class="active"><a href="">Players</a></li>
</ul>
</div><!--/.container-fluid -->
</nav>
<!-- Main component for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>Summary of players</h1>
<p>On this page, you can see a summary of all the players you've added. You can either add or delete players here.</p>
</div>
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline" id="addPlayerForm">
<div class="form-group">
<label class="sr-only" for="exampleInputAmount">Name player</label>
<div class="input-group">
<input type="text" class="form-control" id="playerName" name="playerName" placeholder="Full name" />
</div>
</div>
<button type="submit" class="btn btn-primary">Add player</button>
<button id="removeAllPlayers" type="submit" class="btn btn-danger">Remove all players</button>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Full name</th>
<th>Matches played</th>
<th>Matches won</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</body>
<script src="bower_components/jquery/dist/jquery.min.js" charset="utf-8"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js" charset="utf-8"></script>
<script src="bower_components/store.js/store.min.js" charset="utf-8"></script>
<script src="js/tools.js" charset="utf-8"></script>
<script src="js/players.js" charset="utf-8"></script>
<script>
initStoreJs();
$(function() {
updatePlayersTable($('table'));
$('button#removeAllPlayers').on('click', function() {
removeAllPlayers();
updatePlayersTable($('table'));
});
$( "form#addPlayerForm" ).submit(function( event ) {
addPlayer( $(this).serializeObject() );
updatePlayersTable($('table'));
event.preventDefault();
event.stopPropagation();
});
$('button.remove-player').on('click', function(event) {
removePlayer(event.target.id);
updatePlayersTable($('table'));
});
});
</script>
</html>