* Page that lets the user create a new album.
*/
@TemplatePath("/templates/createAlbum.html")
-class CreateAlbumPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer):
- LoggedInPage("createAlbum.html", "Page.CreateAlbum.Title", webInterface, loaders, templateRenderer) {
+@ToadletPath("createAlbum.html")
+class CreateAlbumPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
+ LoggedInPage("Page.CreateAlbum.Title", webInterface, loaders, templateRenderer) {
override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
if (soneRequest.isPOST) {
setDescription(TextFilter.filter(soneRequest.httpRequest.getHeader("Host"), description))
}.update()
} catch (e: AlbumTitleMustNotBeEmpty) {
- throw RedirectException("emptyAlbumTitle.html")
+ redirectTo("emptyAlbumTitle.html")
}
soneRequest.core.touchConfiguration()
- throw RedirectException("imageBrowser.html?album=${album.id}")
+ redirectTo("imageBrowser.html?album=${album.id}")
}
}