-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #30, pass the correct fragments up the page hierarchy.
- Loading branch information
Showing
4 changed files
with
98 additions
and
11 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
74 changes: 74 additions & 0 deletions
74
Tests/nz/net/ultraq/thymeleaf/tests/decorator/DeepHierarchy.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,74 @@ | ||
%TEMPLATE_MODE HTML5 | ||
|
||
%INPUT | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" | ||
layout:decorator="Parent"> | ||
<head> | ||
<title>Page title</title> | ||
<script src="child-script.js"></script> | ||
</head> | ||
<body> | ||
<div layout:fragment="content"> | ||
<p>This is a paragraph from the child page</p> | ||
</div> | ||
</body> | ||
</html> | ||
|
||
%INPUT[Parent] | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorator="Grandparent"> | ||
<body> | ||
<section layout:fragment="section"> | ||
<header> | ||
<h1>My website</h1> | ||
</header> | ||
<div layout:fragment="content"> | ||
<p>Page content goes here</p> | ||
</div> | ||
<footer> | ||
<p>My footer</p> | ||
</footer> | ||
</section> | ||
</body> | ||
</html> | ||
|
||
%INPUT[Grandparent] | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> | ||
<head> | ||
<script src="grandparent-script.js"></script> | ||
</head> | ||
<body> | ||
<section layout:fragment="section"> | ||
<p>Middle layout section goes here</p> | ||
</section> | ||
</body> | ||
</html> | ||
|
||
%OUTPUT | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>Page title</title> | ||
<script src="grandparent-script.js"></script> | ||
<script src="child-script.js"></script> | ||
</head> | ||
<body> | ||
<section> | ||
<header> | ||
<h1>My website</h1> | ||
</header> | ||
<div> | ||
<p>This is a paragraph from the child page</p> | ||
</div> | ||
<footer> | ||
<p>My footer</p> | ||
</footer> | ||
</section> | ||
</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