parent
86aaf98c47
commit
38b3239d91
@ -0,0 +1,36 @@ |
||||
<!DOCTYPE html> |
||||
<html> |
||||
<head> |
||||
<title>WebSocket Test</title> |
||||
</head> |
||||
<body> |
||||
<h1>WebSocket Test</h1> |
||||
<input id="messageInput" type="text"> |
||||
<button onclick="sendMessage()">Send</button> |
||||
<div id="messages"></div> |
||||
|
||||
<script> |
||||
const chatSocket = new WebSocket( |
||||
'ws://' + window.location.host + '/ws/sync/' |
||||
); |
||||
|
||||
chatSocket.onmessage = function(e) { |
||||
const data = JSON.parse(e.data); |
||||
document.querySelector('#messages').innerHTML += '<p>' + data.message + '</p>'; |
||||
}; |
||||
|
||||
chatSocket.onclose = function(e) { |
||||
console.error('Chat socket closed unexpectedly'); |
||||
}; |
||||
|
||||
function sendMessage() { |
||||
const messageInputDom = document.querySelector('#messageInput'); |
||||
const message = messageInputDom.value; |
||||
chatSocket.send(JSON.stringify({ |
||||
'message': message |
||||
})); |
||||
messageInputDom.value = ''; |
||||
} |
||||
</script> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,36 @@ |
||||
{% extends 'tournaments/base.html' %} |
||||
|
||||
{% block head_title %}Convocations du {{ tournament.display_name }}{% endblock %} |
||||
{% block first_title %}{{ tournament.event.display_name }}{% endblock %} |
||||
{% block second_title %}{{ tournament.display_name }}{% endblock %} |
||||
|
||||
{% block content %} |
||||
|
||||
{% load static %} |
||||
|
||||
{% include 'tournaments/navigation_tournament.html' %} |
||||
|
||||
<div class="grid-x"> |
||||
|
||||
<div class="cell medium-6 large-6 my-block"> |
||||
<h1 class="club my-block topmargin20">{{ tournament.display_name }} {{ tournament.get_federal_age_category_display}}</h1 > |
||||
|
||||
<div class="bubble"> |
||||
<p> |
||||
<div class="semibold">{{ tournament.start_date }}</div> |
||||
<div>{{ tournament.day_duration_formatted }}</div> |
||||
</p> |
||||
|
||||
<p> |
||||
<div class="semibold">{{ tournament.event.club.name }}</div> |
||||
{% if tournament.has_club_address %} |
||||
<div>{{ tournament.event.club.address }}</div> |
||||
<div>{{ tournament.event.club.city_zipcode }}</div> |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
{% endblock %} |
||||
Loading…
Reference in new issue