Fibinger Ádám
2020-03-27 b158104ad7bc0ef74466e26620f66949ba6f730f
templates/admin/modules/overlay.twig
@@ -1,7 +1,6 @@
{% extends "admin/site-base.twig" %}
{% block body %}
    <h1 class="display-4">Mérkőzés overlay</h1>
    <form action="/generator/form.php" method="post">
        <input type="hidden" name="stripe[class]" value="team-ban"/>
@@ -20,18 +19,32 @@
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="form-row">
                <div class="form-group bg-primary">
                    {% include 'admin/modules/team-list-select.twig' %}
                    <div class="col-md-12 mb-4">
                        <label for="team_blue_name" class="bg-primary">Kék csapat neve</label>
                        <input type="text" name="stripe[team][blue][name]" class="form-control team" id="team_blue_name"
                               placeholder="Pld.: Impress!ve" value="{{ stripe.team.blue.name }}" required>
               {% include 'admin/modules/team-list-select.twig'  with {'target': 'team_blue_name'} %}
            </div>
            <div class="col-md-12 mb-4">
               <div class="form-group">
                  <label>Kék csapat neve
                     <input type="text" name="stripe[team][blue][name]" class="form-control team"
                           id="team_blue_name"
                           placeholder="Pld.: Impress!ve" value="{{ stripe.team.blue.name }}">
                  </label>
               </div>
               <div class="form-group">
                  <label>
                     <input type="checkbox" id="checkbox_p_b1" name="stripe[team][blue][score][0]"
                           value="true" {{ stripe.team.blue.score[0] ? "checked" }}>Map 1</label>
                  <label>
                     <input type="checkbox" id="checkbox_p_b2" name="stripe[team][blue][score][1]"
                           value="true" {{ stripe.team.blue.score[1] ? "checked" }}>Map 2</label>
               </div>
                    </div>
                    <div class="col-md-12 mb-4">
                        <label for="op-blue" class="bg-primary">Banolt operátorok</label>
                        <select name="stripe[team][blue][ban][]" class="operators" id="op-blue" style="width: 100%" multiple>
               <select name="stripe[team][blue][ban][]" class="operators" id="op-blue" style="width: 100%"
                     multiple>
                            {% for operator in operators %}
                                <option value="{{ operator }}" {{ operator in stripe.team.blue.ban ? "selected" }}>{{ operator|capitalize }}</option>
                            {% endfor %}
@@ -43,11 +56,30 @@
                    </button>
                </div>
                <div class="form-group bg-warning">
                    {% include 'admin/modules/team-list-select.twig' %}
                    <div class="col-md-12 mb-4">
                        <label for="team_orange_name">Narancs csapat neve</label>
                        <input type="text" name="stripe[team][orange][name]" class="form-control team" id="team_orange_name"
                               placeholder="Pld.: Opress!ve" value="{{ stripe.team.orange.name }}" required>
               {% include 'admin/modules/team-list-select.twig'  with {'target': 'team_orange_name'} %}
                </div>
            <div class="col-md-12 mb-4">
               <div class="form-group">
                  <label>Narancs csapat neve
                     <input type="text" name="stripe[team][orange][name]" class="form-control team"
                           id="team_orange_name"
                           placeholder="Pld.: Opress!ve" value="{{ stripe.team.orange.name }}">
                  </label>
               </div>
               <div class="form-group">
                  <label>
                     <input type="checkbox" id="checkbox_po_1" name="stripe[team][orange][score][0]"
                           value="true" {{ stripe.team.orange.score[0] ? "checked" }}>
                            Map 1
                  </label>
                  <label>
                     <input type="checkbox" id="checkbox_po_2" name="stripe[team][orange][score][1]"
                           value="true" {{ stripe.team.orange.score[1] ? "checked" }}>
                            Map 2
                  </label>
               </div>
                    </div>
                    <div class="col-md-12 mb-4">
                        <label for="op-orange" class="bg-warning">Banolt operátorok</label>
@@ -60,13 +92,12 @@
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <button class="btn btn-primary mx-auto" type="submit">Overlay felülírása</button>
        </div>
    </form>
    <iframe src="/overlays/team-ban-refresh.html" width="100%"></iframe>
   <iframe src="/overlays/team-ban-refresh.html?asdf={{ random(1, 10000000) }}" width="100%"></iframe>
{% endblock %}
{% block lazyload %}
    {{ parent() }}
@@ -79,7 +110,8 @@
        );
        $('.teamname').chosen().on('change',function (event) {
            $(this).parent().children().find('input.team')[0].value = event.target.value;
            var target = document.getElementById($(this).data('target'));
            $(target).val(event.target.value);
        });
        function swapTeams() {