Skip to content

Commit

Permalink
cooler reference_show maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
iilumme committed May 4, 2016
1 parent bdf1519 commit 64b291f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 30 deletions.
74 changes: 44 additions & 30 deletions src/main/resources/templates/references/reference_show.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,51 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title>References</title>
<th:block th:replace="fragments/imports :: imports"></th:block>
</head>
<body>
<div th:replace="fragments/navbar :: navbar">Navbar</div>
<div class="container">
<h1 th:text="${reference.title}">Reference title</h1>

<div>
<a class="btn btn-primary" th:href="@{/references/{id}/edit(id=${reference.id})}">Edit</a>
<button class="btn btn-danger" onclick="confirmDeletion()">Delete</button>
<head>
<title>References</title>
<th:block th:replace="fragments/imports :: imports"></th:block>
</head>
<body>
<div th:replace="fragments/navbar :: navbar">Navbar</div>
<div class="container">
<h1 th:text="${reference.title}">Reference title</h1>

<div style="padding-bottom: 10px">
<a class="btn btn-primary" th:href="@{/references/{id}/edit(id=${reference.id})}">Edit</a>
<button class="btn btn-danger" onclick="confirmDeletion()">Delete</button>
</div>


<div th:each="field : ${reference.mandatoryFields}">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title" th:text=" ${field} + ':'"></h3>
</div>

<div th:each="field : ${reference.mandatoryFields}">
<h1 th:text="'*' + ${field} + ':'"></h1>
<span th:text="${reference.getField(field)}"></span>
<div class="panel-body">
<span style="font-size: 16px" th:text="${reference.getField(field)}"></span>
</div>

<div th:each="field : ${reference.optionalFields}">
<div th:if="${reference.getField(field) != '' and reference.getField(field) != 'null'}">
<h1 th:text="${field} + ':'"></h1>
<span th:text="${reference.getField(field)}"></span>
</div>
</div>

<div th:each="field : ${reference.optionalFields}">
<div th:if="${reference.getField(field) != '' and reference.getField(field) != 'null'}">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title" th:text=" ${field} + ':'"></h3>
</div>
<div class="panel-body">
<span style="font-size: 16px" th:text="${reference.getField(field)}"></span>
</div>
</div>

<form id="delete-reference" action="#" th:action="@{/references/{id}/delete/(id=${reference.id})}" th:object="${reference}" method="post">
</form>
</div>

<th:block th:replace="fragments/footer :: footer"></th:block>

<script src="/js/scripts.js"></script>
</body>
</div>
</div>

<form id="delete-reference" action="#" th:action="@{/references/{id}/delete/(id=${reference.id})}" th:object="${reference}" method="post">
</form>

</div>

<th:block th:replace="fragments/footer :: footer"></th:block>

<script src="/js/scripts.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions src/test/java/ohtuhatut/selenium/ReferenceListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down

0 comments on commit 64b291f

Please sign in to comment.