<commit_before>{% extends 'InsaLanTournamentBundle::layout.html.twig' %}

{% block title %}
  {{ parent() }} - {{ team.getName() }}
{% endblock %}

{% block body %}
{{ parent() }}

<article>
  <header>
    <h2>{{ team.name }} ({{ team.tournament }})</h2>
  </header>

  {% for g in team.groups %}
  
    <h3>{{ g.stage.name }} - {{ g.name }}</h3>

    {% set i=0 %}
    {% for m in g.matches %}
      
    {% if (m.part1 == team or m.part2 == team) %}
    {% set i=i+1 %}
    <div class="match_detail" data-p1="{{ m.part1.id }}" data-p2="{{ m.part2.id }}">

      <table cellpadding="3px">
        <caption>Match {{i}}</caption>
        <thead>
          <th style="width:45%">{{ m.part1.name }}</th>
          <th style="width:45%">{{ m.part2.name }}</th>
          <th style="width:10%"></th>
        </thead>
        {% for r in m.rounds %}
        <tr>
          <td class="{% if r.score1 > r.score2 %}won{% elseif r.score1 < r.score2 %}lost{% endif %}">
            {{r.score1}}
          </td>
          <td class="{% if r.score1 < r.score2 %}won{% elseif r.score1 > r.score2 %}lost{% endif %}">
            {{r.score2}}
          </td>
          <td>
            {% if r.replay == null and authorized %}
              <a href="{{ path('insalan_tournament_user_roundaddreplay', {id: team.id, round: r.id }) }}">replay</a>
            {% elseif r.replay != null %}
              <a href="{{ asset('uploads/tournament/replays/' ~ r.replay) }}">voir</a>
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </table>

      {% if m.state == 0 %}
        <p>Match en attente</p>
      {% elseif m.state == 1 %}

        {% if authorized == true %}
        <a href="{{ m.pvpNetUrl }}"><strong>Créer ou rejoindre un round</strong></a>

        <br /><br />

        <a href="{{ path('insalan_tournament_user_teamvalidatematch', {id: team.id, match: m.id }) }}"><strong>Valider un round</strong></a>
        {% else %}

        <p>Match en attente</p>

        {% endif %}

      {% else %}
        <p>Match terminé !</p>
        <p>Remporté par <strong>{{ m.getWinner().name }}</strong></p>
      {% endif %}

    </div>

    {% endif %}
    {% endfor %}

    <div class="clear"></div><commit_msg>[Tournament] Remove PVP.net which sucks<commit_after>{% extends 'InsaLanTournamentBundle::layout.html.twig' %}

{% block title %}
  {{ parent() }} - {{ team.getName() }}
{% endblock %}

{% block body %}
{{ parent() }}

<article>
  <header>
    <h2>{{ team.name }} ({{ team.tournament }})</h2>
  </header>

  {% for g in team.groups %}
  
    <h3>{{ g.stage.name }} - {{ g.name }}</h3>

    {% set i=0 %}
    {% for m in g.matches %}
      
    {% if (m.part1 == team or m.part2 == team) %}
    {% set i=i+1 %}
    <div class="match_detail" data-p1="{{ m.part1.id }}" data-p2="{{ m.part2.id }}">

      <table cellpadding="3px">
        <caption>Match {{i}}</caption>
        <thead>
          <th style="width:45%">{{ m.part1.name }}</th>
          <th style="width:45%">{{ m.part2.name }}</th>
          <th style="width:10%"></th>
        </thead>
        {% for r in m.rounds %}
        <tr>
          <td class="{% if r.score1 > r.score2 %}won{% elseif r.score1 < r.score2 %}lost{% endif %}">
            {{r.score1}}
          </td>
          <td class="{% if r.score1 < r.score2 %}won{% elseif r.score1 > r.score2 %}lost{% endif %}">
            {{r.score2}}
          </td>
          <td>
            {% if r.replay == null and authorized %}
              <a href="{{ path('insalan_tournament_user_roundaddreplay', {id: team.id, round: r.id }) }}">replay</a>
            {% elseif r.replay != null %}
              <a href="{{ asset('uploads/tournament/replays/' ~ r.replay) }}">voir</a>
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </table>

      {% if m.state == 0 %}
        <p>Match en attente</p>
      {% elseif m.state == 1 %}

        {% if authorized == true %}
        <p>
            Match à jouer entre <br> 
            <strong><a href="">{{ m.part1 }}</a></strong> et <strong><a href="">{{ m.part2 }}</a></strong>
        </p>

        <br /><br />
        <form action="{{ path('insalan_tournament_user_teamvalidatematch', {id: team.id, match: m.id }) }}" method="GET">
            <input value="Récupérer le match" type="submit">
        </form>
        {% else %}

        <p>Match en attente</p>

        {% endif %}

      {% else %}
        <p>Match terminé !</p>
        <p>Remporté par <strong>{{ m.getWinner().name }}</strong></p>
      {% endif %}

    </div>

    {% endif %}
    {% endfor %}

    <div class="clear"></div>
{'fraction_non_alphanumeric': 0.22140381282495666, 'fraction_numerical': 0.014731369150779897, 'mean_word_length': 1.9221518987341772, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, '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': '5013677', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1585, 'n_words': 359}