<commit_before>{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block js %}
<script src="{% static '/static/js/tron-render.js' %}"></script>
<script>
    var sarasa;
    function request_match(match_id){
        jQuery.ajax({
              url: '/get-match/' + match_id,
              dataType: 'json',
              success: function(data, status){
                    $('#p1_img').css("background", color_player1);
                    $('#p2_img').css("background", color_player2);
                    //players:
                    $('#player1').text(data.players[0]);
                    $('#player2').text(data.players[1]);
                    game_start(data,'the-game');
              },
        });
    }
    $(document).ready(function() {
      request_match({{match_id}});
    });
</script>
{% endblock %}

{% block content %}
    <div class="container main">
        <div id="header">
            <img src="/static/img/pytron_logo.png"/><h1>Onapsis Challenge</h1>
        </div>
        <div id="players_divs">
                <img id="p1_img" src="/static/media/lightcycle-start-transparent.png" />
                <span id="player1"></span>
                <span id="vs_text"> vs</span>
                <span id="player2"></span>
                <img id="p2_img" src="/static/media/lightcycle-start-transparent-2.png" />
        </div>
        <div>
            <canvas id="the-game" width="100" height="100" style="background-color:rgb(8, 14, 12);">
                Your browser does not support HTML5 Canvas.
            </canvas>
        </div>

        <div id="list_div" class="float pull-left" style="">
            <h3>Play List</h3>
            <div id="playlist_div"></div>
        </div>

        <!--div id="action_buttons">
            <label for="speed_set">Set Speed: <span id="speed_set_label"></span></label><input type="range" id="speed_set" min="100" max="1000" value="500">
            <a href="#" id="button_replay" class="btn btn-warning pull-right" style="display:none; margin-top:10px;"><span class="glyphicon glyphicon-play"></span>Replay</a>
        </div-->
    </div> <!-- /container -->
{% endblock %}
<commit_msg>[ADD] Redirect when user don't have match & add Replay Button<commit_after>{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block js %}
<script src="{% static '/static/js/tron-render.js' %}"></script>
<script>
    
    if ( !({{match_id}}) ){
        window.location = "/"
    }
    
    function request_match(match_id){
        jQuery.ajax({
              url: '/get-match/' + match_id,
              dataType: 'json',
              success: function(data, status){
                    $('#p1_img').css("background", color_player1);
                    $('#p2_img').css("background", color_player2);
                    //players:
                    $('#player1').text(data.players[0]);
                    $('#player2').text(data.players[1]);
                    game_start(data,'the-game');
              },
        });
    }
    $(document).ready(function() {
      request_match({{match_id}});
    });
</script>
{% endblock %}

{% block content %}
    <div class="container main">
        <div id="header">
            <img src="/static/img/pytron_logo.png"/><h1>Onapsis Challenge</h1>
        </div>
        <div id="players_divs">
                <img id="p1_img" src="/static/media/lightcycle-start-transparent.png" />
                <span id="player1"></span>
                <span id="vs_text"> vs</span>
                <span id="player2"></span>
                <img id="p2_img" src="/static/media/lightcycle-start-transparent-2.png" />
        </div>
        <div>
            <canvas id="the-game" width="100" height="100" style="background-color:rgb(8, 14, 12);">
                Your browser does not support HTML5 Canvas.
            </canvas>
        </div>

        <div id="list_div" class="float pull-left" style="">
            <h3>Play List</h3>
            <div id="playlist_div"></div>
        </div>

        <div id="action_buttons">
            <a href="#" id="button_replay" class="btn btn-warning pull-right" style="display:none; margin-top:10px;"><span class="glyphicon glyphicon-play"></span>Replay</a>
        </div>
    </div> <!-- /container -->
{% endblock %}

{'fraction_non_alphanumeric': 0.18630647414997673, 'fraction_numerical': 0.017699115044247787, 'mean_word_length': 2.0013976240391336, 'pattern_counts': {'":': 0, '<': 84, '<?xml version=': 0, '>': 84, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5308340', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1297, 'n_words': 240}