Created
June 1, 2010 08:39
-
-
Save timperrett/420719 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 xml = | |
{ if(S.errors.isEmpty) Nil else List(MsgsErrorMeta.get, f(S.errors), S.??("msg.error"), LiftRules.noticesContainerId + "_error") } ++ | |
{ if(S.warnings.isEmpty) Nil else List((MsgsWarningMeta.get, f(S.warnings), S.??("msg.warning"), LiftRules.noticesContainerId + "_warn")) } ++ | |
{ if (S.notices.isEmpty) Nil else List((MsgsNoticeMeta.get, f(S.notices), S.??("msg.notice"), LiftRules.noticesContainerId + "_notice")) } flatMap { | |
msg => msg._1 match { | |
case Full(meta) => <div id={msg._4}>{func(msg._2 _, meta.title openOr "", | |
meta.cssClass.map(new UnprefixedAttribute("class", _, Null)) openOr Null)}</div> | |
case _ => <div id={msg._4}>{func(msg._2 _, msg._3, Null)}</div> | |
} | |
} |
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 xml = List((MsgsErrorMeta.get, f(S.errors), S.??("msg.error"), LiftRules.noticesContainerId + "_error"), | |
(MsgsWarningMeta.get, f(S.warnings), S.??("msg.warning"), LiftRules.noticesContainerId + "_warn"), | |
(MsgsNoticeMeta.get, f(S.notices), S.??("msg.notice"), LiftRules.noticesContainerId + "_notice")) flatMap { | |
msg => msg._1 match { | |
case Full(meta) => <div id={msg._4}>{func(msg._2 _, meta.title openOr "", | |
meta.cssClass.map(new UnprefixedAttribute("class", _, Null)) openOr Null)}</div> | |
case _ => <div id={msg._4}>{func(msg._2 _, msg._3, Null)}</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
val xml =
(( if(S.errors.isEmpty) Nil else List(MsgsErrorMeta.get, f(S.errors), S.??("msg.error"), LiftRules.noticesContainerId + "_error") ) ++
( if(S.warnings.isEmpty) Nil else List((MsgsWarningMeta.get, f(S.warnings), S.??("msg.warning"), LiftRules.noticesContainerId + "_warn")) ) ++
( if (S.notices.isEMpty) Nill else List((MsgsNoticeMeta.get, f(S.notices), S.??("msg.notice"), LiftRules.noticesContainerId + "_notice") ) ) flatMap {
msg => msg._1 match {
case Full(meta) =>
meta.cssClass.map(new UnprefixedAttribute("class", _, Null)) openOr Null)}
case _ =>
}
}