From e1a47a2842009179867410164950efb7f39f24b2 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Sun, 23 Aug 2020 11:08:41 +0200 Subject: [PATCH] replace last view avatarUrls --- .../io/papermc/hangar/db/model/ProjectsTable.java | 7 ++++--- .../io/papermc/hangar/model/viewhelpers/Author.java | 4 ---- src/main/resources/templates/projects/userGrid.ftlh | 12 +----------- src/main/resources/templates/users/authors.ftlh | 2 +- .../resources/templates/users/notifications.ftlh | 2 +- src/main/resources/templates/users/projects.ftlh | 2 +- src/main/resources/templates/users/staff.ftlh | 2 +- 7 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/main/java/io/papermc/hangar/db/model/ProjectsTable.java b/src/main/java/io/papermc/hangar/db/model/ProjectsTable.java index 2ef9ca1f5..569395a16 100644 --- a/src/main/java/io/papermc/hangar/db/model/ProjectsTable.java +++ b/src/main/java/io/papermc/hangar/db/model/ProjectsTable.java @@ -1,6 +1,7 @@ package io.papermc.hangar.db.model; +import io.papermc.hangar.db.customtypes.JSONB; import io.papermc.hangar.model.Category; import io.papermc.hangar.model.Visibility; import org.jdbi.v3.core.annotation.Unmappable; @@ -24,7 +25,7 @@ public class ProjectsTable implements Visitable { private Category category; private String description; private Visibility visibility; - private Object notes; // TODO jsonb + private JSONB notes; private Collection keywords; private String homepage; private String issues; @@ -169,11 +170,11 @@ public class ProjectsTable implements Visitable { } - public Object getNotes() { //TODO jsonb + public JSONB getNotes() { return notes; } - public void setNotes(Object notes) { + public void setNotes(JSONB notes) { this.notes = notes; } diff --git a/src/main/java/io/papermc/hangar/model/viewhelpers/Author.java b/src/main/java/io/papermc/hangar/model/viewhelpers/Author.java index b70acd2b3..6f76167b7 100644 --- a/src/main/java/io/papermc/hangar/model/viewhelpers/Author.java +++ b/src/main/java/io/papermc/hangar/model/viewhelpers/Author.java @@ -73,8 +73,4 @@ public class Author { public void setCount(long count) { this.count = count; } - - public String getAvatarUrl() { - return "https://paper.readthedocs.io/en/latest/_images/papermc_logomark_500.png"; // TODO figure out what to do with avatar url - } } diff --git a/src/main/resources/templates/projects/userGrid.ftlh b/src/main/resources/templates/projects/userGrid.ftlh index 2ca92ce8e..848c1501f 100644 --- a/src/main/resources/templates/projects/userGrid.ftlh +++ b/src/main/resources/templates/projects/userGrid.ftlh @@ -31,23 +31,13 @@ <#list users?filter(u -> (users?seq_index_of(u) + 1) % columns == div) as gridUser>
- <@userAvatar.userAvatar userName=gridUser.name avatarUrl=gridUser.avatarUrl clazz="user-avatar-sm media-object" /> + <@userAvatar.userAvatar userName=gridUser.name avatarUrl=utils.avatarUrl(gridUser.name) clazz="user-avatar-sm media-object" />
-<#-- @users.iterator.zipWithIndex.filter(_._2 % columns == div).map(_._1).map { user =>--> -<#--
--> -<#--
--> -<#-- <@userAvatar.userAvatar userName=user.name avatarUrl=user.avatarUrl clazz="user-avatar-sm media-object" />--> -<#--
--> -<#--
--> -<#-- ${user.name}--> -<#--
--> -<#--
--> -<#-- }--> diff --git a/src/main/resources/templates/users/authors.ftlh b/src/main/resources/templates/users/authors.ftlh index f51807a21..e0b672486 100644 --- a/src/main/resources/templates/users/authors.ftlh +++ b/src/main/resources/templates/users/authors.ftlh @@ -72,7 +72,7 @@ <#list authors as author> <#import "*/utils/userAvatar.ftlh" as userAvatar> - <@userAvatar.userAvatar userName=author.name avatarUrl=author.avatarUrl clazz="user-avatar-xs"> + <@userAvatar.userAvatar userName=author.name avatarUrl=utils.avatarUrl(author.name) clazz="user-avatar-xs"> ${author.name} diff --git a/src/main/resources/templates/users/notifications.ftlh b/src/main/resources/templates/users/notifications.ftlh index 6138f42ec..fae387144 100644 --- a/src/main/resources/templates/users/notifications.ftlh +++ b/src/main/resources/templates/users/notifications.ftlh @@ -75,7 +75,7 @@