Skip to content

Commit

Permalink
link opening coach to advanced search
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jul 26, 2015
1 parent 14369c0 commit 5b2d652
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/gameSearch/src/main/DataForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ private[gameSearch] case class SearchPlayer(
white: Option[String] = None,
black: Option[String] = None) {

def cleanA = clean(a)
def cleanB = clean(b)
lazy val cleanA = clean(a)
lazy val cleanB = clean(b)
def cleanWinner = oneOf(winner)
def cleanWhite = oneOf(white)
def cleanBlack = oneOf(black)
Expand Down
21 changes: 17 additions & 4 deletions ui/coachOpening/src/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ module.exports = function(ctrl, inspecting) {
]);
var opening = o.opening;
var results = o.results;
var user = ctrl.user.id;
var searchUrl = '/games/search?players.a=' + user + '&players.' + ctrl.color + '=' + user + '&opening=' + eco;
var analysedUrl = searchUrl + '&analysed=1';
return m('div.top.inspect', [
sideCommands(ctrl),
coach.resultBar(results),
Expand All @@ -49,10 +52,20 @@ module.exports = function(ctrl, inspecting) {
m('em', opening.moves)
]),
m('div.baseline', [
m('strong', results.nbGames),
' games, ',
m('strong', results.nbAnalysis),
' analysed. Last played ',
m('a', {
href: searchUrl
}, [
m('strong', results.nbGames),
' games'
]),
', ',
m('a', {
href: analysedUrl
}, [
m('strong', results.nbAnalysis),
' analysed.'
]),
' Last played ',
coach.shared.momentFromNow(results.lastPlayed),
'.',
])
Expand Down

0 comments on commit 5b2d652

Please sign in to comment.