EOG/Models/Stripe.php | ●●●●● patch | view | raw | blame | history | |
save-interview.php | ●●●●● patch | view | raw | blame | history | |
templates/admin/html-skeleton.twig | ●●●●● patch | view | raw | blame | history | |
templates/admin/modules/overlay.twig | ●●●●● patch | view | raw | blame | history | |
templates/admin/modules/team-list-select.twig | ●●●●● patch | view | raw | blame | history | |
templates/overlays/stripe.twig | ●●●●● patch | view | raw | blame | history |
EOG/Models/Stripe.php
@@ -31,13 +31,22 @@ 'ban' => [ 'mira', 'jackal' ], 'score' => [ true, true ] ], 'blue' => [ 'name' => 'Kék csapat', 'ban' => [ 'rook', 'blitz' ], 'score' => [ true, true ] ] ] @@ -58,6 +67,11 @@ private function setSimpleStripe() { unset($this->state['team']); } public function setScore(string $team, int $number, bool $score) { $this->state['team'][$team]['score'][$number] = $score; } public function setCup(string $number, string $name) @@ -125,10 +139,25 @@ public function loadFromArray(array $state) { unset($this->state); $this->state = []; if (!empty($state['team']['orange']['score'][0])) { $this->setScore('orange',0,true); } if (!empty($state['team']['orange']['score'][1])) { $this->setScore('orange',1,true); } if (!empty($state['team']['blue']['score'][0])) { $this->setScore('blue',0,true); } if (!empty($state['team']['blue']['score'][1])) { $this->setScore('blue',1,true); } if (!empty($state['stripe']["class"])) { $this->setClass($state['stripe']["class"]); save-interview.php
New file @@ -0,0 +1,35 @@ <?php include_once "common/base.php"; if (empty($_POST['interview'])) { header('Location: /generator/form.php', true, 302); } $interview = new \EOG\Models\Interview(); $interview->setTitle("Interrogacioon!"); $interview->setTeamName($_POST['interview']['teamName']); $interview->setPlayers($_POST['interview']['players']); $html_content = $twig->render('overlays/interrogacion.twig', [ 'i' => $interview, 'autorefresh' => 5 ] ); file_put_contents(OVERLAY_DIR . 'interview.html', $html_content); file_put_contents(OVERLAY_DIR . 'interview-full.html', $html_content); var_dump($interview); if ($success) { header('Location: /generator/form.php', true, 302); } else { echo "Szar van a palacsintában. "; } templates/admin/html-skeleton.twig
@@ -5,9 +5,8 @@ <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="assets/chosen.css"> {% endblock %} </head> @@ -20,15 +19,11 @@ {% block lazyload %} <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> <script src="assets/chosen.jquery.js" type="text/javascript"></script> {% endblock %} </body> 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() { templates/admin/modules/team-list-select.twig
@@ -1,4 +1,4 @@ <select class="teamname"> <select class="teamname" data-target="{{ target }}"> {% for teamName in teamNames %} <option value="{{ teamName }}">{{ teamName }}</option> {% endfor %} templates/overlays/stripe.twig
@@ -39,9 +39,19 @@ {% endif %} {% endblock %} {% block logo %} <span class="logo"></span> {% if stripe.team.blue.score[0] == true %} <div class="mapwin left one"></div> {% endif %} {% if stripe.team.blue.score[1] == true %} <div class="mapwin left two"></div> {% endif %} {% if stripe.team.orange.score[0] == true %} <div class="mapwin right one"></div> {% endif %} {% if stripe.team.orange.score[1] == true %} <div class="mapwin right two"></div> {% endif %} {% endblock %} {% block team_orange %} {% if stripe.team.orange and stripe.stripe.class in ['team-ban', 'team'] %} <span class="team orange"> @@ -62,7 +72,7 @@ {% block info_right %} <span class="info right"> {% if stripe.cup.number %} {% if stripe.cup.number starts with '#' %} <img class="esl-logo" src="/assets/ESL_Logo.png"/> {% endif %} </span>