4 Commits

Author SHA1 Message Date
13617eed6d Add support for duplicating assets
All checks were successful
Build / build (push) Successful in 6m44s
Deploy / build (push) Successful in 6m57s
2025-06-10 13:54:27 +02:00
698f6a3903 Fix some conversion problems
All checks were successful
Build / build (push) Successful in 1m31s
2025-06-10 13:30:36 +02:00
d702544f2c Add OpenAPI description
All checks were successful
Build / build (push) Successful in 3m33s
Deploy / build (push) Successful in 4m20s
2025-06-10 10:05:47 +02:00
7fca7c4ff0 Adding api
All checks were successful
Build / build (push) Successful in 2m43s
Deploy / build (push) Successful in 2m24s
2025-06-09 19:49:44 +02:00
24 changed files with 237 additions and 6 deletions

View File

@@ -28,6 +28,8 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-thymeleaf") implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.8")
implementation("org.modelmapper:modelmapper:3.2.3")
compileOnly("org.projectlombok:lombok") compileOnly("org.projectlombok:lombok")
developmentOnly("org.springframework.boot:spring-boot-devtools") developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.postgresql:postgresql")

View File

@@ -0,0 +1,15 @@
package be.seeseepuff.pcinv;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableWebMvc
public class PcinvConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**");
}
}

View File

@@ -0,0 +1,67 @@
package be.seeseepuff.pcinv.controllers;
import be.seeseepuff.pcinv.meta.AssetDescriptor;
import be.seeseepuff.pcinv.models.Asset;
import be.seeseepuff.pcinv.services.AssetService;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.info.Info;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/api")
@RestController
@OpenAPIDefinition(
info = @Info(
title = "PC Inventory API",
version = "1.0",
description = "API for managing PC inventory assets. Assets are identified by QR or ID codes."
)
)
public class ApiController {
private final AssetService assetService;
@Operation(summary = "Lists all types of assets available in the system.")
@GetMapping("/assetTypes")
public List<String> assets() {
return assetService.getAssetDescriptors().getAssets().stream()
.map(AssetDescriptor::getType)
.toList();
}
@Operation(summary = "Lists all information of a specific asset.")
@GetMapping("/asset/{qr}")
public Asset getAsset(
@PathVariable @Parameter(name = "qr", description = "The QR number of the asset") long qr
) {
return assetService.getAssetByQr(qr);
}
@Operation(summary = "Adds a work log entry to an asset.")
@PostMapping("/asset/worklog")
public String addWorkLogEntry(
@RequestBody Entry entry
) {
var qr = entry.qr;
var asset = assetService.getAssetByQr(qr);
if (asset == null) {
throw new IllegalArgumentException("Asset with QR code " + qr + " not found.");
}
if (entry.entry == null || entry.entry.isBlank()) {
throw new IllegalArgumentException("Work log entry comment cannot be empty.");
}
assetService.addWorkLogEntry(asset, entry.entry);
return "";
}
public static class Entry {
@Parameter(name = "qr", description = "The QR number of the asset")
public long qr;
@Parameter(name = "entry", description = "The work log entry text")
public String entry;
}
}

View File

@@ -226,6 +226,27 @@ public class WebController {
return "create_asset"; return "create_asset";
} }
/**
* Shows a view where the user can edit an existing asset.
*
* @param qr The QR code of the asset to edit.
*/
@GetMapping("/duplicate/{qr}")
public String duplicate(Model model, @PathVariable long qr) {
model.addAttribute(TIME, System.currentTimeMillis());
var asset = assetService.getAssetByQr(qr);
if (asset == null) {
throw new RuntimeException("Asset not found");
}
String assetType = asset.getAsset().getType();
model.addAttribute(ACTION, "duplicate");
model.addAttribute(ASSET, asset);
model.addAttribute(DESCRIPTORS, assetService.getAssetDescriptorTree(assetType));
model.addAttribute(DESCRIPTOR, assetService.getAssetDescriptor(assetType));
model.addAttribute(INPUT_LIST, assetService.getInputList(assetType));
return "create_asset";
}
/** /**
* Actually edits an asset based on the form data submitted. * Actually edits an asset based on the form data submitted.
* *

View File

@@ -99,7 +99,7 @@ public class AssetProperty {
.setter((obj, value) -> { .setter((obj, value) -> {
try { try {
property.setAccessible(true); property.setAccessible(true);
property.set(obj, value); property.set(obj, Converters.convert(value, property.getType()));
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@@ -0,0 +1,66 @@
package be.seeseepuff.pcinv.meta;
import lombok.experimental.UtilityClass;
/**
* Utility class for converting values to different types.
*/
@UtilityClass
public class Converters {
/**
* Converts a value to the specified target type.
*
* @param value The value to convert.
* @param target The target class to convert the value to.
* @return The converted value, or null if conversion is not possible.
*/
public static Object convert(Object value, Class<?> target) {
if (value == null) {
return null;
}
if (target.isInstance(value)) {
return value; // No conversion needed
}
if (value instanceof Long longValue) {
return convertLong(longValue, target);
}
if (value instanceof Integer intValue) {
return convertInteger(intValue, target);
}
throw new ClassCastException("Cannot convert " + value.getClass().getName() + " to " + target.getName());
}
/**
* Converts a Long value to the specified target type.
*
* @param value The Long value to convert.
* @param target The target class to convert the value to.
* @return The converted value, or throws ClassCastException if conversion is not possible.
*/
private static Object convertLong(Long value, Class<?> target) {
if (target == Long.class || target == long.class) {
return value; // No conversion needed
}
if (target == Integer.class || target == int.class) {
return value.intValue();
}
throw new ClassCastException("Cannot convert " + value.getClass().getName() + " to " + target.getName());
}
/**
* Converts an Integer value to the specified target type.
*
* @param value The Integer value to convert.
* @param target The target class to convert the value to.
* @return The converted value, or throws ClassCastException if conversion is not possible.
*/
private static Object convertInteger(Integer value, Class<?> target) {
if (target == Integer.class || target == int.class) {
return value; // No conversion needed
}
if (target == Long.class || target == long.class) {
return value.longValue();
}
throw new ClassCastException("Cannot convert " + value.getClass().getName() + " to " + target.getName());
}
}

View File

@@ -4,6 +4,7 @@ import be.seeseepuff.pcinv.meta.AssetInfo;
import be.seeseepuff.pcinv.meta.Description; import be.seeseepuff.pcinv.meta.Description;
import be.seeseepuff.pcinv.meta.HideInOverview; import be.seeseepuff.pcinv.meta.HideInOverview;
import be.seeseepuff.pcinv.meta.Property; import be.seeseepuff.pcinv.meta.Property;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -21,6 +22,7 @@ public class ChassisAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -21,6 +22,7 @@ public class CpuAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
@OneToOne(orphanRemoval = true) @OneToOne(orphanRemoval = true)

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -21,6 +22,7 @@ public class CustomAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
@OneToOne(orphanRemoval = true) @OneToOne(orphanRemoval = true)

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class DisplayAdapterAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class FloppyDriveAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -27,7 +28,9 @@ public class GenericAsset
{ {
public static final String TYPE = "asset"; public static final String TYPE = "asset";
@Id @GeneratedValue @Id
@GeneratedValue
@JsonIgnore
private long id; private long id;
/// The QR code attached to the asset, used for identification. /// The QR code attached to the asset, used for identification.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -21,6 +22,7 @@ public class HddAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
@OneToOne(orphanRemoval = true) @OneToOne(orphanRemoval = true)

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class MotherboardAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class NICAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class OpticalDriveAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class PowerSupplyAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -21,6 +22,7 @@ public class RamAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
@OneToOne(orphanRemoval = true) @OneToOne(orphanRemoval = true)

View File

@@ -1,6 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*; import be.seeseepuff.pcinv.meta.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -18,6 +19,7 @@ public class SoundAdapterAsset implements Asset
{ {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
/// The generic asset associated with this RAM. /// The generic asset associated with this RAM.

View File

@@ -1,5 +1,7 @@
package be.seeseepuff.pcinv.models; package be.seeseepuff.pcinv.models;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -18,8 +20,10 @@ import java.time.ZonedDateTime;
public class WorkLogEntry { public class WorkLogEntry {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonIgnore
private long id; private long id;
@JsonIgnore
@ManyToOne(optional = false) @ManyToOne(optional = false)
private GenericAsset asset; private GenericAsset asset;
@@ -27,5 +31,6 @@ public class WorkLogEntry {
private String comment; private String comment;
/// The date and time when the work log entry was created. /// The date and time when the work log entry was created.
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private ZonedDateTime date; private ZonedDateTime date;
} }

View File

@@ -12,6 +12,8 @@ import be.seeseepuff.pcinv.repositories.GenericAssetRepository;
import be.seeseepuff.pcinv.repositories.WorkLogRepository; import be.seeseepuff.pcinv.repositories.WorkLogRepository;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -54,6 +56,30 @@ public class AssetService {
return getRepositoryFor(genericAsset.getType()).findByAsset(genericAsset); return getRepositoryFor(genericAsset.getType()).findByAsset(genericAsset);
} }
/**
* Retrieves an asset by its QR code and duplicates the object.
*
* @param qr the QR code of the asset to retrieve
* @return the Asset associated with the given QR code, or null if no duplicate is found
*/
@SneakyThrows
public Asset getAssetDuplicateByQr(long qr) {
var mapper = new ModelMapper();
var originalGenericAsset = genericRepository.findByQr(qr);
if (originalGenericAsset == null) {
throw new IllegalArgumentException("No asset found with QR code: " + qr);
}
var originalAsset = getRepositoryFor(originalGenericAsset.getType()).findByAsset(originalGenericAsset);
var genericAsset = mapper.map(originalGenericAsset, GenericAsset.class);
genericAsset.setId(0); // Reset ID to create a new instance
genericAsset.setQr(0);
var asset = mapper.map(originalAsset, originalAsset.getClass());
asset.setAsset(genericAsset);
return asset;
}
/** /**
* Retrieves all assets of a specific type. * Retrieves all assets of a specific type.
* *

View File

@@ -14,6 +14,7 @@
<td> <td>
<a th:href="'/view/'+${a.getQr()}">View</a> <a th:href="'/view/'+${a.getQr()}">View</a>
<a th:href="'/edit/'+${a.getQr()}">Edit</a> <a th:href="'/edit/'+${a.getQr()}">Edit</a>
<a th:href="'/duplicate/'+${a.getQr()}">Duplicate</a>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -1,7 +1,7 @@
<body th:replace="~{fragments :: base(title='Create '+${descriptor.displayName}, content=~{::content})}"> <body th:replace="~{fragments :: base(title='Create '+${descriptor.displayName}, content=~{::content})}">
<div th:fragment="content"> <div th:fragment="content">
<h2>Create a <span th:text="${descriptor.displayName}"></span></h2> <h2>Create a <span th:text="${descriptor.displayName}"></span></h2>
<form th:action="'/'+${action}+'/'+${asset != null ? asset.getQr() : descriptor.getType()}" method="post"> <form th:action="'/'+${(action == 'duplicate') ? 'create' : action}+'/'+${(asset != null && action != 'duplicate') ? asset.getQr() : descriptor.getType()}" method="post">
<div th:each="d : ${descriptors}"> <div th:each="d : ${descriptors}">
<h2 th:text="${d.displayName}"></h2> <h2 th:text="${d.displayName}"></h2>
<table border="1" cellpadding="4"> <table border="1" cellpadding="4">
@@ -17,7 +17,7 @@
<input type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/> <input type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/>
</span> </span>
<input th:case="STRING" type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/> <input th:case="STRING" type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/>
<input th:case="INTEGER" type="number" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:required="${p.required}"/> <input th:case="INTEGER" type="number" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${(p.name == 'qr' && action == 'duplicate') ? null : p.getValue(asset)}" th:required="${p.required}"/>
<!-- <input th:case="BOOLEAN" type="checkbox" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="true" th:checked="${asset != null ? p.getValue(asset) : p.defaultValue}"/>--> <!-- <input th:case="BOOLEAN" type="checkbox" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="true" th:checked="${asset != null ? p.getValue(asset) : p.defaultValue}"/>-->
<span th:case="BOOLEAN"> <span th:case="BOOLEAN">
<input th:name="${d.asString(p)}" th:id="${d.asString(p)}+'-null'" type="radio" value="null" th:checked="${asset == null || (p.getValue(asset) == null)}"> <input th:name="${d.asString(p)}" th:id="${d.asString(p)}+'-null'" type="radio" value="null" th:checked="${asset == null || (p.getValue(asset) == null)}">
@@ -50,7 +50,7 @@
</table> </table>
</div> </div>
<p> <p>
<input th:if="${action == 'create'}" type="submit" value="Create"> <input th:if="${action == 'create' || action == 'duplicate'}" type="submit" value="Create">
<input th:if="${action == 'edit'}" type="submit" value="Save Changes"> <input th:if="${action == 'edit'}" type="submit" value="Save Changes">
</p> </p>
</form> </form>

View File

@@ -15,7 +15,8 @@
<ul th:if="${action == 'view'}"> <ul th:if="${action == 'view'}">
<li><a th:href="'/edit/'+${asset.getQr()}">Edit</a></li> <li><a th:href="'/edit/'+${asset.getQr()}">Edit</a></li>
<li><a th:href="'/delete/'+${asset.getQr()}">Delete</a></li> <li><a th:href="'/delete/'+${asset.getQr()}">Delete</a></li>
<li><a th:href="'/create/'+${asset.getAsset().type}">Create another <span th:text="${descriptor.displayName}">Hard Drive</span> </a></li> <li><a th:href="'/create/'+${asset.getAsset().type}">Create another <span th:text="${descriptor.displayName}">Hard Drive</span></a></li>
<li><a th:href="'/duplicate/'+${asset.getQr()}">Duplicate this <span th:text="${descriptor.displayName}">Hard Drive</span></a></li>
<li><a th:href="'/browse/'+${descriptor.type}">Browse all <span th:text="${descriptor.pluralName}">Hard Drives</span></a></li> <li><a th:href="'/browse/'+${descriptor.type}">Browse all <span th:text="${descriptor.pluralName}">Hard Drives</span></a></li>
</ul> </ul>
<ul th:if="${action == 'delete'}"> <ul th:if="${action == 'delete'}">