class window.BoardsCtrl extends BaseCtrl
    constructor: (@$rootScope, @$scope, @$state, @$injector, @Dock, @Constants) ->
        super()
        if @Dock.getNumberOfBoards() < 1
            @setGoBackSlide()
            @$state.go(@Constants.routes.home)

    continue: (boardId) =>
        console.log "board is "+boardId if DEBUG
        #change class on slide-container in index.html (in case the last transition was from the back button)
        @setForwardSlide()
        @Dock.setBoardFromId(boardId)
        #@$rootScope.backgroundImage = @Dock.data.board.images.display

        if @Dock.hasUserName()
            @$state.go(@Constants.routes.upload, {boardId: boardId})
        else
            console.log "no username found" if DEBUG
            @$state.go(@Constants.routes.user, {boardId: boardId})

BoardsCtrl.$inject = ["$rootScope","$scope", "$state", "$injector", "Dock", "Constants"]

angular.module("shuttlerockApp").controller("BoardsCtrl", BoardsCtrl)