From 723cd41487e2539ea4544cb7aa543cefb879dfa4 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 29 Jan 2021 19:52:25 -0500 Subject: [PATCH] Frontend revision 2. Expanded template functionality and convenience --- .../java/achievements/data/Achievements.java | 12 +- .../main/java/achievements/data/Games.java | 6 +- frontend/webpage/index.html | 18 +- frontend/webpage/scripts/index.js | 18 +- frontend/webpage/scripts/template.js | 169 ++++++++++++------ .../templates/achievements_page.html.template | 8 +- 6 files changed, 142 insertions(+), 89 deletions(-) diff --git a/backend/src/main/java/achievements/data/Achievements.java b/backend/src/main/java/achievements/data/Achievements.java index 7283925..4b2033f 100644 --- a/backend/src/main/java/achievements/data/Achievements.java +++ b/backend/src/main/java/achievements/data/Achievements.java @@ -9,11 +9,11 @@ public class Achievements { public static class Achievement { - @JsonProperty("Name") + @JsonProperty("name") private String name; - @JsonProperty("Description") + @JsonProperty("description") private String description; - @JsonProperty("Stages") + @JsonProperty("stages") private int stages; public Achievement(String name, String description, int stages) { @@ -37,11 +37,11 @@ public class Achievements { // End Getters/Setters } - @JsonProperty("GameID") + @JsonProperty("gameID") private int gameID; - @JsonProperty("GameName") + @JsonProperty("gameName") private String gameName; - @JsonProperty("Achievements") + @JsonProperty("achievements") private List achievements; public Achievements() { achievements = new ArrayList(); } diff --git a/backend/src/main/java/achievements/data/Games.java b/backend/src/main/java/achievements/data/Games.java index df0b743..57ab9c6 100644 --- a/backend/src/main/java/achievements/data/Games.java +++ b/backend/src/main/java/achievements/data/Games.java @@ -11,9 +11,9 @@ public class Games { @JsonProperty("ID") private int id; - @JsonProperty("Name") + @JsonProperty("name") private String name; - @JsonProperty("Platforms") + @JsonProperty("platforms") private List platforms; public Game(int id, String name, String platform) { @@ -41,7 +41,7 @@ public class Games { } - @JsonProperty("Games") + @JsonProperty("games") private List games; public Games() { games = new ArrayList(); } diff --git a/frontend/webpage/index.html b/frontend/webpage/index.html index 4035170..f5ccc0d 100644 --- a/frontend/webpage/index.html +++ b/frontend/webpage/index.html @@ -8,24 +8,24 @@