                 event.preventDefault()
                 @model.destroy().then ->
                     app.router.navigate 'albums', true
+        true
 
     # Change sharing state of the album.
     changeClearance: (event) =>

        @saveModel description: @description.val().trim()

    makeEditable: =>
        @$el.addClass 'editing'
        @options.editable = true
        @galery.options.editable = true

    makeNonEditable: =>
        @$el.removeClass 'editing'
        @options.editable = false
        @galery.options.editable = false

        res

    afterRender: ->

        # Use title of album as window title
        document.title = "#{t 'application title'} - #{@model.get 'title'}"

        @title = @$ '#title'
        @description = @$ '#description'

        @galery = new Galery
            el: @$ '#photos'
            editable: @options.editable
            collection: @model.photos
            beforeUpload: @beforePhotoUpload

        @galery.album = @model
        @galery.render()

        if @options.editable
            @makeEditable()
        else
            @title.addClass 'disabled'
            @description.addClass 'disabled'


    beforePhotoUpload: (callback) =>
        callback albumid: @model.id
