@* * Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0 * See accompanying LICENSE file. *@ @import scalaz.{\/} @(cluster: String, errorOrForm: kafka.manager.ApiError \/ (Form[models.form.CreateTopic], kafka.manager.model.ClusterContext) )(implicit af: features.ApplicationFeatures, messages: play.api.i18n.Messages, menus: models.navigation.Menus, request:RequestHeader) @import helper._ @import controllers.routes @theMenu = { @views.html.navigation.clusterMenu(cluster,"Topic","Create",menus.clusterMenus(cluster)( errorOrForm.toOption.map(_._2.clusterFeatures).getOrElse(kafka.manager.features.ClusterFeatures.default))) } @renderForm(createTopicForm: Form[models.form.CreateTopic]) = {
@b4.text(createTopicForm("topic"), '_label -> "Topic", 'placeholder -> "", 'autofocus -> true ) @b4.text(createTopicForm("partitions"), '_label -> "Partitions", 'placeholder -> "8") @b4.text(createTopicForm("replication"), '_label -> "Replication Factor", 'placeholder -> "3") @b4.submit('class -> "submit-button btn btn-primary"){ Create } Cancel |
@helper.repeat(createTopicForm("configs"), min = 1) { configsForm => @b4.hidden(configsForm("name").name, configsForm("name").value.getOrElse("")) @b4.hidden(configsForm("help").name, configsForm("help").value.getOrElse("")) @b4.text(configsForm("value"), '_label -> configsForm("name").value.getOrElse(""), '_help -> configsForm("help").value.getOrElse("")) } |