<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:replace="base::layout(~{::title}, ~{::main})">
<head>
  <title>[[${session.trace.name}]] Enactment End</title>
</head>
<body>
<main>
  <!-- TODO Use fragment inclusion expressions to hide the panel when no ongoing automated activities are present? -->
  <article th:replace="fragments/automated.html :: activity(activities=${session.automated})"></article>

  <section class="pt-6 pb-6 pl-5 pr-5">
    <p th:inline="text">Enactment of the Process Model: <span class="accent">[[${session.pm.name}]]</span> has ended!</p>
    <p>You can review the details about the Process Trace.</p>
    <div class="tags are-large has-addons">
      <span class="tag">PT</span>
      <span class="tag is-primary">[[${session.trace.name}]]</span>
    </div>
    <p th:inline="text"><strong>Started at: </strong><span class="accent">[[${session.trace.events[0].timestampF}]]</span></p>
    <th:block th:each="ev : ${session.trace.events}">
      <p th:if="${ev.class.name == 'ua.be.wee.model.pt.StartActivityEvent'}"><strong>Begin: </strong></p>
      <p th:if="${ev.class.name == 'ua.be.wee.model.pt.EndActivityEvent'}"><strong>End: </strong></p>
      <p th:if="${ev.class.name == 'ua.be.wee.model.pt.EndActivityEvent' || ev.class.name == 'ua.be.wee.model.pt.StartActivityEvent'}" th:text="${ev.relatesTo.activity.name}"></p>
      <p th:if="${ev.class.name == 'ua.be.wee.model.pt.EndActivityEvent' || ev.class.name == 'ua.be.wee.model.pt.StartActivityEvent'}">port: [[${ev.relatesTo.name}]]</p>
      <p th:if="${ev.class.name == 'ua.be.wee.model.pt.EndTraceEvent'}"><strong>Ended at: </strong><span class="accent">[[${ev.timestampF}]]</span></p>
    </th:block>
  </section>
</main>
</body>
</html>
