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

{% load possessive %}{% load split %}{% load get_option %}

{% comment %}
context variables:
    server_list
    username
{% endcomment %}

{% block title %}upTee - {% if username %}{{ username|possessive }} servers{% else %}Server list{% endif %}{% endblock title %}

{% block link_list %}

<div id="link_list">
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}">All</a>
    |
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}type:online">Online</a>
    |
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}type:offline">Offline</a>
</div>

{% endblock link_list %}

{% block content %}

{% for server in server_list %}

<div class="server_list_entry">
    <div class="server_list_headline {% if server.is_online %}on{% else %}off{% endif %}">
       {{ server|get_option:'sv_name' }}
    </div>
    <div class="server_list_content">
        {% if server.is_online %}<div class="server_status_update" serverid="{{ server.id }}">{% endif %}
            <p>Mod: {{ server.mod.title }}</p>
            {% with server_info=server.info %}
                <p>Gametype: <span info="gametype">{% if server_info %}{{ server_info.gametype }}{% else %}{{ server|get_option:'sv_gametype' }}{% endif %}</span></p>
                <p>Map: <span info="map">{% if server_info %}{{ server_info.map }}{% else %}{{ server|get_option:'sv_map' }}{% endif %}</span></p>
                <p info="slots">Slots: <span info="slots">{% if server_info %}{{ server_info.clients|length }}/{{ server_info.max_clients }}{% else %}{{ server|get_option:'sv_max_clients' }}{% endif %}</span></p>
                {% if server.is_online %}<p>Address: {{ request.META.HTTP_HOST|split:':'|first }}:{{ server.port }}</p>{% endif %}
                <p><a href="{% url server_detail server.id %}">Edit</a></p>
                {% include "scoreboard.html" %}
            {% endwith %}
        {% if server.is_online %}</div>{% endif %}
    </div>
</div>

{% if user.is_authenticated %}{% if user.is_staff or server.owner == user %}
<div class="body">
    <form method="post" action="{% url start_stop_server server.id %}?next={{ request.path }}">
        <input type="hidden" name="csrfmiddlewaretoken" value="{% with csrf_token as csrf_token_clean %}{{ csrf_token_clean }}{% endwith %}">
        <p><input class="button" type="submit" value="{% if server.is_online %}Stop{% else %}Start{% endif %} Server"></p>
    </form>
</div>
{% endif %}{% endif %}

{% endfor %}

{% endblock content %}<commit_msg>-s/Edit/Info in server list -show the server owner if we are on global server list<commit_after>{% extends "base.html" %}

{% load possessive %}{% load split %}{% load get_option %}

{% comment %}
context variables:
    server_list
    username
{% endcomment %}

{% block title %}upTee - {% if username %}{{ username|possessive }} servers{% else %}Server list{% endif %}{% endblock title %}

{% block link_list %}

<div id="link_list">
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}">All</a>
    |
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}type:online">Online</a>
    |
    <a href="{% if username %}{% url user_server_list request.user.username %}{% else %}{% url server_list %}{% endif %}type:offline">Offline</a>
</div>

{% endblock link_list %}

{% block content %}

{% for server in server_list %}

<div class="server_list_entry">
    <div class="server_list_headline {% if server.is_online %}on{% else %}off{% endif %}">
       {{ server|get_option:'sv_name' }}
    </div>
    <div class="server_list_content">
        {% if server.is_online %}<div class="server_status_update" serverid="{{ server.id }}">{% endif %}
            {% if not username %}<p>Owner: {{ server.owner.username }}</p>{% endif %}
            <p>Mod: {{ server.mod.title }}</p>
            {% with server_info=server.info %}
                <p>Gametype: <span info="gametype">{% if server_info %}{{ server_info.gametype }}{% else %}{{ server|get_option:'sv_gametype' }}{% endif %}</span></p>
                <p>Map: <span info="map">{% if server_info %}{{ server_info.map }}{% else %}{{ server|get_option:'sv_map' }}{% endif %}</span></p>
                <p info="slots">Slots: <span info="slots">{% if server_info %}{{ server_info.clients|length }}/{{ server_info.max_clients }}{% else %}{{ server|get_option:'sv_max_clients' }}{% endif %}</span></p>
                {% if server.is_online %}<p>Address: {{ request.META.HTTP_HOST|split:':'|first }}:{{ server.port }}</p>{% endif %}
                <p><a href="{% url server_detail server.id %}">Info</a></p>
                {% include "scoreboard.html" %}
            {% endwith %}
        {% if server.is_online %}</div>{% endif %}
    </div>
</div>

{% if user.is_authenticated %}{% if user.is_staff or server.owner == user %}
<div class="body">
    <form method="post" action="{% url start_stop_server server.id %}?next={{ request.path }}">
        <input type="hidden" name="csrfmiddlewaretoken" value="{% with csrf_token as csrf_token_clean %}{{ csrf_token_clean }}{% endwith %}">
        <p><input class="button" type="submit" value="{% if server.is_online %}Stop{% else %}Start{% endif %} Server"></p>
    </form>
</div>
{% endif %}{% endif %}

{% endfor %}

{% endblock content %}
{'fraction_non_alphanumeric': 0.20956475013433637, 'fraction_numerical': 0.0, 'mean_word_length': 3.668896321070234, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, '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': '3082419', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1838, 'n_words': 425}