forked from ultraq/thymeleaf-layout-dialect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ultraq#200: redeclaration of layout fragments in nested decoratio…
…n hierarchies must produce the expected result
- Loading branch information
1 parent
75c51d1
commit 2a94d0b
Showing
9 changed files
with
143 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
89 changes: 89 additions & 0 deletions
89
tests/nz/net/ultraq/thymeleaf/tests/decorators/Decorate-DeepHierarchy2.thtest
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,89 @@ | ||
|
||
# Test a deep layout hierarchy (3 levels). | ||
|
||
%TEMPLATE_MODE HTML | ||
|
||
|
||
%INPUT | ||
<!DOCTYPE html> | ||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorate="~{Parent}"> | ||
<head> | ||
<title>Page title</title> | ||
<script src="child-script.js"></script> | ||
</head> | ||
<body> | ||
<div layout:fragment="content"> | ||
<p>Page content</p> | ||
</div> | ||
<footer layout:fragment="footer"> | ||
<p>Page footer</p> | ||
</footer> | ||
</body> | ||
</html> | ||
|
||
|
||
%INPUT[Parent] | ||
<!DOCTYPE html> | ||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorate="~{Grandparent}"> | ||
<head> | ||
<script src="parent-script.js"></script> | ||
</head> | ||
<body> | ||
<section layout:fragment="section"> | ||
<header> | ||
<h1>My website</h1> | ||
</header> | ||
<div layout:fragment="content"> | ||
<p>Parent content</p> | ||
</div> | ||
</section> | ||
<!-- parent redeclares footer --> | ||
<footer layout:fragment="footer"> | ||
<p>Parent footer</p> | ||
</footer> | ||
</body> | ||
</html> | ||
|
||
|
||
%INPUT[Grandparent] | ||
<!DOCTYPE html> | ||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> | ||
<head> | ||
<script src="grandparent-script.js"></script> | ||
</head> | ||
<body> | ||
<section layout:fragment="section"> | ||
<p>Grandparent section</p> | ||
</section> | ||
<footer layout:fragment="footer"> | ||
<p>Grandparent footer</p> | ||
</footer> | ||
</body> | ||
</html> | ||
|
||
|
||
%OUTPUT | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Page title</title> | ||
<script src="grandparent-script.js"></script> | ||
<script src="parent-script.js"></script> | ||
<script src="child-script.js"></script> | ||
</head> | ||
<body> | ||
<section> | ||
<header> | ||
<h1>My website</h1> | ||
</header> | ||
<div> | ||
<p>Page content</p> | ||
</div> | ||
</section> | ||
<footer> | ||
<p>Page footer</p> | ||
</footer> | ||
</body> | ||
</html> |
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
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