Skip to content

Commit

Permalink
Last commit for 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
nicmarti committed Oct 20, 2022
1 parent 3dfda38 commit 421af5b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
7 changes: 7 additions & 0 deletions app/controllers/ApproveOrRefuse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
22 changes: 15 additions & 7 deletions app/views/ApproveOrRefuse/showAcceptTerms.scala.html
Original file line number Diff line number Diff line change
@@ -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") {

Expand Down Expand Up @@ -72,12 +72,20 @@ <h3>Version en Français</h3>
(4) Je confirme qu'aucune autre permission n'est nécessaire pour que Devoxx France puisse utiliser mes éléments de présentation.

</textarea>
@helper.form(routes.ApproveOrRefuse.acceptTermsAndConditions()) {
@helper.checkbox(formAccept("accept.chk"))
<input type="submit" value="Validate" class="btn btn-lg btn-success">
<a href="@routes.ApproveOrRefuse.declineTermsAndConditions()" class="btn btn-lg btn-danger">Decline</a>
}

@if(readonly){
<div class="p-3">
<input type="submit" value="Validate" class="btn btn-lg btn-success" disabled>
<a href="#" class="btn btn-lg btn-danger">Decline</a>
</div>
}else{
<div class="p-3">
@helper.form(routes.ApproveOrRefuse.acceptTermsAndConditions()) {
@helper.checkbox(formAccept("accept.chk"))
<input type="submit" value="Validate" class="btn btn-lg btn-success">
<a href="@routes.ApproveOrRefuse.declineTermsAndConditions()" class="btn btn-lg btn-danger">Decline</a>
}
</div>
}
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 421af5b

Please sign in to comment.