@**
 * Generate an HTML radio group
 *
 * Example:
 * {{{
 * @inputRadioGroup(
 *           contactForm("gender"),
 *           options = Seq("M"->"Male","F"->"Female"),
 *           Symbol("_label") -> "Gender",
 *           Symbol("_error") -> contactForm("gender").error.map(_.withMessage("select gender")))
 *
 * }}}
 *
 * @param field The form field.
 * @param options Seq of radio buttons encoded as value -> label
 * @param args Set of extra HTML attributes.
 * @param handler The field constructor.
 *@
@(field: play.api.data.Field, options: Seq[(String,String)], args: (Symbol,Any)*)(implicit handler: FieldConstructor, messages: play.api.i18n.MessagesProvider)
@input(field, args.map{ x => if(x._1 == Symbol("_label")) Symbol("_name") -> x._2 else x }:_*) { (id, name, value, htmlArgs) =>
  <span class="buttonset" id="@id">
    @options.map { v =>
      <input type="radio" id="@(id)_@v._1" name="@name" value="@v._1" @if(value == Some(v._1)){checked="checked"} @toHtmlArgs(htmlArgs)/>
      <label for="@(id)_@v._1">@v._2</label>
    }
  </span>
}
