mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-27 07:03:26 +08:00
userAvatar calls
This commit is contained in:
parent
bd158c5071
commit
32b280b45d
@ -36,7 +36,8 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-1" style="width: 40px;">
|
||||
<a href="${routes.getRouteUrl("users.showProjects", flag.reporter)}">
|
||||
@userAvatar(Some(flag.reporter), User.avatarUrl(flag.reporter), clazz = "user-avatar-xs")
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<@userAvatar.userAvatar userName=flag.reporter avatarUrl=User.avatarUrl(flag.reporter) clazz="user-avatar-xs"></@userAvatar.userAvatar>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-11">
|
||||
|
@ -152,7 +152,8 @@
|
||||
@versions.sortWith((a, b) => a.versionCreatedAt.compareTo(b.versionCreatedAt) < 0).map { entry =>
|
||||
<tr data-version="@helper.urlEncode(entry.namespace.ownerName)/@helper.urlEncode(entry.namespace.slug)/versions/@helper.urlEncode(entry.versionString)">
|
||||
<td>
|
||||
@userAvatar(Some(entry.namespace.ownerName), User.avatarUrl(entry.namespace.ownerName), clazz = "user-avatar-xs")
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<@userAvatar.userAvatar userName=entry.namespace.ownerName avatatUrl=User.avatarUrl(entry.namespace.ownerName) clazz="user-avatar-xs"></@userAvatar.userAvatar>
|
||||
</td>
|
||||
<td>
|
||||
<a href="${routes.getRouteUrl("versions.show", entry.namespace.ownerName, entry.namespace.slug, entry.versionString)}">
|
||||
|
@ -58,19 +58,20 @@
|
||||
<tbody>
|
||||
@authors.map { case (name, joinDate, createdAt, optRole, optDonorRole, projectCount) =>
|
||||
<tr>
|
||||
<td>@userAvatar(Some(name), User.avatarUrl(name), clazz = "user-avatar-xs")</td>
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<td><@userAvatar.userAvatar userName=name avatarUrl=User.avatarUrl(name) clazz="user-avatar-xs"></@userAvatar.userAvatar></td>
|
||||
<td>
|
||||
<a href="${routes.getRouteUrl("users.showProjects", name)}">${name}</a>
|
||||
</td>
|
||||
<td>
|
||||
@optDonorRole.map { role =>
|
||||
<span class="channel channel-sm" style="background-color: ${role.color.hex}">
|
||||
@role.title
|
||||
${role.title}
|
||||
</span>
|
||||
}
|
||||
@optRole.map { role =>
|
||||
<span class="user-role channel" style="background-color: ${role.color.hex}">
|
||||
@role.title
|
||||
${role.title}
|
||||
</span>
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
<#import "*/utils/form.ftlh" as form>
|
||||
<#import "*/utils/csrf.ftlh" as csrf>
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
|
||||
@import ore.OreConfig
|
||||
@import ore.models.user.role.UserRoleModel
|
||||
@ -31,7 +32,7 @@
|
||||
<ul style="display: none;">
|
||||
<li id="row-user" class="list-group-item">
|
||||
<input type="hidden" />
|
||||
@userAvatar(None, clazz = "user-avatar-xs")
|
||||
<@userAvatar.userAvatar clazz="user-avatar-xs"></@userAvatar.userAvatar>
|
||||
<a class="username"></a>
|
||||
<i class="fas fa-times user-cancel"></i>
|
||||
@users.invite.roleSelect(roleCategory = j.roleCategory, classes="pull-right")
|
||||
@ -101,7 +102,7 @@
|
||||
<!-- Member list -->
|
||||
@j.filteredMembers.map { case (role, user) =>
|
||||
<li class="list-group-item">
|
||||
@userAvatar(Some(user.name), user.avatarUrl, clazz = "user-avatar-xs")
|
||||
<@userAvatar.userAvatar userName=user.name avatarUrl=user.avatarUrl clazz="user-avatar-xs"></@userAvatar.userAvatar>
|
||||
<a class="username" href="${routes.getRouteUrl("users.showProjects", user.name)}">
|
||||
${user.name}
|
||||
</a>
|
||||
|
@ -87,7 +87,8 @@
|
||||
<li class="list-group-item notification" data-action="${notification.action!"none"}"
|
||||
data-id="@notification.id">
|
||||
@origin.map { origin =>
|
||||
@userAvatar(Some(origin.name), origin.avatarUrl, clazz = "user-avatar-s")
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<@userAvatar.userAvatar userName=origin.name avatarUrl=origin.avatarUrl clazz = "user-avatar-s"></@userAvatar.userAvatar>
|
||||
}
|
||||
@formatNotification(notification)
|
||||
|
||||
|
@ -76,7 +76,8 @@
|
||||
@u.orgas.map { case (organization, user, role, _) =>
|
||||
<tr>
|
||||
<td>
|
||||
@userAvatar(Some(organization.name), user.avatarUrl, clazz = "user-avatar-xxs")
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<@userAvatar.userAvatar userName=organization.name avatarUrl=user.avatarUrl clazz="user-avatar-xxs"></@userAvatar.userAvatar>
|
||||
<a href="${routes.getRouteUrl("users.showProjects", organization.name)}">
|
||||
${organization.name}
|
||||
</a>
|
||||
|
@ -44,7 +44,8 @@
|
||||
<tbody>
|
||||
<#list staff as user>
|
||||
<tr>
|
||||
<td>@userAvatar(user.name, User.avatarUrl(name), clazz = "user-avatar-xs")</td>
|
||||
<#import "*/utils/userAvatar.ftlh" as userAvatar>
|
||||
<td><@userAvatar.userAvatar userName=user.name avatarUrl=User.avatarUrl(name) clazz="user-avatar-xs"></@userAvatar.userAvatar></td>
|
||||
<td>
|
||||
<a href="${routes.getRouteUrl("showActivities", name)}">${user.name}</a>
|
||||
</td>
|
||||
|
@ -3,8 +3,6 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
|
||||
<#-- TODO: all the userName.nonEmpty/isEmpty stuff - how do you do this? -->
|
||||
|
||||
<#macro userAvatar userName="" avatarUrl="" imgSrc="" clazz="" attr={} href="">
|
||||
<#assign src>
|
||||
<#if imgSrc?has_content>
|
||||
|
Loading…
Reference in New Issue
Block a user