<?php $this->layout('main', ['title' => __('Streamer/DJ Accounts'), 'manual' => true]) ?>

<div class="row">
    <div class="col-md-8">
        <div class="card">
            <div class="card-header ch-alt">
                <h2><?=__('Streamer/DJ Accounts') ?></h2>

                <a class="btn bgm-blue btn-float" role="button" title="<?=__('Add %s', __('Streamer')) ?>" href="<?=$router->named('stations:streamers:add', ['station' => $station->getId()]) ?>">
                    <span class="sr-only"><?=__('Add %s', __('Streamer')) ?></span><i class="zmdi zmdi-plus"></i>
                </a>
            </div>
            <div class="table-responsive">
                <table class="table table-striped">
                    <colgroup>
                        <col width="25%">
                        <col width="15%">
                        <col width="20%">
                        <col width="40%">
                    </colgroup>
                    <thead>
                    <tr>
                        <th><?=__('Actions') ?></th>
                        <th><?=__('Username') ?></th>
                        <th><?=__('Display Name') ?></th>
                        <th><?=__('Notes') ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($streamers as $row): ?>
                        <?php /** @var App\Entity\StationStreamer $row */ ?>
                        <tr class="vertical-align-middle <?php if (!$row->getIsActive()): ?>text-muted<?php endif; ?>">
                            <td>
                                <a class="btn btn-sm btn-primary" href="<?=$router->fromHere('stations:streamers:edit', ['id' => $row->getId()]) ?>"><?=__('Edit') ?></a>
                                <a class="btn btn-sm btn-danger" href="<?=$router->fromHere('stations:streamers:delete', ['id' => $row->getId(), 'csrf' => $csrf]) ?>"><?=__('Delete') ?></a>
                            </td>
                            <td><code><?=$this->e($row->getStreamerUsername()) ?></code></td>
                            <td><?=$this->e($row->getDisplayName()) ?></td>
                            <td><?=nl2br($this->e($row->getComments())) ?></td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="card">
            <div class="card-header ch-alt">
                <h2><?=__('Connection Information') ?></h2>
            </div>
            <div class="card-body card-padding">
                <h4><?=__('IceCast Clients') ?></h4>
                <dl>
                    <dt><?=__('Server') ?>:</dt>
                    <dd><?=$this->e($server_url) ?></dd>

                    <dt><?=__('Port') ?>:</dt>
                    <dd><?=(int)$stream_port ?></dd>

                    <dt><?=__('Mount Name') ?>:</dt>
                    <dd>/</dd>
                </dl>

                <h4><?=__('ShoutCast v1 Clients') ?></h4>
                <dl>
                    <dt><?=__('Server') ?>:</dt>
                    <dd><?=$this->e($server_url) ?></dd>

                    <dt><?=__('Port') ?>:</dt>
                    <dd><?=((int)$stream_port + 1) ?></dd>

                    <dt><?=__('Password') ?>:</dt>
                    <dd>
                        dj_username:dj_password<br>
                        <small><?=__('(DJ username and password separated by a colon)') ?></small>
                    </dd>
                </dl>

                <p><?=sprintf(__('Setup instructions for broadcasting software are available <a href="%s" target="_blank">on the AzuraCast Wiki</a>.'), 'https://github.com/AzuraCast/AzuraCast/wiki/Streaming-Software') ?></p>
            </div>
        </div>
    </div>
</div>

