Browse Source

Fix fragment rendering

Arkadiusz Ryś 1 year ago
parent
commit
d5ad04fc93

+ 1 - 29
src/main/resources/templates/enact.html

@@ -6,35 +6,7 @@
 <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=${activities})"></article>
-
-  <article class="panel is-primary automated-activities">
-    <p class="panel-heading">Automated Activities</p>
-
-    <th:block th:each="aut : ${session.automated}">
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}">
-    	    	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-success activity" value= "100" max="100"></progress>
-      			<span th:text="${aut.name} + ': Completed'" >Example Completed Activity 1</span>
-    			</a>
-            </p>
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).IN_PROGRESS}">
-            	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-info activity" max="100"></progress>
-      			<span th:text="${aut.name} + ': In Progress'">Example In Progress Activity 2</span>
-    			</a>
-            </p>
-
-    </th:block>
-
-   <form class="form" th:action="@{/reload}" method="post">
-
-   <a class="panel-block">
-      <button id="reloadButton" class="button is-primary" type="submit"><img class="refresh" width="32" height="32" th:src="@{/img/refresh.svg}" alt="Circular arrow"></button>
-    </a>
-  </article>
-
-  </form>
+  <article th:replace="fragments/automated.html :: activity(activities=${session.automated})"></article>
 
   <section class="pt-6 pb-6 pl-5 pr-5">
     <div class="columns">

+ 2 - 28
src/main/resources/templates/enactEnd.html

@@ -5,34 +5,8 @@
 </head>
 <body>
 <main>
-  <article th:replace="fragments/automated.html :: activity(activities=${activities})"></article>
-
-  <article class="panel is-primary automated-activities">
-    <p class="panel-heading">Automated Activities</p>
-     <th:block th:each="aut : ${session.automated}">
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}">
-    	    	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-success activity" value= "100" max="100"></progress>
-      			<span th:text="${aut.name} + ': Completed'" >Example Completed Activity 1</span>
-    			</a>
-            </p>
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).IN_PROGRESS}">
-            	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-info activity" max="100"></progress>
-      			<span th:text="${aut.name} + ': In Progress'">Example In Progress Activity 2</span>
-    			</a>
-            </p>
-
-    </th:block>
-    <form class="form" th:action="@{/reload}" method="post">
-
-   <a class="panel-block">
-      <button id="reloadButton" class="button is-primary" type="submit"><img class="refresh" width="32" height="32" th:src="@{/img/refresh.svg}" alt="Circular arrow"></button>
-    </a>
-  </article>
-
-  </form>
-  </article>
+  <!-- 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">
     <div class="columns">

+ 2 - 22
src/main/resources/templates/endEnactment.html

@@ -5,28 +5,8 @@
 </head>
 <body>
 <main>
-  <article th:replace="fragments/automated.html :: activity(activities=${activities})"></article>
-
-  <article class="panel is-primary automated-activities">
-    <p class="panel-heading">Automated Activities</p>
-    <th:block th:each="aut : ${session.automated}">
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}">
-    	    	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-success activity" value= "100" max="100"></progress>
-      			<span th:text="${aut.name} + ': Completed'" >Example Completed Activity 1</span>
-    			</a>
-            </p>
-            <p th:if="${aut.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).IN_PROGRESS}">
-            	<a class="panel-block automated-activity">
-      			<progress class="progress is-medium is-info activity" max="100"></progress>
-      			<span th:text="${aut.name} + ': In Progress'">Example In Progress Activity 2</span>
-    			</a>
-            </p>
-
-    </th:block>
-
-  </article>
-
+  <!-- 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>

+ 2 - 2
src/main/resources/templates/error.html

@@ -6,9 +6,9 @@
 <body>
 <main>
   <section class="pt-6 pb-6 pl-5 pr-5">
-    <h1>Sorry, WEE have weeed and something went wrong </h1>
+    <h1>Sorry, WEE has weeed and something went wrong</h1>
     <img id="img" class="wee-meme-image" src="../static/img/slip-and-fall.png" th:src="@{/img/slip-and-fall.png}" alt="Logo of person slipping">
-    <h2>Let us know about it and we will try to fix ASAP</h2>
+    <h2>Let us know about it and we will try to fix ASAP!</h2>
     <a href="/"><img src="../static/img/home-button.png" th:src="@{/img/home-button.png}" alt="Home icon"></a>
   </section>
 </main>

+ 11 - 12
src/main/resources/templates/fragments/automated.html

@@ -1,21 +1,20 @@
 <!DOCTYPE html>
 <html lang="en" xmlns:th="http://www.thymeleaf.org">
 <article th:fragment="activity (activities)" class="panel is-primary automated-activities">
-  <p class="panel-heading">Automated Activities</p>
+  <p class="panel-heading">Automated Activities Panel</p>
   <a th:each="activity: ${activities}" class="panel-block automated-activity">
-    <progress th:if="${activity.completed}" class="progress is-medium is-success activity" value= "100" max="100"></progress>
-    <progress th:unless="${activity.completed}" class="progress is-medium is-info activity" max="100"></progress>-->
-    <span th:text="${activity.name}"></span>
+    <progress th:if="${activity.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}" class="progress is-medium is-success activity" value= "100" max="100"></progress>
+    <progress th:unless="${activity.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}" class="progress is-medium is-info activity" max="100"></progress>
+    <p>
+      <span th:text="${activity.name}"></span>
+      <span th:if="${activity.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}"> : Completed</span>
+      <span th:unless="${activity.automatedStatus == T(ua.be.wee.model.nodes.AutomatedStatus).COMPLETED}"> : In Progress</span>
+    </p>
   </a>
 
-<!--  <a class="panel-block automated-activity">-->
-<!--    <progress class="progress is-medium is-info activity" max="100"></progress>-->
-<!--    <span>Example In Progress Activity 2</span>-->
-<!--  </a>-->
-
-  <a class="panel-block">
-    <button class="button is-primary"><img class="refresh" width="32" height="32" th:src="@{/img/refresh.svg}" alt="Circular arrow"></button>
-  </a>
+  <form class="panel-block" th:action="@{/reload}" method="post">
+    <button class="button is-primary" type="submit"><img class="refresh" width="32" height="32" th:src="@{/img/refresh.svg}" alt="Circular arrow"></button>
+  </form>
 </article>
 <body>