mslinn / html-form-scala

Bootstrap 3 Form Widgets for Play Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bootstrap 3 HTML Form Widgets for Play Framework

License Build Status GitHub version

This project provides Bootstrap 3 compatible HTML form widgets for Play Framework. The form widgets provided with Play Framework feature a minimum of parameters and have an arcane syntax as a result. Those widgets are rendered within a <dl/> tags, which is only useful for a narrow range of scenarios. Most HTML5 features are not supported "out of the box" so it is common to spend a lot of time crafting wrappers around the standard widgets.

The Play Bootstrap widgets require Twitter Bootstrap, but otherwise its API is similar to the Play Framework form widget API.

ScalaTags is another library for generating HTML using Scala. It is not Play Framework aware, or Twitter Bootstrap aware – instead, it is completely generic.

This package produces output that closely resembles Play Bootstrap's output, but it uses many explicit parameters instead of following the Play Framework API. Widgets in the views.html.htmlForm package are HTML5 compatible, and include a CSRF form helper.

Widgets related to Twitter Bootstrap 3.x are provided in the views.html.htmlForm.bootstrap3 package. Two flavors of modal dialog are provided, smart tabs and a date picker. The HtmlForm object contains checkboxes, selects, and various flavors of input for email, URLs, currency, passwords, percentages, range-limited numeric values and much more.

Installation

Add this to your project's build.sbt:

resolvers += "micronautics/play on bintray" at "https://dl.bintray.com/micronautics/play"

libraryDependencies += "com.micronautics" %% "html-form-scala" % "0.2.1" withSources()

Scaladoc

Here

Working with html-form-scala

This project requires an implementation of model.persistence.Id, defined in has-id for testing purposes. Other projects that incorporate this project as a dependency must define their own implementation of model.persistence.Id (for persistence, for example).

About

Bootstrap 3 Form Widgets for Play Framework

License:Creative Commons Zero v1.0 Universal


Languages

Language:Scala 96.4%Language:JavaScript 1.9%Language:Shell 1.7%