Created
September 7, 2013 16:15
-
-
Save remeniuk/6476903 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val bonusForm = Form( | |
mapping( | |
"alias" -> optional(text), | |
"selectedBonus" -> optional(mapping( | |
"itemId" -> nonEmptyText, | |
"bonus" -> number | |
)(Bonus.apply)(Bonus.unapply)), | |
"bonuses" -> list( | |
mapping( | |
"itemId" -> nonEmptyText, | |
"bonus" -> number | |
)(Bonus.apply)(Bonus.unapply) | |
) | |
) | |
((alias, selectedItem, bonuses) => BonusForm(alias, selectedItem, bonuses)) | |
((bonus) => Some(bonus.alias, bonus.selectedBonus, bonus.bonuses)) | |
) |
This file contains hidden or 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
@repeat(bonusForm("bonuses")) { bonus => | |
@bonus | |
<tr> | |
<td><span name="items[]"></span></td> | |
<td class="numeric"><span name="bonuses[]"></span></td> | |
<td class="single-control"> | |
<a><span class="icon-edit"></span></a> | |
<a><span class="icon-remove"></span></a> | |
</td> | |
</tr> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment