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>Beziehung bearbeiten</title>
  </s:if>
  <s:else>
    <title>Beziehungen anzeigen/bearbeiten</title>
  </s:else>
  </head>
  <body>
  
  <s:if test="edit">
    <h1>Beziehung bearbeiten</h1>
  </s:if>
  <s:else>
    <h1>Beziehungen anzeigen/bearbeiten</h1>
  </s:else>
  
  <s:if test="added">
    <p>
      Die Beziehung <b>&quot;<s:text name="modifiedRelationship.termFrom.name"/>&quot;
      &quot;<s:text name="modifiedRelationship.relationshipType.nameFrom"/>&quot;
      &quot;<s:text name="modifiedRelationship.termTo.name"/>&quot;</b>
      wurde hinzugef&uuml;gt.
    </p>  
  </s:if>
  
  <s:if test="terms.size() == 0">
    <p>Bitte definieren Sie zuerst mindestens einen
      <s:url id="termURL" action="listTerms" />
      <s:a href="%{termURL}">Begriff</s:a>.</p>
  </s:if>
  <s:else>
    <s:if test="edit">
      <h2>Diese Beziehung</h2>
    </s:if>
    <s:else>
      <h2>Neue Beziehung</h2>
    </s:else>
    
    <s:form action="saveRelationship">
      <s:hidden name="edit" />
      <s:hidden name="relationship.objectId" />
      <s:select name="term1" list="terms" listKey="objectId" listValue="name"
                label="Begriff 1" value="relationship.termFrom.objectId" />
      <s:select name="type" list="relationshipTypes" listKey="id" listValue="nameFrom"
                label="Beziehungstyp" value="relationship.relationshipType.id"/>
      <s:select name="term2" list="terms" listKey="objectId" listValue="name"
                label="Begriff 2" value="relationship.termTo.objectId"/>
      <s:textarea name="comment" label="Aenderungskommentar (optional)" />
      <s:if test="edit">
        <s:submit type="button"><img src="${contextPath}/resources/icons/tick.png" alt="" />
          &Auml;nderungen speichern</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:else>
  
  <s:if test="edit">
    <h3>&Auml;nderungsprotokoll</h3>
    <table>
      <thead>
        <th>Datum</th>
        <th>Benutzer</th>
        <th>Aktion</th>
        <th>Neuer Wert</th>
        <th>Kommentar</th>
      </thead>
      <tbody>
        <s:iterator value="relationship.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:if>
  
  <h2>Definierte Beziehungen</h2>
  <s:if test="relationshipList.size() == 0">
    <p>Keine Beziehungen definiert</p>
  </s:if>
  <s:else>
    <table>
        <thead>
          <th>Begriff 1</th>
          <th>Beziehungstyp</th>
          <th>Begriff 2</th>
        </thead>
        <tbody>
          <s:iterator value="relationshipList" status="stat">
            <tr>
              <td><s:url id="term1URL" action="editTerm">
                <s:param name="id" value="%{termFrom.objectId}"></s:param>
              </s:url><s:a href="%{term1URL}"><s:property value="termFrom.name" /></s:a></td>
              <td><s:property value="relationshipType.nameFrom" /></td>
              <td><s:url id="term2URL" action="editTerm">
                  <s:param name="id" value="%{termTo.objectId}"></s:param>
                </s:url><s:a href="%{term2URL}"><s:property value="termTo.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>
  </body>
</html>