Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
WIP: split up create and edit profile page from registration workflow…
Browse files Browse the repository at this point in the history
… and profile edit workflow
  • Loading branch information
Alex Eng committed Nov 27, 2013
1 parent 1eda383 commit 259b175
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 2 deletions.
3 changes: 3 additions & 0 deletions zanata-war/src/main/resources/messages.properties
Expand Up @@ -596,6 +596,9 @@ jsf.MaintainedGroups=Maintained Groups
#------ [home] > My Profile > Edit Profile ------
jsf.FirstExternalLoginMessage=Please verify the email address below and click Save to validate your email address.
jsf.AccountDetails=Account Details
jsf.Profile=Profile
jsf.NewUser.Label=New User
jsf.NewUser.Create=Create user



Expand Down
67 changes: 67 additions & 0 deletions zanata-war/src/main/webapp/WEB-INF/layout/profile/edit_form.xhtml
@@ -0,0 +1,67 @@
<s:fragment
xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<div class="l--push-top-half form__item">
<h:outputLabel for="name">#{messages['jsf.Name']}
<s:span styleClass="txt--required">*</s:span>
<s:span styleClass="icon-info-circle-2 input_help" id="nameHelp">
<rich:tooltip>
#{messages['jsf.NameToolTip']}
</rich:tooltip>
</s:span>
</h:outputLabel>
<s:decorate id="nameField" template="../field.xhtml" enclose="true">
<h:inputText id="name" value="#{profileAction.name}" required="true"
maxlength="80">
<a4j:ajax event="blur" render="nameField" execute="@this"/>
</h:inputText>
</s:decorate>
</div>

<div class="l--push-top-half form__item">
<h:outputLabel for="username">#{messages['jsf.Username']}
<s:span styleClass="txt--required">*</s:span>
<s:span styleClass="icon-info-circle-2 input_help" id="usernameHelp">
<rich:tooltip>
#{messages['jsf.UsernameToolTip']}
</rich:tooltip>
</s:span>
</h:outputLabel>
<s:decorate id="usernameField" template="../field.xhtml" enclose="true">
<h:inputText id="username" required="true" maxlength="80"
rendered="#{profileAction.newUser}"
value="#{profileAction.username}">
<a4j:ajax event="blur" render="usernameField" execute="@this"/>
</h:inputText>

<h:inputText required="true" maxlength="80"
rendered="#{not profileAction.newUser}"
value="#{profileAction.username}" disabled="true">
<a4j:ajax event="blur" render="usernameField" execute="@this"/>
</h:inputText>

</s:decorate>
</div>

<div class="l--push-top-half form__item">
<h:outputLabel for="email">
#{messages['jsf.Email']}
<s:span styleClass="icon-info-circle-2 input_help" id="emailHelp">
<rich:tooltip>
#{messages['jsf.EmailToolTip']}
</rich:tooltip>
</s:span>
</h:outputLabel>
<s:decorate id="emailField" template="../field.xhtml">
<h:inputText id="email" required="false"
value="#{profileAction.email}">
<a4j:ajax event="blur" render="emailField" execute="@this"/>
</h:inputText>
</s:decorate>
</div>
</s:fragment>
Expand Up @@ -3,11 +3,17 @@
xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j">
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<div class="l--push-top-half form__item">
<h:outputLabel for="slug">#{messages['jsf.GroupId']}
<s:span styleClass="txt--required">*</s:span>
<s:span styleClass="icon-info-circle-2 input_help" id="slugHelp">
<rich:tooltip>
<em><code>#{messages['jsf.GroupIdExample']}</code></em>
</rich:tooltip>
</s:span>
</h:outputLabel>
<s:decorate id="slugField" template="../field.xhtml" enclose="true">
<h:inputText rendered="#{versionGroupHome.managed}"
Expand Down
14 changes: 13 additions & 1 deletion zanata-war/src/main/webapp/WEB-INF/pages.xml
Expand Up @@ -46,7 +46,7 @@
<navigation>
<rule
if="#{authenticationManager.authenticated and authenticationManager.newUser}">
<redirect view-id="/profile/edit.xhtml" />
<redirect view-id="/profile/create_user.xhtml" />
</rule>
<rule
if="#{!identity.isLoggedIn() and authenticationManager.authenticatedAccountWaitingForActivation}">
Expand Down Expand Up @@ -468,6 +468,18 @@
</navigation>
</page>

<page view-id="/profile/create_user.xhtml">
<restrict>#{identity.preAuthenticated}</restrict>
<navigation from-action="#{profileAction.createUser}">
<rule if-outcome="home">
<redirect view-id="/home.xhtml" />
</rule>
</navigation>
<navigation from-action="#{profileAction.cancel}">
<redirect view-id="/home.xhtml" />
</navigation>
</page>

<page view-id="/profile/view.xhtml" login-required="true">
<action execute="#{breadcrumbs.clear}" />
<action
Expand Down
50 changes: 50 additions & 0 deletions zanata-war/src/main/webapp/profile/create_user.xhtml
@@ -0,0 +1,50 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.org/schema/seam/taglib"
template="../WEB-INF/template/template.xhtml">

<ui:define
name="page_title">#{messages['jsf.Profile']}:#{messages['jsf.NewUser.Label']}</ui:define>

<ui:define name="center_content">
<div class="g--centered">
<div class="g__item w--1-2-m w--3-8-l w--1-3 l--push-bottom-1">

<s:link view="/account/register.xhtml"
propagation="none"
rendered="#{applicationConfiguration.internalAuth}">
<p class="txt--meta l--push-all-0">#{messages['jsf.Signup']}</p>
</s:link>

<s:fragment
rendered="#{not applicationConfiguration.internalAuth and not empty applicationConfiguration.registerPath}">
<a href="#{applicationConfiguration.registerPath}">
<p class="txt--meta l--push-all-0">#{messages['jsf.Signup']}</p>
</a>
</s:fragment>

<h1 class="l--push-all-0">#{messages['jsf.NewUser.Label']}</h1>
<h:form id="profile-form">
<ui:include src="../WEB-INF/layout/profile/edit_form.xhtml"/>

<div class="l--push-top-1">
<h:commandButton id="user-create-new"
value="#{messages['jsf.NewUser.Create']}"
action="#{profileAction.createUser}"
styleClass="l--push-right-half button--primary"/>
<s:button id="user-create-cancel" styleClass="button button-link"
value="#{messages['jsf.Cancel']}"
action="#{profileAction.cancel}"/>
</div>


</h:form>
</div>
</div>
</ui:define>


</ui:composition>

0 comments on commit 259b175

Please sign in to comment.