-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from jhron/2.3.x
feat(core): Added support for multi-template inheritance.
- Loading branch information
Showing
9 changed files
with
114 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import grails.plugin.json.view.Player | ||
import groovy.transform.Field | ||
|
||
inherits(template: 'parent2') | ||
inherits(template: 'parent4') | ||
|
||
@Field Player player | ||
|
||
json g.render(player) |
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 @@ | ||
import grails.plugin.json.view.Player | ||
import groovy.transform.Field | ||
|
||
inherits(template: 'parent3') | ||
inherits(template: 'parent4') | ||
|
||
@Field Player player | ||
|
||
json g.render(player, [includes:'name']) |
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,11 @@ | ||
import grails.plugin.json.view.Player | ||
import groovy.transform.Field | ||
|
||
inherits(template: 'parent2') | ||
inherits(template: 'parent4') | ||
|
||
@Field Player player | ||
|
||
json { | ||
name player.name | ||
} |
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,7 @@ | ||
import groovy.transform.Field | ||
|
||
@Field Object object | ||
|
||
json { | ||
bar "foo" | ||
} |
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
17 changes: 17 additions & 0 deletions
17
json/src/main/groovy/grails/plugin/json/view/api/internal/ParentInfo.groovy
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,17 @@ | ||
package grails.plugin.json.view.api.internal | ||
|
||
import grails.views.GrailsViewTemplate | ||
import groovy.transform.CompileStatic | ||
|
||
@CompileStatic | ||
class ParentInfo { | ||
/** | ||
* The parent template if any | ||
*/ | ||
GrailsViewTemplate parentTemplate | ||
|
||
/** | ||
* The parent model, if any | ||
*/ | ||
Map parentModel | ||
} |
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