35a0a8dfa093b124317841bc82fec1320d5dde93..7a397279805473a76251db4821b7a8c0a76a554c
2020-05-01 Fibinger Ádám
Csapat import - Battlefy Edition
7a3972 diff | tree
2020-05-01 Fibinger Ádám
Stripe update - Wargasz logó
f84f9c diff | tree
3 files modified
28 ■■■■■ changed files
EOG/Models/TeamList.php 25 ●●●●● patch | view | raw | blame | history
templates/admin/modules/update.twig 1 ●●●● patch | view | raw | blame | history
templates/overlays/stripe.twig 2 ●●● patch | view | raw | blame | history
EOG/Models/TeamList.php
@@ -11,9 +11,7 @@
     */
    protected $teams = [];
    private $requiredRawFields = ['name', 'seed', 'status'];
    public function fromJson(string $jsonString) : int
    public function fromJson(string $jsonString): int
    {
        $rawData = json_decode($jsonString, true);
@@ -31,16 +29,21 @@
        foreach ($rawData as $key => $team)
        {
            $rawKeys = array_keys($team);
            if (count(array_intersect($rawKeys, $this->requiredRawFields)) != 3)
            $players = [];
            if (is_array($team['players']))
            {
                continue;
                foreach ($team['players'] as $player)
                {
                    if (!empty($player['inGameName']))
                    {
                        $players[] = $player['inGameName'];
                    }
                }
            }
            if ($team['status'] == 'checkedIn')
            {
                $this->teams[] = $team;
            }
            $this->teams[] = [
                'name'    => $team['name'],
                'players' => $players
            ];
        }
        return (bool)count($this->teams);
templates/admin/modules/update.twig
@@ -6,6 +6,7 @@
        <div class="col-md-4 mb-4">
            <label for="json">Csapatok API Input adatai:</label>
            Pld: https://api.eslgaming.com/play/v1/leagues/198846/contestants válasz eredménye
            https://api.battlefy.com/tournaments/5e9c747db75c02203ab68eed/teams?page=1&limit=64
            <textarea class="form-control" name="json" id="json"></textarea>
            <button class="btn btn-secondary" type="submit">Csapatok frissítése</button>
        </div>
templates/overlays/stripe.twig
@@ -73,7 +73,7 @@
            {% block info_right %}
            <span class="info right">
                {% if stripe.cup.number starts with '#' %}
                    <img class="esl-logo" src="/assets/ESL_Logo.png"/>
                    <img class="wargasz-logo" src="/assets/WARGASZ_color.png"/>
                {% endif %}
            </span>
            {% endblock %}