Skip to content

Commit

Permalink
Quotes for simuls
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 8, 2016
1 parent 68b98b7 commit ec31317
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/simul/src/main/JsonView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import lila.common.LightUser
import lila.common.PimpedJson._
import lila.game.{ Game, GameRepo }
import lila.user.{ User, UserRepo }
import lila.quote.Quote.quoteWriter

final class JsonView(
getLightUser: String => Option[LightUser]) {
Expand All @@ -30,7 +31,8 @@ final class JsonView(
"pairings" -> simul.pairings.sortBy(-_.player.rating).map(pairingJson(games, simul.hostId)),
"isCreated" -> simul.isCreated,
"isRunning" -> simul.isRunning,
"isFinished" -> simul.isFinished)
"isFinished" -> simul.isFinished,
"quote" -> lila.quote.Quote.one(simul.id))
}

private def variantJson(speed: chess.Speed)(v: chess.variant.Variant) = Json.obj(
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ object ApplicationBuild extends Build {
)

lazy val simul = project("simul", Seq(
common, hub, socket, chess, game, round, chat, memo)).settings(
common, hub, socket, chess, game, round, chat, memo, quote)).settings(
libraryDependencies ++= provided(play.api, RM, PRM)
)

Expand Down
4 changes: 4 additions & 0 deletions public/stylesheets/simul.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
#simul .half.accepted tr.me {
border-right: 10px solid #d59120;
}
#simul .pull-quote {
margin-top: 30px;
width: 300px;
}
#simul .title_tag {
float: right;
font-size: 20px;
Expand Down
1 change: 1 addition & 0 deletions public/stylesheets/tournament.css
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ ol.scheduled_tournaments a {
padding: 3px 5px;
}
#tournament .pull-quote {
margin-top: 30px;
width: 300px;
}
.setup {
Expand Down
4 changes: 4 additions & 0 deletions ui/simul/src/view/created.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ module.exports = function(ctrl) {
})))
])
),
m('blockquote.pull-quote', [
m('p', ctrl.data.quote.text),
m('footer', ctrl.data.quote.author)
]),
m('div.join_choice', ctrl.data.variants.map(function(variant) {
return m('a.button', {
'data-variant': variant.key
Expand Down
2 changes: 0 additions & 2 deletions ui/tournament/src/view/created.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ module.exports = {
startingMoment(ctrl.data),
util.title(ctrl),
arena.standing(ctrl, pag, 'created'),
m('br'),
m('br'),
m('blockquote.pull-quote', [
m('p', ctrl.data.quote.text),
m('footer', ctrl.data.quote.author)
Expand Down

0 comments on commit ec31317

Please sign in to comment.