2020-04-05 16:00:48 +02:00
|
|
|
{% extends "/shared/_layout.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
2020-05-21 19:54:39 +02:00
|
|
|
<script>
|
|
|
|
function playCard(card) {
|
2020-12-06 21:21:51 +01:00
|
|
|
let player = "{{player}}";
|
|
|
|
let c = card.toString();
|
|
|
|
var msg = {
|
2020-12-06 21:56:16 +01:00
|
|
|
type: "message",
|
|
|
|
fct: "playcard",
|
|
|
|
player: player,
|
|
|
|
card: c
|
2020-12-06 21:21:51 +01:00
|
|
|
};
|
2020-12-06 21:56:16 +01:00
|
|
|
let t = JSON.stringify(msg);
|
2020-12-06 21:21:51 +01:00
|
|
|
window.game_socket.send(t);
|
2020-05-21 19:54:39 +02:00
|
|
|
}
|
2020-05-22 15:09:45 +02:00
|
|
|
|
|
|
|
function setTrumpColor(color) {
|
2020-12-06 21:21:51 +01:00
|
|
|
let player = "{{player}}"
|
|
|
|
var msg = {
|
2020-12-06 21:56:16 +01:00
|
|
|
type: "message",
|
|
|
|
fct: "setTrumpColor",
|
|
|
|
player: player,
|
|
|
|
color: color
|
2020-12-06 21:21:51 +01:00
|
|
|
};
|
2020-12-06 21:56:16 +01:00
|
|
|
let t = JSON.stringify(msg);
|
2020-12-06 21:21:51 +01:00
|
|
|
window.game_socket.send(t);
|
2020-05-22 15:09:45 +02:00
|
|
|
}
|
2020-12-11 17:52:19 +01:00
|
|
|
|
|
|
|
function setupGame(player_names) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-21 19:54:39 +02:00
|
|
|
</script>
|
|
|
|
|
2020-04-05 16:00:48 +02:00
|
|
|
<div class="content">
|
|
|
|
<h1><span class="font-semi-bold">Gambling Foo</span> <span class="smaller">A RESTful gaming service</span></h1>
|
|
|
|
<p class="lead">
|
|
|
|
Play a nice game of cards?<br>
|
|
|
|
<br>
|
2020-04-13 16:14:36 +02:00
|
|
|
<strong>Player {{player+1}} view</strong><br>
|
2020-04-06 22:42:31 +02:00
|
|
|
<strong> Table </strong><br>
|
2020-04-13 16:14:36 +02:00
|
|
|
{% for player,card in played_cards %}
|
|
|
|
||
|
|
|
|
{{player.name}}: {{card}}
|
2020-04-12 15:27:05 +02:00
|
|
|
{% endfor %}
|
|
|
|
||
|
2020-04-06 22:42:31 +02:00
|
|
|
<br>
|
2020-04-25 22:00:23 +02:00
|
|
|
<sub>
|
|
|
|
<strong>Tricks:</strong>
|
|
|
|
{% for player,_ in last_trick %}
|
|
|
|
||
|
|
|
|
{{player.name}}: {{player.tricks_taken}}
|
|
|
|
{% endfor %}
|
|
|
|
||
|
|
|
|
<br>
|
|
|
|
<strong>Last Trick:</strong>
|
|
|
|
{% for player,card in last_trick %}
|
|
|
|
||
|
|
|
|
{{player.name}}: {{card}}
|
|
|
|
{% endfor %}
|
|
|
|
||
|
|
|
|
</sub>
|
|
|
|
<br>
|
2020-04-06 22:42:31 +02:00
|
|
|
<strong> Your cards: </strong>
|
2020-04-05 23:27:33 +02:00
|
|
|
<ul>
|
2020-04-06 22:42:31 +02:00
|
|
|
<li>
|
|
|
|
<strong>Trump Card: {{trump_card}}</strong><br>
|
|
|
|
<strong>Trump Color: {{trump_color}}</strong><br>
|
|
|
|
</li>
|
|
|
|
|
2020-04-05 16:00:48 +02:00
|
|
|
{% for card in cards %}
|
|
|
|
<li>
|
|
|
|
<strong>>card {{loop.index}} is: {{card}} </strong><br>
|
2020-04-13 16:14:36 +02:00
|
|
|
{% if playerActive and not choose_trump_color %}
|
2020-05-21 19:54:39 +02:00
|
|
|
<!--
|
2020-04-12 15:27:05 +02:00
|
|
|
<a href="/player/{{player}}/play/{{loop.index0}}">play card {{loop.index}}<{{card}}></a>
|
2020-05-21 19:54:39 +02:00
|
|
|
<div style="background-color:#D94A38;width:170px;height:80px;margin:20px;padding-top:20px;color:#ffffff;font-weight:bold;font-size:18px;float:left;text-align:center;" onclick="playCard({{loop.index0}})">Play Me</div>
|
|
|
|
-->
|
|
|
|
<button onclick="playCard({{loop.index0}})">Play {{card}}</button>
|
2020-04-12 15:27:05 +02:00
|
|
|
{% endif %}
|
2020-04-05 16:00:48 +02:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
2020-04-13 22:07:38 +02:00
|
|
|
{% if choose_trump_color and (player == choose_trump_player) %}
|
2020-04-13 16:14:36 +02:00
|
|
|
<strong>Choose Trump Color:</strong>
|
2020-05-22 15:09:45 +02:00
|
|
|
<!--
|
2020-04-13 16:14:36 +02:00
|
|
|
<a href="/player/{{player}}/set_trump/r">Red></a>
|
|
|
|
<a href="/player/{{player}}/set_trump/g">Green></a>
|
|
|
|
<a href="/player/{{player}}/set_trump/b">Blue></a>
|
|
|
|
<a href="/player/{{player}}/set_trump/y">Yellow ></a>
|
2020-05-22 15:09:45 +02:00
|
|
|
-->
|
|
|
|
<button onclick="setTrumpColor('r')">Red</button>
|
|
|
|
<button onclick="setTrumpColor('g')">Green</button>
|
|
|
|
<button onclick="setTrumpColor('b')">Blue</button>
|
|
|
|
<button onclick="setTrumpColor('y')">Yellow</button>
|
2020-04-13 16:14:36 +02:00
|
|
|
{% endif %}
|
2020-04-06 22:42:31 +02:00
|
|
|
<!--
|
2020-04-05 16:00:48 +02:00
|
|
|
<li>
|
|
|
|
<strong>Movie by IMDB code</strong><br>
|
|
|
|
<a href="/api/movie/tt0096754">GET /api/movie/{imdb_number}</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Top 10 Movies (by IMDB score)</strong><br>
|
|
|
|
<a href="/api/movie/top">GET /api/movie/top</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>All genres</strong><br>
|
|
|
|
<a href="/api/movie/genre/all">GET /api/movie/genre/all</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Top movies for a given genres</strong><br>
|
|
|
|
<a href="/api/movie/genre/sci-fi">GET /api/movie/genre/{genre}</a>
|
|
|
|
</li>
|
|
|
|
-->
|
2020-04-05 23:27:33 +02:00
|
|
|
</ul>
|
2020-04-05 16:00:48 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="disclaimer">
|
|
|
|
Spam Bacon Sausage + Spam
|
|
|
|
Spam Spam Spam Spam Spam
|
|
|
|
Spam Baked Beans Spam
|
|
|
|
Spam Spam + Spam
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|