<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<div class="viewTitle">Manage Surveys</div>

<table class="detailTable">
  <tr>
    <th>Name</th>
    <th>Description</th>
    <th>&nbsp;</th>
  </tr>
  <c:forEach items="${surveys}" var="survey">
    <form action="/" method="post">
      <input type="hidden" name="surveyId" value="<c:out value="${survey.id}"/>" />
      <tr>
        <td><c:out value="${survey.name}"/></td>
        <td><c:out value="${survey.description}"/></td>
        <td>
          <input type="submit" value="Edit" onclick="this.form.action='EditSurvey'; return true;" />
          <input type="submit" value="Delete" onclick="this.form.action='DeleteSurvey'; return true;" />
        </td>
      </tr>
    </form>
  </c:forEach>
  <form action="AddSurvey" method="post">
    <input type="hidden" name="updateMode" value="create" />
    <tr>
      <td colspan="4"><input type="submit" value="New Survey" /></td>
    </tr>
  </form>
</table>
  </form>

<form action="Welcome" method="post">
  <input type="submit" value="Return to Main Page" />
</form>

</body>