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

{% block body %}

<div class="col-sm-5">
    <h1>{{ event }}</h1>

    <table class="showTable">
        <tbody>
            <tr>
                <th>Name</th>
                <td>{{ event.name }}</td>
            </tr>
            <tr>
                <th>Description</th>
                <td>{{ event.description }}</td>
            </tr>
{% if event.location is not null %}
            <tr>
                <th>Location</th>
                <td>{{ event.location.name }}</td>
            </tr>
{% endif %}
            <tr>
                <th>Start</th>
                <td>{% if event.start %}{{ event.start|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
            <tr>
                <th>End</th>
                <td>{% if event.end %}{{ event.end|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
            <tr>
                <th>State</th>
                <td>{{ event.state }}</td>
            </tr>
{% if event.children.count > 0 %}
            <tr>
                <th>Sub events</th>
                <td>
{% for child in event.children %}
                    <a href="{{ path('event_show', { 'id': child.id }) }}">{{ child.name }}</a><br>
{% endfor %}
                </td>
            </tr>
{% endif %}
        </tbody>
    </table>

    <ul>
{% if event.parent %}
        <li>
          <a href="{{ path('event_show', { 'id': event.parent.id }) }}">Back to {{ event.parent.name }}</a><br>
        </li>
{% endif %}
        <li>
            <a href="{{ path('event_log', { 'id': event.id }) }}">History</a>
        </li>
        <li>
            <a href="{{ path('event_index') }}">Back to Events</a>
        </li>
        <li>
            <a href="{{ path('event_edit', { 'id': event.id }) }}">Edit</a>
        </li>
        <li>
            <a href="{{ path('event_new', {'parent': event.id}) }}">Create a sub event</a>
        </li>
        <li>
            {{ form_start(delete_form) }}
                <input type="submit" value="Delete">
            {{ form_end(delete_form) }}
        </li>
        <li>
            {% set mconf = {'mconfig': {
                    'subject': "",
                    'to_field': false,
                    'from_field': false,
                    'message_type': 'AdminNote',
                    'context': {
                        'system': 'crewcall',
                        'object_name': 'event',
                        'external_id': event.id
                        }
                    }
                }
            %}
            {% include 'BisonLabSakonninBundle:Message:_create_popup.html.twig' with mconf %}
            <a href="#" onClick="createMessage()">Add a note</a><br />
        </li>
{% set sfconf = {'sfconfig': {
        'context': {
            'system': 'crewcall',
            'object_name': 'event',
            'external_id': event.id
            }
        }
    }
%}
{% include 'BisonLabSakonninBundle:SakonninFile:_create_popup.html.twig' with sfconf %}
        <li>
          <a href="#" onClick="uploadFile(); return false;">Add a document or image</a><br />
        </li>
    </ul>
{% set mlogcontext = {
            'system': 'crewcall',
            'object_name': 'event',
            'message_type': 'Notes',
            'external_id': event.id
    }
%}
{% for note in sakonnin_messages.MessagesForContext(mlogcontext) %}
    <strong>{{ note.subject }}</strong><br>
    <pre>{{ note.body }}</pre>
    <br>
{% endfor %}
{% set filecontext = {
            'system': 'crewcall',
            'object_name': 'event',
            'external_id': event.id
    }
%}
{% include 'CrewCallBundle::_files.html.twig' with filecontext %}
</div>
<div class="col-sm-7">
<h3>Shifts</h3>
{% include 'CrewCallBundle:shift:handling.html.twig' with { 'event': event}  %}
</div>
{% endblock %}
<commit_msg>Put note and file creation (mostly) on top.<commit_after>{% extends 'base.html.twig' %}

{% block body %}

<div class="col-sm-5">
    <h1>{{ event }}</h1>

    <table class="showTable">
        <tbody>
            <tr>
                <th>Name</th>
                <td>{{ event.name }}</td>
            </tr>
            <tr>
                <th>Description</th>
                <td>{{ event.description }}</td>
            </tr>
{% if event.location is not null %}
            <tr>
                <th>Location</th>
                <td>{{ event.location.name }}</td>
            </tr>
{% endif %}
            <tr>
                <th>Start</th>
                <td>{% if event.start %}{{ event.start|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
            <tr>
                <th>End</th>
                <td>{% if event.end %}{{ event.end|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
            <tr>
                <th>State</th>
                <td>{{ event.state }}</td>
            </tr>
{% if event.children.count > 0 %}
            <tr>
                <th>Sub events</th>
                <td>
{% for child in event.children %}
                    <a href="{{ path('event_show', { 'id': child.id }) }}">{{ child.name }}</a><br>
{% endfor %}
                </td>
            </tr>
{% endif %}
        </tbody>
    </table>

    <ul>
{% if event.parent %}
        <li>
          <a href="{{ path('event_show', { 'id': event.parent.id }) }}">Back to {{ event.parent.name }}</a><br>
        </li>
{% endif %}
        <li>
            {% set mconf = {'mconfig': {
                    'subject': "",
                    'to_field': false,
                    'from_field': false,
                    'message_type': 'AdminNote',
                    'context': {
                        'system': 'crewcall',
                        'object_name': 'event',
                        'external_id': event.id
                        }
                    }
                }
            %}
            {% include 'BisonLabSakonninBundle:Message:_create_popup.html.twig' with mconf %}
            <a href="#" onClick="createMessage()">Add a note</a><br />
        </li>
{% set sfconf = {'sfconfig': {
        'context': {
            'system': 'crewcall',
            'object_name': 'event',
            'external_id': event.id
            }
        }
    }
%}
{% include 'BisonLabSakonninBundle:SakonninFile:_create_popup.html.twig' with sfconf %}
        <li>
          <a href="#" onClick="uploadFile(); return false;">Add a document or image</a><br />
        </li>
        <li>
            <a href="{{ path('event_log', { 'id': event.id }) }}">History</a>
        </li>
        <li>
            <a href="{{ path('event_index') }}">Back to Events</a>
        </li>
        <li>
            <a href="{{ path('event_edit', { 'id': event.id }) }}">Edit</a>
        </li>
        <li>
            <a href="{{ path('event_new', {'parent': event.id}) }}">Create a sub event</a>
        </li>
        <li>
            {{ form_start(delete_form) }}
                <input type="submit" value="Delete">
            {{ form_end(delete_form) }}
        </li>
    </ul>
{% set mlogcontext = {
            'system': 'crewcall',
            'object_name': 'event',
            'message_type': 'Notes',
            'external_id': event.id
    }
%}
{% for note in sakonnin_messages.MessagesForContext(mlogcontext) %}
    <strong>{{ note.subject }}</strong><br>
    <pre>{{ note.body }}</pre>
    <br>
{% endfor %}
{% set filecontext = {
            'system': 'crewcall',
            'object_name': 'event',
            'external_id': event.id
    }
%}
{% include 'CrewCallBundle::_files.html.twig' with filecontext %}
</div>
<div class="col-sm-7">
<h3>Shifts</h3>
{% include 'CrewCallBundle:shift:handling.html.twig' with { 'event': event}  %}
</div>
{% endblock %}

{'fraction_non_alphanumeric': 0.1924669945638105, 'fraction_numerical': 0.0018120631633445508, 'mean_word_length': 1.441390205371248, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 203, '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': '4651697', 'n_tokens_mistral': 2573, 'n_tokens_neox': 2405, 'n_words': 493}