mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-27 07:03:26 +08:00
Form calls
This commit is contained in:
parent
09fef55e49
commit
95b9b2aa76
@ -1,6 +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 "*/projects/channels/helper/popoverColorPicker.ftlh" as popoverColorPicker />
|
<#import "*/projects/channels/helper/popoverColorPicker.ftlh" as popoverColorPicker />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import ore.OreConfig
|
@import ore.OreConfig
|
||||||
@import views.html.helper.{CSRF, form}
|
@import views.html.helper.{CSRF, form}
|
||||||
@ -16,13 +18,13 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title"></h4>
|
<h4 class="modal-title"></h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = routes.Application.showHome()) {
|
<@form.form action=routes.getRouteUrl("showHome") method="GET">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<label for="channel-input"><@spring.message "channel.name" /></label>
|
<label for="channel-input"><@spring.message "channel.name" /></label>
|
||||||
<input class="form-control channel-input" name="channel-input" type="text" value=""
|
<input class="form-control channel-input" name="channel-input" type="text" value=""
|
||||||
maxlength="@config.ore.channels.maxNameLen"/>
|
maxlength="${config.ore.channels.maxNameLen}"/>
|
||||||
<input type="hidden" name="channel-color-input" class="channel-color-input" value="" />
|
<input type="hidden" name="channel-color-input" class="channel-color-input" value="" />
|
||||||
<a href="#">
|
<a href="#">
|
||||||
<span class="color-picker" data-toggle="popover" data-placement="right" data-trigger="hover">
|
<span class="color-picker" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||||
@ -51,7 +53,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<input type="submit" value="" class="btn btn-primary" disabled />
|
<input type="submit" value="" class="btn btn-primary" disabled />
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +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 "*/projects/channels/helper/modalManage.ftlh" as modalManage />
|
<#import "*/projects/channels/helper/modalManage.ftlh" as modalManage />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import controllers.sugar.Requests.OreRequest
|
@import controllers.sugar.Requests.OreRequest
|
||||||
@import models.viewhelper.ProjectData
|
@import models.viewhelper.ProjectData
|
||||||
@ -58,12 +60,11 @@
|
|||||||
id="channel-delete-${channel.id}" data-channel-delete="safe-delete"
|
id="channel-delete-${channel.id}" data-channel-delete="safe-delete"
|
||||||
data-channel-id="${channel.id}">
|
data-channel-id="${channel.id}">
|
||||||
|
|
||||||
@form(action = routes.getRouteUrl("channels.delete",
|
<@form.form method="POST" action=routes.getRouteUrl("channels.delete", p.project.ownerName, p.project.slug, channel.name)
|
||||||
p.project.ownerName, p.project.slug, channel.name),
|
id="form-delete-${channel.id}"
|
||||||
Symbol("id") -> s"form-delete-${channel.id}",
|
class="form-channel-delete">
|
||||||
Symbol("class") -> "form-channel-delete") {
|
<@csrf.formField />
|
||||||
@CSRF.formField
|
</@form.form>
|
||||||
}
|
|
||||||
</#if>
|
</#if>
|
||||||
Delete
|
Delete
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import controllers.sugar.Requests.OreRequest
|
@import controllers.sugar.Requests.OreRequest
|
||||||
@import models.viewhelper.{ProjectData, ScopedProjectData}
|
@import models.viewhelper.{ProjectData, ScopedProjectData}
|
||||||
@ -210,14 +212,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
@form(action = routes.getRouteUrl("projects.save", p.project.ownerName, p.project.slug), Symbol("id") -> "save",
|
<@form.form action=routes.getRouteUrl("projects.save", p.project.ownerName, p.project.slug) method="POST" id="save" class="pull-right">
|
||||||
Symbol("class") -> "pull-right") {
|
<@csrf.formField />
|
||||||
@CSRF.formField
|
|
||||||
<input type="hidden" id="update-icon" name="update-icon" value="false" />
|
<input type="hidden" id="update-icon" name="update-icon" value="false" />
|
||||||
<button type="submit" name="save" class="btn btn-success btn-spinner" data-icon="fa-check">
|
<button type="submit" name="save" class="btn btn-success btn-spinner" data-icon="fa-check">
|
||||||
<i class="fas fa-check"></i> Save changes
|
<i class="fas fa-check"></i> Save changes
|
||||||
</button>
|
</button>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -249,13 +250,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
@form(action = routes.getRouteUrl("projects.rename", p.project.ownerName, p.project.slug), Symbol("id") -> "rename") {
|
<@form.form action=routes.getRouteUrl("projects.rename", p.project.ownerName, p.project.slug) method="POST" id="rename">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "channel.edit.close" />
|
<@spring.message "channel.edit.close" />
|
||||||
</button>
|
</button>
|
||||||
<input type="submit" name="rename" value="<@spring.message "project.rename" />" class="btn btn-warning">
|
<input type="submit" name="rename" value="<@spring.message "project.rename" />" class="btn btn-warning">
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -271,19 +272,19 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="label-delete"><@spring.message "project.delete.title" /></h4>
|
<h4 class="modal-title" id="label-delete"><@spring.message "project.delete.title" /></h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = routes.getRouteUrl("projects.softDelete", p.project.ownerName, p.project.slug)) {
|
<@form.form action=routes.getRouteUrl("projects.softDelete", p.project.ownerName, p.project.slug) method="POST">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<@spring.message "project.delete.info" />
|
<@spring.message "project.delete.info" />
|
||||||
<br>
|
<br>
|
||||||
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
||||||
<br>
|
<br>
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
<@spring.message "project.delete.info.uniqueid", p.project.name />
|
<@spring.messageArgs "project.delete.info.uniqueid", p.project.name />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "channel.edit.close" />
|
<@spring.message "channel.edit.close" />
|
||||||
</button>
|
</button>
|
||||||
@ -291,7 +292,7 @@
|
|||||||
value="<@spring.message "general.delete" />" class="btn btn-danger">
|
value="<@spring.message "general.delete" />" class="btn btn-danger">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,6 +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 "*/layout/base.ftlh" as base />
|
<#import "*/layout/base.ftlh" as base />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import controllers.sugar.Requests.OreRequest
|
@import controllers.sugar.Requests.OreRequest
|
||||||
@import models.querymodels.ViewTag
|
@import models.querymodels.ViewTag
|
||||||
@ -148,32 +150,31 @@
|
|||||||
}
|
}
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
@form(action = routes.getRouteUrl("versions.upload", ownerName, projectSlug),
|
<@form.form action=routes.getRouteUrl("versions.upload", ownerName, projectSlug) method="POST"
|
||||||
Symbol("enctype") -> "multipart/form-data", Symbol("id") -> "form-upload") {
|
enctype="multipart/form-data" id="form-upload">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<label class="btn btn-default pull-left" for="pluginFile">
|
<label class="btn btn-default pull-left" for="pluginFile">
|
||||||
<input id="pluginFile" name="pluginFile" type="file" style="display: none;">
|
<input id="pluginFile" name="pluginFile" type="file" style="display: none;">
|
||||||
<@spring.message "version.create.selectFile" />
|
<@spring.message "version.create.selectFile" />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
${projects.helper.alertFile()}
|
${projects.helper.alertFile()}
|
||||||
}
|
</@form.form>
|
||||||
|
|
||||||
<#if pending??>
|
<#if pending??>
|
||||||
@* Ready to go! *@
|
@* Ready to go! *@
|
||||||
@defining(pending.get) { version: PendingVersion =>
|
@defining(pending.get) { version: PendingVersion =>
|
||||||
@form(action = routes.getRouteUrl("versions.publish",
|
<@form.form method="POST" action=routes.getRouteUrl("versions.publish", ownerName, projectSlug, version.versionString)
|
||||||
ownerName, projectSlug, version.versionString),
|
id="form-publish" class="pull-right">
|
||||||
Symbol("id") -> "form-publish", Symbol("class") -> "pull-right") {
|
<@csrf.formField />
|
||||||
@CSRF.formField
|
|
||||||
<input type="hidden" class="channel-color-input" name="channel-color-input"
|
<input type="hidden" class="channel-color-input" name="channel-color-input"
|
||||||
value="@config.defaultChannelColor.hex" />
|
value="${config.defaultChannelColor.hex}" />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<input type="submit" name="create" value="<@spring.message "version.create.publish" />"
|
<input type="submit" name="create" value="<@spring.message "version.create.publish" />"
|
||||||
class="btn btn-primary" />
|
class="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
}
|
}
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import controllers.sugar.Requests.OreRequest
|
@import controllers.sugar.Requests.OreRequest
|
||||||
@import models.viewhelper.{ScopedProjectData, VersionData}
|
@import models.viewhelper.{ScopedProjectData, VersionData}
|
||||||
@ -69,13 +71,12 @@
|
|||||||
<div>
|
<div>
|
||||||
|
|
||||||
<#if !v.isRecommended && sp.perms(Permission.EditVersion) && v.v.visibility != Visibility.SoftDelete>
|
<#if !v.isRecommended && sp.perms(Permission.EditVersion) && v.v.visibility != Visibility.SoftDelete>
|
||||||
@form(action = versionRoutes.setRecommended(
|
<@form.form method="POST" action=routes.getRouteUrl("versions.setRecommended", v.p.project.ownerName, v.p.project.slug, v.v.versionString) class="form-inline">
|
||||||
v.p.project.ownerName, v.p.project.slug, v.v.versionString), Symbol("class") -> "form-inline") {
|
<@csrf.formField />
|
||||||
@CSRF.formField
|
|
||||||
<button type="submit" class="btn btn-info">
|
<button type="submit" class="btn btn-info">
|
||||||
<i class="fas fa-gem"></i> Set recommended
|
<i class="fas fa-gem"></i> Set recommended
|
||||||
</button>
|
</button>
|
||||||
}
|
</@form.form>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#if request.headerData.globalPerm(Permission.Reviewer)>
|
<#if request.headerData.globalPerm(Permission.Reviewer)>
|
||||||
@ -233,21 +234,21 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="label-delete"><@spring.message "version.delete.title" /></h4>
|
<h4 class="modal-title" id="label-delete"><@spring.message "version.delete.title" /></h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = versionRoutes.softDelete(v.p.project.ownerName, v.p.project.slug, v.v.versionString)) {
|
<@form.form method="POST" action=routes.getRouteUrl("versions.softDelete", v.p.project.ownerName, v.p.project.slug, v.v.versionString)>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<@spring.message "version.delete.info" />
|
<@spring.message "version.delete.info" />
|
||||||
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "channel.edit.close" />
|
<@spring.message "channel.edit.close" />
|
||||||
</button>
|
</button>
|
||||||
<input type="submit" name="delete" value="<@spring.message "general.delete" />" class="btn btn-danger">
|
<input type="submit" name="delete" value="<@spring.message "general.delete" />" class="btn btn-danger">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -264,20 +265,20 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="label-delete"><@spring.message "general.restore" /></h4>
|
<h4 class="modal-title" id="label-delete"><@spring.message "general.restore" /></h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = versionRoutes.restore(v.p.project.ownerName, v.p.project.slug, v.v.versionString)) {
|
<@form.form method="POST" action=routes.getRouteUrl("versions.restore", v.p.project.ownerName, v.p.project.slug, v.v.versionString)>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "channel.edit.close" />
|
<@spring.message "channel.edit.close" />
|
||||||
</button>
|
</button>
|
||||||
<input type="submit" name="delete" value="<@spring.message "general.restore" />" class="btn btn-success">
|
<input type="submit" name="delete" value="<@spring.message "general.restore" />" class="btn btn-success">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -292,20 +293,20 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="label-delete"><@spring.message "general.harddelete" /></h4>
|
<h4 class="modal-title" id="label-delete"><@spring.message "general.harddelete" /></h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = versionRoutes.delete(v.p.project.ownerName, v.p.project.slug, v.v.versionString)) {
|
<@form.form method="POST" action=routes.getRouteUrl("versions.delete", v.p.project.ownerName, v.p.project.slug, v.v.versionString)>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
<textarea name="comment" class="textarea-delete-comment form-control" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "channel.edit.close" />
|
<@spring.message "channel.edit.close" />
|
||||||
</button>
|
</button>
|
||||||
<input type="submit" name="delete" value="<@spring.message "general.harddelete" />" class="btn btn-danger">
|
<input type="submit" name="delete" value="<@spring.message "general.harddelete" />" class="btn btn-danger">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -140,9 +140,11 @@ TODO: this is a layout, should we move/rename it?
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="label-flag">Flag project</h4>
|
<h4 class="modal-title" id="label-flag">Flag project</h4>
|
||||||
</div>
|
</div>
|
||||||
@form(action = Projects.flag(
|
<#import "*/utils/form.ftlh" as form>
|
||||||
p.project.ownerName, p.project.slug)) {
|
<#-- todo: Projects.flag -->
|
||||||
@CSRF.formField
|
<@form.form action=Projects.flag( p.project.ownerName, p.project.slug)>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
<@csrf.formField />
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<ul class="list-group list-flags">
|
<ul class="list-group list-flags">
|
||||||
<#list FlagReason.values.indices as i>
|
<#list FlagReason.values.indices as i>
|
||||||
@ -165,7 +167,7 @@ TODO: this is a layout, should we move/rename it?
|
|||||||
</button>
|
</button>
|
||||||
<button type="submit" class="btn btn-primary">Flag</button>
|
<button type="submit" class="btn btn-primary">Flag</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
@import ore.OreConfig
|
@import ore.OreConfig
|
||||||
@import ore.models.user.role.UserRoleModel
|
@import ore.models.user.role.UserRoleModel
|
||||||
@ -49,14 +51,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body"><@spring.message "project.removeMember.confirm" /></div>
|
<div class="modal-body"><@spring.message "project.removeMember.confirm" /></div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@form(action = removeCall, Symbol("class") -> "form-inline") {
|
<#-- todo: removeCall, gotten from settings template -->
|
||||||
@CSRF.formField
|
<@form.form action=removeCall method="POST" class="form-inline">
|
||||||
|
<@csrf.formField />
|
||||||
<input type="hidden" name="username" />
|
<input type="hidden" name="username" />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||||
<@spring.message "general.close" />
|
<@spring.message "general.close" />
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" class="btn btn-danger"><@spring.message "general.remove" /></button>
|
<button type="submit" class="btn btn-danger"><@spring.message "general.remove" /></button>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -81,13 +84,14 @@
|
|||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#if saveCall??>
|
<#if saveCall??>
|
||||||
@form(action = saveCall, Symbol("id") -> "save") {
|
<#-- todo: saveCall, gotten from settings template -->
|
||||||
@CSRF.formField
|
<@form.form action=saveCall method="POST" id="save">
|
||||||
|
<@csrf.formField />
|
||||||
<button class="btn-members-save btn btn-default btn-panel btn-xs" data-toggle="tooltip"
|
<button class="btn-members-save btn btn-default btn-panel btn-xs" data-toggle="tooltip"
|
||||||
data-placement="top" data-title="<@spring.message "org.users.save" />" style="display: none;">
|
data-placement="top" data-title="<@spring.message "org.users.save" />" style="display: none;">
|
||||||
<i class="fas fa-paper-plane"></i>
|
<i class="fas fa-paper-plane"></i>
|
||||||
</button>
|
</button>
|
||||||
}
|
</@form.form>
|
||||||
</#if>
|
</#if>
|
||||||
</div>
|
</div>
|
||||||
</#if>
|
</#if>
|
||||||
@ -99,7 +103,7 @@
|
|||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@userAvatar(Some(user.name), user.avatarUrl, clazz = "user-avatar-xs")
|
@userAvatar(Some(user.name), user.avatarUrl, clazz = "user-avatar-xs")
|
||||||
<a class="username" href="${routes.getRouteUrl("users.showProjects", user.name)}">
|
<a class="username" href="${routes.getRouteUrl("users.showProjects", user.name)}">
|
||||||
@user.name
|
${user.name}
|
||||||
</a>
|
</a>
|
||||||
<p style="display: none;" class="role-id">${role.id}</p>
|
<p style="display: none;" class="role-id">${role.id}</p>
|
||||||
<#if editable && perms.has(Permission.ManageSubjectMembers) && !role.role.permissions.has(Permission.IsOrganizationOwner)>
|
<#if editable && perms.has(Permission.ManageSubjectMembers) && !role.role.permissions.has(Permission.IsOrganizationOwner)>
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
<#import "*/utils/modal.ftlh" as modal />
|
<#import "*/utils/modal.ftlh" as modal />
|
||||||
<#import "*/utils/prompt.ftlh" as prompt />
|
<#import "*/utils/prompt.ftlh" as prompt />
|
||||||
<#import "*/utils/userAvatar.ftlh" as userAvatar />
|
<#import "*/utils/userAvatar.ftlh" as userAvatar />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
<#--
|
<#--
|
||||||
@(u: UserData, o: Option[(OrganizationData, ScopedOrganizationData)], additionalScripts: Html = Html(""))(content: Html)(implicit messages: Messages, flash: Flash, request: OreRequest[_], config: OreConfig, assetsFinder: AssetsFinder)
|
@(u: UserData, o: Option[(OrganizationData, ScopedOrganizationData)], additionalScripts: Html = Html(""))(content: Html)(implicit messages: Messages, flash: Flash, request: OreRequest[_], config: OreConfig, assetsFinder: AssetsFinder)
|
||||||
@ -160,21 +162,16 @@
|
|||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal"><@spring.message "general.close" /></button>
|
<button type="button" class="btn btn-default" data-dismiss="modal"><@spring.message "general.close" /></button>
|
||||||
@form(action = routes.Users.verify(Some(routes.Users.setLocked(
|
<@form.form method="POST" action=routes.getRouteUrl("users.verify", routes.getRouteUrl("users.setLocked", u.user.name, !u.user.isLocked, "", "")) class="form-inline">
|
||||||
user = u.user.name,
|
<@csrf.formField />
|
||||||
locked = !u.user.isLocked,
|
|
||||||
sso = None,
|
|
||||||
sig = None
|
|
||||||
).path())), Symbol("class") -> "form-inline") {
|
|
||||||
@CSRF.formField
|
|
||||||
<button type="submit" class="btn btn-primary"><@spring.message "general.continue" /></button>
|
<button type="submit" class="btn btn-primary"><@spring.message "general.continue" /></button>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</@modal.modal>
|
</@modal.modal>
|
||||||
|
|
||||||
<@modal.modal "user.tagline.edit" "modal-tagline" "label-tagline">
|
<@modal.modal "user.tagline.edit" "modal-tagline" "label-tagline">
|
||||||
@form(action = routes.Users.saveTagline(u.user.name)) {
|
<@form.form action=routes.getRouteUrl("users.saveTagline", u.user.name) method="POST">
|
||||||
@CSRF.formField
|
<@csrf.formField />
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="setting setting-no-border">
|
<div class="setting setting-no-border">
|
||||||
<div class="setting-description">
|
<div class="setting-description">
|
||||||
@ -192,7 +189,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<input type="submit" value="<@spring.message "general.save" />" class="btn btn-primary" />
|
<input type="submit" value="<@spring.message "general.save" />" class="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
}
|
</@form.form>
|
||||||
</@modal.modal>
|
</@modal.modal>
|
||||||
</@base.base>
|
</@base.base>
|
||||||
</#macro>
|
</#macro>
|
@ -1,5 +1,7 @@
|
|||||||
<#import "/spring.ftl" as spring />
|
<#import "/spring.ftl" as spring />
|
||||||
<#import "*/utils/hangar.ftlh" as hangar />
|
<#import "*/utils/hangar.ftlh" as hangar />
|
||||||
|
<#import "*/utils/form.ftlh" as form>
|
||||||
|
<#import "*/utils/csrf.ftlh" as csrf>
|
||||||
|
|
||||||
<#--
|
<#--
|
||||||
@import views.html.helper.{CSRF, form}
|
@import views.html.helper.{CSRF, form}
|
||||||
@ -71,10 +73,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
@form(action = deleteCall, Symbol("class") -> "form-inline") {
|
<#-- todo: where does this come from ._. -->
|
||||||
@CSRF.formField
|
<@form.form action=deleteCall class="form-inline">
|
||||||
|
<@csrf.formField />
|
||||||
<button type="submit" class="btn btn-danger">Delete</button>
|
<button type="submit" class="btn btn-danger">Delete</button>
|
||||||
}
|
</@form.form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -94,12 +97,13 @@
|
|||||||
<div class="page-preview page-rendered" style="display: none ;"></div>
|
<div class="page-preview page-rendered" style="display: none ;"></div>
|
||||||
|
|
||||||
<#if savable>
|
<#if savable>
|
||||||
@form(action = saveCall, Symbol("id") -> "form-editor-save") {
|
<#-- todo: where does this come from ._. -->
|
||||||
@CSRF.formField
|
<@form.form action=saveCall id="form-editor-save">
|
||||||
|
<@csrf.formField />
|
||||||
<#if extraFormValue??>
|
<#if extraFormValue??>
|
||||||
<input type="hidden" value="@extraFormValue" name="name">
|
<input type="hidden" value="@extraFormValue" name="name">
|
||||||
</#if>
|
</#if>
|
||||||
}
|
</@form.form>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<#macro form action method id="">
|
<#macro form action method id="" class="" enctype="">
|
||||||
<form action="${action}" method="${method}" <#if id??>id="${id}"</#if>>
|
<form action="${action}" method="${method}" <#if id??>id="${id}"</#if> <#if class??>class="${class}"</#if> <#if enctype??>enctype="${enctype}"</#if>>
|
||||||
<#nested>
|
<#nested>
|
||||||
</form>
|
</form>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
Loading…
Reference in New Issue
Block a user