@* * Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0 * See accompanying LICENSE file. *@ @import scalaz.{\/} @(cluster: String, topic: String, errorOrForm: kafka.manager.ApiError \/ (Form[models.form.AddTopicPartitions], 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","Add Partitions",menus.clusterMenus(cluster)( errorOrForm.toOption.map(_._2.clusterFeatures).getOrElse(kafka.manager.features.ClusterFeatures.default))) } @renderForm(addTopicPartitionsForm: Form[models.form.AddTopicPartitions]) = { @b4.vertical.form(routes.Topic.handleAddPartitions(cluster, topic)) { implicit fc =>
Add PartitionsBrokers
@b4.text(addTopicPartitionsForm("topic"), '_label -> "Topic", 'placeholder -> "", 'autofocus -> true ) @b4.text(addTopicPartitionsForm("partitions"), '_label -> "Partitions", 'placeholder -> "8") @b4.hidden(addTopicPartitionsForm("readVersion").name,addTopicPartitionsForm("readVersion").value.getOrElse(-1)) @helper.repeat(addTopicPartitionsForm("brokers"), min = 1) { brokerSelectForm => @b4.hidden(brokerSelectForm("id").name,brokerSelectForm("id").value.getOrElse(-1)) @b4.hidden(brokerSelectForm("host").name,brokerSelectForm("host").value.getOrElse("")) @b4.checkbox(brokerSelectForm("selected"), '_text -> s"${brokerSelectForm("id").value.getOrElse(-1)} - ${brokerSelectForm("host").value.getOrElse("")}") }
@b4.submit('class -> "submit-button btn btn-primary"){ Add Partitions } Cancel } } @main( "Add Partitions", menu = theMenu, breadcrumbs=views.html.navigation.breadCrumbs(models.navigation.BreadCrumbs.withNamedViewAndClusterAndTopic("Topic View",cluster,topic,"Add Partitions"))) {

Add Partitions

@errorOrForm.fold( views.html.errors.onApiError(_), t => renderForm(t._1))
}