analyze -> analyse

This commit is contained in:
Thibault Duplessis 2013-10-02 18:02:59 +02:00
parent 2ca5610924
commit ade64ed258
8 changed files with 15 additions and 15 deletions

View file

@ -92,7 +92,7 @@ themepicker = true) {
}.getOrElse { "Unknown" }
<nav>
@round.continueFromHere(pov.game, true)
@if(ctx.isAuth && game.analyzable && analysis.isEmpty) {
@if(ctx.isAuth && game.analysable && analysis.isEmpty) {
<form class="request_analysis" action="@routes.Analyse.computer(gameId, color.name)" method="post">
<a>@trans.requestAComputerAnalysis()</a>
</form>

View file

@ -138,7 +138,7 @@ moreCss = moreCss) {
<label>Analyzed</label>
</th>
<td class="single">
@{ base.checkbox(form("analyzed"), Query.analyzeds._2, 1) }
@{ base.checkbox(form("analysed"), Query.analyseds._2, 1) }
</td>
</tr>
</table>

View file

@ -32,7 +32,7 @@ final class Analyser(
}
def doGenerate: Fu[Analysis] =
$find.byId[Game](id) map (_ filter (_.analyzable)) zip
$find.byId[Game](id) map (_ filter (_.analysable)) zip
(PgnRepo getNonEmpty id) zip
(GameRepo initialFen id) flatMap {
case ((Some(game), Some(pgn)), initialFen) (for {

View file

@ -250,7 +250,7 @@ case class Game(
def finishedOrAborted = finished || aborted
def analyzable = finished && (source.fold(true)(Source.Position!=))
def analysable = finished && (source.fold(true)(Source.Position!=))
def winner = players find (_.wins)

View file

@ -32,7 +32,7 @@ private[gameSearch] final class DataForm {
"dateMin" -> optional(stringIn(Query.dates)),
"dateMax" -> optional(stringIn(Query.dates)),
"status" -> optional(numberIn(Query.statuses)),
"analyzed" -> optional(numberIn(Query.analyzeds :: Nil)),
"analysed" -> optional(numberIn(Query.analyseds :: Nil)),
"sort" -> mapping(
"field" -> stringIn(Sorting.fields),
"order" -> stringIn(Sorting.orders)
@ -57,7 +57,7 @@ private[gameSearch] case class SearchData(
dateMin: Option[String] = None,
dateMax: Option[String] = None,
status: Option[Int] = None,
analyzed: Option[Int] = None,
analysed: Option[Int] = None,
sort: SearchSort = SearchSort()) {
lazy val query = Query(
@ -74,7 +74,7 @@ private[gameSearch] case class SearchData(
duration = Range(durationMin, durationMax),
date = Range(dateMin flatMap toDate, dateMax flatMap toDate),
status = status,
analyzed = analyzed map (_ == 1),
analysed = analysed map (_ == 1),
sorting = Sorting(sort.field, sort.order)
)

View file

@ -74,7 +74,7 @@ final class Env(
val nbGames = games.size
nb = nb + nbGames
PgnRepo.associate(gameIds) flatMap { pgns
analyser hasMany gameIds map { analyzedIds
analyser hasMany gameIds map { analysedIds
val pairs = (pgns map {
case (id, pgn) games.find(_.id == id) map (_ -> pgn)
}).flatten
@ -84,7 +84,7 @@ final class Env(
IndexName,
TypeName,
game.id,
Json stringify Game.from(game, pgn, analyzedIds contains game.id)
Json stringify Game.from(game, pgn, analysedIds contains game.id)
).request
})
}

View file

@ -21,7 +21,7 @@ private[gameSearch] object Game {
val opening = "op"
val date = "da"
val duration = "du"
val analyzed = "an"
val analysed = "an"
}
import fields._
@ -55,7 +55,7 @@ private[gameSearch] object Game {
field(opening, "string"),
field(date, "date", attrs = Json.obj("format" -> Date.format)),
field(duration, "short"),
field(analyzed, "boolean")
field(analysed, "boolean")
))
)
}
@ -72,6 +72,6 @@ private[gameSearch] object Game {
date -> (Date.formatter print game.createdAt),
duration -> game.estimateTotalTime,
opening -> Json.toJson(OpeningExplorer openingOf pgn map (_.code.toLowerCase)),
analyzed -> anal
analysed -> anal
)
}

View file

@ -24,7 +24,7 @@ case class Query(
date: Range[DateTime] = Range.none,
duration: Range[Int] = Range.none,
sorting: Sorting = Sorting.default,
analyzed: Option[Boolean] = None) extends lila.search.Query {
analysed: Option[Boolean] = None) extends lila.search.Query {
def nonEmpty =
user1.nonEmpty ||
@ -65,7 +65,7 @@ case class Query(
toFilters(rated, fields.rated),
toFilters(opening, fields.opening),
toFilters(status, fields.status),
toFilters(analyzed, fields.analyzed)
toFilters(analysed, fields.analysed)
).flatten.toNel map { fs andFilter(fs.list: _*) }
private def hasAiFilters = hasAi.toList map { a
@ -102,7 +102,7 @@ object Query {
val aiLevels = (1 to 8) map { l l -> ("Stockfish level " + l) }
val analyzeds = 1 -> "Analysis available"
val analyseds = 1 -> "Analysis available"
val dates = List("0d" -> "Now") ++
options(List(1, 2, 6), "h", "%d hour{s} ago") ++