]> git.mxchange.org Git - addressbook-war.git/blobdiff - web/user/user_profile.xhtml
need to add language stuff in every page. :-( Maybe one day there is a better solutio...
[addressbook-war.git] / web / user / user_profile.xhtml
index 4866ab0fc37f01106918c1294c2541fd66b584a2..c9c629143f3be885da22c688f077262e255b3673 100644 (file)
@@ -1,12 +1,22 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
+<html
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+       xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://xmlns.jcp.org/jsf/html"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
+         xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
 
-       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
+       <f:metadata>
+               <f:viewParam id="userId" name="userId" value="#{userController.userId}" required="true" requiredMessage="#{msg.PARAMETER_USER_ID_MISSING}" converterMessage="#{msg.PARAMETER_USER_ID_INVALID}" validatorMessage="#{msg.PARAMETER_USER_ID_NOT_FOUND}">
+                       <f:convertNumber for="userId" type="number" minIntegerDigits="1" maxIntegerDigits="20" />
+                       <f:validator for="userId" validatorId="UserIdValidator" />
+               </f:viewParam>
+       </f:metadata>
+
+       <ui:composition template="/WEB-INF/templates/#{loginController.templateType}/#{loginController.templateType}_base.tpl">
+               <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_USER_PROFILE}</ui:define>
                <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_USER_PROFILE}</ui:define>
 
                <ui:define name="content_header">
                </ui:define>
 
                <ui:define name="content">
-                       Here goes your content.
+                       <c:choose>
+                               <c:when test="#{userController.isUserIdEmpty()}">
+                                       <ui:include src="/WEB-INF/templates/generic/userid_error.tpl" />
+                               </c:when>
+
+                               <c:when test="#{profileController.isProfileLinkVisibleById(userController.userId)}">
+                                       <div align="center">
+                                               <h:panelGrid styleClass="table" headerClass="table_header" footerClass="table_footer">
+                                                       <f:facet name="header">
+                                                               #{msg.PUBLIC_USER_PROFILE}
+                                                       </f:facet>
+                                               </h:panelGrid>
+                                       </div>
+                               </c:when>
+
+                               <c:otherwise>
+                                       #{msg.ERROR_PROFILE_NOT_VISIBLE}
+                               </c:otherwise>
+                       </c:choose>
                </ui:define>
        </ui:composition>
 </html>