1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/nekurak.net-web/web/WEB-INF/tags/nekurak/podnikKomentare.tag Sun Jan 09 16:27:44 2011 +0100
1.3 @@ -0,0 +1,72 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
1.6 + xmlns:c="http://java.sun.com/jsp/jstl/core"
1.7 + xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
1.8 + xmlns:fn="http://java.sun.com/jsp/jstl/functions"
1.9 + xmlns:nkfn="/WEB-INF/nekurakFunkce"
1.10 + version="2.0">
1.11 +
1.12 + <jsp:directive.attribute name="podnik" type="cz.frantovo.nekurak.dto.Podnik" required="true"/>
1.13 +
1.14 + <div class="komentare oddelovac">
1.15 + <h3><fmt:message key="komentare.vypisNadpis"/></h3>
1.16 +
1.17 + <!-- Zatím nikdo nekomentoval? -->
1.18 + <c:if test="${fn:length(podnik.komentare) == 0}">
1.19 + <p><fmt:message key="komentare.zadneKomentare"/></p>
1.20 + </c:if>
1.21 +
1.22 + <!-- Komentovat! -->
1.23 + <c:choose>
1.24 + <c:when test="${prihlasenyUzivatel == null}">
1.25 + <p><fmt:message key="komentare.prihlasitSe"/></p>
1.26 + </c:when>
1.27 + <c:otherwise>
1.28 + <p id="formularKomentujSkryvac" style="display: none;"><a href="javascript:komentare.zobrazFormular()"><fmt:message key="komentare.komentovat"/></a></p>
1.29 + <div id="formularKomentuj">
1.30 + <form method="post" action="?akce=odeslatKomentar" onsubmit="javascript:komentare.odeslat(); return false;">
1.31 + <fieldset>
1.32 + <input type="hidden" name="podnik" maxlength="255" value="${podnik.id}"/>
1.33 + <label><fmt:message key="komentare.nadpis"/>: <input type="text" name="nadpis" maxlength="255"/></label>
1.34 + <br/>
1.35 + <textarea name="komentar" cols="30" rows="10"></textarea>
1.36 + <br/>
1.37 + <select name="typ">
1.38 + <option value="PROSTY_TEXT" selected="selected"><fmt:message key="komentar.typ.prostyText"/></option>
1.39 + <option value="XHTML"><fmt:message key="komentar.typ.xhtml"/></option>
1.40 + <option value="TEXY"><fmt:message key="komentar.typ.texy"/></option>
1.41 + </select>
1.42 + <br/>
1.43 + <button style="display: none;" id="tlacitkoNahled" onclick="javascript:komentare.nahled(); return false;"><fmt:message key="komentare.tlacitkoNahled"/></button>
1.44 + <button value="submit"><fmt:message key="komentare.tlacitkoOdeslat"/></button>
1.45 + </fieldset>
1.46 + </form>
1.47 + <div class="vystup"></div>
1.48 + <div class="cistic"/>
1.49 + </div>
1.50 + <script type="text/javascript">
1.51 + $("#formularKomentuj").css("display", "none");
1.52 + $("#tlacitkoNahled").css("display", "inline");
1.53 + $("#formularKomentujSkryvac").css("display", "block");
1.54 + </script>
1.55 + </c:otherwise>
1.56 + </c:choose>
1.57 +
1.58 + <!-- Výpis komentářů -->
1.59 + <c:forEach var="k" items="${podnik.komentare}">
1.60 + <div class="komentar">
1.61 + <h4>
1.62 + <fmt:message key="komentare.napsal"/>: <c:out value="${k.uzivatel}" />,
1.63 + <fmt:formatDate value="${k.datum}" pattern="dd. MMMM yyyy HH:mm"/>
1.64 + <c:if test="${k.nadpis != null && k.nadpis != ''}">
1.65 + <br/>
1.66 + <fmt:message key="komentare.nadpis"/>: <c:out value="${k.nadpis}" />
1.67 + </c:if>
1.68 + </h4>
1.69 + <!-- Pozor: předpokládáme, že v DB jsou pouze zkontrolovaná data -->
1.70 + <c:out value="${k.komentar}" escapeXml="false" />
1.71 + </div>
1.72 + </c:forEach>
1.73 + </div>
1.74 +
1.75 +</jsp:root>
1.76 \ No newline at end of file