Skip to content

Commit

Permalink
ajuste de mensagens
Browse files Browse the repository at this point in the history
  • Loading branch information
boaglio committed Jan 4, 2014
1 parent bfad32b commit 63522f2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
9 changes: 8 additions & 1 deletion app/Global.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import static play.mvc.Results.notFound;
import play.Application;
import play.GlobalSettings;
import play.libs.F.Promise;
import play.mvc.Http.RequestHeader;
Expand All @@ -11,4 +11,11 @@ public class Global extends GlobalSettings {
public Promise<SimpleResult> onHandlerNotFound(RequestHeader request) {
return Promise.<SimpleResult> pure(notFound(views.html.paginaNaoEncontrada.render(request.uri())));
}

@Override
public void onStart(Application app) {

System.out.println("Top 100 filmes cult no ar!");

}
}
2 changes: 1 addition & 1 deletion app/controllers/FilmeCRUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static Result gravar() {

List<Diretor> diretores = Diretor.find.findList();

return badRequest(views.html.novoFilme.render(filmeForm,diretores));
return ok(views.html.novoFilme.render(filmeForm,diretores));
}

form.get().save();
Expand Down
30 changes: 14 additions & 16 deletions app/views/novoFilme.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

@import helper._

@main("Novo filme") {
@main(Messages("filme.novo")) {

<div class="container">

<ul class="nav nav-pills pull-right">
<li class="active"><a href="@routes.FilmeCRUD.lista()">Home</a></li>
</ul>
<ul class="nav nav-pills pull-right">
<li class="active"><a href="@routes.FilmeCRUD.lista()">Home</a></li>
</ul>

<div class="row clearfix">
<div class="col-md-12 column">
Expand All @@ -25,15 +25,15 @@
filmeForm("ano"),
options(Filme.anoOptions),
'_label -> Messages("filme.ano"),
'_default -> "-- Ano --"
'_default -> Messages("filme.ano.combo")
)

@inputText(filmeForm("nome"),'_label -> Messages("filme.nome"))

@select(
filmeForm("diretor.id"),
options(Diretor.options),
'_label -> Messages("filme.diretor"), '_default -> "-- Diretor --"
'_label -> Messages("filme.diretor"), '_default -> Messages("filme.diretor.combo")
)

@inputText(filmeForm("duracao"),'_label -> Messages("filme.duracao"))
Expand All @@ -42,15 +42,13 @@

</fieldset>

<div class="form-group">
<label class="col-md-3 col-md-3 control-label" for="singlebutton"> </label>
<div class="col-lg-6">
<button id="singlebutton" name="singlebutton" class="btn btn-primary">@Messages("filme.gravar")</button>

<a href="@routes.FilmeCRUD.lista()" class="btn btn-primary">Cancelar</a>
</div>
</div>

}
<div class="form-group">
<label class="col-md-3 col-md-3 control-label" for="singlebutton"> </label>
<div class="col-lg-6">
<button id="singlebutton" name="singlebutton" class="btn btn-primary">@Messages("global.gravar")</button>
<a href="@routes.FilmeCRUD.lista()" class="btn btn-primary">@Messages("global.cancel")</a>
</div>
</div>
}
</div>
}
5 changes: 4 additions & 1 deletion conf/messages.pt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# globais
global.home=Home
global.erro=Erro interno do sistema
global.gravar=Gravar
global.cancel=Cancelar

# filme
filme.duracao=Duração
Expand All @@ -14,4 +16,5 @@ filme.nome=Filme
filme.diretor=Diretor
filme.nome.hint=informe o nome do filme
filme.genero=Gênero
filme.gravar=Gravar
filme.ano.combo=-- Ano --
filme.diretor.combo=-- Diretor --

0 comments on commit 63522f2

Please sign in to comment.