Subversion Repositories WebE

Rev

Rev 35 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

1
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />

<html>
  <head>
    <s:if test="edit">
      <title>Begriff bearbeiten</title>
    </s:if>
    <s:else>
      <title>Begriffe anzeigen/bearbeiten</title>
    </s:else>
  </head>
  <body>  
    <s:if test="edit">
      <h1>Begriff bearbeiten</h1>
    </s:if>
    <s:else>
      <h1>Begriffe anzeigen/bearbeiten</h1>
    </s:else>
    
    <s:if test="added">
      <p>Der Begriff <b><s:text name="savedTerm.name"/></b> wurde hinzugef&uuml;gt.</p>  
    </s:if>
    
    <s:if test="edit">
      <h2>Dieser Begriff</h2>
    </s:if>
    <s:else>
      <h2>Neuer Begriff</h2>
    </s:else>
    
    <s:form action="saveTerm">
      <s:hidden name="edit" />
      <s:hidden name="term.objectId" />
      <s:textfield name="term.name" label="Name" required="true" />
      <s:textarea name="comment" label="Aenderungskommentar (optional)" />
      <s:if test="edit">
        <s:submit type="button"><img src="${contextPath}/resources/icons/tick.png" alt="" />
          Umbenennen</s:submit>
      </s:if>
      <s:else>
        <s:submit type="button"><img src="${contextPath}/resources/icons/add.png" alt="" />
          Hinzuf&uuml;gen
        </s:submit>
      </s:else>
    </s:form>
    
    <s:if test="edit">
      <h3>Beziehungen</h3>
      
      <s:if test="term.relationshipsForTermFrom.size() == 0 && term.relationshipsForTermTo.size() == 0">
        <p>Dieser Begriff steht mit keinem anderen in Beziehung.</p>
        
      </s:if>
      <s:else>
        <p>Dieser Begriff steht zur Zeit in folgenden Beziehungen:</p>
        
        <table>
          <thead>
            <th>Begriff 1</th>
            <th>Beziehungstyp</th>
            <th>Begriff 2</th>      
          </thead>
          <tbody>
            <s:iterator value="term.relationshipsForTermFrom">
              <tr>
                <td><s:property value="termFrom.name" /></td>
                <td><s:property value="relationshipType.nameFrom" /></td>
                <td><s:url id="term1URL" action="editTerm">
                    <s:param name="id" value="%{termTo.objectId}"></s:param>
                  </s:url><s:a href="%{term1URL}"><s:property value="termTo.name" /></s:a></td>
                <td><s:url id="editURL" action="editRelationship">
                    <s:param name="id" value="%{objectId}" />
                  </s:url><s:a href="%{editURL}"><img
                    src="${contextPath}/resources/icons/page_white_edit.png"
                    alt="Bearbeiten" title="Bearbeiten" />
                </s:a></td>
                
                <td><s:url id="deleteURL" action="deleteRelationship">
                    <s:param name="id" value="%{objectId}"></s:param>
                  </s:url><s:a href="%{deleteURL}"
                    onclick="return window.confirm('Beziehung loeschen?')"><img
                    src="${contextPath}/resources/icons/delete.png"
                    alt="L&ouml;schen" title="L&ouml;schen""/></s:a></td>
              </tr>
            </s:iterator>    
            <s:iterator value="term.relationshipsForTermTo">
              <tr>
                <td><s:property value="termTo.name" /></td>
                <td><s:property value="relationshipType.nameTo" /></td>
                <td><s:url id="term2URL" action="editTerm">
                    <s:param name="id" value="%{termFrom.objectId}" />
                  </s:url><s:a href="%{term2URL}"><s:property value="termFrom.name" /></s:a></td>
                <td><s:url id="editURL" action="editRelationship">
                   <s:param name="id" value="%{objectId}"></s:param>
                  </s:url><s:a href="%{editURL}"><img
                  src="${contextPath}/resources/icons/page_white_edit.png"
                  alt="Bearbeiten" title="Bearbeiten" />
                </s:a></td>
                
                <td><s:url id="deleteURL" action="deleteRelationship">
                    <s:param name="id" value="%{objectId}"></s:param>
                  </s:url><s:a href="%{deleteURL}"
                  onclick="return window.confirm('Beziehung loeschen?')"><img
                  src="${contextPath}/resources/icons/delete.png"
                  alt="L&ouml;schen" title="L&ouml;schen" /></s:a></td>
              </tr>
            </s:iterator>
          </tbody>
        </table>
      </s:else>
  
      <h3>&Auml;nderungsprotokoll</h3>
      <s:if test="term.object.history.size() == 0">
        <p>Es sind keine &Auml;nderungen f&uuml;r diesen Begriff protokolliert.</p>
      </s:if>
      <s:else>
        <table>
          <thead>
            <th>Datum</th>
            <th>Benutzer</th>
            <th>Aktion</th>
            <th>Neuer Name</th>
            <th>Kommentar</th>
          </thead>
          <tbody>
            <s:iterator value="term.object.history" status="stat">
              <tr>
                <td><s:date name="date" format="yyyy-MM-dd hh:mm:ss" /></td>
                <td><s:property value="user.firstname" /> <s:property value="user.lastname"/></td>
                <td><s:property value="actionType.name" /></td>
                <td><s:property value="value" /></td>
                <td><s:property value="comment" /></td>
              </tr>
            </s:iterator>
          </tbody>
        </table>
      </s:else>
    </s:if>
    
    <h2>Gespeicherte Begriffe</h2>
    <s:if test="termList.size() == 0">
      <p>Es wurden noch keine Begriffe eingegeben.</p>
    </s:if>
    <s:else>
      <table>
        <tbody>
          <s:iterator value="termList" status="stat">
            <s:url id="editURL" action="editTerm">
              <s:param name="id" value="%{objectId}"></s:param>
            </s:url>
                <tr>
                        <td><s:a href="%{editURL}"><s:property value="name" /></s:a></td>
              <td><s:a href="%{editURL}"><img
                src="${contextPath}/resources/icons/page_white_edit.png"
                alt="Bearbeiten" title="Bearbeiten" /></s:a></td>
                
              <s:if test="false">            
                <td><s:url id="deleteURL" action="deleteTerm">
                  <s:param name="id" value="%{objectId}"></s:param>
                </s:url><s:a href="%{deleteURL}" onclick="return window.confirm('Begriff loeschen?')"><img
                  src="${contextPath}/resources/icons/delete.png"
                  alt="L&ouml;schen" title="L&ouml;schen" /></s:a></td>
              </s:if>
                </tr>
          </s:iterator>
        </tbody>
      </table>
    </s:else>
  </body>
</html>