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

{% block body %}
    <div class="ui main container">
        <div class="page-header">
            <h1>{{ 'Screens'|trans }}</h1>
        </div>

        {# TODO{p:0} save multiple/all at once (perhaps "dirty" flag and iteration?) #}
        <div class="ui cards">
            {% for screen in screens %}
                <div class="card">
                    <div class="image">
                        <img class="preview" src="{{ path('management-dashboard-preview', {'screen_guid': screen.getGuid()}) }}">
                    </div>
                    <div class="content">
                        <p>
                            <a href="{{ path('management-screen-data', {guid: screen.guid}) }}" class="ui button">{{ 'Settings'|trans }}</a>
                        </p>
                        <p>
                            <a class="ui open-modal olive labeled icon button"><i class="eye icon"></i>{{ 'View in online player'|trans }}</a>
                        </p>
                        <div class="ui modal">
                            <div class="header">{{ 'View in online player'|trans }}</div>
                            <div class="content">
                                <p>{{ 'Use the following link'|trans }}:</p>
                                <p>
                                    <a target="_blank" href="{{ url('shinage.online.player.view', {screenGuid: screen.guid}) }}">
                                        {{ url('shinage.online.player.view', {screenGuid: screen.guid}) }}
                                    </a>
                                </p>
                            </div>
                            <div class="actions">
                                <div class="ui cancel button">{{ 'Close'|trans }}</div>
                            </div>
                        </div>
                    </div>
                    <div class="extra content">
                        {{ 'Current'|trans }}: {{ screen.getCurrentPresentation() }}
                    </div>
                </div>
            {% endfor %}
        </div>
        
        <h3 class="ui top attached block header">
            {{ 'Connect screen'|trans }}
        </h3>

        <div class="ui bottom attached segment">
            <form action="{{ path('management-connect-screen') }}" method="post" class="form-inline">
                <label for="inlineFormInput">{{ 'Connect code'|trans }}:</label>
                <div class="ui input">
                    <input type="text" id="inlineFormInput" placeholder="12345678" name="connect_code" maxlength="8">
                </div>

                <label for="who">&nbsp;&nbsp;&nbsp;{{ 'Connect with'|trans }}: </label>
                <select class="ui dropdown" id="who" name="who">
                    <option value="me">{{ 'to my account'|trans }}</option>
                    {% for orga in organizations %}
                        <option value="{{ orga.getId() }}">{{ "Organization"|trans }}: {{ orga.getName() }}</option>
                    {% endfor %}
                </select>

                <button class="ui default button" type="submit" class="btn btn-primary">{{ "Connect"|trans }}</button>
            </form>
        </div>

        <a name="create_virtual"></a>
        <h3 class="ui top attached block header">
            {{ 'Create virtual screen'|trans }}
        </h3>

        <div class="ui bottom attached segment">
            {{ form(create_form) }}
        </div>
    </div>

{% endblock %}

{% block scripts %}
    <script>
        $('.ui.modal').modal({ detachable: false });
        $('.open-modal').on('click', function () {
            var $modal = $(this).parent().siblings('.ui.modal');
            $modal.modal('show');
        });

        $(document).ready(function(){
            $('[data-toggle="tooltip"]').tooltip();
        });
    </script>
{% endblock %}

{% block stylesheets %}
<style>

</style>
{% endblock %}<commit_msg>screens overview: fix displaced online player modals<commit_after>{% extends 'base.html.twig' %}

{% block body %}
    <div class="ui main container">
        <div class="page-header">
            <h1>{{ 'Screens'|trans }}</h1>
        </div>

        {# TODO{p:0} save multiple/all at once (perhaps "dirty" flag and iteration?) #}
        <div class="ui cards">
            {% for screen in screens %}
                <div class="card">
                    <div class="image">
                        <img class="preview" src="{{ path('management-dashboard-preview', {'screen_guid': screen.getGuid()}) }}">
                    </div>
                    <div class="content">
                        <p>
                            <a href="{{ path('management-screen-data', {guid: screen.guid}) }}" class="ui button">{{ 'Settings'|trans }}</a>
                        </p>
                        <p>
                            <a
                                    class="ui open-modal olive labeled icon button"
                                    data-screen-url="{{ url('shinage.online.player.view', {screenGuid: screen.guid}) }}"
                            >
                                <i class="eye icon"></i>{{ 'View in online player'|trans }}
                            </a>
                        </p>
                    </div>
                    <div class="extra content">
                        {{ 'Current'|trans }}: {{ screen.getCurrentPresentation() }}
                    </div>
                </div>
            {% endfor %}
        </div>

        <div id="modal--online-player" class="ui modal">
            <div class="header">{{ 'View in online player'|trans }}</div>
            <div class="content">
                <p>{{ 'Use the following link'|trans }}:</p>
                <p>
                    <a target="_blank" href="#"></a>
                </p>
            </div>
            <div class="actions">
                <div class="ui cancel button">{{ 'Close'|trans }}</div>
            </div>
        </div>
        
        <h3 class="ui top attached block header">
            {{ 'Connect screen'|trans }}
        </h3>

        <div class="ui bottom attached segment">
            <form action="{{ path('management-connect-screen') }}" method="post" class="form-inline">
                <label for="inlineFormInput">{{ 'Connect code'|trans }}:</label>
                <div class="ui input">
                    <input type="text" id="inlineFormInput" placeholder="12345678" name="connect_code" maxlength="8">
                </div>

                <label for="who">&nbsp;&nbsp;&nbsp;{{ 'Connect with'|trans }}: </label>
                <select class="ui dropdown" id="who" name="who">
                    <option value="me">{{ 'to my account'|trans }}</option>
                    {% for orga in organizations %}
                        <option value="{{ orga.getId() }}">{{ "Organization"|trans }}: {{ orga.getName() }}</option>
                    {% endfor %}
                </select>

                <button class="ui default button" type="submit" class="btn btn-primary">{{ "Connect"|trans }}</button>
            </form>
        </div>

        <a name="create_virtual"></a>
        <h3 class="ui top attached block header">
            {{ 'Create virtual screen'|trans }}
        </h3>

        <div class="ui bottom attached segment">
            {{ form(create_form) }}
        </div>
    </div>

{% endblock %}

{% block scripts %}
    <script>
        $('.ui.modal').modal({ detachable: false });
        $('.open-modal').on('click', function () {
            var url = $(this).data('screenUrl');
            var $modal = $('#modal--online-player');
            $('a', $modal).attr('href', url);
            $('a', $modal).text(url);
            $modal.modal('show');
        });

        $(document).ready(function(){
            $('[data-toggle="tooltip"]').tooltip();
        });
    </script>
{% endblock %}

{% block stylesheets %}
<style>

</style>
{% endblock %}
{'fraction_non_alphanumeric': 0.17214748380667663, 'fraction_numerical': 0.003986048829098156, 'mean_word_length': 1.4293494704992435, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 151, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6700433', 'n_tokens_mistral': 2190, 'n_tokens_neox': 2031, 'n_words': 489}