From 58908c2e639a9025886f84fadb2a28547221c10b Mon Sep 17 00:00:00 2001 From: uyaji Date: Mon, 12 Aug 2013 12:11:07 +0900 Subject: [PATCH] Implementation of the Appendix Attach on Reply --- PartsList/PartsList/app/controllers/ReplyController.scala | 8 ++------ PartsList/PartsList/app/views/issueresult.scala.html | 7 +++++-- PartsList/PartsList/app/views/showReplyForm.scala.html | 10 +++++----- PartsList/PartsList/conf/application.conf | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/PartsList/PartsList/app/controllers/ReplyController.scala b/PartsList/PartsList/app/controllers/ReplyController.scala index 0262e5f..80f0d32 100644 --- a/PartsList/PartsList/app/controllers/ReplyController.scala +++ b/PartsList/PartsList/app/controllers/ReplyController.scala @@ -76,10 +76,9 @@ object ReplyController extends Controller{ } def appendAtach(id: Long, partId: Long, notifyType: Long, replyType: Long, state: Long) = Action(parse.multipartFormData) { implicit request => - println("Check OK") replyRegistForm.bindFromRequest.fold( -// formWithErrors => BadRequest(views.html.showReplyForm(formWithErrors, id, partId, notifyType, replyType, state, null)), - formWithErrors => BadRequest(views.html.error(formWithErrors)), + formWithErrors => BadRequest(views.html.showReplyForm(formWithErrors, id, partId, notifyType, replyType, state, null)), +// formWithErrors => BadRequest(views.html.error(formWithErrors)), reply => { inTransaction { val uploadAtach = UploadAtach() @@ -87,9 +86,6 @@ object ReplyController extends Controller{ uploadAtach.uploadAtach(atach, "PICTUE", 0, 0, id) } Redirect(routes.ReplyController.showReply(id, partId, notifyType, replyType, state)) -/* val reply = PartsListDb.replies.where(r => r.id === id).head - val replyForm = ReplyForm(reply.message, UserForm(reply.user.assign(reply.user.head).name), null) - Ok(views.html.showReplyForm(replyRegistForm.fill(replyForm), id, partId, notifyType, replyType, state, reply))*/ } } ) diff --git a/PartsList/PartsList/app/views/issueresult.scala.html b/PartsList/PartsList/app/views/issueresult.scala.html index 13f5cba..1027532 100644 --- a/PartsList/PartsList/app/views/issueresult.scala.html +++ b/PartsList/PartsList/app/views/issueresult.scala.html @@ -1,6 +1,9 @@ -@(notifyType: Long) +@(notifyType: Long)(implicit lang: Lang) +@import helper._ +@import play.api.i18n.Messages + @main("Parts Master by Play 2.1") {

@Messages("issue.message" + notifyType)


-戻る +@Messages("list.link5") } \ No newline at end of file diff --git a/PartsList/PartsList/app/views/showReplyForm.scala.html b/PartsList/PartsList/app/views/showReplyForm.scala.html index 9a610d7..2b3d3be 100644 --- a/PartsList/PartsList/app/views/showReplyForm.scala.html +++ b/PartsList/PartsList/app/views/showReplyForm.scala.html @@ -3,14 +3,14 @@ @implicitFiedConstructor = @{FieldConstructor(twitterBootstrapInput.f)} @main("showReply by Play 2.1") {

@Messages("title18")

- @commonReplyForm(replyForm, replyType) + @form(routes.ReplyController.appendAtach(id, partId, notifyType, replyType, state), 'enctype -> "multipart/form-data") { + @commonReplyForm(replyForm, replyType) + + } +
@form(routes.ReplyController.createReply(0, id, notifyType, 0, partId, state)) { } -@*
- @form(routes.ReplyController.appendAtach(id, partId, notifyType, replyType, state), 'enctype -> "multipart/form-data") { - - }*@
diff --git a/PartsList/PartsList/conf/application.conf b/PartsList/PartsList/conf/application.conf index eb84e15..3b79b6f 100644 --- a/PartsList/PartsList/conf/application.conf +++ b/PartsList/PartsList/conf/application.conf @@ -39,8 +39,8 @@ application.langs="en,ja" # db.default.password="" db.default.driver=com.mysql.jdbc.Driver db.default.url="jdbc:mysql://localhost/play_db?useUnicode=yes&characterEncoding=UTF-8" -db.default.user=myuser -db.default.password="mypass" +db.default.user=dbuser +db.default.password="dbpass" # Evolutions # ~~~~~ -- 2.11.0
@Messages("form.header2")