@(courseOp: Option[models.organization.Course] = None)(implicit user: models.user.User, session: play.api.db.slick.Config.driver.simple.Session)

@import models.game.Games
@import views.html.tag.gameLink

@defining(courseOp match { case Some(course) => Games.requests(user.id, course.id); case None => Games.requests(user.id)}) { games : List[models.game.Game] =>

<section>
    <h5>Game Requests</h5>
    @if(games.isEmpty){<h6>You have no outstanding game requests</h6>} else {<h6>The following players have requested a game</h6>
    <ul class="pure-list">
        @for(game <- games) {<li> @gameLink(game.otherPlayer(user).nameView, game, 'class -> "button-xsmall") @tag.gameCourseLink(courseOp, game, 'class -> "button-xsmall") </li>}
    </ul>
    }
</section>

}
