replace last view avatarUrls

This commit is contained in:
MiniDigger 2020-08-23 11:08:41 +02:00
parent 66eb9fcf92
commit e1a47a2842
7 changed files with 9 additions and 22 deletions

View File

@ -1,6 +1,7 @@
package io.papermc.hangar.db.model; package io.papermc.hangar.db.model;
import io.papermc.hangar.db.customtypes.JSONB;
import io.papermc.hangar.model.Category; import io.papermc.hangar.model.Category;
import io.papermc.hangar.model.Visibility; import io.papermc.hangar.model.Visibility;
import org.jdbi.v3.core.annotation.Unmappable; import org.jdbi.v3.core.annotation.Unmappable;
@ -24,7 +25,7 @@ public class ProjectsTable implements Visitable {
private Category category; private Category category;
private String description; private String description;
private Visibility visibility; private Visibility visibility;
private Object notes; // TODO jsonb private JSONB notes;
private Collection<String> keywords; private Collection<String> keywords;
private String homepage; private String homepage;
private String issues; private String issues;
@ -169,11 +170,11 @@ public class ProjectsTable implements Visitable {
} }
public Object getNotes() { //TODO jsonb public JSONB getNotes() {
return notes; return notes;
} }
public void setNotes(Object notes) { public void setNotes(JSONB notes) {
this.notes = notes; this.notes = notes;
} }

View File

@ -73,8 +73,4 @@ public class Author {
public void setCount(long count) { public void setCount(long count) {
this.count = 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
}
} }

View File

@ -31,23 +31,13 @@
<#list users?filter(u -> (users?seq_index_of(u) + 1) % columns == div) as gridUser> <#list users?filter(u -> (users?seq_index_of(u) + 1) % columns == div) as gridUser>
<div class="media"> <div class="media">
<div class="media-left"> <div class="media-left">
<@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" />
</div> </div>
<div class="media-body center-vertically"> <div class="media-body center-vertically">
<a class="media-heading mb-0" href="${routes.getRouteUrl("users.showProjects", gridUser.name)}">${gridUser.name}</a> <a class="media-heading mb-0" href="${routes.getRouteUrl("users.showProjects", gridUser.name)}">${gridUser.name}</a>
</div> </div>
</div> </div>
</#list> </#list>
<#-- @users.iterator.zipWithIndex.filter(_._2 % columns == div).map(_._1).map { user =>-->
<#-- <div class="media">-->
<#-- <div class="media-left">-->
<#-- <@userAvatar.userAvatar userName=user.name avatarUrl=user.avatarUrl clazz="user-avatar-sm media-object" />-->
<#-- </div>-->
<#-- <div class="media-body center-vertically">-->
<#-- <a class="media-heading mb-0" href="${routes.getRouteUrl("users.showProjects", user.name)}">${user.name}</a>-->
<#-- </div>-->
<#-- </div>-->
<#-- }-->
</div> </div>
</#list> </#list>

View File

@ -72,7 +72,7 @@
<#list authors as author> <#list authors as author>
<tr> <tr>
<#import "*/utils/userAvatar.ftlh" as userAvatar> <#import "*/utils/userAvatar.ftlh" as userAvatar>
<td><@userAvatar.userAvatar userName=author.name avatarUrl=author.avatarUrl clazz="user-avatar-xs"></@userAvatar.userAvatar></td> <td><@userAvatar.userAvatar userName=author.name avatarUrl=utils.avatarUrl(author.name) clazz="user-avatar-xs"></@userAvatar.userAvatar></td>
<td> <td>
<a href="${routes.getRouteUrl("users.showProjects", author.name)}">${author.name}</a> <a href="${routes.getRouteUrl("users.showProjects", author.name)}">${author.name}</a>
</td> </td>

View File

@ -75,7 +75,7 @@
<ul class="list-group"> <ul class="list-group">
<#list notifications as notification, origin> <#list notifications as notification, origin>
<li class="list-group-item notification" data-action="${notification.action!"none"}" data-id="${notification.id}"> <li class="list-group-item notification" data-action="${notification.action!"none"}" data-id="${notification.id}">
<#if origin??><@userAvatar.userAvatar userName=origin.user.name avatarUrl=origin.user.avatarUrl clazz="user-avatar-s" /></#if> <#if origin??><@userAvatar.userAvatar userName=origin.user.name avatarUrl=utils.avatarUrl(origin.user.name) clazz="user-avatar-s" /></#if>
<@formatNotification notification /> <@formatNotification notification />
<#if !notification.read> <#if !notification.read>
<span class="btn-mark-read"> <span class="btn-mark-read">

View File

@ -75,7 +75,7 @@
<tr> <tr>
<td> <td>
<#import "*/utils/userAvatar.ftlh" as userAvatar> <#import "*/utils/userAvatar.ftlh" as userAvatar>
<@userAvatar.userAvatar userName=organization.name avatarUrl=user.avatarUrl clazz="user-avatar-xxs"></@userAvatar.userAvatar> <@userAvatar.userAvatar userName=organization.name avatarUrl=utils.avatarUrl(organization.name) clazz="user-avatar-xxs"></@userAvatar.userAvatar>
<a href="${routes.getRouteUrl("users.showProjects", organization.name)}"> <a href="${routes.getRouteUrl("users.showProjects", organization.name)}">
${organization.name} ${organization.name}
</a> </a>

View File

@ -49,7 +49,7 @@
<#list staff as staffUser> <#list staff as staffUser>
<tr> <tr>
<#import "*/utils/userAvatar.ftlh" as userAvatar> <#import "*/utils/userAvatar.ftlh" as userAvatar>
<td><@userAvatar.userAvatar userName=staffUser.name avatarUrl=staffUser.avatarUrl clazz="user-avatar-xs"></@userAvatar.userAvatar></td> <td><@userAvatar.userAvatar userName=staffUser.name avatarUrl=utils.avatarUrl(staffUser.name) clazz="user-avatar-xs"></@userAvatar.userAvatar></td>
<td> <td>
<a href="${routes.getRouteUrl("showActivities", staffUser.name)}">${staffUser.name}</a> <a href="${routes.getRouteUrl("showActivities", staffUser.name)}">${staffUser.name}</a>
</td> </td>