From 09fef55e4978b9e47af90d88af32cf2b2624c7cc Mon Sep 17 00:00:00 2001
From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com>
Date: Tue, 14 Jul 2020 12:04:35 -0600
Subject: [PATCH] work on create org (#19)
---
.../resources/templates/users/admin/log.ftlh | 2 +-
.../templates/users/invite/form.ftlh | 18 ++++++++-----
.../templates/users/invite/roleSelect.ftlh | 26 ++++++++++---------
.../templates/users/invite/userSearch.ftlh | 16 +++++++-----
.../resources/templates/utils/userAvatar.ftlh | 12 ++++-----
5 files changed, 41 insertions(+), 33 deletions(-)
diff --git a/src/main/resources/templates/users/admin/log.ftlh b/src/main/resources/templates/users/admin/log.ftlh
index b2fc15a74..91206eb97 100644
--- a/src/main/resources/templates/users/admin/log.ftlh
+++ b/src/main/resources/templates/users/admin/log.ftlh
@@ -115,7 +115,7 @@
(${action.version.versionString})
#if>
- @* Show diff only when page edit *@
+ <#-- Show diff only when page edit -->
<#if action.action == LoggedActionType.ProjectPageEdited || action.action == LoggedActionType.VersionDescriptionEdited>
View
diff --git a/src/main/resources/templates/users/invite/form.ftlh b/src/main/resources/templates/users/invite/form.ftlh
index 3416a5985..ebed99b25 100644
--- a/src/main/resources/templates/users/invite/form.ftlh
+++ b/src/main/resources/templates/users/invite/form.ftlh
@@ -1,5 +1,8 @@
<#import "/spring.ftl" as spring />
<#import "*/utils/hangar.ftlh" as hangar />
+<#import "*/utils/userAvatar.ftlh" as userAvatar />
+<#import "*/users/invite/userSearch.ftlh" as userSearch />
+<#import "*/users/invite/roleSelect.ftlh" as roleSelect />
<#--
@import ore.OreConfig
@@ -12,9 +15,8 @@
@(owner: User, loadedUsers: Seq[Model[User]] = Seq(), roleCategory: RoleCategory)(implicit messages: Messages, config: OreConfig)
-->
-<#macro form owner roleCategory loadedUsers=[]>
+<#macro form owner roleCategory="" loadedUsers=[]>
-<#import "*/utils/userAvatar.ftlh" as userAvatar>
<#-- Template row -->
@@ -45,12 +47,14 @@
<@userAvatar.userAvatar userName=owner.name avatarUrl=owner.avatarUrl clazz="user-avatar-xs" />
- ${owner.name}
+ <#if owner.name?has_content>
+ ${owner.name}
+ #if>
<@spring.message "project.owner" />
|
- @loadedUsers.map { user =>
+ <#list loadedUsers as user>
@@ -58,14 +62,14 @@
${user.name}
- ${users.invite.roleSelect(roleCategory)}
+ <@roleSelect.roleSelect roleCategory=roleCategory />
|
- }
+ #list>
<#-- User search -->
- @users.invite.userSearch() |
+ <@userSearch.userSearch /> |
diff --git a/src/main/resources/templates/users/invite/roleSelect.ftlh b/src/main/resources/templates/users/invite/roleSelect.ftlh
index 225658cc3..4fc8c8aa9 100644
--- a/src/main/resources/templates/users/invite/roleSelect.ftlh
+++ b/src/main/resources/templates/users/invite/roleSelect.ftlh
@@ -1,17 +1,19 @@
<#import "/spring.ftl" as spring />
<#import "*/utils/hangar.ftlh" as hangar />
-@import ore.permission.role.{Role, RoleCategory}
-@(roleCategory: RoleCategory, form: String = "form-continue", id: String = "", classes: String = "",
- hidden: Boolean = false)
+<#--@import ore.permission.role.{Role, RoleCategory}-->
+<#--@(roleCategory: RoleCategory, form: String = "form-continue", id: String = "", classes: String = "",-->
+<#-- hidden: Boolean = false)-->
-@roles = @{
- Role.values.filter(role => role.category == roleCategory && role.isAssignable)
- .toList.sortBy(_.permissions: Long).reverse
-}
+<#--@roles = @{-->
+<#-- Role.values.filter(role => role.category == roleCategory && role.isAssignable)-->
+<#-- .toList.sortBy(_.permissions: Long).reverse-->
+<#--}-->
-
+<#macro roleSelect roleCategory="" form="form-continue" id="" classes="" hidden=false>
+
+#macro>
diff --git a/src/main/resources/templates/users/invite/userSearch.ftlh b/src/main/resources/templates/users/invite/userSearch.ftlh
index e001a1e3b..9fb3f29bc 100644
--- a/src/main/resources/templates/users/invite/userSearch.ftlh
+++ b/src/main/resources/templates/users/invite/userSearch.ftlh
@@ -1,11 +1,13 @@
<#import "/spring.ftl" as spring />
<#import "*/utils/hangar.ftlh" as hangar />
-@()(implicit messages: Messages)
+<#--@()(implicit messages: Messages)-->
+<#macro userSearch>
+
+ …" />
+
+
+
+
+#macro>
-
- …" />
-
-
-
-
diff --git a/src/main/resources/templates/utils/userAvatar.ftlh b/src/main/resources/templates/utils/userAvatar.ftlh
index 5042ef2d4..bba0f77a2 100644
--- a/src/main/resources/templates/utils/userAvatar.ftlh
+++ b/src/main/resources/templates/utils/userAvatar.ftlh
@@ -1,4 +1,4 @@
-@(userName: Option[String], avatarUrl: String = "", imgSrc: String = null, clazz: String = "", attr: Map[String, String] = Map(), href: String = null)
+<#--@(userName: Option[String], avatarUrl: String = "", imgSrc: String = null, clazz: String = "", attr: Map[String, String] = Map(), href: String = null)-->
<#import "/spring.ftl" as spring />
<#import "*/utils/hangar.ftlh" as hangar />
@@ -7,19 +7,19 @@
<#macro userAvatar userName="" avatarUrl="" imgSrc="" clazz="" attr={} href="">
<#assign src>
- <#if !imgSrc.isEmpty()>
+ <#if imgSrc?has_content>
${imgSrc}
<#else>
- <#if !userName.isEmpty()>
+ <#if userName?has_content>
${avatarUrl}
#if>
#if>
#assign>
<#assign url>
- <#if !href.isEmpty()>
+ <#if href?has_content>
${href}
- <#elseif !userName.isEmpty()>
+ <#elseif userName?has_content>
${routes.getRouteUrl("users.showProjects", userName)}
<#else>
#
@@ -29,6 +29,6 @@
<#assign name>${userName}#assign>
${k + "=" + v + " "}#list>>
-
+
#macro>
|