Start to implement issue labels.

This commit is contained in:
takezoe
2013-06-24 13:53:10 +09:00
parent b591cc1454
commit dff658aa68
3 changed files with 27 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ class ScalatraBootstrap extends LifeCycle {
context.mount(new RepositoryViewerController, "/*")
context.mount(new WikiController, "/*")
context.mount(new IssuesController, "/*")
context.mount(new LabelsController, "/*")
context.mount(new MilestonesController, "/*")
context.mount(new SettingsController, "/*")

View File

@@ -0,0 +1,7 @@
package app
class LabelsController extends LabelsControllerBase
trait LabelsControllerBase extends ControllerBase {
}

View File

@@ -0,0 +1,19 @@
package service
import scala.slick.driver.H2Driver.simple._
import Database.threadLocalSession
import scala.slick.jdbc.{StaticQuery => Q}
import Q.interpolation
import model._
import Labels._
trait LabelsService {
def getLabels(owner: String, repository: String): List[Label] =
Query(Labels)
.filter(l => (l.userName is owner.bind) && (l.repositoryName is repository.bind))
.sortBy(_.labelName asc)
.list
}