java/nekurak.net-web/web/WEB-INF/casti/registrovatUzivatele.jsp
author František Kučera <franta-hg@frantovo.cz>
Sun Jan 09 16:27:44 2011 +0100 (2011-01-09)
changeset 158 e1ac3efcd140
parent 82 df86ad0c0e55
child 175 a121def64733
permissions -rw-r--r--
vylepšen detail podniku, modularizace, značky, css
franta-hg@51
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@51
     2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
franta-hg@145
     3
		  xmlns:c="http://java.sun.com/jsp/jstl/core"
franta-hg@145
     4
		  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
franta-hg@145
     5
		  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
franta-hg@145
     6
		  xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
franta-hg@145
     7
		  version="2.0">
franta-hg@51
     8
franta-hg@145
     9
	<jsp:useBean id="uzivatel" class="cz.frantovo.nekurak.dto.PozadavekNaRegistraciUzivatele" scope="request"/>
franta-hg@145
    10
	<jsp:useBean id="uzivatelPredRegistraci" class="cz.frantovo.nekurak.web.UzivatelPredRegistraci" scope="request"/>
franta-hg@145
    11
	<jsp:useBean id="registraceUzivatele" class="cz.frantovo.nekurak.web.RegistraceUzivatele" scope="session"/>
franta-hg@51
    12
franta-hg@145
    13
	<fmt:message key="registrace.nadpis" var="titulekStranky"/>
franta-hg@145
    14
	<nk:stranka titulek="${titulekStranky}">
franta-hg@51
    15
franta-hg@145
    16
		<h1><c:out value="${titulekStranky}"/></h1>
franta-hg@73
    17
franta-hg@145
    18
		<!--
franta-hg@145
    19
			Registrace probíhá ve třech krocích:
franta-hg@145
    20
			1) uživatel vyplňí formulář
franta-hg@145
    21
			2) zobrazíme mu vyplněné údaje a on si je zkontroluje
franta-hg@145
    22
			3) potvrdí registraci
franta-hg@145
    23
		-->
franta-hg@52
    24
franta-hg@73
    25
		<c:choose>
franta-hg@145
    26
			<c:when test="${param.akceRegistrace == 'kontrola'}">
franta-hg@145
    27
				<!-- Vypíšeme uživateli údaje, které zadal do formuláře, aby si je mohl zkontrolovat. -->
franta-hg@145
    28
				<c:choose>
franta-hg@145
    29
					<c:when test="${param.heslo == param.heslo_kontrola}">
franta-hg@145
    30
						<jsp:setProperty name="uzivatel" property="*"/>
franta-hg@145
    31
						<jsp:setProperty name="uzivatel" property="jazyk" value="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session']}"/>
franta-hg@145
    32
						<jsp:setProperty name="uzivatelPredRegistraci" property="uzivatel" value="${uzivatel}"/>
franta-hg@145
    33
						<jsp:setProperty name="registraceUzivatele" property="uzivatel" value="${uzivatelPredRegistraci}"/>
franta-hg@145
    34
franta-hg@145
    35
						<p><fmt:message key="registrace.kontrola"/></p>
franta-hg@145
    36
franta-hg@145
    37
						<p class="registraceKontrolaUdaju">
franta-hg@145
    38
							<fmt:message key="dto.uzivatel.prezdivka"/>: <c:out value="${uzivatel.prezdivka}"/><br/>
franta-hg@145
    39
							<fmt:message key="dto.uzivatel.jmeno"/>: <c:out value="${uzivatel.jmeno}"/><br/>
franta-hg@145
    40
							<fmt:message key="dto.uzivatel.prijmeni"/>: <c:out value="${uzivatel.prijmeni}"/><br/>
franta-hg@145
    41
							<fmt:message key="dto.uzivatel.email"/>: <c:out value="${uzivatel.email}"/><br/>
franta-hg@145
    42
						</p>
franta-hg@145
    43
franta-hg@145
    44
						<p>
franta-hg@145
    45
							<a href="?akce=registrovatUzivatele&amp;amp;akceRegistrace=dokonceni&amp;amp;token=${fn:escapeXml(uzivatelPredRegistraci.token)}">
franta-hg@145
    46
								<fmt:message key="registrace.potvrdit"/>
franta-hg@145
    47
							</a>
franta-hg@145
    48
						</p>
franta-hg@145
    49
					</c:when>
franta-hg@145
    50
					<c:otherwise>
franta-hg@145
    51
						<p class="chybovaHlaska"><fmt:message key="registrace.vyjimka.heslaSeNeshoduji"/></p>
franta-hg@145
    52
					</c:otherwise>
franta-hg@145
    53
				</c:choose>
franta-hg@145
    54
			</c:when>
franta-hg@145
    55
			<c:when test="${param.akceRegistrace == 'dokonceni'}">
franta-hg@145
    56
				<!-- Uživatel si zkontroloval údaje a chce dokončit svoji registraci. -->
franta-hg@145
    57
				<jsp:setProperty name="registraceUzivatele" property="token" value="${param.token}"/>
franta-hg@145
    58
franta-hg@145
    59
				<c:set var="chybaRegistrace" value="${registraceUzivatele.dokonciRegistraci}"/>
franta-hg@145
    60
franta-hg@145
    61
				<c:choose>
franta-hg@145
    62
					<c:when test="${chybaRegistrace == null}">
franta-hg@145
    63
						<!-- Registrace proběhla úspěšně. -->
franta-hg@145
    64
						<p>
franta-hg@145
    65
							<fmt:message key="registrace.hotovo"/>&amp;#160;
franta-hg@145
    66
							<a href="?akce=prihlaseni">
franta-hg@145
    67
								<fmt:message key="registrace.hotovo.prihlasit"/>
franta-hg@145
    68
							</a>.
franta-hg@145
    69
						</p>
franta-hg@145
    70
					</c:when>
franta-hg@145
    71
					<c:otherwise>
franta-hg@145
    72
						<!-- Během pokusu o registraci uživatele došlo k chybě. -->
franta-hg@145
    73
						<p class="chybovaHlaska"><fmt:message key="${chybaRegistrace}"/></p>
franta-hg@145
    74
					</c:otherwise>
franta-hg@145
    75
				</c:choose>
franta-hg@145
    76
			</c:when>
franta-hg@145
    77
			<c:otherwise>
franta-hg@145
    78
				<!-- Zobrazíme uživateli registrační formulář. -->
franta-hg@145
    79
				<form method="post" action="?akce=registrovatUzivatele&amp;amp;akceRegistrace=kontrola">
franta-hg@145
    80
					<fieldset>
franta-hg@145
    81
						<fmt:message key="dto.uzivatel.prezdivka.tip" var="prezdivkaTip"/>
franta-hg@145
    82
						<label title="${prezdivkaTip}"><fmt:message key="dto.uzivatel.prezdivka"/>: <input type="text" name="prezdivka" maxlength="255"/></label><br/>
franta-hg@145
    83
						<label><fmt:message key="dto.uzivatel.heslo"/>: <input type="password" name="heslo" maxlength="255"/></label><br/>
franta-hg@145
    84
						<label><fmt:message key="dto.uzivatel.heslo.kontrola"/>: <input type="password" name="heslo_kontrola" maxlength="255"/></label><br/>
franta-hg@145
    85
						<br/>
franta-hg@145
    86
						<label><fmt:message key="dto.uzivatel.jmeno"/>: <input type="text" name="jmeno" maxlength="255"/></label><br/>
franta-hg@145
    87
						<label><fmt:message key="dto.uzivatel.prijmeni"/>: <input type="text" name="prijmeni" maxlength="255"/></label><br/>
franta-hg@145
    88
						<label><fmt:message key="dto.uzivatel.email"/>: <input type="text" name="email" maxlength="255"/></label><br/>
franta-hg@145
    89
						<button value="submit"><fmt:message key="registrace.tlacitko"/></button>
franta-hg@145
    90
					</fieldset>
franta-hg@145
    91
				</form>
franta-hg@145
    92
			</c:otherwise>
franta-hg@73
    93
		</c:choose>
franta-hg@73
    94
franta-hg@145
    95
	</nk:stranka>
franta-hg@51
    96
franta-hg@51
    97
</jsp:root>