work on create org (#19)

This commit is contained in:
Jake Potrebic 2020-07-14 12:04:35 -06:00 committed by GitHub
parent 3bf3b20743
commit 09fef55e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 33 deletions

View File

@ -115,7 +115,7 @@
<small class="filter-version">(<a href="${routes.getRouteUrl("showLog", page, userFilter, projectFilter, action.version.versionString, pageFilter, actionFilter, subjectFilter)}">${action.version.versionString}</a>)</small>
</td>
</#if>
@* Show diff only when page edit *@
<#-- Show diff only when page edit -->
<#if action.action == LoggedActionType.ProjectPageEdited || action.action == LoggedActionType.VersionDescriptionEdited>
<td>
<a href="#" class="data-view-old" data-view="${offset + index}">View</a>

View File

@ -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 -->
<table style="display: none;">
<tbody>
@ -45,12 +47,14 @@
<tr>
<td>
<@userAvatar.userAvatar userName=owner.name avatarUrl=owner.avatarUrl clazz="user-avatar-xs" />
<strong>${owner.name}</strong>
<#if owner.name?has_content>
<strong>${owner.name}</strong>
</#if>
<span><i class="minor"><@spring.message "project.owner" /></i></span>
</td>
</tr>
@loadedUsers.map { user =>
<#list loadedUsers as user>
<tr>
<td>
<input form="form-continue" type="hidden" value="${user.id}" />
@ -58,14 +62,14 @@
<a target="_blank" rel="noopener" href="${routes.getRouteUrl("users.showProjects", user.name)}">
${user.name}
</a>
<span>${users.invite.roleSelect(roleCategory)}</span>
<span><@roleSelect.roleSelect roleCategory=roleCategory /></span>
</td>
</tr>
}
</#list>
<#-- User search -->
<tr>
<td>@users.invite.userSearch()</td>
<td><@userSearch.userSearch /></td>
</tr>
</tbody>

View File

@ -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-->
<#--}-->
<select id="${id}" form="${form}" class="${classes}" <#if hidden> style="display: none;" </#if>>
<#list roles as roleType>
<option value="${roleType.value}">${roleType.title}</option>
</#list>
</select>
<#macro roleSelect roleCategory="" form="form-continue" id="" classes="" hidden=false>
<select id="${id}" form="${form}" class="${classes}" <#if hidden> style="display: none;" </#if>>
<#list roles as roleType>
<option value="${roleType.value}">${roleType.title}</option>
</#list>
</select>
</#macro>

View File

@ -1,11 +1,13 @@
<#import "/spring.ftl" as spring />
<#import "*/utils/hangar.ftlh" as hangar />
@()(implicit messages: Messages)
<#--@()(implicit messages: Messages)-->
<#macro userSearch>
<div class="input-group input-group-sm user-search">
<input type="text" class="form-control" placeholder="<@spring.message "org.users.add" />&hellip;" />
<span class="input-group-btn">
<button disabled class="btn btn-default btn-search"><i class="fas fa-search"></i></button>
</span>
</div>
</#macro>
<div class="input-group input-group-sm user-search">
<input type="text" class="form-control" placeholder="<@spring.message "org.users.add" />&hellip;" />
<span class="input-group-btn">
<button disabled class="btn btn-default btn-search"><i class="fas fa-search"></i></button>
</span>
</div>

View File

@ -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>
<a href="${url}" <#list attr as k, v>${k + "=" + v + " "}</#list>>
<img class="user-avatar ${clazz}" title="${name}" src="${src}" alt="${name}" />
<img class="user-avatar ${clazz}" title="${name}" src="${imgSrc}" alt="${name}" />
</a>
</#macro>