Skip to content

Commit

Permalink
Add register link to loginSidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
drosowski committed Aug 8, 2011
1 parent 39ed9c6 commit a33c55b
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 1 deletion.
4 changes: 4 additions & 0 deletions grails-app/controllers/de/womomo/RegisterController.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package de.womomo

class RegisterController extends grails.plugins.springsecurity.ui.RegisterController {
}
24 changes: 23 additions & 1 deletion grails-app/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,26 @@ campsite.average_rating=bei {0} Bewertungen

comment.add.title=Kommentar hinzufügen
comment.error.not_authorized=Sie müssen eingeloggt sein um Stellplätze zu kommentieren.
comment.post.button.name=Hinzufügen
comment.post.button.name=Hinzufügen

login.username.label=Benutzername
login.password.label=Passwort
login.register.no_account=Sie haben noch kein Benutzerkonto?
login.register.here=Hier registrieren

register.heading.label=Benutzerkonto registrieren
register.username.label=Benutzername
register.email.label=E-Mail
register.password.label=Passwort
register.password2.label=Passwort wiederholen
register.button.register.label=Registrieren

spring.security.ui.register.sent=Eine Bestätigungsmail wurde an die angegebene E-Mail Adresse versandt.
command.password2.error.mismatch=Die Passwörter stimmen nicht überein.
registerCommand.username.blank=Es wurde kein Benutzername angegeben.
registerCommand.username.unique=Der Benutzername wird bereits verwendet.
registerCommand.email.blank=Es wurde keine E-Mail Adresse angegeben.
registerCommand.email.email.invalid=Bitte geben Sie eine gültige E-Mail Adresse an.
registerCommand.password.blank=Es wurde kein Passwort angegeben.
registerCommand.password.minSize.notmet=Das Passwort muß zwischen 6 und 64 Zeichen lang sein.
registerCommand.password.maxSize.exceeded=Das Passwort muß zwischen 6 und 64 Zeichen lang sein.
2 changes: 2 additions & 0 deletions grails-app/views/_loginSidebar.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<input type="hidden" name="spring-security-redirect" value="${request.forwardURI - request.contextPath}"
<p><span><g:message code="login.username.label" default="Username"/></span><input type="text" name="j_username"/></p>
<p><span><g:message code="login.password.label" default="Password"/></span><input type="password" name="j_password"/></p>
<p><sub><g:message code="login.register.no_account"/><br/>
<a href="${createLink(controller: "register")}"><g:message code="login.register.here"/></a></sub></p>
<p><span>&nbsp;</span><input class="submit" type="submit" name="name" value="${message(code: 'button.login.label', default: 'Login')}"/></p>
</div>
</form>
Expand Down
45 changes: 45 additions & 0 deletions grails-app/views/register/forgotPassword.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<head>
<title><g:message code='spring.security.ui.forgotPassword.title'/></title>
<meta name='layout' content='register'/>
</head>

<body>

<p/>

<s2ui:form width='350' height='220' elementId='forgotPasswordFormContainer'
titleCode='spring.security.ui.forgotPassword.header' center='true'>

<g:form action='forgotPassword' name="forgotPasswordForm" autocomplete='off'>

<g:if test='${emailSent}'>
<br/>
<g:message code='spring.security.ui.forgotPassword.sent'/>
</g:if>

<g:else>

<br/>
<h4><g:message code='spring.security.ui.forgotPassword.description'/></h4>

<table>
<tr>
<td><label for="username"><g:message code='spring.security.ui.forgotPassword.username'/></label></td>
<td><g:textField name="username" size="25" /></td>
</tr>
</table>

<s2ui:submitButton elementId='reset' form='forgotPasswordForm' messageCode='spring.security.ui.forgotPassword.submit'/>

</g:else>

</g:form>
</s2ui:form>

<script>
$(document).ready(function() {
$('#username').focus();
});
</script>

</body>
47 changes: 47 additions & 0 deletions grails-app/views/register/index.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<%@ page import="de.womomo.Campsite" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="layout" content="main"/>
<title><g:message code="register.heading.label"/></title>
</head>
<body>
<content tag="sidebar"></content>

<content tag="body">

<h1><g:message code="register.heading.label"/></h1>

<g:if test="${flash.message}">
<div class="success">${flash.message}</div>
</g:if>
<g:hasErrors bean="${command}">
<g:renderErrors bean="${command}" as="list"/>
</g:hasErrors>

<g:form action="register" name="registerForm">

<g:if test='${emailSent}'>
<br/>
<g:message code='spring.security.ui.register.sent'/>
</g:if>
<g:else>

<div class="form_settings">
<p><span><g:message code="register.username.label" default="Username"/></span><g:textField name="username" value="${command?.username}" class="text"/></p>

<p><span><g:message code="register.email.label" default="E-Mail"/></span><g:textField name="email" value="${command?.email}" class="text"/></p>

<p><span><g:message code="register.password.label" default="Password"/></span><g:passwordField name="password" value="${command?.password}" class="text"/></p>

<p><span><g:message code="register.password2.label" default="Repeat password"/></span><g:passwordField name="password2" value="${command?.password2}" class="text"/></p>

<br/>
<p class="buttons"><input class="submit" type="submit" name="register" value="${message(code: 'register.button.register.label', default: 'Register')}"/></p>
</div>
</g:else>
</g:form>
</content>

</body>
</html>
42 changes: 42 additions & 0 deletions grails-app/views/register/resetPassword.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<head>
<title><g:message code='spring.security.ui.resetPassword.title'/></title>
<meta name='layout' content='register'/>
</head>

<body>

<p/>

<s2ui:form width='475' height='250' elementId='resetPasswordFormContainer'
titleCode='spring.security.ui.resetPassword.header' center='true'>

<g:form action='resetPassword' name='resetPasswordForm' autocomplete='off'>
<g:hiddenField name='t' value='${token}'/>
<div class="sign-in">

<br/>
<h4><g:message code='spring.security.ui.resetPassword.description'/></h4>

<table>
<s2ui:passwordFieldRow name='password' labelCode='resetPasswordCommand.password.label' bean="${command}"
labelCodeDefault='Password' value="${command?.password}"/>

<s2ui:passwordFieldRow name='password2' labelCode='resetPasswordCommand.password2.label' bean="${command}"
labelCodeDefault='Password (again)' value="${command?.password2}"/>
</table>

<s2ui:submitButton elementId='reset' form='resetPasswordForm' messageCode='spring.security.ui.resetPassword.submit'/>

</div>
</g:form>

</div>
</s2ui:form>

<script>
$(document).ready(function() {
$('#password').focus();
});
</script>

</body>

0 comments on commit a33c55b

Please sign in to comment.