NavHead(it.name),
NavLink("/user/${it.id}", "Your User Page"),
NavLink("https://nationstates.net/${it.id}", "Your NationStates Page"),
- NavLink("/auth/logout", "Log Out", attributes = mapOf("data-method" to "post", "data-csrf-token" to createCsrfToken("/auth/logout")))
+ NavLink("/auth/logout", "Log Out", linkAttributes = mapOf("data-method" to "post", "data-csrf-token" to createCsrfToken("/auth/logout")))
)
} ?: listOf(
NavHead("Log In"),
}
}
-data class NavLink(val to: String, val text: String, val aClasses: String? = null, val attributes: Map<String, String> = emptyMap()) : NavItem() {
+data class NavLink(val to: String, val text: String, val aClasses: String? = null, val linkAttributes: Map<String, String> = emptyMap()) : NavItem() {
override fun DIV.display() {
a(href = to, classes = aClasses) {
- for ((attrName, attrValue) in attributes)
+ for ((attrName, attrValue) in linkAttributes)
attributes[attrName] = attrValue
+text