diff --git a/core-play27/app/views/bs/package.scala b/core-play27/app/views/bs/package.scala index 09b273e..057a6a6 100644 --- a/core-play27/app/views/bs/package.scala +++ b/core-play27/app/views/bs/package.scala @@ -33,22 +33,22 @@ package object bs { val argsMap: Map[Symbol, Any] = Args.withoutNones(args).toMap /* Id of the input */ - val id: String = argsMap.get('id).map(_.toString).getOrElse(field.id) + val id: String = argsMap.get(Symbol("id")).map(_.toString).getOrElse(field.id) /* Id of the form-group */ - val idFormField: String = argsMap.get('_id).map(_.toString).getOrElse(id + "_field") + val idFormField: String = argsMap.get(Symbol("_id")).map(_.toString).getOrElse(id + "_field") /* The optional label */ - val labelOpt: Option[Any] = argsMap.get('_label).orElse(argsMap.get('_hiddenLabel)) + val labelOpt: Option[Any] = argsMap.get(Symbol("_label")).orElse(argsMap.get(Symbol("_hiddenLabel"))) /* Indicates if the label must be hidden */ - val hideLabel: Boolean = isTrue(argsMap, '_hideLabel) || argsMap.contains('_hiddenLabel) + val hideLabel: Boolean = isTrue(argsMap, Symbol("_hideLabel")) || argsMap.contains(Symbol("_hiddenLabel")) /* Name of the input */ def name: String = field.name /* Value of the input */ - val value: Option[String] = field.value.orElse(argsMap.get('value).map(_.toString)) + val value: Option[String] = field.value.orElse(argsMap.get(Symbol("value")).map(_.toString)) /* List with every error and its corresponding ARIA id. Ex: ("foo_error_0" -> "foo error") */ val errors: Seq[(String, Any)] = BSFieldInfo.errors(Some(field), argsMap, msgsProv).zipWithIndex.map { @@ -56,7 +56,7 @@ package object bs { } /* Indicates if there is any error */ - val hasErrors: Boolean = !errors.isEmpty || ArgsMap.isNotFalse(argsMap, '_error) + val hasErrors: Boolean = !errors.isEmpty || ArgsMap.isNotFalse(argsMap, Symbol("_error")) /* The optional validation state ("success", "warning" or "error") */ lazy val status: Option[String] = BSFieldInfo.status(hasErrors, argsMap) @@ -74,14 +74,14 @@ package object bs { /* List with every error */ def errors(maybeField: Option[Field], argsMap: Map[Symbol, Any], msgsProv: MessagesProvider): Seq[Any] = { - argsMap.get('_error).filter(!_.isInstanceOf[Boolean]).map { + argsMap.get(Symbol("_error")).filter(!_.isInstanceOf[Boolean]).map { _ match { case Some(FormError(_, message, args)) => Seq(msgsProv.messages(message, args.map(a => translate(a)(msgsProv)): _*)) case FormError(_, message, args) => Seq(msgsProv.messages(message, args.map(a => translate(a)(msgsProv)): _*)) case message => Seq(translate(message)(msgsProv)) } }.getOrElse { - maybeField.filter(_ => argsMap.get('_showErrors) != Some(false)).map { field => + maybeField.filter(_ => argsMap.get(Symbol("_showErrors")) != Some(false)).map { field => field.errors.map { e => msgsProv.messages(e.message, e.args.map(a => translate(a)(msgsProv)): _*) } }.getOrElse(Nil) } @@ -89,15 +89,15 @@ package object bs { /* List with every "feedback info" except "errors" */ def feedbackInfosButErrors(argsMap: Map[Symbol, Any], msgsProv: MessagesProvider): Seq[Any] = { - argsMap.get('_warning).filter(!_.isInstanceOf[Boolean]).map(m => Seq(translate(m)(msgsProv))).getOrElse( - argsMap.get('_success).filter(!_.isInstanceOf[Boolean]).map(m => Seq(translate(m)(msgsProv))).getOrElse(Nil) + argsMap.get(Symbol("_warning")).filter(!_.isInstanceOf[Boolean]).map(m => Seq(translate(m)(msgsProv))).getOrElse( + argsMap.get(Symbol("_success")).filter(!_.isInstanceOf[Boolean]).map(m => Seq(translate(m)(msgsProv))).getOrElse(Nil) ) } /* List with every "help info", i.e. a help text or constraints */ def helpInfos(maybeField: Option[Field], argsMap: Map[Symbol, Any], msgsProv: MessagesProvider): Seq[Any] = { - argsMap.get('_help).map(m => Seq(translate(m)(msgsProv))).getOrElse { - maybeField.filter(_ => argsMap.get('_showConstraints) == Some(true)).map { field => + argsMap.get(Symbol("_help")).map(m => Seq(translate(m)(msgsProv))).getOrElse { + maybeField.filter(_ => argsMap.get(Symbol("_showConstraints")) == Some(true)).map { field => field.constraints.map(c => msgsProv.messages(c._1, c._2.map(a => translate(a)(msgsProv)): _*)) ++ field.format.map(f => msgsProv.messages(f._1, f._2.map(a => translate(a)(msgsProv)): _*)) }.getOrElse(Nil) } @@ -107,9 +107,9 @@ package object bs { def status(hasErrors: Boolean, argsMap: Map[Symbol, Any]): Option[String] = { if (hasErrors) Some("error") - else if (ArgsMap.isNotFalse(argsMap, '_warning)) + else if (ArgsMap.isNotFalse(argsMap, Symbol("_warning"))) Some("warning") - else if (ArgsMap.isNotFalse(argsMap, '_success)) + else if (ArgsMap.isNotFalse(argsMap, Symbol("_success"))) Some("success") else None @@ -117,14 +117,14 @@ package object bs { /* Generates automatically the input attributes for the constraints of a field */ def constraintsArgs(field: Field, msgsProv: MessagesProvider): Seq[(Symbol, Any)] = field.constraints.map { - case ("constraint.required", params) => Some(('required -> true)) - case ("constraint.min", params: Seq[Any]) => Some(('min -> msgsProv.messages(params.head.toString))) - case ("constraint.max", params: Seq[Any]) => Some(('max -> msgsProv.messages(params.head.toString))) - case ("constraint.minLength", params: Seq[Any]) => Some(('minlength -> msgsProv.messages(params.head.toString))) - case ("constraint.maxLength", params: Seq[Any]) => Some(('maxlength -> msgsProv.messages(params.head.toString))) + case ("constraint.required", params) => Some((Symbol("required") -> true)) + case ("constraint.min", params: Seq[Any]) => Some((Symbol("min") -> msgsProv.messages(params.head.toString))) + case ("constraint.max", params: Seq[Any]) => Some((Symbol("max") -> msgsProv.messages(params.head.toString))) + case ("constraint.minLength", params: Seq[Any]) => Some((Symbol("minlength") -> msgsProv.messages(params.head.toString))) + case ("constraint.maxLength", params: Seq[Any]) => Some((Symbol("maxlength") -> msgsProv.messages(params.head.toString))) case ("constraint.pattern", params: Seq[Any]) => params.head match { - case str: String => Some(('pattern -> msgsProv.messages(str))) - case func: Function0[_] => Some(('pattern -> msgsProv.messages(func.asInstanceOf[() => scala.util.matching.Regex]().toString))) + case str: String => Some((Symbol("pattern") -> msgsProv.messages(str))) + case func: Function0[_] => Some((Symbol("pattern") -> msgsProv.messages(func.asInstanceOf[() => scala.util.matching.Regex]().toString))) case _ => None } case _ => None @@ -154,7 +154,7 @@ package object bs { } /* Indicates if there is any error */ - val hasErrors: Boolean = !errors.isEmpty || ArgsMap.isNotFalse(argsMap, '_error) + val hasErrors: Boolean = !errors.isEmpty || ArgsMap.isNotFalse(argsMap, Symbol("_error")) /* The optional validation state ("success", "warning" or "error") */ lazy val status: Option[String] = BSFieldInfo.status(hasErrors, argsMap) diff --git a/play27-bootstrap3/module/app/views/b3/bsFieldConstructorCommon.scala.html b/play27-bootstrap3/module/app/views/b3/bsFieldConstructorCommon.scala.html index 7056c03..f4bd2ca 100644 --- a/play27-bootstrap3/module/app/views/b3/bsFieldConstructorCommon.scala.html +++ b/play27-bootstrap3/module/app/views/b3/bsFieldConstructorCommon.scala.html @@ -1,5 +1,5 @@ @(fieldInfo: b3.B3FieldInfo, inputHtml: Html)(wrap: Html => Html)(implicit fc: b3.B3FieldConstructor) -
+
@wrap { @inputHtml @fieldInfo.errorsAndInfos.map { case (id, text) => diff --git a/play27-bootstrap3/module/app/views/b3/bsFormGroupCommon.scala.html b/play27-bootstrap3/module/app/views/b3/bsFormGroupCommon.scala.html index a554825..cbab8c6 100644 --- a/play27-bootstrap3/module/app/views/b3/bsFormGroupCommon.scala.html +++ b/play27-bootstrap3/module/app/views/b3/bsFormGroupCommon.scala.html @@ -1,9 +1,9 @@ @(contentHtml: Html, argsMap: Map[Symbol, Any])(wrap: Html => Html)(implicit messages: MessagesProvider) -@defining(argsMap.get('_id).map(_.toString).orElse(argsMap.get('id).map(_.toString + "_field"))) { idFormField => -
id="@id"}> +@defining(argsMap.get(Symbol("_id")).map(_.toString).orElse(argsMap.get(Symbol("id")).map(_.toString + "_field"))) { idFormField => +
id="@id"}> @wrap { @contentHtml - @argsMap.get('_help).map { help => + @argsMap.get(Symbol("_help")).map { help => @bs.Args.msg(help)(messages) } } diff --git a/play27-bootstrap3/module/app/views/b3/checkbox.scala.html b/play27-bootstrap3/module/app/views/b3/checkbox.scala.html index f032580..e192d86 100644 --- a/play27-bootstrap3/module/app/views/b3/checkbox.scala.html +++ b/play27-bootstrap3/module/app/views/b3/checkbox.scala.html @@ -1,18 +1,18 @@ @(field: Field, args: (Symbol,Any)*)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) @defining({ val argsMap = args.toMap - val value = argsMap.get('value).getOrElse("true").toString - val checked = argsMap.get('checked).orElse(field.value.map(_ == value).orElse(argsMap.get('_default))).map(_.toString == "true").getOrElse(false) - val containsReadonly = argsMap.contains('readonly) - val readonly = bs.ArgsMap.isTrue(argsMap, 'readonly) - val disabled = readonly || bs.ArgsMap.isTrue(argsMap, 'disabled) + val value = argsMap.get(Symbol("value")).getOrElse("true").toString + val checked = argsMap.get(Symbol("checked")).orElse(field.value.map(_ == value).orElse(argsMap.get(Symbol("_default")))).map(_.toString == "true").getOrElse(false) + val containsReadonly = argsMap.contains(Symbol("readonly")) + val readonly = bs.ArgsMap.isTrue(argsMap, Symbol("readonly")) + val disabled = readonly || bs.ArgsMap.isTrue(argsMap, Symbol("disabled")) (argsMap, value, checked, containsReadonly, readonly, disabled) }){ case (argsMap, value, checked, containsReadonly, readonly, disabled) => - @inputFormGroup(field, withFeedback = false, withLabelFor = false, bs.Args.withDefault(args.filterNot(_._1 == 'checked), 'checked -> checked, 'disabled -> disabled)) { fieldInfo => + @inputFormGroup(field, withFeedback = false, withLabelFor = false, bs.Args.withDefault(args.filterNot(_._1 == Symbol("checked")), Symbol("checked") -> checked, Symbol("disabled") -> disabled)) { fieldInfo =>
@if(containsReadonly) { diff --git a/play27-bootstrap3/module/app/views/b3/clear/package.scala b/play27-bootstrap3/module/app/views/b3/clear/package.scala index 2e3f35c..8b6a4dc 100644 --- a/play27-bootstrap3/module/app/views/b3/clear/package.scala +++ b/play27-bootstrap3/module/app/views/b3/clear/package.scala @@ -55,11 +55,11 @@ package object clear { * ********************************************************************************************************************************* */ def form(action: Call, args: (Symbol, Any)*)(body: ClearFieldConstructor => Html) = { - val cfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val cfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.form(action, inner(args): _*)(body(cfc))(cfc) } def formCSRF(action: Call, args: (Symbol, Any)*)(body: ClearFieldConstructor => Html)(implicit request: RequestHeader) = { - val cfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val cfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.formCSRF(action, inner(args): _*)(body(cfc))(cfc, request) } diff --git a/play27-bootstrap3/module/app/views/b3/form.scala.html b/play27-bootstrap3/module/app/views/b3/form.scala.html index 53d938c..6c3aa6a 100644 --- a/play27-bootstrap3/module/app/views/b3/form.scala.html +++ b/play27-bootstrap3/module/app/views/b3/form.scala.html @@ -1,4 +1,4 @@ @(action: Call, args: (Symbol, Any)*)(body: => Html)(implicit fc: b3.B3FieldConstructor) -
"form"), 'class).toMap)> + "form"), Symbol("class")).toMap)> @body
\ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/horizontal/bsFormGroup.scala.html b/play27-bootstrap3/module/app/views/b3/horizontal/bsFormGroup.scala.html index 762605e..b96fbf3 100644 --- a/play27-bootstrap3/module/app/views/b3/horizontal/bsFormGroup.scala.html +++ b/play27-bootstrap3/module/app/views/b3/horizontal/bsFormGroup.scala.html @@ -1,7 +1,7 @@ @(contentHtml: Html, argsMap: Map[Symbol, Any], colLabel: String, colOffset: String, colInput: String)(implicit messages: MessagesProvider) @b3.bsFormGroupCommon(contentHtml, argsMap) { content => - @argsMap.get('_label).map { label => - + @argsMap.get(Symbol("_label")).map { label => +
@content
diff --git a/play27-bootstrap3/module/app/views/b3/horizontal/package.scala b/play27-bootstrap3/module/app/views/b3/horizontal/package.scala index f253b84..fbbceaa 100644 --- a/play27-bootstrap3/module/app/views/b3/horizontal/package.scala +++ b/play27-bootstrap3/module/app/views/b3/horizontal/package.scala @@ -61,11 +61,11 @@ package object horizontal { * ********************************************************************************************************************************* */ def form(action: Call, colLabel: String, colInput: String, args: (Symbol, Any)*)(body: HorizontalFieldConstructor => Html) = { - val hfc = fieldConstructorSpecific(colLabel, colInput, withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val hfc = fieldConstructorSpecific(colLabel, colInput, withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.form(action, inner(args): _*)(body(hfc))(hfc) } def formCSRF(action: Call, colLabel: String, colInput: String, args: (Symbol, Any)*)(body: HorizontalFieldConstructor => Html)(implicit request: RequestHeader) = { - val hfc = fieldConstructorSpecific(colLabel, colInput, withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val hfc = fieldConstructorSpecific(colLabel, colInput, withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.formCSRF(action, inner(args): _*)(body(hfc))(hfc, request) } diff --git a/play27-bootstrap3/module/app/views/b3/inline/bsFormGroup.scala.html b/play27-bootstrap3/module/app/views/b3/inline/bsFormGroup.scala.html index f78da2a..73468db 100644 --- a/play27-bootstrap3/module/app/views/b3/inline/bsFormGroup.scala.html +++ b/play27-bootstrap3/module/app/views/b3/inline/bsFormGroup.scala.html @@ -1,7 +1,7 @@ @(contentHtml: Html, argsMap: Map[Symbol, Any])(implicit messages: MessagesProvider) @b3.bsFormGroupCommon(contentHtml, argsMap) { content => - @argsMap.get('_label).map { label => - + @argsMap.get(Symbol("_label")).map { label => + } @content } \ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/inline/package.scala b/play27-bootstrap3/module/app/views/b3/inline/package.scala index 59cc0fd..6625ede 100644 --- a/play27-bootstrap3/module/app/views/b3/inline/package.scala +++ b/play27-bootstrap3/module/app/views/b3/inline/package.scala @@ -55,11 +55,11 @@ package object inline { * ********************************************************************************************************************************* */ def form(action: Call, args: (Symbol, Any)*)(body: InlineFieldConstructor => Html) = { - val ifc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackTooltip)) + val ifc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackTooltip"))) views.html.b3.form(action, inner(args): _*)(body(ifc))(ifc) } def formCSRF(action: Call, args: (Symbol, Any)*)(body: InlineFieldConstructor => Html)(implicit request: RequestHeader) = { - val ifc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackTooltip)) + val ifc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackTooltip"))) views.html.b3.formCSRF(action, inner(args): _*)(body(ifc))(ifc, request) } diff --git a/play27-bootstrap3/module/app/views/b3/inputWrapped.scala.html b/play27-bootstrap3/module/app/views/b3/inputWrapped.scala.html index bfc1a51..506c70c 100644 --- a/play27-bootstrap3/module/app/views/b3/inputWrapped.scala.html +++ b/play27-bootstrap3/module/app/views/b3/inputWrapped.scala.html @@ -1,5 +1,5 @@ @(inputType: String, field: Field, args: (Symbol,Any)*)(inputGroup: Html => Html)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) -@inputFormGroup(field, withFeedback = true, withLabelFor = true, bs.Args.withAddingStringValue(args, 'class, "form-control")) { fieldInfo => +@inputFormGroup(field, withFeedback = true, withLabelFor = true, bs.Args.withAddingStringValue(args, Symbol("class"), "form-control")) { fieldInfo => @inputGroup { @if(fieldInfo.hasFeedback) { diff --git a/play27-bootstrap3/module/app/views/b3/package.scala b/play27-bootstrap3/module/app/views/b3/package.scala index 0221a3e..ed50004 100644 --- a/play27-bootstrap3/module/app/views/b3/package.scala +++ b/play27-bootstrap3/module/app/views/b3/package.scala @@ -54,9 +54,9 @@ package object b3 { /* Each boolean indicate if a any of the corresponding feedback icons should be shown */ val (showIconError, showIconWarning, showIconValid) = { if (!withFeedback) (false, false, false) - else if (hasErrors) (isTrue(argsMap, '_showIconOnError), false, false) - else if (isTrue(argsMap, '_showIconWarning)) (false, true, false) - else (false, false, isTrue(argsMap, '_showIconValid)) + else if (hasErrors) (isTrue(argsMap, Symbol("_showIconOnError")), false, false) + else if (isTrue(argsMap, Symbol("_showIconWarning"))) (false, true, false) + else (false, false, isTrue(argsMap, Symbol("_showIconValid"))) } /* Indicates if any of the previous feedback icons should be shown */ @@ -90,9 +90,9 @@ package object b3 { (if (hasErrors) Seq(Symbol("aria-invalid") -> "true") else Nil) ++ BSFieldInfo.constraintsArgs(field, msgsProv) ++ Args.inner( - Args.remove(args, 'id, 'value).map { - case arg if arg._1 == 'placeholder => Args.msg(arg)(msgsProv.messages) - case other => other + Args.remove(args, Symbol("id"), Symbol("value")).map { + case arg if arg._1 == Symbol("placeholder") => Args.msg(arg)(msgsProv.messages) + case other => other } ) ).toMap @@ -106,9 +106,9 @@ package object b3 { def status(hasErrors: Boolean, argsMap: Map[Symbol, Any]): Option[String] = { if (hasErrors) Some("error") - else if (ArgsMap.isNotFalse(argsMap, '_warning) || isTrue(argsMap, '_showIconWarning)) + else if (ArgsMap.isNotFalse(argsMap, Symbol("_warning")) || isTrue(argsMap, Symbol("_showIconWarning"))) Some("warning") - else if (ArgsMap.isNotFalse(argsMap, '_success) || isTrue(argsMap, '_showIconValid)) + else if (ArgsMap.isNotFalse(argsMap, Symbol("_success")) || isTrue(argsMap, Symbol("_showIconValid"))) Some("success") else None @@ -150,11 +150,11 @@ package object b3 { override lazy val status: Option[String] = B3FieldInfo.status(hasErrors, argsMap) /* The optional validation state for the form-group ("has-success", "has-warning", "has-error") with the optional "has-feedback" */ - def statusWithFeedback: Option[String] = B3FieldInfo.statusWithFeedback(status, hasFeedback = isTrue(argsMap, '_hasFeedback)) + def statusWithFeedback: Option[String] = B3FieldInfo.statusWithFeedback(status, hasFeedback = isTrue(argsMap, Symbol("_hasFeedback"))) override lazy val globalArgs = { - val withoutHelp = Args.remove(globalArguments, '_help) - val withStatus = status.map(s => Args.withDefault(withoutHelp, '_class -> statusWithFeedback)).getOrElse(withoutHelp) + val withoutHelp = Args.remove(globalArguments, Symbol("_help")) + val withStatus = status.map(s => Args.withDefault(withoutHelp, Symbol("_class") -> statusWithFeedback)).getOrElse(withoutHelp) withStatus } } @@ -213,7 +213,7 @@ package object b3 { def week(field: Field, args: (Symbol, Any)*)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = inputType("week", field, args: _*)(fc, msgsProv) def hidden(name: String, value: Any, args: (Symbol, Any)*) = hiddenInput(name, value, args: _*) - def hidden(field: Field, args: (Symbol, Any)*) = hiddenInput(name = field.name, value = field.value.orElse(bs.Args.get(args, 'value)), (bs.Args.inner(bs.Args.remove(args, 'value))): _*) + def hidden(field: Field, args: (Symbol, Any)*) = hiddenInput(name = field.name, value = field.value.orElse(bs.Args.get(args, Symbol("value"))), (bs.Args.inner(bs.Args.remove(args, Symbol("value")))): _*) def radio(field: Field, args: (Symbol, Any)*)(content: Tuple3[Boolean, Boolean, B3FieldInfo] => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = radioWithContent(field, args: _*)(content)(fc, msgsProv) def radio(field: Field, options: Seq[(String, Any)], args: (Symbol, Any)*)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = radioWithOptions(field, options, args: _*)(fc, msgsProv) @@ -226,8 +226,8 @@ package object b3 { def button(args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = buttonType("button", args: _*)(text)(fc, msgsProv) def static(args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = staticBasic(args: _*)(text)(fc, msgsProv) - def static(label: String, args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = staticBasic(Args.withDefault(args, '_label -> label): _*)(text)(fc, msgsProv) - def static(label: Html, args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = staticBasic(Args.withDefault(args, '_label -> label): _*)(text)(fc, msgsProv) + def static(label: String, args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = staticBasic(Args.withDefault(args, Symbol("_label") -> label): _*)(text)(fc, msgsProv) + def static(label: Html, args: (Symbol, Any)*)(text: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = staticBasic(Args.withDefault(args, Symbol("_label") -> label): _*)(text)(fc, msgsProv) def free(args: (Symbol, Any)*)(content: => Html)(implicit fc: B3FieldConstructor, msgsProv: MessagesProvider) = freeFormGroup(args)(_ => content)(fc, msgsProv) } \ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/radioWithContent.scala.html b/play27-bootstrap3/module/app/views/b3/radioWithContent.scala.html index c94cfe1..5038d0a 100644 --- a/play27-bootstrap3/module/app/views/b3/radioWithContent.scala.html +++ b/play27-bootstrap3/module/app/views/b3/radioWithContent.scala.html @@ -1,20 +1,20 @@ @(field: Field, args: (Symbol, Any)*)(content: Tuple3[Boolean, Boolean, b3.B3FieldInfo] => Html)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) @readonlyWrapper(name: String, value: Option[String], argsMap: Map[Symbol, Any], disabled: Boolean)(contentWrapped: Html) = { - @if(argsMap.contains('readonly)) { + @if(argsMap.contains(Symbol("readonly"))) {
@contentWrapped - +
} else { @contentWrapped } } @defining({ val argsMap = args.toMap - val inline = bs.ArgsMap.isTrue(argsMap, '_inline) || fc.formClass == "form-inline" - val readonly = bs.ArgsMap.isTrue(argsMap, 'readonly) - val disabled = readonly || bs.ArgsMap.isTrue(argsMap, 'disabled) + val inline = bs.ArgsMap.isTrue(argsMap, Symbol("_inline")) || fc.formClass == "form-inline" + val readonly = bs.ArgsMap.isTrue(argsMap, Symbol("readonly")) + val disabled = readonly || bs.ArgsMap.isTrue(argsMap, Symbol("disabled")) (argsMap, inline, disabled) }) { case (argsMap, inline, disabled) => - @inputFormGroup(field, withFeedback = false, withLabelFor = false, bs.Args.withDefault(args, 'disabled -> disabled)) { fieldInfo => + @inputFormGroup(field, withFeedback = false, withLabelFor = false, bs.Args.withDefault(args, Symbol("disabled") -> disabled)) { fieldInfo => @readonlyWrapper(fieldInfo.name, fieldInfo.value, argsMap, disabled) { @content(inline, disabled, fieldInfo) } diff --git a/play27-bootstrap3/module/app/views/b3/radioWithOptions.scala.html b/play27-bootstrap3/module/app/views/b3/radioWithOptions.scala.html index 980e640..71bba21 100644 --- a/play27-bootstrap3/module/app/views/b3/radioWithOptions.scala.html +++ b/play27-bootstrap3/module/app/views/b3/radioWithOptions.scala.html @@ -1,5 +1,5 @@ @(field: Field, options: Seq[(String, Any)], args: (Symbol, Any)*)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) -@radioWithContent(field, bs.Args.withDefault(args, '_hiddenValue -> options.headOption.map(_._1)):_*) { implicit extraInfo => +@radioWithContent(field, bs.Args.withDefault(args, Symbol("_hiddenValue") -> options.headOption.map(_._1)):_*) { implicit extraInfo => @options.map { v => @radioOption(v._1, v._2) } diff --git a/play27-bootstrap3/module/app/views/b3/selectWithContent.scala.html b/play27-bootstrap3/module/app/views/b3/selectWithContent.scala.html index b2a06b9..d42c438 100644 --- a/play27-bootstrap3/module/app/views/b3/selectWithContent.scala.html +++ b/play27-bootstrap3/module/app/views/b3/selectWithContent.scala.html @@ -1,20 +1,20 @@ @(field: Field, args: (Symbol,Any)*)(content: Set[String] => Html)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) @readonlyWrapper(selectName: String, value: Option[String], disabled: Boolean, argsMap: Map[Symbol, Any])(contentWrapped: Html) = { - @if(argsMap.contains('readonly)) { + @if(argsMap.contains(Symbol("readonly"))) {
@contentWrapped - +
} else { @contentWrapped } } @defining({ val argsMap = args.toMap - val readonly = bs.ArgsMap.isTrue(argsMap, 'readonly) - val disabled = readonly || bs.ArgsMap.isTrue(argsMap, 'disabled) - val multiple = bs.ArgsMap.isTrue(argsMap, 'multiple) + val readonly = bs.ArgsMap.isTrue(argsMap, Symbol("readonly")) + val disabled = readonly || bs.ArgsMap.isTrue(argsMap, Symbol("disabled")) + val multiple = bs.ArgsMap.isTrue(argsMap, Symbol("multiple")) (argsMap, disabled, multiple) }) { case (argsMap, disabled, multiple) => - @inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withDefault(bs.Args.withAddingStringValue(args, 'class, "form-control"), 'disabled -> disabled)) { fieldInfo => + @inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withDefault(bs.Args.withAddingStringValue(args, Symbol("class"), "form-control"), Symbol("disabled") -> disabled)) { fieldInfo => @defining( if(multiple) "%s[]".format(fieldInfo.name) else fieldInfo.name ) { selectName => @defining( ( !field.indexes.isEmpty && multiple ) match { case true => field.indexes.map( i => field("[%s]".format(i)).value ).flatten.toSet @@ -23,8 +23,8 @@ }){ implicit values => @readonlyWrapper(selectName, fieldInfo.value, disabled, argsMap) { diff --git a/play27-bootstrap3/module/app/views/b3/selectWithOptions.scala.html b/play27-bootstrap3/module/app/views/b3/selectWithOptions.scala.html index ec21e92..96e0ac8 100644 --- a/play27-bootstrap3/module/app/views/b3/selectWithOptions.scala.html +++ b/play27-bootstrap3/module/app/views/b3/selectWithOptions.scala.html @@ -1,5 +1,5 @@ @(field: Field, options: Seq[(String,String)], args: (Symbol,Any)*)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) -@selectWithContent(field, bs.Args.withDefault(args, '_hiddenValue -> bs.Args.get(args, '_default).orElse(options.headOption.map(_._1))):_*) { implicit values => +@selectWithContent(field, bs.Args.withDefault(args, Symbol("_hiddenValue") -> bs.Args.get(args, Symbol("_default")).orElse(options.headOption.map(_._1))):_*) { implicit values => @options.map { v => @selectOption(v._1, v._2) } diff --git a/play27-bootstrap3/module/app/views/b3/staticBasic.scala.html b/play27-bootstrap3/module/app/views/b3/staticBasic.scala.html index 6e72d44..e59ca97 100644 --- a/play27-bootstrap3/module/app/views/b3/staticBasic.scala.html +++ b/play27-bootstrap3/module/app/views/b3/staticBasic.scala.html @@ -1,4 +1,4 @@ @(args: (Symbol,Any)*)(text: => Html)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) -@freeFormGroup(bs.Args.withAddingStringValue(args, 'class, "form-control-static")) { innerArgsMap => +@freeFormGroup(bs.Args.withAddingStringValue(args, Symbol("class"), "form-control-static")) { innerArgsMap =>

@text

}(fc, messages) \ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/textarea.scala.html b/play27-bootstrap3/module/app/views/b3/textarea.scala.html index b1370eb..044324b 100644 --- a/play27-bootstrap3/module/app/views/b3/textarea.scala.html +++ b/play27-bootstrap3/module/app/views/b3/textarea.scala.html @@ -1,4 +1,4 @@ @(field: Field, args: (Symbol,Any)*)(implicit fc: b3.B3FieldConstructor, messages: MessagesProvider) -@inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withAddingStringValue(args, 'class, "form-control")) { fieldInfo => +@inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withAddingStringValue(args, Symbol("class"), "form-control")) { fieldInfo => }(fc, messages) \ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/vertical/bsFormGroup.scala.html b/play27-bootstrap3/module/app/views/b3/vertical/bsFormGroup.scala.html index f78da2a..73468db 100644 --- a/play27-bootstrap3/module/app/views/b3/vertical/bsFormGroup.scala.html +++ b/play27-bootstrap3/module/app/views/b3/vertical/bsFormGroup.scala.html @@ -1,7 +1,7 @@ @(contentHtml: Html, argsMap: Map[Symbol, Any])(implicit messages: MessagesProvider) @b3.bsFormGroupCommon(contentHtml, argsMap) { content => - @argsMap.get('_label).map { label => - + @argsMap.get(Symbol("_label")).map { label => + } @content } \ No newline at end of file diff --git a/play27-bootstrap3/module/app/views/b3/vertical/package.scala b/play27-bootstrap3/module/app/views/b3/vertical/package.scala index b8a0e96..c2a57a2 100644 --- a/play27-bootstrap3/module/app/views/b3/vertical/package.scala +++ b/play27-bootstrap3/module/app/views/b3/vertical/package.scala @@ -55,11 +55,11 @@ package object vertical { * ********************************************************************************************************************************* */ def form(action: Call, args: (Symbol, Any)*)(body: VerticalFieldConstructor => Html) = { - val vfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val vfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.form(action, args: _*)(body(vfc))(vfc) } def formCSRF(action: Call, args: (Symbol, Any)*)(body: VerticalFieldConstructor => Html)(implicit request: RequestHeader) = { - val vfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, '_feedbackIcons)) + val vfc = fieldConstructorSpecific(withFeedbackIcons = isTrue(args, Symbol("_feedbackIcons"))) views.html.b3.formCSRF(action, args: _*)(body(vfc))(vfc, request) } diff --git a/play27-bootstrap3/module/test/FieldConstructorsSpec.scala b/play27-bootstrap3/module/test/FieldConstructorsSpec.scala index 11d20ad..3ee39af 100644 --- a/play27-bootstrap3/module/test/FieldConstructorsSpec.scala +++ b/play27-bootstrap3/module/test/FieldConstructorsSpec.scala @@ -68,21 +68,21 @@ object FieldConstructorsSpec extends Specification { } "allow setting a custom id" in { - simpleInputWithArgs('_id -> "customid") must contain("id=\"customid\"") + simpleInputWithArgs(Symbol("_id") -> "customid") must contain("id=\"customid\"") } "allow setting extra classes form-group" in { - clean(simpleInputWithArgs('_class -> "extra_class another_class")) must contain(s"""
"extra_class another_class")) must contain(s"""
"theLabel")) must contain(s"""""") + clean(simpleInputWithArgs(Symbol("_label") -> "theLabel")) must contain(s"""""") } "allow hide the label" in { val labelString = s"""""" - clean(simpleInputWithArgs('_label -> "theLabel", '_hideLabel -> true)) must contain(labelString) - clean(simpleInputWithArgs('_hiddenLabel -> "theLabel")) must contain(labelString) + clean(simpleInputWithArgs(Symbol("_label") -> "theLabel", Symbol("_hideLabel") -> true)) must contain(labelString) + clean(simpleInputWithArgs(Symbol("_hiddenLabel") -> "theLabel")) must contain(labelString) } "allow render without label" in { @@ -97,7 +97,7 @@ object FieldConstructorsSpec extends Specification { } "allow showing constraints" in { - val test = simpleInputWithArgs('_showConstraints -> true) + val test = simpleInputWithArgs(Symbol("_showConstraints") -> true) test must contain("") test must contain("") test must contain("class=\"help-block\">" + msgsProv.messages("constraint.required") + "") @@ -105,14 +105,14 @@ object FieldConstructorsSpec extends Specification { } "allow showing help info" in { - simpleInputWithArgs('_help -> "test-help") must contain("test-help") - simpleInputWithArgs('_success -> "test-help") must contain("test-help") - simpleInputWithArgs('_warning -> "test-help") must contain("test-help") - simpleInputWithArgs('_error -> "test-help") must contain("test-help") + simpleInputWithArgs(Symbol("_help") -> "test-help") must contain("test-help") + simpleInputWithArgs(Symbol("_success") -> "test-help") must contain("test-help") + simpleInputWithArgs(Symbol("_warning") -> "test-help") must contain("test-help") + simpleInputWithArgs(Symbol("_error") -> "test-help") must contain("test-help") } "allow rendering erros and hide constraints when help info is present" in { - val test = simpleInputWithError('_showConstraints -> true, '_help -> "test-help") + val test = simpleInputWithError(Symbol("_showConstraints") -> true, Symbol("_help") -> "test-help") test must contain("test-error-0") test must contain("test-error-1") test must contain("test-help") @@ -141,27 +141,27 @@ object FieldConstructorsSpec extends Specification { } } - testStatus("success", withIcon = false, '_success -> true) - testStatus("success", withIcon = false, '_success -> "test-help") - testStatus("warning", withIcon = false, '_warning -> true) - testStatus("warning", withIcon = false, '_warning -> "test-help") - testStatus("error", withIcon = false, '_error -> true) - testStatus("error", withIcon = false, '_error -> "test-help") + testStatus("success", withIcon = false, Symbol("_success") -> true) + testStatus("success", withIcon = false, Symbol("_success") -> "test-help") + testStatus("warning", withIcon = false, Symbol("_warning") -> true) + testStatus("warning", withIcon = false, Symbol("_warning") -> "test-help") + testStatus("error", withIcon = false, Symbol("_error") -> true) + testStatus("error", withIcon = false, Symbol("_error") -> "test-help") "with feedback icons" in { - testStatus("success", withIcon = true, '_showIconValid -> true) - testStatus("success", withIcon = true, '_success -> "test-help", '_showIconValid -> true) - testStatus("warning", withIcon = true, '_showIconWarning -> true) - testStatus("warning", withIcon = true, '_warning -> "test-help", '_showIconWarning -> true) - testStatus("error", withIcon = true, '_error -> true, '_showIconOnError -> true) - testStatus("error", withIcon = true, '_error -> "test-help", '_showIconOnError -> true) + testStatus("success", withIcon = true, Symbol("_showIconValid") -> true) + testStatus("success", withIcon = true, Symbol("_success") -> "test-help", Symbol("_showIconValid") -> true) + testStatus("warning", withIcon = true, Symbol("_showIconWarning") -> true) + testStatus("warning", withIcon = true, Symbol("_warning") -> "test-help", Symbol("_showIconWarning") -> true) + testStatus("error", withIcon = true, Symbol("_error") -> true, Symbol("_showIconOnError") -> true) + testStatus("error", withIcon = true, Symbol("_error") -> "test-help", Symbol("_showIconOnError") -> true) } "with automatic feedback icons" in { - testStatus("success", withIcon = true, '_success -> "test-help")(fcWithFeedbackIcons) - testStatus("warning", withIcon = true, '_warning -> "test-help")(fcWithFeedbackIcons) - testStatus("error", withIcon = true, '_error -> true)(fcWithFeedbackIcons) - testStatus("error", withIcon = true, '_error -> "test-help")(fcWithFeedbackIcons) + testStatus("success", withIcon = true, Symbol("_success") -> "test-help")(fcWithFeedbackIcons) + testStatus("warning", withIcon = true, Symbol("_warning") -> "test-help")(fcWithFeedbackIcons) + testStatus("error", withIcon = true, Symbol("_error") -> true)(fcWithFeedbackIcons) + testStatus("error", withIcon = true, Symbol("_error") -> "test-help")(fcWithFeedbackIcons) } } @@ -173,7 +173,7 @@ object FieldConstructorsSpec extends Specification { test0 must not contain (" true, '_showIconOnError -> true) + val test1 = simpleInputWithError(Symbol("_showConstraints") -> true, Symbol("_showIconOnError") -> true) test1 must contain("aria-invalid=\"true\"") test1 must contain("aria-describedby=\"foo_status foo_info_0 foo_info_1 foo_error_0 foo_error_1\"") test1 must contain(" "test-help", '_showIconValid -> true) + val test2 = simpleInputWithArgs(Symbol("_help") -> "test-help", Symbol("_showIconValid") -> true) test2 must not contain ("aria-invalid") test2 must contain("aria-describedby=\"foo_status foo_info_0\"") test2 must contain(" Forms.text))("foo"), '_label -> "theLabel").body + val body = b3.text(Form(single("foo" -> Forms.text))("foo"), Symbol("_label") -> "theLabel").body body must contain(colLabel) body must contain(colInput) } diff --git a/play27-bootstrap3/module/test/FormsSpec.scala b/play27-bootstrap3/module/test/FormsSpec.scala index 2fa7907..b66c705 100644 --- a/play27-bootstrap3/module/test/FormsSpec.scala +++ b/play27-bootstrap3/module/test/FormsSpec.scala @@ -65,7 +65,7 @@ object FormsSpec extends Specification { } "allow setting custom class" in { - fooFormBody('class -> "customClass")(vfc) must contain("class=\"form-vertical customClass\"") + fooFormBody(Symbol("class") -> "customClass")(vfc) must contain("class=\"form-vertical customClass\"") } "add form role as default" in { @@ -73,7 +73,7 @@ object FormsSpec extends Specification { } "allow setting extra arguments and remove those arguments with false values or with underscored names" in { - val body = fooFormBody('extra_attr -> "test", 'true_attr -> true, 'fase_attr -> false, '_underscored_attr -> "test")(vfc) + val body = fooFormBody(Symbol("extra_attr") -> "test", Symbol("true_attr") -> true, Symbol("fase_attr") -> false, Symbol("_underscored_attr") -> "test")(vfc) body must contain("extra_attr=\"test\"") body must contain("true_attr=\"true\"") body must not contain ("false_attr=\"false\"") diff --git a/play27-bootstrap3/module/test/HelpersSpec.scala b/play27-bootstrap3/module/test/HelpersSpec.scala index ca022ae..7c9cdf0 100644 --- a/play27-bootstrap3/module/test/HelpersSpec.scala +++ b/play27-bootstrap3/module/test/HelpersSpec.scala @@ -59,7 +59,7 @@ object HelpersSpec extends Specification { "@inputType" should { "allow setting a custom id" in { - val body = b3.inputType("text", fooField, 'id -> "someid").body + val body = b3.inputType("text", fooField, Symbol("id") -> "someid").body val idAttr = "id=\"someid\"" body must contain(idAttr) // Make sure it doesn't have it twice @@ -79,11 +79,11 @@ object HelpersSpec extends Specification { } "allow setting additional classes" in { - b3.inputType("text", fooField, 'class -> "extra_class").body must contain("class=\"form-control extra_class\"") + b3.inputType("text", fooField, Symbol("class") -> "extra_class").body must contain("class=\"form-control extra_class\"") } "allow setting a default value" in { - val body = b3.inputType("text", fooField, 'value -> "defaultvalue").body + val body = b3.inputType("text", fooField, Symbol("value") -> "defaultvalue").body val valueAttr = "value=\"defaultvalue\"" body must contain(valueAttr) // Make sure it doesn't contain it twice @@ -91,7 +91,7 @@ object HelpersSpec extends Specification { } "allow being filled with a value" in { - val body = b3.inputType("text", fooFieldFilled("filledvalue"), 'value -> "defaultvalue").body + val body = b3.inputType("text", fooFieldFilled("filledvalue"), Symbol("value") -> "defaultvalue").body val valueAttr = "value=\"filledvalue\"" body must contain(valueAttr) // Make sure it doesn't contain it twice @@ -101,7 +101,7 @@ object HelpersSpec extends Specification { } "allow setting extra arguments and remove those arguments with false values or with underscored names" in { - val body = b3.inputType("text", fooField, 'extra_attr -> "test", 'true_attr -> true, 'fase_attr -> false, '_underscored_attr -> "test").body + val body = b3.inputType("text", fooField, Symbol("extra_attr") -> "test", Symbol("true_attr") -> true, Symbol("fase_attr") -> false, Symbol("_underscored_attr") -> "test").body body must contain("extra_attr=\"test\"") body must contain("true_attr=\"true\"") body must not contain ("false_attr=\"false\"") @@ -109,7 +109,7 @@ object HelpersSpec extends Specification { } } - val sampleArgs = Seq[(Symbol, Any)]('id -> "someid", 'foo -> "fooValue") + val sampleArgs = Seq[(Symbol, Any)](Symbol("id") -> "someid", Symbol("foo") -> "fooValue") def sampleInputTypeBody(theType: String) = b3.inputType(theType, fooField, sampleArgs: _*).body.trim "@text" should { @@ -127,14 +127,14 @@ object HelpersSpec extends Specification { } "@file" should { "be equivalent to inputType with file type" in { - b3.file(fooField, (('class -> "form-control") +: sampleArgs): _*).body.trim must be equalTo sampleInputTypeBody("file") + b3.file(fooField, ((Symbol("class") -> "form-control") +: sampleArgs): _*).body.trim must be equalTo sampleInputTypeBody("file") } } "@textarea" should { "allow setting a custom id" in { - val body = b3.textarea(fooField, 'id -> "someid").body + val body = b3.textarea(fooField, Symbol("id") -> "someid").body val idAttr = "id=\"someid\"" body must contain(idAttr) // Make sure it doesn't have it twice @@ -146,11 +146,11 @@ object HelpersSpec extends Specification { } "allow setting additional classes" in { - b3.textarea(fooField, 'class -> "extra_class").body must contain("class=\"form-control extra_class\"") + b3.textarea(fooField, Symbol("class") -> "extra_class").body must contain("class=\"form-control extra_class\"") } "allow setting a default value" in { - val body = b3.textarea(fooField, 'value -> "defaultvalue").body + val body = b3.textarea(fooField, Symbol("value") -> "defaultvalue").body body must contain(">defaultvalue") body must not contain ("value=\"defaultvalue\"") } @@ -163,7 +163,7 @@ object HelpersSpec extends Specification { def stringFieldFilled(v: String) = Form(single("foo" -> Forms.text)).fill(v)("foo") "allow setting a custom id" in { - val body = b3.checkbox(boolField, 'id -> "someid").body + val body = b3.checkbox(boolField, Symbol("id") -> "someid").body val idAttr = "id=\"someid\"" body must contain(idAttr) // Make sure it doesn't have it twice @@ -177,19 +177,19 @@ object HelpersSpec extends Specification { } "allow setting a default custom value" in { - val body = b3.checkbox(boolField, 'value -> "bar").body + val body = b3.checkbox(boolField, Symbol("value") -> "bar").body body must not contain ("checked") body must contain("value=\"bar\"") } "allow setting a default value for checked attribute" in { - val body = b3.checkbox(boolField, '_default -> true).body + val body = b3.checkbox(boolField, Symbol("_default") -> true).body body must contain("checked") body must contain("value=\"true\"") } "allow setting a default value for checked attribute with a custom value" in { - val body = b3.checkbox(boolField, 'value -> "bar", '_default -> true).body + val body = b3.checkbox(boolField, Symbol("value") -> "bar", Symbol("_default") -> true).body body must contain("checked") body must contain("value=\"bar\"") } @@ -201,44 +201,44 @@ object HelpersSpec extends Specification { } "allow being filled with a custom value" in { - val body = b3.checkbox(stringFieldFilled("bar"), 'value -> "bar").body + val body = b3.checkbox(stringFieldFilled("bar"), Symbol("value") -> "bar").body body must contain("checked") body must contain("value=\"bar\"") } "ignore default checked value if it is filled" in { - val body1 = b3.checkbox(boolFieldFilled(false), '_default -> true).body + val body1 = b3.checkbox(boolFieldFilled(false), Symbol("_default") -> true).body body1 must not contain ("checked") body1 must contain("value=\"true\"") - val body2 = b3.checkbox(stringFieldFilled(""), 'value -> "bar", '_default -> true).body + val body2 = b3.checkbox(stringFieldFilled(""), Symbol("value") -> "bar", Symbol("_default") -> true).body body2 must not contain ("checked") body2 must contain("value=\"bar\"") } "allow setting a forced value for checked attribute (always true)" in { - val body = b3.checkbox(boolField, 'checked -> true).body + val body = b3.checkbox(boolField, Symbol("checked") -> true).body body must contain("checked") body must contain("value=\"true\"") } "allow setting a forced value for checked attribute (always false)" in { - val body = b3.checkbox(boolField, 'checked -> false).body + val body = b3.checkbox(boolField, Symbol("checked") -> false).body body must not contain ("checked") body must contain("value=\"true\"") } "add support to readonly attribute" in { - val bodyWithoutReadonly = b3.checkbox(boolField, 'value -> true).body + val bodyWithoutReadonly = b3.checkbox(boolField, Symbol("value") -> true).body bodyWithoutReadonly must contain("
false, 'value -> true).body + val bodyReadonlyFalse = b3.checkbox(boolField, Symbol("readonly") -> false, Symbol("value") -> true).body bodyReadonlyFalse must contain("
") - val bodyReadonlyTrue = b3.checkbox(boolField, 'readonly -> true, 'value -> true).body + val bodyReadonlyTrue = b3.checkbox(boolField, Symbol("readonly") -> true, Symbol("value") -> true).body bodyReadonlyTrue must contain("
") bodyReadonlyTrue must contain("disabled=\"true\"") bodyReadonlyTrue must contain("") @@ -250,7 +250,7 @@ object HelpersSpec extends Specification { val fruits = Seq("A" -> "Apples", "P" -> "Pears", "B" -> "Bananas") "allow setting a custom id" in { - val body = b3.radio(fooField, fruits, 'id -> "someid").body + val body = b3.radio(fooField, fruits, Symbol("id") -> "someid").body body must contain("id=\"someid_A\"") body must contain("id=\"someid_P\"") body must contain("id=\"someid_B\"") @@ -261,7 +261,7 @@ object HelpersSpec extends Specification { } "allow setting a default value" in { - val body = b3.radio(fooField, fruits, 'value -> "B").body + val body = b3.radio(fooField, fruits, Symbol("value") -> "B").body val checkedAttr = "checked" body must contain(checkedAttr) // Make sure it doesn't have it twice @@ -281,23 +281,23 @@ object HelpersSpec extends Specification { } "allow be inline" in { - b3.radio(fooField, fruits, '_inline -> true).body must contain("radio-inline") + b3.radio(fooField, fruits, Symbol("_inline") -> true).body must contain("radio-inline") } "add support to readonly attribute" in { - val bodyWithoutReadonly = b3.radio(fooField, fruits, 'value -> "B").body + val bodyWithoutReadonly = b3.radio(fooField, fruits, Symbol("value") -> "B").body bodyWithoutReadonly must not contain ("radio-group") bodyWithoutReadonly must not contain ("disabled") bodyWithoutReadonly must not contain (" false, 'value -> "B").body + val bodyReadonlyFalse = b3.radio(fooField, fruits, Symbol("readonly") -> false, Symbol("value") -> "B").body bodyReadonlyFalse must contain("
") bodyReadonlyFalse must not contain ("disabled=\"true\"") bodyReadonlyFalse must contain("
") - val bodyReadonlyTrue = b3.radio(fooField, fruits, 'readonly -> true, 'value -> "B").body + val bodyReadonlyTrue = b3.radio(fooField, fruits, Symbol("readonly") -> true, Symbol("value") -> "B").body bodyReadonlyTrue must contain("
") bodyReadonlyTrue must contain("disabled=\"true\"") bodyReadonlyTrue must contain("
"Apples", "P" -> "Pears", "B" -> "Bananas") "allow setting a custom id" in { - val body = b3.select(fooField, fruits, 'id -> "someid").body + val body = b3.select(fooField, fruits, Symbol("id") -> "someid").body body must contain("id=\"someid\"") } @@ -319,7 +319,7 @@ object HelpersSpec extends Specification { } "allow setting additional classes" in { - b3.select(fooField, fruits, 'class -> "extra_class").body must contain("class=\"form-control extra_class\"") + b3.select(fooField, fruits, Symbol("class") -> "extra_class").body must contain("class=\"form-control extra_class\"") } "be unselected by default" in { @@ -327,7 +327,7 @@ object HelpersSpec extends Specification { } "allow setting a default value" in { - val body = b3.select(fooField, fruits, 'value -> "B").body + val body = b3.select(fooField, fruits, Symbol("value") -> "B").body val selectedAttr = "selected" body must contain(selectedAttr) // Make sure it doesn't have it twice @@ -343,24 +343,24 @@ object HelpersSpec extends Specification { } "add support to readonly attribute" in { - val bodyWithoutReadonly = b3.select(fooField, fruits, 'value -> "B").body + val bodyWithoutReadonly = b3.select(fooField, fruits, Symbol("value") -> "B").body bodyWithoutReadonly must not contain ("
") bodyWithoutReadonly must not contain ("disabled") bodyWithoutReadonly must not contain (" false, 'value -> "B").body + val bodyReadonlyFalse = b3.select(fooField, fruits, Symbol("readonly") -> false, Symbol("value") -> "B").body bodyReadonlyFalse must contain("
") bodyReadonlyFalse must not contain ("disabled=\"true\"") bodyReadonlyFalse must contain("") - val bodyReadonlyTrue = b3.select(fooField, fruits, 'readonly -> true, 'value -> "B").body + val bodyReadonlyTrue = b3.select(fooField, fruits, Symbol("readonly") -> true, Symbol("value") -> "B").body bodyReadonlyTrue must contain("
") bodyReadonlyTrue must contain("disabled=\"true\"") bodyReadonlyTrue must contain("") } "allow multiple" in { - val body = b3.select(fooField, fruits, 'multiple -> true, 'value -> "P,B").body + val body = b3.select(fooField, fruits, Symbol("multiple") -> true, Symbol("value") -> "P,B").body body must contain("multiple=\"true\"") val selectedAttr = "selected" body must contain(selectedAttr) @@ -373,15 +373,15 @@ object HelpersSpec extends Specification { "@hidden" should { "be rendered correctly" in { - val body = clean(b3.hidden("testName", "testValue", 'foo -> "bar").body) + val body = clean(b3.hidden("testName", "testValue", Symbol("foo") -> "bar").body) body must be equalTo """""" } "with Field object" in { - val body = clean(b3.hidden(fooField, 'value -> "testValue", 'foo -> "bar").body) + val body = clean(b3.hidden(fooField, Symbol("value") -> "testValue", Symbol("foo") -> "bar").body) body must be equalTo """""" } "with filled Field object" in { - val body = clean(b3.hidden(fooFieldFilled("filledValue"), 'value -> "testValue", 'foo -> "bar").body) + val body = clean(b3.hidden(fooFieldFilled("filledValue"), Symbol("value") -> "testValue", Symbol("foo") -> "bar").body) body must be equalTo """""" } } @@ -464,7 +464,7 @@ object HelpersSpec extends Specification { clean(b3.freeFormGroup(args)(innerArgs => Html(""))(fc, msgsProv).body) "vertical: show label" in { - testFormGroup('_class -> "theClass", '_id -> "theId", '_label -> "theLabel")(vfc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId", Symbol("_label") -> "theLabel")(vfc, msgsProv) must be equalTo clean("""
@@ -472,14 +472,14 @@ object HelpersSpec extends Specification { """) } "vertical: without label" in { - testFormGroup('_class -> "theClass", '_id -> "theId")(vfc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId")(vfc, msgsProv) must be equalTo clean("""
""") } "horizontal: show label" in { - testFormGroup('_class -> "theClass", '_id -> "theId", '_label -> "theLabel")(hfc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId", Symbol("_label") -> "theLabel")(hfc, msgsProv) must be equalTo clean("""
@@ -489,7 +489,7 @@ object HelpersSpec extends Specification { """) } "horizontal: without label" in { - testFormGroup('_class -> "theClass", '_id -> "theId")(hfc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId")(hfc, msgsProv) must be equalTo clean("""
@@ -498,7 +498,7 @@ object HelpersSpec extends Specification { """) } "inline: show label" in { - testFormGroup('_class -> "theClass", '_id -> "theId", '_label -> "theLabel")(ifc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId", Symbol("_label") -> "theLabel")(ifc, msgsProv) must be equalTo clean("""
@@ -506,7 +506,7 @@ object HelpersSpec extends Specification { """) } "inline: without label" in { - testFormGroup('_class -> "theClass", '_id -> "theId")(ifc, msgsProv) must be equalTo clean(""" + testFormGroup(Symbol("_class") -> "theClass", Symbol("_id") -> "theId")(ifc, msgsProv) must be equalTo clean("""
@@ -514,7 +514,7 @@ object HelpersSpec extends Specification { } "get the inner arguments for the content" in { - val body = b3.freeFormGroup(Seq('_class -> "theClass", '_underscored -> "underscored", 'foo -> "foo"))(innerArgsMap => Html(innerArgsMap.toSeq.map(a => s"""${a._1.name}="${a._2.toString}"""").mkString("")))(vfc, msgsProv).body + val body = b3.freeFormGroup(Seq(Symbol("_class") -> "theClass", Symbol("_underscored") -> "underscored", Symbol("foo") -> "foo"))(innerArgsMap => Html(innerArgsMap.toSeq.map(a => s"""${a._1.name}="${a._2.toString}"""").mkString("")))(vfc, msgsProv).body body must not contain "_class=\"theClass\"" body must not contain "_underscored=\"underscored\"" body must contain("foo=\"foo\"") @@ -523,7 +523,7 @@ object HelpersSpec extends Specification { "@free" should { "be rendered correctly" in { - clean(b3.free('foo -> "fooValue")(Html(""))(vfc, msgsProv).body) must be equalTo clean(b3.freeFormGroup(Seq('foo -> "fooValue"))(_ => Html(""))(vfc, msgsProv).body) + clean(b3.free(Symbol("foo") -> "fooValue")(Html(""))(vfc, msgsProv).body) must be equalTo clean(b3.freeFormGroup(Seq(Symbol("foo") -> "fooValue"))(_ => Html(""))(vfc, msgsProv).body) } } @@ -534,11 +534,11 @@ object HelpersSpec extends Specification { } "allow setting additional classes" in { - b3.static("theLabel", 'class -> "extra_class")(Html("theText"))(vfc, msgsProv).body must contain("

theText

") + b3.static("theLabel", Symbol("class") -> "extra_class")(Html("theText"))(vfc, msgsProv).body must contain("

theText

") } "allow setting extra arguments and remove those arguments with false values or with underscored names" in { - val body = b3.static("theLabel", 'extra_attr -> "test", 'true_attr -> true, 'fase_attr -> false, '_underscored_attr -> "test")(Html("theText"))(vfc, msgsProv).body + val body = b3.static("theLabel", Symbol("extra_attr") -> "test", Symbol("true_attr") -> true, Symbol("fase_attr") -> false, Symbol("_underscored_attr") -> "test")(Html("theText"))(vfc, msgsProv).body body must contain("extra_attr=\"test\"") body must contain("true_attr=\"true\"") body must not contain ("false_attr=\"false\"") @@ -564,7 +564,7 @@ object HelpersSpec extends Specification { } "allow setting extra arguments and remove those arguments with false values or with underscored names" in { - val body = buttonTypeBody('extra_attr -> "test", 'true_attr -> true, 'fase_attr -> false, '_underscored_attr -> "test") + val body = buttonTypeBody(Symbol("extra_attr") -> "test", Symbol("true_attr") -> true, Symbol("fase_attr") -> false, Symbol("_underscored_attr") -> "test") body must contain("extra_attr=\"test\"") body must contain("true_attr=\"true\"") body must not contain ("false_attr=\"false\"") @@ -572,7 +572,7 @@ object HelpersSpec extends Specification { } "be rendered correctly" in { - val body = buttonTypeBody('id -> "someid", 'class -> "btn btn-default") + val body = buttonTypeBody(Symbol("id") -> "someid", Symbol("class") -> "btn btn-default") body must contain("") } } @@ -598,16 +598,16 @@ object HelpersSpec extends Specification { "@inputWrapped" should { "be equivalent to inputType for an empty wrapper" in { - val bodyInputType = clean(b3.inputType("text", fooField, 'id -> "someid").body) - val body = clean(b3.inputWrapped("text", fooField, 'id -> "someid")(x => x).body) + val bodyInputType = clean(b3.inputType("text", fooField, Symbol("id") -> "someid").body) + val body = clean(b3.inputWrapped("text", fooField, Symbol("id") -> "someid")(x => x).body) body must be equalTo bodyInputType } "wrap the input" in { - val bodyInputType = clean(b3.inputType("text", fooField, 'id -> "someid").body) + val bodyInputType = clean(b3.inputType("text", fooField, Symbol("id") -> "someid").body) val (wrapperPre, wrapperPost) = ("", "") def wrap(input: Html) = HtmlFormat.fill(scala.collection.immutable.Seq(Html(wrapperPre), input, Html(wrapperPost))) - val body = clean(b3.inputWrapped("text", fooField, 'id -> "someid")(input => wrap(input)).body) + val body = clean(b3.inputWrapped("text", fooField, Symbol("id") -> "someid")(input => wrap(input)).body) val (indexOfWrapperPre, indexOfWrapperPost) = (body.indexOf(wrapperPre), body.indexOf(wrapperPost)) @@ -631,7 +631,7 @@ object HelpersSpec extends Specification { def fooMultifieldWithFielsArgs(fieldsArgs: (Symbol, Any)*) = multifield(fooForm, fieldsArgs = fieldsArgs)(vfc, msgsProv) "have the basic structure" in { - val body = fooMultifield('_label -> "theLabel") + val body = fooMultifield(Symbol("_label") -> "theLabel") body must contain("class=\"form-group") body must not contain ("has-error") body must contain("") @@ -640,22 +640,22 @@ object HelpersSpec extends Specification { } "behave as a horizontal field constructor" in { - val body = multifield(fooForm, Seq('_label -> "theLabel"))(hfc, msgsProv) + val body = multifield(fooForm, Seq(Symbol("_label") -> "theLabel"))(hfc, msgsProv) body must contain("") body must contain("
") } "allow setting a custom id" in { - fooMultifield('_id -> "customid") must contain("id=\"customid\"") + fooMultifield(Symbol("_id") -> "customid") must contain("id=\"customid\"") } "allow setting extra classes form-group" in { - fooMultifield('_class -> "extra_class another_class") must contain("class=\"form-group extra_class another_class") + fooMultifield(Symbol("_class") -> "extra_class another_class") must contain("class=\"form-group extra_class another_class") } "show label" in { - multifield(fooForm, Seq('_label -> "fooLabel"))(vfc, msgsProv) must contain("") - multifield(fooForm, Seq('_label -> "fooLabel"))(hfc, msgsProv) must contain("") + multifield(fooForm, Seq(Symbol("_label") -> "fooLabel"))(vfc, msgsProv) must contain("") + multifield(fooForm, Seq(Symbol("_label") -> "fooLabel"))(hfc, msgsProv) must contain("") } "without label" in { @@ -670,17 +670,17 @@ object HelpersSpec extends Specification { } "allow showing constraints" in { - multifield(fooForm, fieldsArgs = Seq('_showConstraints -> true))(vfc, msgsProv) must contain("" + msgsProv.messages("constraint.required") + "") + multifield(fooForm, fieldsArgs = Seq(Symbol("_showConstraints") -> true))(vfc, msgsProv) must contain("" + msgsProv.messages("constraint.required") + "") } "allow showing help info" in { - fooMultifield('_help -> "test-help") must contain("""test-help""") - fooMultifield('_success -> "test-help") must contain("""test-help""") - fooMultifieldWithFielsArgs('_success -> "test-help") must contain("""test-help""") - fooMultifield('_warning -> "test-help") must contain("""test-help""") - fooMultifieldWithFielsArgs('_warning -> "test-help") must contain("""test-help""") - fooMultifield('_error -> "test-help") must contain("""test-help""") - fooMultifieldWithFielsArgs('_error -> "test-help") must contain("""test-help""") + fooMultifield(Symbol("_help") -> "test-help") must contain("""test-help""") + fooMultifield(Symbol("_success") -> "test-help") must contain("""test-help""") + fooMultifieldWithFielsArgs(Symbol("_success") -> "test-help") must contain("""test-help""") + fooMultifield(Symbol("_warning") -> "test-help") must contain("""test-help""") + fooMultifieldWithFielsArgs(Symbol("_warning") -> "test-help") must contain("""test-help""") + fooMultifield(Symbol("_error") -> "test-help") must contain("""test-help""") + fooMultifieldWithFielsArgs(Symbol("_error") -> "test-help") must contain("""test-help""") } "render validation states" in { @@ -697,9 +697,9 @@ object HelpersSpec extends Specification { )) def testStatus(status: String, withIcon: Boolean, withFieldsArgs: Boolean, args: (Symbol, Any)*) = { val test = if (withFieldsArgs) - clean(b3.multifield(fooForm("foo"))(globalArgs = if (withIcon) Seq('_hasFeedback -> true) else Seq(), fieldsArgs = args)(cfc => b3.text(fooForm("foo"), args: _*))(vfc, msgsProv).body) + clean(b3.multifield(fooForm("foo"))(globalArgs = if (withIcon) Seq(Symbol("_hasFeedback") -> true) else Seq(), fieldsArgs = args)(cfc => b3.text(fooForm("foo"), args: _*))(vfc, msgsProv).body) else - clean(b3.multifield(fooForm("foo"))(globalArgs = if (withIcon) (('_hasFeedback -> true) +: args) else args, fieldsArgs = Seq())(cfc => b3.text(fooForm("foo"), args: _*))(vfc, msgsProv).body) + clean(b3.multifield(fooForm("foo"))(globalArgs = if (withIcon) ((Symbol("_hasFeedback") -> true) +: args) else args, fieldsArgs = Seq())(cfc => b3.text(fooForm("foo"), args: _*))(vfc, msgsProv).body) test must withStatus(status, withIcon) if (withIcon) { test must withFeedbackIcon(status) @@ -708,32 +708,32 @@ object HelpersSpec extends Specification { } } - testStatus("success", withIcon = false, withFieldsArgs = false, '_success -> true) - testStatus("success", withIcon = false, withFieldsArgs = true, '_success -> true) - testStatus("success", withIcon = false, withFieldsArgs = false, '_success -> "test-help") - testStatus("success", withIcon = false, withFieldsArgs = true, '_success -> "test-help") - testStatus("warning", withIcon = false, withFieldsArgs = false, '_warning -> true) - testStatus("warning", withIcon = false, withFieldsArgs = true, '_warning -> true) - testStatus("warning", withIcon = false, withFieldsArgs = false, '_warning -> "test-help") - testStatus("warning", withIcon = false, withFieldsArgs = true, '_warning -> "test-help") - testStatus("error", withIcon = false, withFieldsArgs = false, '_error -> true) - testStatus("error", withIcon = false, withFieldsArgs = true, '_error -> true) - testStatus("error", withIcon = false, withFieldsArgs = false, '_error -> "test-help") - testStatus("error", withIcon = false, withFieldsArgs = true, '_error -> "test-help") + testStatus("success", withIcon = false, withFieldsArgs = false, Symbol("_success") -> true) + testStatus("success", withIcon = false, withFieldsArgs = true, Symbol("_success") -> true) + testStatus("success", withIcon = false, withFieldsArgs = false, Symbol("_success") -> "test-help") + testStatus("success", withIcon = false, withFieldsArgs = true, Symbol("_success") -> "test-help") + testStatus("warning", withIcon = false, withFieldsArgs = false, Symbol("_warning") -> true) + testStatus("warning", withIcon = false, withFieldsArgs = true, Symbol("_warning") -> true) + testStatus("warning", withIcon = false, withFieldsArgs = false, Symbol("_warning") -> "test-help") + testStatus("warning", withIcon = false, withFieldsArgs = true, Symbol("_warning") -> "test-help") + testStatus("error", withIcon = false, withFieldsArgs = false, Symbol("_error") -> true) + testStatus("error", withIcon = false, withFieldsArgs = true, Symbol("_error") -> true) + testStatus("error", withIcon = false, withFieldsArgs = false, Symbol("_error") -> "test-help") + testStatus("error", withIcon = false, withFieldsArgs = true, Symbol("_error") -> "test-help") "with feedback icons" in { - testStatus("success", withIcon = true, withFieldsArgs = false, '_showIconValid -> true) - testStatus("success", withIcon = true, withFieldsArgs = true, '_showIconValid -> true) - testStatus("success", withIcon = true, withFieldsArgs = false, '_success -> "test-help", '_showIconValid -> true) - testStatus("success", withIcon = true, withFieldsArgs = true, '_success -> "test-help", '_showIconValid -> true) - testStatus("warning", withIcon = true, withFieldsArgs = false, '_showIconWarning -> true) - testStatus("warning", withIcon = true, withFieldsArgs = true, '_showIconWarning -> true) - testStatus("warning", withIcon = true, withFieldsArgs = false, '_warning -> "test-help", '_showIconWarning -> true) - testStatus("warning", withIcon = true, withFieldsArgs = true, '_warning -> "test-help", '_showIconWarning -> true) - testStatus("error", withIcon = true, withFieldsArgs = false, '_error -> true, '_showIconOnError -> true) - testStatus("error", withIcon = true, withFieldsArgs = true, '_error -> true, '_showIconOnError -> true) - testStatus("error", withIcon = true, withFieldsArgs = false, '_error -> "test-help", '_showIconOnError -> true) - testStatus("error", withIcon = true, withFieldsArgs = true, '_error -> "test-help", '_showIconOnError -> true) + testStatus("success", withIcon = true, withFieldsArgs = false, Symbol("_showIconValid") -> true) + testStatus("success", withIcon = true, withFieldsArgs = true, Symbol("_showIconValid") -> true) + testStatus("success", withIcon = true, withFieldsArgs = false, Symbol("_success") -> "test-help", Symbol("_showIconValid") -> true) + testStatus("success", withIcon = true, withFieldsArgs = true, Symbol("_success") -> "test-help", Symbol("_showIconValid") -> true) + testStatus("warning", withIcon = true, withFieldsArgs = false, Symbol("_showIconWarning") -> true) + testStatus("warning", withIcon = true, withFieldsArgs = true, Symbol("_showIconWarning") -> true) + testStatus("warning", withIcon = true, withFieldsArgs = false, Symbol("_warning") -> "test-help", Symbol("_showIconWarning") -> true) + testStatus("warning", withIcon = true, withFieldsArgs = true, Symbol("_warning") -> "test-help", Symbol("_showIconWarning") -> true) + testStatus("error", withIcon = true, withFieldsArgs = false, Symbol("_error") -> true, Symbol("_showIconOnError") -> true) + testStatus("error", withIcon = true, withFieldsArgs = true, Symbol("_error") -> true, Symbol("_showIconOnError") -> true) + testStatus("error", withIcon = true, withFieldsArgs = false, Symbol("_error") -> "test-help", Symbol("_showIconOnError") -> true) + testStatus("error", withIcon = true, withFieldsArgs = true, Symbol("_error") -> "test-help", Symbol("_showIconOnError") -> true) } } diff --git a/play27-bootstrap3/sample/app/views/b3/my/email.scala.html b/play27-bootstrap3/sample/app/views/b3/my/email.scala.html index 6c5dd8e..d04167b 100644 --- a/play27-bootstrap3/sample/app/views/b3/my/email.scala.html +++ b/play27-bootstrap3/sample/app/views/b3/my/email.scala.html @@ -1,5 +1,5 @@ @(field: Field, args: (Symbol,Any)*)(implicit handler: b3.B3FieldConstructor, msgsProv: MessagesProvider) -@b3.inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withDefault(args, 'class -> "form-control")) { fieldInfo => +@b3.inputFormGroup(field, withFeedback = false, withLabelFor = true, bs.Args.withDefault(args, Symbol("class") -> "form-control")) { fieldInfo =>
@@ diff --git a/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFieldConstructor.scala.html b/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFieldConstructor.scala.html index f299e9c..bfe169a 100644 --- a/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFieldConstructor.scala.html +++ b/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFieldConstructor.scala.html @@ -2,12 +2,12 @@ @alertStatus = @{ if (fieldInfo.hasErrors) "alert-danger" - else if (bs.ArgsMap.isTrue(fieldInfo.argsMap, '_success)) + else if (bs.ArgsMap.isTrue(fieldInfo.argsMap, Symbol("_success"))) "alert-success" else "alert-info" } -
+
@fieldInfo.labelOpt.map { label => diff --git a/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFormGroup.scala.html b/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFormGroup.scala.html index 1d1a819..3cb8644 100644 --- a/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFormGroup.scala.html +++ b/play27-bootstrap3/sample/app/views/b3/my/vertical/bsFormGroup.scala.html @@ -1,14 +1,14 @@ @(contentHtml: Html, argsMap: Map[Symbol, Any])(implicit msgsProv: MessagesProvider) -
+
- @argsMap.get('_label).map { label => + @argsMap.get(Symbol("_label")).map { label => } @contentHtml