java/nekurak.net-web/web/WEB-INF/tags/nekurak/komentareVypis.tag
author František Kučera <franta-hg@frantovo.cz>
Tue, 08 Jun 2010 07:37:05 +0200
changeset 129 420d7024f6f4
parent 128 24fbed5ba743
child 130 1bbff3f5181f
permissions -rw-r--r--
komentáře – formulář
franta-hg@126
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@126
     2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
franta-hg@126
     3
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
franta-hg@126
     4
	  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
franta-hg@126
     5
	  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
franta-hg@126
     6
	  xmlns:nkfn="/WEB-INF/nekurakFunkce"
franta-hg@126
     7
	  version="2.0">
franta-hg@126
     8
franta-hg@126
     9
    <jsp:directive.attribute name="podnik" type="cz.frantovo.nekurak.dto.Podnik" required="true"/>
franta-hg@126
    10
franta-hg@126
    11
    <div class="komentare">
franta-hg@126
    12
	<h3><fmt:message key="komentare.vypisNadpis"/></h3>
franta-hg@128
    13
franta-hg@128
    14
	<!-- Zatím nikdo nekomentoval? -->
franta-hg@128
    15
	<c:if test="${fn:length(podnik.komentare) == 0}">
franta-hg@128
    16
	    <p><fmt:message key="komentare.zadneKomentare"/></p>
franta-hg@128
    17
	</c:if>
franta-hg@128
    18
franta-hg@128
    19
	<!-- Komentovat! -->
franta-hg@126
    20
	<c:choose>
franta-hg@126
    21
	    <c:when test="${prihlasenyUzivatel == null}">
franta-hg@127
    22
		<p><fmt:message key="komentare.prihlasitSe"/></p>
franta-hg@126
    23
	    </c:when>
franta-hg@126
    24
	    <c:otherwise>
franta-hg@128
    25
		<p><a href="javascript:komentare.zobrazFormular()"><fmt:message key="komentare.komentovat"/></a></p>
franta-hg@128
    26
		<div id="formularKomentuj" style="display: none;">
franta-hg@129
    27
		    <form method="post" action="?akce=odeslatKomentar">
franta-hg@129
    28
		    <fieldset>
franta-hg@129
    29
			<input type="hidden" name="podnik" maxlength="255" value="${podnik.id}"/>
franta-hg@129
    30
			<label><fmt:message key="komentare.nadpis"/>: <input type="text" name="nadpis" maxlength="255"/></label><br/>
franta-hg@129
    31
			<textarea name="komentar" cols="30" rows="10"></textarea><br/>
franta-hg@129
    32
			<button value="submit"><fmt:message key="komentare.tlacitkoOdeslat"/></button>
franta-hg@129
    33
		    </fieldset>
franta-hg@129
    34
		</form>
franta-hg@128
    35
		</div>
franta-hg@126
    36
	    </c:otherwise>
franta-hg@126
    37
	</c:choose>
franta-hg@126
    38
franta-hg@128
    39
	<!-- Výpis komentářů -->
franta-hg@127
    40
	<c:forEach var="k" items="${podnik.komentare}">
franta-hg@127
    41
	    <div class="komentar">
franta-hg@127
    42
		<h4>
franta-hg@129
    43
		    <fmt:message key="komentare.napsal"/>: <c:out value="${k.uzivatel}" />,
franta-hg@127
    44
		    <fmt:formatDate value="${k.datum}" pattern="dd. MMMM yyyy HH:mm"/>
franta-hg@127
    45
		    <br/>
franta-hg@129
    46
		    <fmt:message key="komentare.nadpis"/>: <c:out value="${k.nadpis}" />
franta-hg@127
    47
		</h4>
franta-hg@127
    48
		<!-- Pozor: předpokládáme, že v DB jsou pouze zkontrolovaná data -->
franta-hg@127
    49
		<c:out value="${k.komentar}" escapeXml="false" />
franta-hg@127
    50
	    </div>
franta-hg@127
    51
	</c:forEach>
franta-hg@126
    52
    </div>
franta-hg@126
    53
franta-hg@126
    54
</jsp:root>