Skip to content

Commit 0f49e76

Browse files
committed
Responsive design for permalinks
.. also improve print view by hiding the interactive SVG and showing a static SVG
1 parent 6ba1d5d commit 0f49e76

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

src/main/resources/static/css/main-20170616.css

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,27 @@ polygon.hover {
288288
margin-bottom: 30px;
289289
}
290290

291-
#permalink {
292-
overflow: hidden;
293-
text-overflow: ellipsis;
291+
@media screen {
292+
.permalink {
293+
overflow: hidden;
294+
text-overflow: ellipsis;
295+
}
296+
}
297+
298+
.help {
299+
color: #9af;
300+
}
301+
302+
@media print {
303+
.help {
304+
display: none !important;
305+
}
294306
}
295307

296-
#permalink a {
308+
#permalink {
297309
font-size: smaller;
298-
font-family: Consolas, Inconsolata, monospace;
299-
}
310+
font-family: Consolas, Inconsolata, monospace;
311+
312+
overflow: hidden;
313+
white-space: nowrap;
314+
}

src/main/resources/templates/workflow.html

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
132132
<img th:unless="${workflow.retrievedFrom.getType().name() == 'GITHUB'}" id="gitLogo" src="../static/img/gitlogo.png" th:src="@{/img/gitlogo.png}" width="30" height="30" />
133133
</a>
134134
<i>Fetched <span th:text="${{workflow.retrievedOn}}">01/12/16 at 21:00</span></i>
135+
<span class="hidden-print">
135136
<span th:if="${workflow.roBundlePath == null}" id="ajaxRequired"></span>
136137
<span th:class="${workflow.roBundlePath != null} ? hide : ''" id="generating"> - Generating download link <img alt="loading" src="../static/img/loading.svg" th:src="@{/img/loading.svg}" width="20" height="20" /></span>
137138
<span th:class="${workflow.roBundlePath == null} ? hide : ''" id="generated">
138139
- <a th:href="@{${workflow.getRoBundleLink()}}" id="download" href="#" download="bundle.zip">Download as Research Object Bundle</a>
139-
<a href="http://www.researchobject.org/" rel="noopener" target="_blank">[?]</a>
140+
<a href="http://www.researchobject.org/" rel="noopener" class="help" target="_blank">[?]</a>
140141
</span>
142+
</span>
141143
</div>
142144
<div class="col-md-6 text-right">
143145
<img class="verification_icon" src="../static/img/tick.svg" th:src="@{/img/tick.svg}" width="20" height="22" /> Verified with cwltool version <span th:text="${workflow.cwltoolVersion}">1.0.20170622090721</span>
@@ -147,18 +149,19 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
147149
</div>
148150
</div>
149151
<div class="row">
150-
<div class="col-md-8">
151-
<div id="permalink">
152-
Permalink: <a th:href="${workflow.permalink}" th:text="${workflow.permalink}"
153-
href="#">https://w3id.org/cwl/view/git/933bf2a1a1cce32d88f88f136275535da9df0954/workflows/hello/hello.cwl</a>
154-
</div>
152+
<div class="col-lg-9 col-md-8 col-sm-6">
153+
<div class="permalink hidden-xs-down">
154+
Permalink:
155+
<a href="https://w3id.org/cwl/view/" rel="noopener" class="help" target="_blank">[?]</a>
156+
<a id="permalink" th:href="${workflow.permalink}" th:text="${workflow.permalink}"
157+
href="#">https://w3id.org/cwl/view/git/933bf2a1a1cce32d88f88f136275535da9df0954/workflows/larger/test-hello.cwl</a>
158+
</div>
155159
</div>
156-
<div class="col-md-4">
157-
<div id="graph-menu" class="pull-right">
158-
<strong>Graph: </strong>
159-
<button id="view-dot" class="btn btn-primary" type="button" data-toggle="modal" data-target="#dotGraph">View DOT</button>
160-
<div class="btn-group">
161-
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
160+
<div class="col-lg-3 col-md-4 col-sm-6">
161+
<div id="graph-menu hidden-print" class="pull-right">
162+
<button id="view-dot" class="hidden-print hidden-sm-down btn btn-primary" type="button" data-toggle="modal" data-target="#dotGraph">View DOT</button>
163+
<div class="btn-group hidden-print">
164+
<button type="button " class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
162165
Download Image <span class="caret"></span>
163166
</button>
164167
<ul class="dropdown-menu">
@@ -171,14 +174,15 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
171174
</div>
172175
<div class="row">
173176
<div class="col-md-12">
174-
<div id="visualisation" class="jumbotron">
177+
<div id="visualisation" class="jumbotron hidden-print">
175178
<span id="fullscreen-open" data-toggle="modal" data-target="#fullScreenGraphModal" data-tooltip="true" class="glyphicon glyphicon-resize-full graphControl" title="Expand"></span>
176179
<img id="selectChildren" class="graphControl" th:src="@{/img/children-logo.svg}" src="../static/img/children-logo.svg" alt="children" data-tooltip="true" title="Select All Children" />
177180
<img id="selectParents" class="graphControl" th:src="@{/img/parents-logo.svg}" src="../static/img/parents-logo.svg" alt="parents" data-tooltip="true" title="Select All Parents" />
178181
<div id="graph" data-th-attr="data-svgurl=@{${workflow.getVisualisationSvg()}}"></div>
179182
</div>
183+
<img alt="Workflow as SVG" src="@{${workflow.getVisualisationSvg()}}" class="visible-print-block" />
180184
<ul class="legend">
181-
<li><span class="selectednode"></span> Selected</li>
185+
<li><span class="selectednode hidden-print"></span> Selected</li>
182186
<li class="hidden-xs">|</li>
183187
<li><span class="defaults"></span> Default Values</li>
184188
<li><span class="nestedworkflows"></span> Nested Workflows</li>
@@ -293,4 +297,4 @@ <h2>Outputs</h2>
293297

294298
<script src="/bower_components/requirejs/require.js" data-main="/js/workflow.js"></script>
295299
</body>
296-
</html>
300+
</html>

0 commit comments

Comments
 (0)