Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.lunatech.training.quarkus.extensions;

import io.quarkus.qute.RawString;
import io.quarkus.qute.TemplateExtension;

import java.math.BigDecimal;
import java.math.RoundingMode;

@TemplateExtension
public class BigDecimalExtension {

static RawString monetary(BigDecimal value) {
return new RawString("€ " + value.setScale(2, RoundingMode.HALF_EVEN).toString());
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<html lang="en">
<head>
<title>Welcome to the HIQUEA catalog!</title>
</head>
<body>
{#include layout}
{#title}Welcome to the HIQUEA catalog!{/}

{#body}
<h1>HIQUEA Catalog</h1>
<p>Total products: {products.size}</p>
<h2>Products</h2>
<ul>
{#each products}
<li><a href="/products/{it.id}">{it.name}</a></li>
{/each}
{#each products}
{#productListItem product=it /}
{/each}
</ul>
</body>
</html>
{/body}
{/include}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<html lang="en">
<head>
<title>{product.name} - Details</title>
</head>
<body>
{#include layout}
{#title}{product.name} - Details{/}

{#body}
<h1>{product.name}</h1>
<dl>
<dt>Product ID</dt>
<dd>{product.id}</dd>
<dt>Description</dt>
<dd>{product.description}</dd>
<dt>Price</dt>
<dd>&euro; {product.price}</dd>
<dd>{product.price.monetary}</dd>
</dl>
</body>
</html>
{/body}
{/include}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html lang="en">
<head>
<title>{#insert title}HIQUEA{/}</title>
</head>
<body>
{#insert body /}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<li><a href="/products/{product.id}">{product.name}</a></li>
Loading