Skip to content

Commit bbbd40d

Browse files
committed
display open source license
For now the mapping to human-readable names done straight in template..
1 parent 83c06c1 commit bbbd40d

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

src/main/resources/templates/workflow.html

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
144144
<div class="col-md-6 text-right hidden-xs">
145145
<img class="verification_icon" src="../static/img/tick.svg" th:src="@{/img/tick.svg}" width="20" height="22" /> Verified with cwltool version <samp th:text="${workflow.cwltoolVersion}">1.0.20170622090721</samp>
146146
</div>
147-
147+
148148
<div class="col-md-12" style="margin-top:5px;" th:if="${workflow.doc != null}">
149149
<p id="workflow-doc" th:text="${workflow.doc}">This workflow documentation explains the purpose of the workflow and the main techniques used. Steps are documented individually further down. This is just an example documentation for the template, real documentation might be even longer than this!</p>
150150
</div>
@@ -157,8 +157,8 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
157157
<a id="permalink" th:href="${workflow.permalink}" th:text="${workflow.permalink}"
158158
href="#">https://w3id.org/cwl/view/git/933bf2a1a1cce32d88f88f136275535da9df0954/workflows/larger/test-hello.cwl</a>
159159
</div>
160-
161-
</div>
160+
161+
</div>
162162
<div class="col-lg-3 col-md-4 col-sm-6 hidden-xs">
163163
<div id="graph-menu hidden-print" class="pull-right">
164164
<button id="view-dot" class="hidden-print hidden-sm-down btn btn-primary" type="button" data-toggle="modal" data-target="#dotGraph">View DOT</button>
@@ -198,6 +198,44 @@ <h2 style="float:left;">Requires: </h2>
198198
</a>
199199
<img th:if="${workflow.dockerLink == 'true'}" id="dockerLogo" th:src="@{/img/Docker-logo.png}" src="../static/img/Docker-logo.png" alt="docker logo" />
200200
</div>
201+
<div th:if="${workflow.licenseLink != null}" class="alert alert-success" role="alert">
202+
<span class="hidden-xs">This workflow is Open Source and may be reused according to the terms of:</span>
203+
<a href="http://example.com/" th:href="@{${workflow.licenseLink}}" class="alert-link">
204+
<span th:remove="tag" th:switch="${workflow.licenseLink}">
205+
<!-- TODO: Move license 'registry' to controller? -->
206+
<span th:remove="tag" th:case="'https://www.apache.org/licenses/LICENSE-2.0'">
207+
Apache License, version 2.0
208+
</span>
209+
<span th:remove="tag" th:case="'http://www.apache.org/licenses/LICENSE-2.0'">
210+
Apache License, version 2.0
211+
</span>
212+
<span th:remove="tag" th:case="'https://spdx.org/licenses/Apache-2.0'">
213+
Apache License, version 2.0
214+
</span>
215+
<span th:remove="tag" th:case="'https://mit-license.org/'">
216+
MIT License
217+
</span>
218+
<span th:remove="tag" th:case="'https://spdx.org/licenses/AGPL-3.0'">
219+
GNU Affero General Public License v3.0
220+
</span>
221+
<span th:remove="tag" th:case="'http://www.gnu.org/licenses/agpl.txt'">
222+
GNU Affero General Public License
223+
</span>
224+
<span th:remove="tag" th:case="'http://www.opensource.org/licenses/AGPL-3.0'">
225+
GNU Affero General Public License v3.0
226+
</span>
227+
<div th:remove="tag" th:case="*" th:text="${workflow.licenseLink}">
228+
<!-- FIXME: This may not be an open source license! -->
229+
http://example.com/LICENSE
230+
</div>
231+
</span>
232+
</a>
233+
<div class="hidden-xs"><small>Note that the <em>tools</em> invoked by the workflow may have separate licenses.</small></div>
234+
</div>
235+
<div th:unless="${workflow.licenseLink}" class="alert alert-warning" role="alert">
236+
Unknown workflow license, check
237+
<a th:href="@{${workflow.retrievedFrom.getUrl()}}" href="#" rel="noopener" target="_blank">source repository</a>.
238+
</div>
201239
<h2>Inputs</h2>
202240
<div th:if="${workflow.inputs.isEmpty()}" class="alert alert-info">
203241
<p>There are no inputs in this workflow</p>
@@ -295,7 +333,7 @@ <h2>Outputs</h2>
295333
</div>
296334
<div class="row hidden-print">
297335
<div class="col-md-12 text-center" id="formats">
298-
<span th:each="format : ${formats}">
336+
<span th:each="format : ${formats}">
299337
<a th:id="|format-${format}|" role="button" class="btn btn-default btn-sm" th:href="${workflow.getPermalink(format.name())}" th:text="${format}"
300338
href="#">html</a>
301339
</span>
@@ -305,7 +343,7 @@ <h2>Outputs</h2>
305343
<address>Permalink:
306344
<code th:text="${workflow.permalink}">https://w3id.org/cwl/view/git/933bf2a1a1cce32d88f88f136275535da9df0954/workflows/larger/test-hello.cwl</code>
307345
</address>
308-
</div>
346+
</div>
309347
</div>
310348

311349
<div th:replace="fragments/footer :: copy"></div>

0 commit comments

Comments
 (0)