Skip to content

Commit 3fd8852

Browse files
authored
Merge pull request #65 from common-workflow-language/style-changes
Style changes
2 parents d156e0b + 9f0321f commit 3fd8852

File tree

5 files changed

+38
-17
lines changed

5 files changed

+38
-17
lines changed

src/main/java/org/commonwl/viewer/web/WorkflowController.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.github.jabbalaci.graphviz.GraphViz;
2323
import org.apache.commons.lang.StringUtils;
24-
import org.apache.jena.ext.com.google.common.collect.Lists;
2524
import org.commonwl.viewer.domain.GithubDetails;
2625
import org.commonwl.viewer.domain.Workflow;
2726
import org.commonwl.viewer.domain.WorkflowForm;
@@ -33,13 +32,10 @@
3332
import org.springframework.beans.factory.annotation.Autowired;
3433
import org.springframework.beans.factory.annotation.Value;
3534
import org.springframework.core.io.FileSystemResource;
36-
import org.springframework.data.domain.Page;
37-
import org.springframework.data.domain.PageRequest;
3835
import org.springframework.data.domain.Pageable;
3936
import org.springframework.data.web.PageableDefault;
4037
import org.springframework.stereotype.Controller;
4138
import org.springframework.ui.Model;
42-
import org.springframework.ui.ModelMap;
4339
import org.springframework.validation.BindingResult;
4440
import org.springframework.web.bind.annotation.*;
4541
import org.springframework.web.servlet.HandlerMapping;
@@ -81,7 +77,7 @@ public WorkflowController(WorkflowFormValidator workflowFormValidator,
8177
* @return The workflows view
8278
*/
8379
@RequestMapping(value="/workflows")
84-
public String listWorkflows(Model model, Pageable pageable) {
80+
public String listWorkflows(Model model, @PageableDefault(size = 10) Pageable pageable) {
8581
model.addAttribute("workflows", workflowRepository.findAllByOrderByRetrievedOnDesc(pageable));
8682
model.addAttribute("pages", pageable);
8783
return "workflows";

src/main/resources/static/css/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ body {
106106
font-size: 20px;
107107
}
108108

109+
.workflow-thumb {
110+
width:100%;
111+
max-height:300px;
112+
}
113+
109114
#visualisation {
110115
overflow: hidden;
111116
padding: 0;

src/main/resources/templates/fragments/header.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
<a class="navbar-brand" href="/">
3131
<img id="logo" src="/img/CWL-Logo-Header.png"></img>
3232
</a>
33+
<a href="/workflows" class="button navbar-toggle">Explore</a>
34+
</div>
35+
<div class="collapse navbar-collapse">
36+
<ul class="nav navbar-nav navbar-right">
37+
<li><a href="/workflows">Explore</a></li>
38+
</ul>
3339
</div>
34-
<ul class="nav navbar-nav navbar-right">
35-
<li><a href="/workflows">Explore</a></li>
36-
</ul>
3740
</div>
3841
</nav>
3942
</body>

src/main/resources/templates/fragments/pagination.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
~ under the License.
1919
-->
2020

21-
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
21+
<html lang="en" xmlns:th="http://www.thymeleaf.org">
2222
<head>
2323
<link rel="stylesheet" type="text/css" href="../../static/css/main.css" />
2424
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
@@ -27,10 +27,8 @@
2727
<nav th:fragment="workflowControl" class="text-center">
2828
<ul class="pagination">
2929
<li th:class="${pages.getPageNumber() == 0}? 'disabled' : ''">
30-
<span th:if="${pages.getPageNumber() == 0}? 'disabled' : ''" aria-hidden="true">First</span>
31-
<a th:unless="${pages.getPageNumber() == 0}? 'disabled' : ''" aria-label="Previous">
32-
<span aria-hidden="true">First</span>
33-
</a>
30+
<span th:if="${pages.getPageNumber() == 0}" aria-hidden="true">First</span>
31+
<a th:unless="${pages.getPageNumber() == 0}" th:href="@{'?page=0&amp;size=' + ${pages.getPageSize()}}">First</a>
3432
</li>
3533
<li th:class="${workflows.hasPrevious()} ? '' : 'disabled'">
3634
<span th:unless="${workflows.hasPrevious()}">&laquo;</span>
@@ -57,9 +55,9 @@
5755
<li th:if="${pages.getPageNumber() + 3 &lt; workflows.getTotalPages()}">
5856
<a href="#" th:text="${pages.getPageNumber() + 4}" th:href="@{'?page=' + ${pages.getPageNumber() + 3} + '&amp;size=' + ${pages.getPageSize()}}">7</a>
5957
</li>
60-
<li th:class="${workflows.hasNext()}? '' : 'disabled'">
61-
<span th:if="${workflows.hasNext()}">&raquo;</span>
62-
<a th:unless="${workflows.hasNext()}" th:href="@{'?page=' + ${pages.getPageNumber() + 1} + '&amp;size=' + ${pages.getPageSize()}}" title="Go to next page">&raquo;</a>
58+
<li th:class="${workflows.hasNext()} ? '' : 'disabled'">
59+
<span th:unless="${workflows.hasNext()}">&raquo;</span>
60+
<a th:if="${workflows.hasNext()}" th:href="@{'?page=' + ${pages.getPageNumber() + 1} + '&amp;size=' + ${pages.getPageSize()}}" title="Go to next page">&raquo;</a>
6361
</li>
6462
<li th:class="${workflows.getTotalPages() == pages.getPageNumber() + 1} ? 'disabled' : ''">
6563
<span th:if="${workflows.getTotalPages() == pages.getPageNumber() + 1}">Last</span>

src/main/resources/templates/workflows.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
<!DOCTYPE html>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing,
14+
~ software distributed under the License is distributed on an
15+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
~ KIND, either express or implied. See the License for the
17+
~ specific language governing permissions and limitations
18+
~ under the License.
19+
-->
120

221
<html xmlns:th="http://www.thymeleaf.org">
322
<head>
@@ -30,7 +49,7 @@ <h1>Explore Workflows</h1>
3049
<tr th:each="workflow : ${workflows}" th:with="workflowURL=@{'/workflows/github.com/' + ${workflow.retrievedFrom.owner} + '/' + ${workflow.retrievedFrom.repoName} + '/tree/' + ${workflow.retrievedFrom.branch} + '/' + ${workflow.retrievedFrom.path}}">
3150
<td>
3251
<a th:href="${workflowURL}">
33-
<img th:src="@{'/workflows/' + ${workflow.id} + '/graph/svg'}" alt="workflow graph" style="width:100%;"/>
52+
<img class="workflow-thumb" th:src="@{'/workflows/' + ${workflow.id} + '/graph/svg'}" alt="workflow graph" />
3453
</a>
3554
</td>
3655
<td th:text="${workflow.label}"></td>

0 commit comments

Comments
 (0)