Skip to content

Commit 514f730

Browse files
authored
Merge pull request #59 from common-workflow-language/empty-tables
Show info message in the case of an empty table
2 parents c0a0ddc + aca6497 commit 514f730

File tree

1 file changed

+58
-43
lines changed

1 file changed

+58
-43
lines changed

src/main/resources/templates/workflow.html

Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -133,54 +133,69 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
133133
</object>
134134
</div>
135135
<h2>Inputs</h2>
136-
<table class="table table-striped table-hover">
137-
<thead>
138-
<th>ID</th>
139-
<th>Type</th>
140-
<th>Label</th>
141-
<th>Doc</th>
142-
</thead>
143-
<tbody>
144-
<tr th:each="input : ${workflow.inputs}">
145-
<td th:text="${input.key}">ID</td>
146-
<td th:text="${input.value.type}">Type</td>
147-
<td th:text="${input.value.label}">Label</td>
148-
<td th:text="${input.value.doc}">Description</td>
149-
</tr>
150-
</tbody>
151-
</table>
136+
<div th:if="${workflow.inputs.isEmpty()}" class="alert alert-info">
137+
<p>There are no inputs in this workflow</p>
138+
</div>
139+
<div th:unless="${workflow.inputs.isEmpty()}">
140+
<table class="table table-striped table-hover">
141+
<thead>
142+
<th>ID</th>
143+
<th>Type</th>
144+
<th>Label</th>
145+
<th>Doc</th>
146+
</thead>
147+
<tbody>
148+
<tr th:each="input : ${workflow.inputs}">
149+
<td th:text="${input.key}">ID</td>
150+
<td th:text="${input.value.type}">Type</td>
151+
<td th:text="${input.value.label}">Label</td>
152+
<td th:text="${input.value.doc}">Description</td>
153+
</tr>
154+
</tbody>
155+
</table>
156+
</div>
152157
<h2>Outputs</h2>
153-
<table class="table table-striped table-hover">
154-
<thead>
158+
<div th:if="${workflow.outputs.isEmpty()}" class="alert alert-info">
159+
<p>There are no outputs in this workflow</p>
160+
</div>
161+
<div th:unless="${workflow.outputs.isEmpty()}">
162+
<table class="table table-striped table-hover">
163+
<thead>
164+
<th>ID</th>
165+
<th>Type</th>
166+
<th>Label</th>
167+
<th>Doc</th>
168+
</thead>
169+
<tbody>
170+
<tr th:each="output : ${workflow.outputs}">
171+
<td th:text="${output.key}">ID</td>
172+
<td th:text="${output.value.type}">Type</td>
173+
<td th:text="${output.value.label}">Label</td>
174+
<td th:text="${output.value.doc}">Description</td>
175+
</tr>
176+
</tbody>
177+
</table>
178+
</div>
179+
<h2>Steps</h2>
180+
<div th:if="${workflow.steps.isEmpty()}" class="alert alert-info">
181+
<p>There are no steps in this workflow</p>
182+
</div>
183+
<div th:unless="${workflow.steps.isEmpty()}">
184+
<table class="table table-striped table-hover">
185+
<thead>
155186
<th>ID</th>
156-
<th>Type</th>
157187
<th>Label</th>
158188
<th>Doc</th>
159-
</thead>
160-
<tbody>
161-
<tr th:each="output : ${workflow.outputs}">
162-
<td th:text="${output.key}">ID</td>
163-
<td th:text="${output.value.type}">Type</td>
164-
<td th:text="${output.value.label}">Label</td>
165-
<td th:text="${output.value.doc}">Description</td>
189+
</thead>
190+
<tbody>
191+
<tr th:each="step : ${workflow.steps}">
192+
<td th:text="${step.key}">ID</td>
193+
<td th:text="${step.value.label}">Label</td>
194+
<td th:text="${step.value.doc}">Description</td>
166195
</tr>
167-
</tbody>
168-
</table>
169-
<h2>Steps</h2>
170-
<table class="table table-striped table-hover">
171-
<thead>
172-
<th>ID</th>
173-
<th>Label</th>
174-
<th>Doc</th>
175-
</thead>
176-
<tbody>
177-
<tr th:each="step : ${workflow.steps}">
178-
<td th:text="${step.key}">ID</td>
179-
<td th:text="${step.value.label}">Label</td>
180-
<td th:text="${step.value.doc}">Description</td>
181-
</tr>
182-
</tbody>
183-
</table>
196+
</tbody>
197+
</table>
198+
</div>
184199
</div>
185200
</div>
186201
</div>

0 commit comments

Comments
 (0)