<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:replace="base::layout(~{::title}, ~{::main})">
<head>
  <title>Process Model Enactment</title>
</head>
<body>
<main>
  <section class="pt-6 pb-6 pl-5 pr-5">
    <h2 class="is-size-3 is-capitalized">Wee: Workflow Enactment Engine</h2>
    <form class="pt-3" th:action="@{/enactpm}" method="post">
      <p class="is-size-4">Choose the Process Model to be enacted:</p>
      <div class="field has-addons">
        <div class="control is-expanded">
          <div class="select is-fullwidth">
            <select id="dropDownList" name="pmiri" th:onchange="'window.location.href = \'' + @{/gettraces} + '?iri=\' + encodeURIComponent(this.value) ' ">
              <option th:value="1">select PM</option>
              <option th:each="pm: ${pms}" th:value="${pm.iri}" th:text="${pm}" th:selected="${pm.iri == current}"></option>
            </select>
          </div>
        </div>
        <div class="control">
          <button type="submit" class="button is-primary" name="action" value="new" >New Enactment</button>
        </div>
        
      </div>
      
       <div class="field has-addons" th:if="${traces != null}">
          <p class="is-size-6">Continue enactment:</p>
           <div class="select is-fullwidth">
          <select id="dropDownList" name="contTrace">
              <option value="Select Trace">select trace</option>
              <option th:each="trace: ${traces}" th:value="${trace.iri}" th:text="${trace.name} + ' started at ' + ${trace.timestampF}"></option>
          </select>
          </div>
          <div class="control">
          	<button type="submit" class="button is-primary" name="action" value="continue">Continue Enactment</button>
      	  </div>    
       </div>
      
    </form>
  </section>
</main>
</body>
</html>