Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f8aac3
commit 2f21149
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Creating a login form is a good example of how you can use Themes and UI Sets to build some UI that is independent of look and feel. | ||
|
||
Create a @TestController@ with a @login@ action and save @login.gsp@ in @grails-app/views/test/@ and place this in it: | ||
|
||
{docx} | ||
<html> | ||
<head> | ||
<theme:layout name="dialog"/> | ||
<theme:title text="login.page.title"></theme:title> | ||
<head> | ||
<body> | ||
<theme:zone name="body"> | ||
<ui:h1>Please log in</ui:h1> | ||
<ui:form> | ||
<ui:field name="username"/> | ||
<ui:field name="password" type="password"/> | ||
<ui:actions> | ||
<ui:button>Log in</ui:button> | ||
<ui:button>I forgot my password</ui:button> | ||
</ui:actions> | ||
</ui:form> | ||
</theme:zone> | ||
</body> | ||
</html> | ||
{docx} | ||
|
||
Now browse to @/test/login@ and view the form. Notice how you have no styling or structure related code in your markup. | ||
|
||
If you had more themes installed you could switch to others to test the same form in them. | ||
|