package de.thpeetz.kontor

import de.thpeetz.kontor.KontorProperties
import de.thpeetz.kontor.Navigation
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.ui.set
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping

@Controller
@RequestMapping("/")
class KontorController(val properties: KontorProperties, val navigation: Navigation) {
    @GetMapping("/")
    fun blog(model: Model): String {
        model["title"] = properties.title
        model["title"] = "Kontor"
        model["banner"] = properties.banner
        model["version"] = properties.version
        model["navigation"] = navigation.links()
        model["login"] = navigation.login()
        return "kontor"
    }
}