class window.PhotoCtrl extends BaseCtrl
    constructor: (@$rootScope, @$scope, @$state, @Dock, @Constants, @$injector) ->
        super()

        @hasError = false;
        if not @Dock.hasBoard() or not @Dock.hasUserName()
            @$state.go(@Constants.routes.home);

    continue: ->
        if @$scope.photoForm.$valid
            @hasError = false;
            if @Dock.hasUserToken()
              @$state.go(@Constants.routes.submission, {boardId: @boardId})
            else
              @$state.go(@Constants.routes.email, {boardId: @boardId})
        else 
            @hasError = true


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

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