Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,22 @@ dependencies {
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-webflux')
runtime('org.springframework.boot:spring-boot-devtools')
compile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
compile group: 'cz.jirutka.spring', name: 'embedmongo-spring', version: '1.3.1'
compile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive')
compile group: 'cz.jirutka.spring', name: 'embedmongo-spring', version: '1.3.1'
compile 'org.webjars:bootstrap:3.3.7-1'
compileOnly('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('io.projectreactor:reactor-test')

}

//export test coverage
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
reports {
xml.enabled true
html.enabled false
}
}
2 changes: 2 additions & 0 deletions out/production/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spring.data.mongodb.port=0
spring.data.mongodb.host=localhost
13 changes: 13 additions & 0 deletions out/production/resources/messages.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Set names of properties
recipe.description=Description

#Validaiton Messages
#Order of precedence
# 1 code.objectName.fieldName
# 2 code.fieldName
# 3 code.fieldType (Java data type)
# 4 code
NotBlank.recipe.description=Description Cannot Be Blank
Size.recipe.description={0} must be between {2} and {1} characters long.
Max.recipe.cookTime={0} must be less than {1}
URL.recipe.url=Please provide a valid URL
1 change: 1 addition & 0 deletions out/production/resources/messages_en_GB.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recipe.description=Description (GB)
1 change: 1 addition & 0 deletions out/production/resources/messages_en_US.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recipe.description=Description (US)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions out/production/resources/templates/400error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>404 Not Found Error</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>
<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>400 Bad Request</h1>
<p th:text="${exception.getMessage()}"></p>
</div>
</div>
</div>

</body>
</html>
30 changes: 30 additions & 0 deletions out/production/resources/templates/404error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>404 Not Found Error</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>
<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>404 Not Found</h1>
<p th:text="${exception.getMessage()}"></p>
</div>
</div>
</div>

</body>
</html>
68 changes: 68 additions & 0 deletions out/production/resources/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>Recipe Home</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>
<!--/*@thymesVar id="recipes" type="java.util.List"*/-->
<!--/*@thymesVar id="recipe" type="guru.springframework.domain.Recipe"*/-->
<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">

<div class="panel-heading">
<h1 class="panel-title">My Recipes!</h1>
</div>
<div class="panel-body">
<div class="table-responsive" th:if="${not #lists.isEmpty(recipes)}">
<table class="table table-hover ">
<thead class="thead-inverse">
<tr>
<th>ID</th>
<th>Description</th>
<th>View</th>
<th>Update</th>
<th>Delete</th>
</tr>
</thead>
<tr th:remove="all">
<td>123</td>
<td>Tasty Goodnees 1</td>
<td><a href="#">View</a></td>
</tr>
<tr th:remove="all">
<td>12333</td>
<td>Tasty Goodnees 2</td>
<td><a href="#">View</a></td>
</tr>
<tr th:each="recipe : ${recipes}">
<td th:text="${recipe.id}">334</td>
<td th:text="${recipe.description}">Tasty Goodnees 3</td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/show'}">View</a></td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/update'}">Update</a></td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/delete'}">Delete</a></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

</body>
</html>
47 changes: 47 additions & 0 deletions out/production/resources/templates/recipe/imageuploadform.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>Image Upload Form</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>
<!--/*@thymesVar id="recipe" type="guru.springframework.domain.Recipe"*/-->
<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="pannel-group">
<div class="panel panel-primary">
<div class="panel-heading">
<h1 class="panel-title">Upload a new recipe image</h1>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-5">
<form action="http:\\localhost" method="post" enctype="multipart/form-data"
th:action="@{'/recipe/' + ${recipe.getId()} + '/image'}">
<label class="control-label">Select File</label>
<input id="imagefile" name="imagefile" type="file" class="file">
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>Edit Ingredient</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>

<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<!--/*@thymesVar id="ingredient" type="guru.springframework.commands.IngredientCommand"*/-->
<form th:object="${ingredient}" th:action="@{'/recipe/' + ${ingredient.getRecipeId()} + '/ingredient'}" method="post">
<input type="hidden" th:field="*{id}"/>
<div class="pannel-group">
<div class="panel panel-primary">
<div class="panel-heading">
<h1 class="panel-title">Edit Ingredient Information</h1>
</div>
<div class="panel-body">


<div class="row">
<div class="col-md-3 form-group">
<label>Description:</label>
<input type="text" class="form-control" th:field="*{description}"/>
</div>

<div class="col-md-3 form-group">
<label>Amount:</label>
<input type="number" class="form-control" th:field="*{amount}"/>
</div>

<div class="col-md-3 form-group">
<label>UOM:</label>
<select class="form-control" name="uom.id">
<option th:each="uomEach : ${uomList}"
th:value="${uomEach.id}"
th:selected="${uomEach.id.equals(ingredient.uom.id)}"
th:text="${uomEach.description}">Each</option>
</select>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
80 changes: 80 additions & 0 deletions out/production/resources/templates/recipe/ingredient/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<title>List Ingredients</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"
th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}">

<script src="/webjars/jquery/1.11.1/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous" th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
</head>
<body>
<!--/*@thymesVar id="recipe" type="guru.springframework.domain.Recipe"*/-->
<!--/*@thymesVar id="ingredients" type="java.util.Set<guru.springframework.commands.IngredientCommand>"*/-->
<div class="container-fluid" style="margin-top: 20px">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">

<div class="panel-heading">
<div class="row">
<div class="col-md-11 ">
<h1 class="panel-title">Ingredients</h1>
</div>
<div class="col-md-1">
<a class="btn btn-default" href="#" th:href="@{'/recipe/' + ${recipe.id} + '/ingredient/new'}" role="button">New</a>
</div>
</div>

</div>
<div class="panel-body">

<div class="table-responsive" th:if="${not #lists.isEmpty(recipe.ingredients)}">
<table class="table table-hover ">
<thead class="thead-inverse">
<tr>
<th>ID</th>
<th>Description</th>
<th>View</th>
<th>Update</th>
<th>Delete</th>
</tr>
</thead>
<tr th:remove="all">
<td>123</td>
<td>Tasty Goodnees 1</td>
<td><a href="#">View</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
<tr th:remove="all">
<td>12333</td>
<td>Tasty Goodnees 2</td>
<td><a href="#">View</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
<tr th:each="ingredient : ${recipe.ingredients}">
<td th:text="${ingredient.id}">334</td>
<td th:text="${ingredient.amount} + ' ' + ${ingredient.uom.getDescription()} + ' ' + ${ingredient.description}">Tasty Goodnees 3</td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/ingredient/' + ${ingredient.id} + '/show'}">View</a></td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/ingredient/' + ${ingredient.id} + '/update'}">Update</a></td>
<td><a href="#" th:href="@{'/recipe/' + ${recipe.id} + '/ingredient/' + ${ingredient.id} + '/delete'}">Delete</a></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Loading