-
Notifications
You must be signed in to change notification settings - Fork 5
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
Dierk Koenig
committed
Oct 16, 2024
1 parent
a551576
commit 2065396
Showing
2 changed files
with
19 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package rooms | ||
|
||
class DecorationTagLib { | ||
static defaultEncodeAs = 'raw' | ||
static namespace = "rooms" | ||
|
||
def decorate = { attributes, body -> | ||
String grade = attributes.grade | ||
def decor = "<img src='http://2.bp.blogspot.com/"; | ||
switch (grade) { | ||
case ["1","2","3"] : decor += "-rnfZUujszZI/UZEFYJ269-I/AAAAAAAADnw/BbB-v_QWo1w/s1600/facebook-frown-emoticon.png'>"; break | ||
case ["4","5","6"] : decor += "-qODY1kxipZ0/Tv5dwDFFntI/AAAAAAAAAjM/cLXT6KEp-bE/s400/sunglasses%2Bemoticon.png'>"; break | ||
default: decor = "" | ||
} | ||
out << decor | ||
out << body() | ||
out << decor | ||
} | ||
} |
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