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

{% block page-header %}
  <div class="page-header">
    <h1>Competitions</h1>
  </div>
{% endblock %}

{% block content %}
  <ul class="media-list">
    {% for competition in competitions %}
      <li class="media well">
        {% if competition.image %}
          <a class="pull-left" href="{{ competition.get_absolute_url }}">
            <img src="{{ competition.thumbnail_url }}"
                 alt="{{ competition.name }}">
          </a>
        {% else %}
          <a class="pull-left" href="{{ competition.get_absolute_url }}">
            <img src="{{ competition.DEFAULT_THUMB }}"
                 alt="{{ competition.name }}">
          </a>
        {% endif %}
        <div class="media-body">
          <!-- Left Side -->
          <div class="col-md-6 pull-left">
            <a href="{{ competition.get_absolute_url }}">
              <h4 class="media-heading">{{ competition.name }}</h4>
            </a>
            {{ competition.description }}
            <br>
            <br>
            <h4>
              <span class="label label-{% if competition.is_open %}success
                           {% else %}danger{% endif %} label-lg">
                {% if competition.is_open %}
                  Currently Open!
                {% else %}
                  Currently Closed :(
                {% endif %}
              </span>
            </h4>
            <h4>
              <span class="label label-{% if competition.is_running %}success
                           {% else %}danger{% endif %} label-lg">
                {% if competition.is_running %}
                  Running!
                {% else %}
                  Not Running :(
                {% endif %}
              </span>
            </h4>
          </div>
          <div class="col-md-1"></div>
          <!-- Right Side -->
          <div class="col-md-5">
            <div class="panel panel-info">
              <div class="panel-heading">Competition Statistics</div>
              <div class="panel-body">
                <span class="badge">
                  {% registered_users_count competition %}
                </span>
                 Registered Users
                <br>
                <span class="badge">
                  {% freeagent_count competition %}
                </span>
                 Free Agents
                <br>
                <span class="badge">
                  {{ competition.game_set.count }}
                </span>
                 Games Played
              </div>
            </div>
          </div>
        </div>
      </li>
    {% empty %}
      <h2>No competitions, yet.</h2>
    {% endfor %}
  </ul>
<commit_msg>Add new mobile rendering of competition list<commit_after>{% extends "base.html" %}
{% load competition_tags %}

{% block page-header %}
  <div class="page-header">
    <h1>Competitions</h1>
  </div>
{% endblock %}

{% block content %}
  <!-- Desktop View -->
  <ul class="media-list hidden-xs hidden-sm">
    {% for competition in competitions %}
      <li class="media well">
        {% if competition.image %}
          <a class="pull-left" href="{{ competition.get_absolute_url }}">
            <img src="{{ competition.thumbnail_url }}"
                 alt="{{ competition.name }}">
          </a>
        {% else %}
          <a class="pull-left" href="{{ competition.get_absolute_url }}">
            <img src="{{ competition.DEFAULT_THUMB }}"
                 alt="{{ competition.name }}">
          </a>
        {% endif %}
        <div class="media-body">
          <!-- Left Side -->
          <div class="col-md-6 pull-left">
            <a href="{{ competition.get_absolute_url }}">
              <h4 class="media-heading">{{ competition.name }}</h4>
            </a>
            {{ competition.description }}
            <br>
            <br>
            <h4>
              <span class="label label-{% if competition.is_open %}success
                           {% else %}danger{% endif %} label-lg">
                {% if competition.is_open %}
                  Currently Open!
                {% else %}
                  Currently Closed :(
                {% endif %}
              </span>
            </h4>
            <h4>
              <span class="label label-{% if competition.is_running %}success
                           {% else %}danger{% endif %} label-lg">
                {% if competition.is_running %}
                  Running!
                {% else %}
                  Not Running :(
                {% endif %}
              </span>
            </h4>
          </div>
          <div class="col-md-1"></div>
          <!-- Right Side -->
          <div class="col-md-5">
            <div class="panel panel-info">
              <div class="panel-heading">Competition Statistics</div>
              <div class="panel-body">
                <span class="badge">
                  {% registered_users_count competition %}
                </span>
                 Registered Users
                <br>
                <span class="badge">
                  {% freeagent_count competition %}
                </span>
                 Free Agents
                <br>
                <span class="badge">
                  {{ competition.game_set.count }}
                </span>
                 Games Played
              </div>
            </div>
          </div>
        </div>
      </li>
    {% empty %}
      <h2>No competitions, yet.</h2>
    {% endfor %}
  </ul>
  <!-- Mobile View -->
  <div class="hidden-md hidden-lg hidden-xl">
    <link href="{{ STATIC_URL }}css/mobile.css" rel="stylesheet">
    {% for competition in competitions %}
      <li class="well col-xs-12 col-sm-12" style="list-style-type:none">
        <!-- Competition Image -->
        <div id="comp_img" class="container">
          {% if competition.image %}
            <a href="{{ competition.get_absolute_url }}">
              <img src="{{ competition.thumbnail_url }}"
                   alt="{{ competition.name }}">
            </a>
          {% else %}
            <a href="{{ competition.get_absolute_url }}">
              <img src="{{ competition.DEFAULT_THUMB }}"
                   alt="{{ competition.name }}">
            </a>
          {% endif %}
        </div>
        <br>
        <!-- Competition Description and Labels -->
        <div class="container" style="text-align:center">
          <a href="{{ competition.get_absolute_url }}">
            <h4 class="media-heading">{{ competition.name }}</h4>
          </a>
          {{ competition.description }}
          <br>
          <h4>
            <span class="label label-{% if competition.is_open %}success
                         {% else %}danger{% endif %} label-lg">
              {% if competition.is_open %}
                Currently Open!
              {% else %}
                Currently Closed :(
              {% endif %}
            </span>
          </h4>
          <h4>
            <span class="label label-{% if competition.is_running %}success
                         {% else %}danger{% endif %} label-lg">
              {% if competition.is_running %}
                Running!
              {% else %}
                Not Running :(
              {% endif %}
            </span>
          </h4>
        </div>
        <!-- Competition Statistics -->
        <div class="container">
          <div class="panel panel-info">
            <div class="panel-heading">Competition Statistics</div>
            <div class="panel-body">
              <span class="badge">
                {% registered_users_count competition %}
              </span>
               Registered Users
              <br>
              <span class="badge">
                {% freeagent_count competition %}
              </span>
               Free Agents
              <br>
              <span class="badge">
                {{ competition.game_set.count }}
              </span>
               Games Played
            </div>
          </div>
        </div>
      </li>
    {% empty %}
      <h2>No competitions, yet.</h2>
    {% endfor %}
  </div>

{'fraction_non_alphanumeric': 0.14867018016913838, 'fraction_numerical': 0.004657433509008457, 'mean_word_length': 1.249173098125689, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 163, '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': '2654974', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2042, 'n_words': 470}