mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-30 14:30:08 +08:00
A few more ifs and variable usages
This commit is contained in:
parent
e9827e6400
commit
71858b5836
@ -38,8 +38,8 @@ Discussion page within Project overview.
|
||||
<div class="pull-right push-down">
|
||||
<i class="minor"><@spring.message "project.discuss.postAs" /></i>
|
||||
<select name="poster" form="form-editor-save">
|
||||
<option selected>@request.headerData.currentUser.get.name</option>
|
||||
<option>@p.projectOwner.name</option>
|
||||
<option selected>${request.headerData.currentUser.get.name}</option>
|
||||
<option>${p.projectOwner.name}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
@ -11,12 +11,12 @@
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="visibility-actions">
|
||||
@for(visibility <- Visibility.values.sortBy(_.value)) {
|
||||
<#list Visibility.values.sortBy(_.value) as visibility>
|
||||
<li>
|
||||
<a href="#" class="btn-visibility-change" data-project="@namespace" data-level="@visibility.value" @if(visibility.showModal){ data-modal="true" }>
|
||||
<@spring.message "visibility.name." + visibility.nameKey) @if(projectVisibility == visibility /> { <i class="fa fa-check" style="color: black" aria-hidden="true"></i> }
|
||||
<a href="#" class="btn-visibility-change" data-project="@namespace" data-level="@visibility.value" <#if visibility.showModal> data-modal="true" </#if>>
|
||||
<@spring.message "visibility.name." + visibility.nameKey /> <#if projectVisibility == visibility> <i class="fa fa-check" style="color: black" aria-hidden="true"></i> </#if>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -4,13 +4,13 @@
|
||||
@import models.querymodels.ViewTag
|
||||
|
||||
@(tag: ViewTag, tagCount: Int = 0)
|
||||
<#if tag.data.isEmpty || tagCount gt 2 || tag.data.exists(_.length > 14)>
|
||||
<#if tag.data.isEmpty || tagCount gt 2 || tag.data.exists(_.length gt 14)>
|
||||
<div class="tags">
|
||||
<span style="color: @tag.color.foreground; background-color:@tag.color.background; border-color: @tag.color.background" class="tag">@tag.name</span>
|
||||
<span style="color: ${tag.color.foreground}; background-color:${tag.color.background}; border-color: ${tag.color.background}" class="tag">${tag.name}</span>
|
||||
</div>
|
||||
<#else>
|
||||
<div class="tags has-addons">
|
||||
<span style="color: @tag.color.foreground; background-color:@tag.color.background; border-color: @tag.color.background" class="tag">@tag.name</span>
|
||||
<span class="tag">@tag.data.get.take(14)</span>
|
||||
<span style="color: ${tag.color.foreground}; background-color:${tag.color.background}; border-color: ${tag.color.background}" class="tag">${tag.name}</span>
|
||||
<span class="tag">${tag.data.get.take(14)}</span>
|
||||
</div>
|
||||
</#if>
|
||||
|
@ -100,7 +100,7 @@
|
||||
</a>
|
||||
<#else>
|
||||
<#if sp.perms(Permission.DeleteVersion)>
|
||||
@if(v.p.publicVersions == 1) {
|
||||
<#if v.p.publicVersions == 1>
|
||||
<a class="btn btn-danger" disabled data-toggle="tooltip" data-placement="top"
|
||||
title="<@spring.message "version.delete.cannotLast" />">
|
||||
<i class="fas fa-trash"></i> <@spring.message "general.delete" />
|
||||
@ -109,7 +109,7 @@
|
||||
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#modal-delete">
|
||||
<i class="fas fa-trash"></i> <@spring.message "general.delete" />
|
||||
</button>
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
@ -205,19 +205,19 @@
|
||||
|
||||
@v.filteredDependencies.map { case (depend, project)=>
|
||||
<li class="list-group-item">
|
||||
@if(project.isDefined) {
|
||||
<#if project.isDefined>
|
||||
<a href="@projectRoutes.show(
|
||||
project.get.ownerName, project.get.slug)">
|
||||
<strong>@project.get.name</strong>
|
||||
<strong>${project.get.name}</strong>
|
||||
</a>
|
||||
} else {
|
||||
<#else>
|
||||
<div class="minor">
|
||||
@depend.pluginId
|
||||
${depend.pluginId}
|
||||
<i class="fas fa-question-circle"
|
||||
title="<@spring.message "version.dependency.notOnOre" />"
|
||||
data-toggle="tooltip" data-placement="right"></i>
|
||||
</div>
|
||||
}
|
||||
</#if>
|
||||
<p class="version-string">@depend.version</p>
|
||||
</li>
|
||||
}
|
||||
|
@ -91,11 +91,11 @@
|
||||
<#elseif action.project.id.isEmpty>
|
||||
<td>
|
||||
Resource deleted
|
||||
@if(action.actionContext == LoggedActionContext.Project || action.actionContext == LoggedActionContext.ProjectPage) {
|
||||
<#if action.actionContext == LoggedActionContext.Project || action.actionContext == LoggedActionContext.ProjectPage>
|
||||
<small class="filter-project">(<a href="@appRoutes.showLog(Some(page), userFilter, action.project.pluginId, versionFilter, pageFilter, actionFilter, subjectFilter)">@action.project.pluginId</a>)</small>
|
||||
} else {
|
||||
<#else>
|
||||
<small class="filter-version">(<a href="@appRoutes.showLog(Some(page), userFilter, projectFilter, action.version.versionString, pageFilter, actionFilter, subjectFilter)">@action.version.versionString</a>)</small>
|
||||
}
|
||||
</#if>
|
||||
</td>
|
||||
<#elseif action.actionContext == LoggedActionContext.Project>
|
||||
<td>
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
@roleTable[T, M <: UserRoleModel[M]](keyName: String, tableType: String, withOwner: Boolean, roles: Set[(T, Model[M], String)], roleTypes: IndexedSeq[Role])(showKey: (T, M) => Html) = {
|
||||
<table class="table role-table">
|
||||
<tr><th>@keyName</th>@if(withOwner) {<th>Owner</th>}<th>Role</th><th>Accepted</th></tr>
|
||||
<tr><th>${keyName}</th><#if withOwner><th>Owner</th></#if><th>Role</th><th>Accepted</th></tr>
|
||||
@roles.map { case (t, role, owner) =>
|
||||
<tr data-role-type="@tableType" data-role-id="@role.id">
|
||||
<td>@showKey(t, role)</td>
|
||||
|
@ -10,8 +10,8 @@
|
||||
.toList.sortBy(_.permissions: Long).reverse
|
||||
}
|
||||
|
||||
<select id="@id" form="@form" class="@classes" @if(hidden) { style="display: none;" }>
|
||||
@for(roleType <- roles) {
|
||||
<option value="@roleType.value">@roleType.title</option>
|
||||
}
|
||||
<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>
|
||||
|
@ -75,8 +75,8 @@
|
||||
<!-- Notifications content -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="list-group-item no-notifications" @if(notifications.nonEmpty) {
|
||||
style="display: none; }">
|
||||
<div class="list-group-item no-notifications" <#if notifications.nonEmpty>
|
||||
style="display: none; </#if>">
|
||||
<h3 class="minor">
|
||||
<i class="far fa-thumbs-up"></i> <@spring.message notificationFilter.emptyMessage />
|
||||
</h3>
|
||||
|
@ -71,23 +71,23 @@
|
||||
</div>
|
||||
<table class="table panel-body">
|
||||
<tbody>
|
||||
@if(u.orgas.isEmpty) {
|
||||
<#if u.orgas.isEmpty>
|
||||
<tr><td><i class="minor"><i class="fas fa-star"></i> <@spring.message "user.noOrganizations", u.user.name /></i></td></tr>
|
||||
} else {
|
||||
<#else>
|
||||
@u.orgas.map { case (organization, user, role, _) =>
|
||||
<tr>
|
||||
<td>
|
||||
@userAvatar(Some(organization.name), user.avatarUrl, clazz = "user-avatar-xxs")
|
||||
<a href="@userRoutes.showProjects(organization.name)">
|
||||
@organization.name
|
||||
${organization.name}
|
||||
</a>
|
||||
<div class="pull-right">
|
||||
@role.role.title
|
||||
${role.role.title}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -17,10 +17,10 @@ scopedData.permissions.has(Permission.EditOrganizationSettings)
|
||||
<script type="text/javascript" src="<@hangar.url "javascripts/userPage.js" />"></script>
|
||||
<script <#-- @CSPNonce.attr -->>
|
||||
window.USERNAME ='${u.user.name}';
|
||||
@for(category <- Category.values) {
|
||||
<#list Category.values as category> <#-- todo -->
|
||||
CATEGORY_TITLE['${category.apiName}'] = '${category.title}';
|
||||
CATEGORY_ICON['${category.apiName}'] = '${category.icon}';
|
||||
}
|
||||
</#list>
|
||||
NO_ACTION_MESSAGE.starred = '<@spring.messageArgs "user.noStars" u.user.name />';
|
||||
NO_ACTION_MESSAGE.watching = '<@spring.messageArgs "user.noWatching" u.user.name />';
|
||||
</script>
|
||||
@ -57,7 +57,7 @@ scopedData.permissions.has(Permission.EditOrganizationSettings)
|
||||
|
||||
<span class="user-title">
|
||||
<h1 class="username">
|
||||
@u.user.name
|
||||
${u.user.name}
|
||||
|
||||
<#if u.isCurrent && !u.isOrga>
|
||||
<a class="user-settings" href="@config.security.api.url/accounts/settings">
|
||||
@ -120,7 +120,7 @@ scopedData.permissions.has(Permission.EditOrganizationSettings)
|
||||
</ul>
|
||||
|
||||
<div class="user-info">
|
||||
<i class="minor">@u.projectCount @if(u.projectCount == 1){project}else{projects}</i><br/>
|
||||
<i class="minor">@u.projectCount <#if u.projectCount == 1>project<#else>projects</#if></i><br/>
|
||||
<i class="minor">
|
||||
@messages(
|
||||
"user.memberSince",
|
||||
|
Loading…
Reference in New Issue
Block a user