mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
work on create org (#19)
This commit is contained in:
parent
3bf3b20743
commit
09fef55e49
@ -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>
|
<small class="filter-version">(<a href="${routes.getRouteUrl("showLog", page, userFilter, projectFilter, action.version.versionString, pageFilter, actionFilter, subjectFilter)}">${action.version.versionString}</a>)</small>
|
||||||
</td>
|
</td>
|
||||||
</#if>
|
</#if>
|
||||||
@* Show diff only when page edit *@
|
<#-- Show diff only when page edit -->
|
||||||
<#if action.action == LoggedActionType.ProjectPageEdited || action.action == LoggedActionType.VersionDescriptionEdited>
|
<#if action.action == LoggedActionType.ProjectPageEdited || action.action == LoggedActionType.VersionDescriptionEdited>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" class="data-view-old" data-view="${offset + index}">View</a>
|
<a href="#" class="data-view-old" data-view="${offset + index}">View</a>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#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
|
@import ore.OreConfig
|
||||||
@ -12,9 +15,8 @@
|
|||||||
@(owner: User, loadedUsers: Seq[Model[User]] = Seq(), roleCategory: RoleCategory)(implicit messages: Messages, config: OreConfig)
|
@(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 -->
|
<#-- Template row -->
|
||||||
<table style="display: none;">
|
<table style="display: none;">
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -45,12 +47,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<@userAvatar.userAvatar userName=owner.name avatarUrl=owner.avatarUrl clazz="user-avatar-xs" />
|
<@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>
|
<span><i class="minor"><@spring.message "project.owner" /></i></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@loadedUsers.map { user =>
|
<#list loadedUsers as user>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input form="form-continue" type="hidden" value="${user.id}" />
|
<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)}">
|
<a target="_blank" rel="noopener" href="${routes.getRouteUrl("users.showProjects", user.name)}">
|
||||||
${user.name}
|
${user.name}
|
||||||
</a>
|
</a>
|
||||||
<span>${users.invite.roleSelect(roleCategory)}</span>
|
<span><@roleSelect.roleSelect roleCategory=roleCategory /></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
</#list>
|
||||||
|
|
||||||
<#-- User search -->
|
<#-- User search -->
|
||||||
<tr>
|
<tr>
|
||||||
<td>@users.invite.userSearch()</td>
|
<td><@userSearch.userSearch /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
|
|
||||||
@import ore.permission.role.{Role, RoleCategory}
|
<#--@import ore.permission.role.{Role, RoleCategory}-->
|
||||||
@(roleCategory: RoleCategory, form: String = "form-continue", id: String = "", classes: String = "",
|
<#--@(roleCategory: RoleCategory, form: String = "form-continue", id: String = "", classes: String = "",-->
|
||||||
hidden: Boolean = false)
|
<#-- hidden: Boolean = false)-->
|
||||||
|
|
||||||
@roles = @{
|
<#--@roles = @{-->
|
||||||
Role.values.filter(role => role.category == roleCategory && role.isAssignable)
|
<#-- Role.values.filter(role => role.category == roleCategory && role.isAssignable)-->
|
||||||
.toList.sortBy(_.permissions: Long).reverse
|
<#-- .toList.sortBy(_.permissions: Long).reverse-->
|
||||||
}
|
<#--}-->
|
||||||
|
|
||||||
<select id="${id}" form="${form}" class="${classes}" <#if hidden> style="display: none;" </#if>>
|
<#macro roleSelect roleCategory="" form="form-continue" id="" classes="" hidden=false>
|
||||||
<#list roles as roleType>
|
<select id="${id}" form="${form}" class="${classes}" <#if hidden> style="display: none;" </#if>>
|
||||||
<option value="${roleType.value}">${roleType.title}</option>
|
<#list roles as roleType>
|
||||||
</#list>
|
<option value="${roleType.value}">${roleType.title}</option>
|
||||||
</select>
|
</#list>
|
||||||
|
</select>
|
||||||
|
</#macro>
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#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" />…" />
|
||||||
|
<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" />…" />
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button disabled class="btn btn-default btn-search"><i class="fas fa-search"></i></button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
@ -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 "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
@ -7,19 +7,19 @@
|
|||||||
|
|
||||||
<#macro userAvatar userName="" avatarUrl="" imgSrc="" clazz="" attr={} href="">
|
<#macro userAvatar userName="" avatarUrl="" imgSrc="" clazz="" attr={} href="">
|
||||||
<#assign src>
|
<#assign src>
|
||||||
<#if !imgSrc.isEmpty()>
|
<#if imgSrc?has_content>
|
||||||
${imgSrc}
|
${imgSrc}
|
||||||
<#else>
|
<#else>
|
||||||
<#if !userName.isEmpty()>
|
<#if userName?has_content>
|
||||||
${avatarUrl}
|
${avatarUrl}
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#assign>
|
</#assign>
|
||||||
|
|
||||||
<#assign url>
|
<#assign url>
|
||||||
<#if !href.isEmpty()>
|
<#if href?has_content>
|
||||||
${href}
|
${href}
|
||||||
<#elseif !userName.isEmpty()>
|
<#elseif userName?has_content>
|
||||||
${routes.getRouteUrl("users.showProjects", userName)}
|
${routes.getRouteUrl("users.showProjects", userName)}
|
||||||
<#else>
|
<#else>
|
||||||
#
|
#
|
||||||
@ -29,6 +29,6 @@
|
|||||||
<#assign name>${userName}</#assign>
|
<#assign name>${userName}</#assign>
|
||||||
|
|
||||||
<a href="${url}" <#list attr as k, v>${k + "=" + v + " "}</#list>>
|
<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>
|
</a>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
Loading…
Reference in New Issue
Block a user