Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
iss #22: add more vars to /config
Browse files Browse the repository at this point in the history
  • Loading branch information
maizy committed Jun 25, 2014
1 parent bffe085 commit 59472ff
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/controllers/Status.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controllers

import play.api.mvc.{Action, Controller}
import play.core.PlayVersion
import hedgehog.controllers.WithViewContext
import hedgehog.Config.playAppInstance

Expand All @@ -10,6 +11,6 @@ import hedgehog.Config.playAppInstance
*/
object Status extends Controller with WithViewContext {
def index = Action { implicit request =>
Ok(views.html.status(playAppInstance))
Ok(views.html.status(playAppInstance, PlayVersion.current, PlayVersion.scalaVersion))
}
}
36 changes: 34 additions & 2 deletions app/views/status.scala.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
@(config: hedgehog.Config)(implicit c: hedgehog.views.ViewContext)
@(config: hedgehog.Config, playVersion: String, scalaVersion: String)(implicit c: hedgehog.views.ViewContext)

@templates.main(nav = "status") {
<h1>@c.Messages("Status")</h1>

<h3>Some configs:</h3>
<h3>@c.Messages("Some_configs")</h3>

<table class="table">
<tbody>
<tr>
<td>github base api url</td>
<td>@config.apiBaseUrl</td>
</tr>

<tr>
<td>available langs</td>
<td>@c.availableLanguages.map(_.code).mkString(", ")</td>
</tr>

<tr>
<td>current lang</td>
<td>@c.lang.code</td>
</tr>

</tbody>
</table>

<h3>@c.Messages("Versions")</h3>

<table class="table">
<tbody>
<tr>
<td>scala</td>
<td>@scalaVersion</td>
</tr>

<tr>
<td>play</td>
<td>@playVersion</td>
</tr>

<tr>
<td>hedgehog</td>
<td>@c.version</td>
</tr>
</tbody>
</table>
}
3 changes: 3 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Status = Status

Code_search = Code search
go_search_button = Go!

Versions=Versions
Some_configs=Some configs
5 changes: 4 additions & 1 deletion conf/messages.ru
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ footer.ChooseLanguage = Выбрать язык (Choose language)

About = О сервисе
Author = Автор
Status = Состояние
Status = Статус

Code_search = Поиск по коду
go_search_button = Искать!

Versions=Версии
Some_configs=Некоторые настройки

0 comments on commit 59472ff

Please sign in to comment.