Skip to content

Commit

Permalink
Fix #431 - Regressions to testing UI caused by Thymeleaf upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Aug 29, 2016
1 parent 3e00fda commit 3ed197e
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 75 deletions.
8 changes: 6 additions & 2 deletions hapi-fhir-jpaserver-example/pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- Note: HAPI projects use the "hapi-fhir" POM as their base to provide easy management. You do not need to use this in your own projects, so the "parent" tag and it's contents below may be removed
if you are using this file as a basis for your own project. -->
<!--
Note: HAPI projects use the "hapi-fhir" POM as their base to provide easy management.
You do not need to use this in your own projects, so the "parent" tag and it's
contents below may be removed
if you are using this file as a basis for your own project.
-->
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<body>
<form action="" method="get" id="outerForm">
<input type="hidden" id="serverId" name="serverId" th:value="${serverId}"/>
<input type="hidden" id="serverId" name="serverId" th:value="${serverId}"></input>

<div th:replace="tmpl-navbar-top :: top" ></div>

Expand All @@ -25,7 +25,7 @@
<!-- ** Default Home ** -->
<!-- ********************************************************** -->

<div th:replace="tmpl-home-welcome :: banner"/>
<div th:replace="tmpl-home-welcome :: banner"></div>

<table class="table table-bordered table-striped" th:if="${resourceName.empty}">
<colgroup>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h3 class="panel-title">Server Actions</h3>
<div class="col-sm-3 form-group">
<a type="button" id="fetch-conformance-btn"
class="btn btn-primary btn-block">
<i class="fa fa-dot-circle-o"></i>
<span class="fa fa-dot-circle-o"></i>
Conformance
</a>
<script type="text/javascript">
Expand All @@ -96,7 +96,7 @@ <h3 class="panel-title">Server Actions</h3>
<div class="col-sm-3">
<button type="button" id="server-history-btn"
class="btn btn-primary btn-block">
<i class="fa fa-calendar"></i>
<span class="fa fa-calendar"></i>
History
</button>
</div>
Expand Down Expand Up @@ -156,7 +156,7 @@ <h3 class="panel-title">Server Actions</h3>
<div class="row-fluid">
<div class="col-sm-3">
<button type="button" id="transaction-btn" class="btn btn-primary btn-block">
<i class="fa fa-files-o"></i>
<span class="fa fa-files-o"></i>
Transaction
</button>
</div>
Expand Down Expand Up @@ -209,7 +209,7 @@ <h3 class="panel-title">Server Actions</h3>
<div class="row-fluid">
<div class="col-sm-3 form-group">
<button type="button" id="get-server-tags-btn" class="btn btn-primary btn-block">
<i class="fa fa-tags"></i>
<span class="fa fa-tags"></i>
Get Tags
</button>
<script type="text/javascript">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3 class="panel-title" th:text="'Resource: ' + ${resourceName}">Resource: <b>Pa
</div>
<div class="panel-body">
This page contains various operations for interacting with
the <th:block th:text="${resourceName}"/> resource.
the <th:block th:text="${resourceName}"></th:block> resource.
</div>
</div>

Expand Down Expand Up @@ -137,7 +137,7 @@ <h4>Includes <small>Also include resources which are referenced by the search re
<div class="row-fluid">
<span th:each="include : ${includes}" class="includeCheckContainer">
<span class="includeCheckCheck">
<input type="checkbox" th:value="${include}" th:id="'inc_' + ${include}" />
<input type="checkbox" th:value="${include}" th:id="'inc_' + ${include}"></input>
</span>
<span class="includeCheckName" th:text="${include}"/>
</span>
Expand All @@ -161,7 +161,7 @@ <h4>Sort Results</h4>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:updateSort('');">Default Sort</a></li>
<li class="divider"></li>
<li th:each="param : ${sortParams}"><a th:href="'javascript:updateSort(\'' + ${param} + '\');'" th:text="${param}"></a></li>
<li th:each="nextParam : ${sortParams}"><a th:href="'javascript:updateSort(\'' + ${nextParam} + '\');'" th:text="${nextParam}"></a></li>
</ul>
</div>
&nbsp;&nbsp;&nbsp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
<div class="panel-body clientCodeBox" id="clientCodeBody">
</div>
<script type="text/javascript" src="js/ClientCodeGeneratorHapi.js"></script>
<script type="text/javascript">
var jsonClientCode = <th:block th:utext="${clientCodeJson}"/>;
<script type="text/javascript" th:utext="'var jsonClientCode = ' + ${clientCodeJson} + ';'">
</script>
<script type="text/javascript" th:inline="javascript">
generateHapi(jsonClientCode, $('#clientCodeBody'));
</script>
</div>
Expand Down Expand Up @@ -95,8 +96,8 @@
Response
</td>
<td>
<i th:if="${resultStatus.contains(' 2')}" class="fa fa-check" style="color:#4E4;"/>
<i th:if="${!resultStatus.contains(' 2')}" class="fa fa-warning" style="color:#E44;"/>
<i th:if="${resultStatus.contains(' 2')}" class="fa fa-check" style="color:#4E4;"></i>
<i th:if="${!resultStatus.contains(' 2')}" class="fa fa-warning" style="color:#E44;"></i>
<th:block th:text="${resultStatus}"/>
</td>
</tr>
Expand Down Expand Up @@ -142,8 +143,8 @@ <h4 class="panel-title">
<span class="glyphicon glyphicon-step-backward"></span>
Prev Page
</button>
<script type="text/javascript">
if (<th:block th:text="${bundle.linkPrevious.empty}"/>) {
<script type="text/javascript" th:inline="javascript">
if ([[${bundle.linkPrevious.empty}]]) {
$('#page-prev-btn').prop('disabled', true);
}
$('#page-prev-btn').click(function() {
Expand All @@ -159,8 +160,8 @@ <h4 class="panel-title">
<span class="glyphicon glyphicon-step-forward"></span>
Next Page
</button>
<script type="text/javascript">
if (<th:block th:text="${bundle.linkNext.empty}"/>) {
<script type="text/javascript" th:inline="javascript">
if ([[${bundle.linkNext.empty}]]) {
$('#page-next-btn').prop('disabled', true);
}
$('#page-next-btn').click(function() {
Expand Down Expand Up @@ -202,7 +203,7 @@ <h4 class="panel-title">
<a th:if="${entry.resource} != null" th:href="${entry.resource.id}" th:text="${entry.resource.id.toUnqualified()}" style="font-size: 0.8em"/>
</td>
<td>
<small th:text="${entry.title}"/>
<!-- Title used to go here -->
</td>
<td th:if="${entry.updated.value} == null"></td>
<td th:if="${entry.updated.value} != null and ${entry.updated.today} == true" th:text="${#dates.format(entry.updated.value, 'HH:mm:ss')}"></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,23 @@
<meta name="description" content="" />
<meta name="author" content="" />
<script src="js/jquery-2.1.0.min.js"></script>
<!-- <script src="js/jquery-2.1.1.js"></script>-->
<script src="js/bootstrap.min.js"></script>

<script type="text/javascript">
var conformance = <th:block th:utext="${jsonEncodedConf}"/>;
var resourceName = '<th:block th:utext="${resourceName}"/>';
</script>

<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/tester.css" rel="stylesheet" />

<!-- Custom styles for this template -->
<link href="css/tester.css" rel="stylesheet" />
<script type="text/javascript" th:utext="'var conformance = ' + ${jsonEncodedConf} + ';'">
</script>
<script type="text/javascript" th:utext="'var resourceName = \'' + ${resourceName} + '\';'">
</script>

<link href="fa/css/font-awesome.min.css" rel="stylesheet" />

<link href="css/hapi-narrative.css" rel="stylesheet" />

<script type="text/javascript" src="js/moment.min.js"></script>

<!-- Datetimepicker Component -->
<link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="js/bootstrap-datetimepicker.min.js"></script>

<!-- Select2 component -->
<link href="css/select2.css" rel="stylesheet"/>
<script src="js/select2.min.js"></script>

<!-- Fontawesome -->
<link href="fa/css/font-awesome.min.css" rel="stylesheet" />

<script src="js/select2.min.js"></script>
<script src="js/RestfulTester.js" type="text/javascript" ></script>
</head>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -47,47 +47,40 @@ <h4>Options</h4>
</label>
</div>

<script type="text/javascript">
<script type="text/javascript" th:inline="javascript">

$( document ).ready(function() {

// Encoding buttons are wider, so set the shorter group to the same width
// so that they wrap at the same time if the page is narrow
$('#prettyBtnGroup').width($('#encodingBtnGroup').width());

// Set the buttons' initial state correctly
<th:block th:switch="${encoding}">
<th:block th:case="'xml'">
var encoding = [[${encoding}]];
if (encoding == 'xml') {
$('#encode-xml').trigger("click");
</th:block>
<th:block th:case="'json'">
} else if (encoding == 'json') {
$('#encode-json').trigger("click");
</th:block>
</th:block>
<th:block th:switch="${pretty}">
<th:block th:case="'true'">
}
var pretty = [[${pretty}]];
if (pretty){
$('#pretty-true').trigger("click");
</th:block>
<th:block th:case="'false'">
} else {
$('#pretty-false').trigger("click");
</th:block>
</th:block>
<th:block th:switch="${_summary}">
<th:block th:case="'true'">
}

var summary = [[${_summary}]];
if (summary == 'true') {
$('#summary-true').trigger("click");
</th:block>
<th:block th:case="'text'">
} else if (summary == 'text') {
$('#summary-text').trigger("click");
</th:block>
<th:block th:case="'data'">
} else if (summary == 'data') {
$('#summary-data').trigger("click");
</th:block>
<th:block th:case="'count'">
} else if (summary == 'count') {
$('#summary-count').trigger("click");
</th:block>
</th:block>

<th:block th:if="${!#strings.isEmpty(resultBody)}">
}

if ([[${!#strings.isEmpty(resultBody)}]]) {
// When we're displaying a result page, the options buttons should
// actually apply their values to the current search/action
$('#encode-default').change( function(){ location.href=updateURLParameter(location.href, 'encoding', '') });
Expand All @@ -96,7 +89,7 @@ <h4>Options</h4>
$('#pretty-default').change( function(){ location.href=updateURLParameter(location.href, 'pretty', '') });
$('#pretty-true').change( function(){ location.href=updateURLParameter(location.href, 'pretty', 'true') });
$('#pretty-false').change( function(){ location.href=updateURLParameter(location.href, 'pretty', 'false') });
</th:block>
}

});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ul th:fragment="farright">
<li><a href="https://github.com/jamesagnew/hapi-fhir"><i class="fa fa-github topbarIcon" />&nbsp;Source Code</a></li>
<li><a href="about"><i class="fa fa-question-circle topbarIcon" />&nbsp;About This Server</a></li>
<li><a href="https://github.com/jamesagnew/hapi-fhir"><span class="fa fa-github topbarIcon"></span>&nbsp;Source Code</a></li>
<li><a href="about"><span class="fa fa-question-circle topbarIcon"></span>&nbsp;About This Server</a></li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</button>
<a class="navbar-brand"
th:href="'home?encoding=' + ${encoding} + '&amp;pretty=' + ${pretty}">
<i class="fa fa-home topbarIcon" /> Home
<span class="fa fa-home topbarIcon"></span> Home
</a>
<a class="navbar-left navbarBreadcrumb hidden-xs hidden-sm"
th:if="${resourceName} != null and ${resourceName.empty} == false"
Expand All @@ -38,12 +38,13 @@
Server Selection Dropdown
-->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span id="serverSelectorFhirIcon" class="glyphicon glyphicon-fire topbarIcon" />&nbsp;<span id="serverSelectorName" th:text="'Server: ' + ${baseName}" />&nbsp;<span class="caret" /></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span id="serverSelectorFhirIcon" class="glyphicon glyphicon-fire topbarIcon"></span>&nbsp;<span id="serverSelectorName" th:text="'Server: ' + ${baseName}"></span>&nbsp;<span class="caret" /></a>
<ul class="dropdown-menu" role="menu">
<li th:each="serverEntry : ${serverEntries}">
<a th:href="'javascript:selectServer(\'' + ${serverEntry.key} + '\');'">
<i class="fa fa-check-square-o" th:if="${serverEntry.key} == ${serverId}" />
<i class="fa fa-square-o" style="color: #CCC;" th:unless="${serverEntry.key} == ${serverId}" />
<span class="fa fa-check-square-o" th:if="${serverEntry.key} == ${serverId}"></span>
<span class="fa fa-square-o" style="color: #CCC;" th:unless="${serverEntry.key} == ${serverId}"></span>
&nbsp;&nbsp;
<th:block th:text="${serverEntry.value}"/>
</a>
Expand All @@ -56,7 +57,7 @@
-->
<th:block th:if="${apiKey != null}">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-key topbarIcon" />&nbsp;API Key&nbsp;<span class="caret" /></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-key topbarIcon"></span>&nbsp;API Key&nbsp;<span class="caret" /></a>
<ul class="dropdown-menu" role="menu">
<div style="padding: 10px;">
<p>If your chosen server requires an API key / Bearer token, enter it here:</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Empty for now */
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function addSearchControls(theConformance, theSearchParamType, theSearchParamNam
$('<br clear="all" />'),
$('<div />', { 'class': 'col-sm-1' }),
$('<div />', { 'class': 'col-sm-1' }).append(
$('<i class="glyphicon glyphicon-link" style="margin-left: 20px; margin-top: 10px;"/>')
$('<i class="glyphicon glyphicon-link" style="margin-left: 20px; margin-top: 10px;"></i>')
),
$('<div />', { 'class': 'col-sm-4' }).append(
select
Expand Down

0 comments on commit 3ed197e

Please sign in to comment.