-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
app/src/main/java/it/chalmers/gamma/adapter/primary/web/UserAgreementController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package it.chalmers.gamma.adapter.primary.web; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
public class UserAgreementController { | ||
|
||
@GetMapping("/user-agreement") | ||
public ModelAndView getUserAgreement(@RequestHeader(value = "HX-Request", required = false) boolean htmxRequest) { | ||
ModelAndView mv = new ModelAndView(); | ||
if (htmxRequest) { | ||
mv.setViewName("user-agreement/page"); | ||
} else { | ||
mv.setViewName("index"); | ||
mv.addObject("page", "user-agreement/page"); | ||
} | ||
|
||
return mv; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<header th:replace="~{common/header}"></header> | ||
<main> | ||
<article> | ||
<header> | ||
User agreement | ||
</header> | ||
<th:block th:replace="~{register-account/user-agreement}" /> | ||
</article> | ||
</main> |