Add validation for label name and color.

This commit is contained in:
takezoe
2013-06-26 02:11:19 +09:00
parent f335d30ac7
commit e334570670
2 changed files with 6 additions and 4 deletions

View File

@@ -14,13 +14,13 @@ trait LabelsControllerBase extends ControllerBase {
case class LabelForm(labelName: String, color: String)
val newForm = mapping(
"newLabelName" -> trim(label("Label name", text(required, maxlength(100)))),
"newColor" -> trim(label("Color", text(required, maxlength(7))))
"newLabelName" -> trim(label("Label name", text(required, identifier, maxlength(100)))),
"newColor" -> trim(label("Color", text(required, color)))
)(LabelForm.apply)
val editForm = mapping(
"editLabelName" -> trim(label("Label name", text(required, maxlength(100)))),
"editColor" -> trim(label("Color", text(required, maxlength(7))))
"editLabelName" -> trim(label("Label name", text(required, identifier, maxlength(100)))),
"editColor" -> trim(label("Color", text(required, color)))
)(LabelForm.apply)
post("/:owner/:repository/issues/label/new", newForm)(writableRepository { form =>