<commit_before>{% extends 'base/standard.html.twig' %}

{% block content %}
  <h1 class="page-header">Audit Log</h1>

  <blockquote>
    <p>
      He sees you when you're sleeping<br>
      He knows when you're awake<br>
      He knows if you've been bad or good<br>
      So be good for goodness sake<br>
    </p>
  </blockquote>

  <table class="table table-bordered table-striped" style="background-color: white;">
    <thead>
      <tr>
        <th style="width: 160px;">Time</th>
        <th style="width: 540px;">Action</th>
        <th>Data</th>
      </tr>
    </thead>
  {% for action in actions %}
    {% set entity = auditService.getEntity(action) %}
    <tr>
      <td>
        <abbr title="{{ action.timestamp.format('Y-m-d H:i:s') }}">
          {{ (action.timestamp | moment).fromNow.relative }}
        </abbr>
         &nbsp; <small class="text-muted">{{ action.timestamp.format('H:i') }}</small>
      </td>
      <td>
        <div>
          <img src="{{ action.user.avatar }}" style="width: 25px; margin-right: 3px;"> <strong>{{ action.user.name }}</strong>
          {{ actionTypes[action.action] | lower }}
        </div>
        {% if action.action starts with 'profile' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            <a href="{{ path('viewPerson', {'steamID': entity.username}) }}">{{ entity.getName() }}</a>
            {% if action.data2 %}
            : <code>{{ action.data2 }}</code>
            {% endif %}
          </div>
        {% endif %}
        {% if action.action starts with 'award' or action.action starts with 'winner' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if entity and action.action != 'award-delete' %}
              {{ entity.name }} :
            {% endif %}
            <code>{{ action.data1 }}</code>
          </div>
        {% endif %}
        {% if action.action starts with 'nominee' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if entity and action.action != 'nominee-delete' %}
              {{ entity.award.name }} : <code>{{ action.data1 }}</code><br>
              {{ entity.name }} : <code>{{ action.data2 }}</code>
            {% else %}
              <code>{{ action.data1 }}</code><br>
              <code>{{ action.data2 }}</code>
            {% endif %}
          </div>
        {% endif %}
        {% if action.action starts with 'advert' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if action.tableHistory %}
              {{ action.tableHistory.values.name }} :
            {% endif %}
            <code>{{ action.data1 }}</code><br>
          </div>
        {% endif %}
        {% if action.action == 'user-added' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            <a href="{{ path('viewPerson', {'steamID': entity.username}) }}">{{ entity.getName() }}</a>
            {% if action.data2 %}
              : <small>permission <code>{{ action.data2 }}</code></small>
            {% else %}
              : <small>no permissions given</small>
            {% endif %}
          </div>
        {% endif %}
      </td>
      <td>
        {% if action.tableHistory %}
          <a class="btn btn-default" onclick="$('#data{{ action.id }}').show();$(this).hide();">Show data</a>
          <div id="data{{ action.id }}" style="display: none;">
          {% for key, value in action.tableHistory.values %}
            <div><strong>{{ key }}:</strong> {{ value is iterable ? value | json_encode : value }}</div>
          {% endfor %}
          </div>
        {% endif %}
      </td>
    </tr>
  {% endfor %}
  </table>
{% endblock %}
<commit_msg>Display information for items in the audit log<commit_after>{% extends 'base/standard.html.twig' %}

{% block content %}
  <h1 class="page-header">Audit Log</h1>

  <blockquote>
    <p>
      He sees you when you're sleeping<br>
      He knows when you're awake<br>
      He knows if you've been bad or good<br>
      So be good for goodness sake<br>
    </p>
  </blockquote>

  <table class="table table-bordered table-striped" style="background-color: white;">
    <thead>
      <tr>
        <th style="width: 160px;">Time</th>
        <th style="width: 540px;">Action</th>
        <th>Data</th>
      </tr>
    </thead>
  {% for action in actions %}
    {% set entity = auditService.getEntity(action) %}
    <tr>
      <td>
        <abbr title="{{ action.timestamp.format('Y-m-d H:i:s') }}">
          {{ (action.timestamp | moment).fromNow.relative }}
        </abbr>
         &nbsp; <small class="text-muted">{{ action.timestamp.format('H:i') }}</small>
      </td>
      <td>
        <div>
          <img src="{{ action.user.avatar }}" style="width: 25px; margin-right: 3px;"> <strong>{{ action.user.name }}</strong>
          {{ actionTypes[action.action] | lower }}
        </div>
        {% if action.action starts with 'profile' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            <a href="{{ path('viewPerson', {'steamID': entity.username}) }}">{{ entity.getName() }}</a>
            {% if action.data2 %}
            : <code>{{ action.data2 }}</code>
            {% endif %}
          </div>
        {% endif %}
        {% if action.action starts with 'award' or action.action starts with 'winner' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if entity and action.action != 'award-delete' %}
              {{ entity.name }} :
            {% endif %}
            <code>{{ action.data1 }}</code>
          </div>
        {% endif %}
        {% if action.action starts with 'nominee' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if entity and action.action != 'nominee-delete' %}
              {{ entity.award.name }} : <code>{{ action.data1 }}</code><br>
              {{ entity.name }} : <code>{{ action.data2 }}</code>
            {% else %}
              <code>{{ action.data1 }}</code><br>
              <code>{{ action.data2 }}</code>
            {% endif %}
          </div>
        {% endif %}
        {% if action.action starts with 'advert' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if action.tableHistory %}
              {{ action.tableHistory.values.name }} :
            {% endif %}
            <code>{{ action.data1 }}</code><br>
          </div>
        {% endif %}
        {% if action.action starts with 'item' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            {% if action.tableHistory %}
              {{ action.tableHistory.values.name }} :
            {% endif %}
            <code>{{ action.tableHistory.values['short-name'] }}</code><br>
          </div>
        {% endif %}
        {% if action.action == 'user-added' %}
          <div style="margin-left: 31px; margin-top: 5px;">
            <a href="{{ path('viewPerson', {'steamID': entity.username}) }}">{{ entity.getName() }}</a>
            {% if action.data2 %}
              : <small>permission <code>{{ action.data2 }}</code></small>
            {% else %}
              : <small>no permissions given</small>
            {% endif %}
          </div>
        {% endif %}
      </td>
      <td>
        {% if action.tableHistory %}
          <a class="btn btn-default" onclick="$('#data{{ action.id }}').show();$(this).hide();">Show data</a>
          <div id="data{{ action.id }}" style="display: none;">
          {% for key, value in action.tableHistory.values %}
            <div><strong>{{ key }}:</strong> {{ value is iterable ? value | json_encode : value }}</div>
          {% endfor %}
          </div>
        {% endif %}
      </td>
    </tr>
  {% endfor %}
  </table>
{% endblock %}

{'fraction_non_alphanumeric': 0.19176302455502145, 'fraction_numerical': 0.009744056125763284, 'mean_word_length': 1.9027149321266967, 'pattern_counts': {'":': 0, '<': 176, '<?xml version=': 0, '>': 176, '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': '2734704', 'n_tokens_mistral': 2555, 'n_tokens_neox': 2283, 'n_words': 550}