mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-01 15:17:07 +08:00
Continue porting bits of templates
This commit is contained in:
parent
764e6d5575
commit
ca3b9d5be0
@ -1,20 +1,23 @@
|
||||
<#--
|
||||
@import controllers.sugar.Requests.OreRequest
|
||||
@import ore.OreConfig
|
||||
@import ore.permission.role.RoleCategory
|
||||
@import views.html.helper.{CSRF, form}
|
||||
@()(implicit messages: Messages, flash: Flash, request: OreRequest[_], config: OreConfig, assetsFinder: AssetsFinder)
|
||||
-->
|
||||
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "../utils/hangar.ftlh" as hangar />
|
||||
<#import "*/../utils/hangar.ftlh" as hangar />
|
||||
<#import "*/../layout/base.ftlh" as base />
|
||||
|
||||
@scripts = {
|
||||
<#assign scripts>
|
||||
<script type="text/javascript" src="<@hangar.url "javascripts/orgCreate.js" />"></script>
|
||||
<script type="text/javascript" src="<@hangar.url "javascripts/userSearch.js" />"></script>
|
||||
<script type="text/javascript" src="<@hangar.url "javascripts/membersConfig.js" />"></script>
|
||||
}
|
||||
|
||||
@layout.base(messages("org.create"), scripts) {
|
||||
</#assign>
|
||||
|
||||
<#assign message><@spring.message "org.create.title" /></#assign>
|
||||
<@base.base title="${message}" additionalScripts=scripts>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="panel panel-default">
|
||||
@ -51,5 +54,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
</@base.base>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
|
||||
<#--
|
||||
@import views.html.helper.{CSRF, form}
|
||||
@(saveCall: Call = null,
|
||||
deleteCall: Call = null,
|
||||
@ -13,8 +14,9 @@
|
||||
cancellable: Boolean = true,
|
||||
targetForm: String = null,
|
||||
extraFormValue: String = null)(implicit messages: Messages, request: Request[_])
|
||||
-->
|
||||
|
||||
@if(enabled) {
|
||||
<#if enabled>
|
||||
<!-- Edit -->
|
||||
<button type="button" class="btn btn-sm btn-edit btn-page btn-default" title="<@spring.message "general.edit" />">
|
||||
<i class="fas fa-edit"></i> <@spring.message "general.edit" />
|
||||
@ -28,25 +30,25 @@
|
||||
</div>
|
||||
|
||||
<!-- Save -->
|
||||
@if(savable) {
|
||||
<#if savable>
|
||||
<div class="btn-edit-container btn-save-container" title="<@spring.message "general.save" />">
|
||||
<button form="form-editor-save" type="submit" class="btn btn-sm btn-save btn-page btn-default">
|
||||
<i class="fas fa-save"></i>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</#if>
|
||||
|
||||
<!-- Cancel -->
|
||||
@if(cancellable) {
|
||||
<#if cancellable>
|
||||
<div class="btn-edit-container btn-cancel-container" title="<@spring.message "general.cancel" />">
|
||||
<button type="button" class="btn btn-sm btn-cancel btn-page btn-default">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</#if>
|
||||
|
||||
<!-- Delete -->
|
||||
@if(deletable) {
|
||||
<#if deletable>
|
||||
<div class="btn-edit-container btn-delete-container" title="<@spring.message "general.delete" />">
|
||||
<button type="button" class="btn btn-sm btn-page-delete btn-page btn-default"
|
||||
data-toggle="modal" data-target="#modal-page-delete">
|
||||
@ -62,10 +64,10 @@
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="label-page-delete">Delete @subject.toLowerCase</h4>
|
||||
<h4 class="modal-title" id="label-page-delete">Delete ${subject.toLowerCase}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Are you sure you want to delete this @subject.toLowerCase? This cannot be undone.
|
||||
Are you sure you want to delete this ${subject.toLowerCase}? This cannot be undone.
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
@ -77,30 +79,29 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</#if>
|
||||
|
||||
<!-- Edit window -->
|
||||
<div class="page-edit" style="display: none ;">
|
||||
<textarea name="content" class="form-control" @if(targetForm != null) {
|
||||
form="@targetForm"
|
||||
} else {
|
||||
<textarea name="content" class="form-control" <#if targetForm??>
|
||||
form="${targetForm}"
|
||||
<#else>
|
||||
form="form-editor-save"
|
||||
}>@raw</textarea>
|
||||
</#if>>${raw}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- Preview window -->
|
||||
<div class="page-preview page-rendered" style="display: none ;"></div>
|
||||
|
||||
@if(savable) {
|
||||
<#if savable>
|
||||
@form(action = saveCall, Symbol("id") -> "form-editor-save") {
|
||||
@CSRF.formField
|
||||
@if(extraFormValue != null) {
|
||||
<input type="hidden" value="@extraFormValue" name="name">
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<!-- Saved window -->
|
||||
<div class="page-content page-rendered">@cooked</div>
|
||||
<div class="page-content page-rendered">${cooked}</div>
|
||||
|
@ -1,16 +1,16 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
<#import "*/layout/base.ftlh" as base />
|
||||
|
||||
@import controllers.sugar.Requests.OreRequest
|
||||
@import ore.OreConfig
|
||||
@(title: String, recipient: String, body: String)(implicit messages: Messages, request: OreRequest[_], config: OreConfig, flash: Flash, assetsFinder: AssetsFinder)
|
||||
|
||||
@layout.base(messages(title), scriptsEnabled = false, showHeader = false, showFooter = false) {
|
||||
|
||||
<#assign message><@spring.message title /></#assign>
|
||||
<@base.base title=message scriptsEnabled=false showHeader=false showFooter=false>
|
||||
<div class="container">
|
||||
<p>@recipient,</p>
|
||||
<p>${recipient},</p>
|
||||
<p><@spring.message body /></p>
|
||||
<p>@Html(messages("email.signature"))</p>
|
||||
<p>@Html(<@spring.message "email.signature" />)</p>
|
||||
</div>
|
||||
|
||||
}
|
||||
</@base.base>
|
||||
|
@ -5,7 +5,7 @@
|
||||
label: String = "",
|
||||
titleId: String)(content: Html)(implicit messages: Messages)
|
||||
|
||||
<div class="modal fade" id="@id" tabindex="-1" role="dialog" aria-labelledby="@label">
|
||||
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="${label}">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -15,7 +15,7 @@
|
||||
</button>
|
||||
<h4 class="modal-title"><@spring.message titleId /></h4>
|
||||
</div>
|
||||
@content
|
||||
${content}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
|
||||
<div class="prompt popover @id @position" data-prompt-id="@prompt.value">
|
||||
<div class="prompt popover ${id} ${position}" data-prompt-id="${prompt.value}">
|
||||
<div class="arrow"></div>
|
||||
<h3 class="popover-title"><@spring.message prompt.titleId /></h3>
|
||||
<div class="popover-content">
|
||||
|
@ -3,15 +3,29 @@
|
||||
<#import "/spring.ftl" as spring />
|
||||
<#import "*/utils/hangar.ftlh" as hangar />
|
||||
|
||||
@src = @{
|
||||
if (imgSrc == null) {
|
||||
if (userName.nonEmpty)
|
||||
avatarUrl
|
||||
else
|
||||
""
|
||||
} else
|
||||
imgSrc
|
||||
}
|
||||
<#-- TODO: all the userName.nonEmpty/isEmpty stuff - how do you do this? -->
|
||||
|
||||
<#assign src>
|
||||
<#if imgSrc??>
|
||||
${imgSrc}
|
||||
<#else>
|
||||
<#if userName.nonEmpty>
|
||||
${avatarUrl}
|
||||
</#if>
|
||||
</#if>
|
||||
</#assign>
|
||||
|
||||
<#--
|
||||
|
||||
<#assign url>
|
||||
<#if href??>
|
||||
${href}
|
||||
<#elseif userName.isEmpty>
|
||||
#
|
||||
<#else>
|
||||
${routes.getRouteUrl("users.showProjects")} -- ????????
|
||||
</#if>
|
||||
</#assign>
|
||||
|
||||
@url = @{
|
||||
if (href != null)
|
||||
@ -22,6 +36,13 @@
|
||||
routes.Users.showProjects(userName.get).url
|
||||
}
|
||||
|
||||
-->
|
||||
|
||||
<#assign name>
|
||||
<#if !userName.isEmpty>
|
||||
${userName}
|
||||
</#if>
|
||||
</#assign>
|
||||
@name = @{
|
||||
if (userName.isEmpty)
|
||||
""
|
||||
@ -29,6 +50,7 @@
|
||||
userName
|
||||
}
|
||||
|
||||
<a href="@url" @for((k, v) <- attr) { @(s"$k=$v") }>
|
||||
<img class="user-avatar @clazz" title="@name" src="@src" alt="@name" />
|
||||
<#-- TODO: attrs here -->
|
||||
<a href="${url}" @for((k, v) <- attr) { @(s"$k=$v") }>
|
||||
<img class="user-avatar ${clazz}" title="${name}" src="${src}" alt="${name}" />
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user