ChrisBAshton/smartresolution

View on GitHub
webapp/core/view/dispute_view--list.html

Summary

Maintainability
Test Coverage
<h1>Disputes</h1>

<?php
if (count($disputes) === 0) :
    echo '<p class="bg-padded bg-info">No disputes yet.</p>';
else :
?>

<div class="list">

    <div class="row list__item">
        <div class="list__item__status col-sm-4">
            <h3>Status</h3>
        </div>
        <div class="list__item__title col-sm-4">
            <h3>Dispute Title</h3>
        </div>
        <div class="list__item__lifespan col-sm-4">
            <h3>Lifespan Status</h3>
        </div>
    </div>
    <?php
    foreach($disputes as $dispute) {
    ?>
        <div class="row list__item">
            <div class="list__item__title col-sm-4">
                <?php
                    $state = DisputeStateCalculator::instance()->getState($dispute, $account);
                    echo $state->getStateDescription();
                ?>
            </div>
            <div class="list__item__title col-sm-4">
                <a href="<?php echo $dispute->getUrl(); ?>"><?php echo $dispute->getTitle(); ?></a>
            </div>
            <div class="list__item__lifespan col-sm-4">
                <?php echo '<a href="' . $dispute->getUrl() . '/lifespan">' . $dispute->getLatestLifespan()->status() . '</a>'; ?>
            </div>
        </div>
    <?php
    }
    ?>

</div>

<?php
endif;
?>