-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added admin to delete dangling games (no pwd yet)
- Loading branch information
Alex Legg
committed
Feb 13, 2014
1 parent
8f1fac1
commit 62984f9
Showing
8 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
formatDate = (d) -> | ||
d = new Date(d) | ||
d_names = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] | ||
ampm = if (d.getHours() < 13) then "am" else "pm" | ||
h = d.getHours() % 12 | ||
h = if h == 0 then 12 else h | ||
s = d_names[d.getDay()] + " " + | ||
d.getDate() + "/" + | ||
(d.getMonth() + 1) + "/" + | ||
d.getFullYear() + " " + | ||
h + ":" + d.getMinutes() + ampm | ||
|
||
jQuery -> | ||
gamesReq = $.ajax | ||
url : '/api?type=games&gamestate=0' | ||
|
||
gamesReq.done (res, status, jqXHR) -> | ||
if not res then return | ||
|
||
for r in res | ||
do (r) -> | ||
li = $("<a>") | ||
.addClass("list-group-item") | ||
.html($("<b>").text(formatDate(r.date))) | ||
.append($("<br>")) | ||
.append(r.name) | ||
.click () -> | ||
delete_game(r.id) | ||
$("#gamelist").append(li) | ||
$("#gamelist").show() | ||
|
||
delete_game = (id) -> | ||
deleteReq = $.ajax | ||
url : '/api?type=deletegame&id=' + id | ||
|
||
deleteReq.done (res, status, jqXHR) -> | ||
location.reload() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body { | ||
background-color: #eee; | ||
} | ||
.container { | ||
max-width: 330px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||
<head> | ||
<script src="jquery.min.js"></script> | ||
<script src="jquery.cookie.js"></script> | ||
<script src="admin.js"></script> | ||
<link rel="stylesheet" href="bootstrap.min.css"> | ||
<link rel="stylesheet" href="bootstrap-theme.min.css"> | ||
<script src="bootstrap.min.js"></script> | ||
<link rel="stylesheet" href="stats.css"> | ||
<title>Avalon</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h2 style="text-align: center">Games</h2> | ||
|
||
<div id="gamelist" class="list-group"></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||
<head> | ||
<script src="jquery.min.js"></script> | ||
<script src="jquery.cookie.js"></script> | ||
<script src="stats.js"></script> | ||
<link rel="stylesheet" href="bootstrap.min.css"> | ||
<link rel="stylesheet" href="bootstrap-theme.min.css"> | ||
<script src="bootstrap.min.js"></script> | ||
<link rel="stylesheet" href="stats.css"> | ||
<title>Avalon</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h2 style="text-align: center">Game</h2> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | ||
<head> | ||
<script src="jquery.min.js"></script> | ||
<script src="jquery.cookie.js"></script> | ||
<script src="stats.js"></script> | ||
<link rel="stylesheet" href="bootstrap.min.css"> | ||
<link rel="stylesheet" href="bootstrap-theme.min.css"> | ||
<script src="bootstrap.min.js"></script> | ||
<link rel="stylesheet" href="stats.css"> | ||
<title>Avalon</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h2 style="text-align: center">Games</h2> | ||
|
||
<div id="gamelist" class="list-group"></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PORT = 80 | ||
IP = "192.168.1.1" | ||
DEBUG = true | ||
ADMINPW = "adminpassword_changeme" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters