Implementing label editing form.

This commit is contained in:
takezoe
2013-06-25 03:17:23 +09:00
parent f5f408fb55
commit 65ac07a0fe
4 changed files with 44 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ class LabelsController extends LabelsControllerBase
with LabelsService with RepositoryService with AccountService with WritableRepositoryAuthenticator
trait LabelsControllerBase extends ControllerBase {
self: LabelsService with WritableRepositoryAuthenticator =>
self: LabelsService with RepositoryService with WritableRepositoryAuthenticator =>
case class LabelForm(labelName: String, color: String)
@@ -26,4 +26,15 @@ trait LabelsControllerBase extends ControllerBase {
redirect("/%s/%s/issues".format(owner, repository))
})
get("/:owner/:repository/issues/label/:labelId/edit")(writableRepository {
val owner = params("owner")
val repository = params("repository")
val labelId = params("labelId").toInt
getLabel(owner, repository, labelId) match {
case None => NotFound()
case Some(l) => issues.html.labeledit(Some(l), getRepository(owner, repository, baseUrl).get)
}
})
}