From 421af5b65a37706ecd8bfa5eed443434150a60a3 Mon Sep 17 00:00:00 2001 From: Nicolas Martignole Date: Thu, 20 Oct 2022 18:36:53 +0200 Subject: [PATCH] Last commit for 2022 --- app/controllers/ApproveOrRefuse.scala | 7 ++++++ .../showAcceptTerms.scala.html | 22 +++++++++++++------ conf/routes | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/controllers/ApproveOrRefuse.scala b/app/controllers/ApproveOrRefuse.scala index d1b1931d8..756f0c3e9 100644 --- a/app/controllers/ApproveOrRefuse.scala +++ b/app/controllers/ApproveOrRefuse.scala @@ -30,6 +30,7 @@ import models._ import play.api.data.Form import play.api.data.Forms._ import play.api.i18n.Messages +import play.api.mvc.Action import scala.concurrent.Future @@ -132,6 +133,12 @@ object ApproveOrRefuse extends SecureCFPController { } } + /* Public */ + def displayOnlyTerms() = Action { + implicit request => + Ok(views.html.ApproveOrRefuse.showAcceptTerms(formApprove, readonly = true)) + } + def acceptTermsAndConditions() = SecuredAction { implicit request: SecuredRequest[play.api.mvc.AnyContent] => formApprove.bindFromRequest().fold( diff --git a/app/views/ApproveOrRefuse/showAcceptTerms.scala.html b/app/views/ApproveOrRefuse/showAcceptTerms.scala.html index f0ec0af33..9303bede6 100644 --- a/app/views/ApproveOrRefuse/showAcceptTerms.scala.html +++ b/app/views/ApproveOrRefuse/showAcceptTerms.scala.html @@ -1,4 +1,4 @@ -@(formAccept: Form[Boolean])(implicit lang: Lang, flash: Flash, req: RequestHeader) +@(formAccept: Form[Boolean], readonly:Boolean = false)(implicit lang: Lang, flash: Flash, req: RequestHeader) @main("Accept or refuse "+ Messages("shortName")+" terms") { @@ -72,12 +72,20 @@

Version en Français

(4) Je confirme qu'aucune autre permission n'est nécessaire pour que Devoxx France puisse utiliser mes éléments de présentation. - @helper.form(routes.ApproveOrRefuse.acceptTermsAndConditions()) { - @helper.checkbox(formAccept("accept.chk")) - - Decline - } - +@if(readonly){ +
+ + Decline +
+}else{ +
+ @helper.form(routes.ApproveOrRefuse.acceptTermsAndConditions()) { + @helper.checkbox(formAccept("accept.chk")) + + Decline + } +
+} diff --git a/conf/routes b/conf/routes index fd13a02ed..44a648d66 100644 --- a/conf/routes +++ b/conf/routes @@ -197,6 +197,7 @@ GET /ar/allRefused/:talkType GET /ar/notifyApprove/:talkType controllers.ApproveOrRefuse.notifyApprove(talkType:String, proposalId:String) GET /ar/notifyRefuse/:talkType controllers.ApproveOrRefuse.notifyRefused(talkType:String, proposalId:String) GET /ar/showAcceptTerms controllers.ApproveOrRefuse.showAcceptTerms() +GET /ar/terms_and_conditions controllers.ApproveOrRefuse.displayOnlyTerms() GET /ar/accept controllers.ApproveOrRefuse.acceptTermsAndConditions() GET /ar/acceptOrRefuseTalks controllers.ApproveOrRefuse.showAcceptOrRefuseTalks() POST /ar/acceptOrRefuseTalks controllers.ApproveOrRefuse.doAcceptOrRefuseTalk()