<h1 class="title"><?= __('Sell item') ?></h1>

<ul class="breadcrumber">
    <li><a href="<?= url_to('/') ?>" data-ajax><?= __('Home') ?></a></li>
    <li><a href="<?= url_to('/direct-market') ?>" data-ajax><?= __('Direct Market') ?></a></li>
    <li class="active"><?= __('Sell') ?></li>
</ul>

<div class="warehouse-extended">
    <?php if (config('warehouse.extended')): ?>
        <?php if ($extended === null): ?>
            <a data-ajax class="btn" href="<?= url_to('/direct-market/sell?extended') ?>"><?= __('Extended') ?></a>
        <?php else: ?>
            <a data-ajax class="btn" href="<?= url_to('/direct-market/sell') ?>"><?= __('Normal') ?></a>
        <?php endif ?>
    <?php endif ?>
</div>

<div class="morpheus-warehouse">
    <?= $warehouse->getRenderer()
        ->setItemUrl('/direct-market/sell/{slot}' . ($extended === null ? '' : '?extended'))
        ->setActiveItem($item, $slot)
        ->render($extended === null ? 1 : 2) ?>
</div>

<div class="market-item">
    <?php if ($item === null): ?>

    <?php else: ?>
        <form class="form" data-ajax action="<?= url_to('/direct-market/sell/' . $slot . ($extended === null ? '' : '?extended')) ?>" method="post">
            <?= csrf_field() ?>

            <input type="hidden" name="pid" value="" />

            <div class="box-panel">
                <div class="box-panel-title">
                    <div class="box-panel-title-left"></div>
                    <div class="box-panel-title-content"><?= util('Item')->getFullName($item) ?></div>
                    <div class="box-panel-title-right"></div>
                </div>

                <div class="box-panel-content">
                    <div class="box">
                        <div class="row">
                            <div class="label">
                                <label for="target"><?= __('Target') ?> <span class="required">*</span></label>
                            </div>
                            <div class="field">
                                <input type="text" id="target" name="target" style="width:100%" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="label">
                                <label for="price"><?= __('Price') ?>(<?= __('$') ?>) <span class="required">*</span></label>
                            </div>
                            <div class="field">
                                <input type="text" id="price" name="price" style="width:100%" />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="submit">
                    <input type="submit" class="btn" value="<?= __('Sell') ?>">
                </div>
            </div>
        </form>
    <?php endif ?>
</div>