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

        if not @Dock.hasEntryId()
            #this means the page has been reloaded
            @$state.go(@Constants.routes.home)

        @hasCoupon = angular.copy(@Dock.hasCoupon())
        @board = angular.copy(@Dock.data.board)
        @entryId = angular.copy(@Dock.getEntryId())
        @Dock.removeEntry()
        @$rootScope.hideNavbar = false
        @$rootScope.hideButtons = true

    viewPhoto: =>
        console.log "@entryId is #{@entryId}" if DEBUG
        @$state.go(@Constants.routes.viewPhoto, {entryId: @entryId})

    sharePhoto: =>
        @$state.go(@Constants.routes.share, {entryId: @entryId})

    goHome: ->
      @$state.go(@Constants.routes.home)


ConfirmationCtrl.$inject = ["$scope", "$state", "Dock", "Constants", "Coupons", "$injector"]

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