-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
432 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
{{define "title"}}Internal: Crowd App ({{.CrowdApp.Name}}){{end}} | ||
{{define "content"}} | ||
<div class="column is-10" style="min-height: 88vh"> | ||
<section class="hero is-info welcome is-small"> | ||
<div class="hero-body"> | ||
<div class="container"> | ||
<h1 class="title">{{.CrowdApp.Name}}</h1> | ||
</div> | ||
</div> | ||
</section> | ||
<br> | ||
<div class="columns box" style="height: fit-content"> | ||
<div class="column is-2"> | ||
<div class="buttons" style="display: block"> | ||
<a class="button is-warning is-outlined" onclick="editCrowdAppModal()"> | ||
<span class="mdi mdi-pencil"></span> Edit | ||
</a> | ||
<a class="button is-danger is-outlined" onclick="deleteCrowdAppModal()"> | ||
<span class="mdi mdi-account-multiple-minus"></span> Delete | ||
</a> | ||
</div> | ||
</div> | ||
<div class="column"> | ||
{{with .CrowdApp}} | ||
<p> | ||
App ID: {{.AppID}}<br> | ||
Name: {{.Name}}<br> | ||
Username: {{.Username}}<br> | ||
Description: {{.Description.String}}<br> | ||
Active: {{if .Active}}active{{else}}inactive{{end}}<br> | ||
</p> | ||
{{end}} | ||
</div> | ||
</div> | ||
</div> | ||
{{template "modals" .}} | ||
{{end}} | ||
|
||
{{define "modals"}} | ||
{{with .CrowdApp}} | ||
<div id="editCrowdAppModal" class="modal"> | ||
<div class="modal-background"></div> | ||
<div class="modal-content"> | ||
<div class="box"> | ||
<article class="media"> | ||
<div class="media-content"> | ||
<div class="content"> | ||
<p class="title">Are you sure you want to edit this crowd app?</p> | ||
<p><strong>This action can be undone by changing them back but be careful</strong><br> | ||
Modifications may affect other applications and the usability, proceed with caution<br> | ||
Use the fields below to modify the details</p> | ||
<form action="/internal/crowdapp/{{.AppID}}/edit" method="post"> | ||
<div class="field"> | ||
<label class="label" for="name">Name</label> | ||
<div class="control"> | ||
<input | ||
id="name" | ||
class="input" | ||
type="text" | ||
name="name" | ||
placeholder="Name" | ||
value="{{.Name}}" | ||
/> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label" for="description">Description</label> | ||
<div class="control"> | ||
<textarea | ||
id="description" | ||
class="input" | ||
name="description" | ||
placeholder="Description" | ||
>{{.Description.String}}</textarea> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label" for="active">Active</label> | ||
<div class="control"> | ||
<input | ||
id="active" | ||
class="checkbox" | ||
type="checkbox" | ||
name="active" | ||
{{if .Active}}checked{{end}} | ||
/> | ||
</div> | ||
</div> | ||
<button class="button is-danger"><span class="mdi mdi-pencil"></span> Edit | ||
crowd app | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
</div> | ||
<button class="modal-close is-large" aria-label="close"></button> | ||
</div> | ||
<div id="deleteCrowdAppModal" class="modal"> | ||
<div class="modal-background"></div> | ||
<div class="modal-content"> | ||
<div class="box"> | ||
<article class="media"> | ||
<div class="media-content"> | ||
<div class="content"> | ||
<p class="title">Are you sure you want to delete this crowd app?</p> | ||
<p>Be careful! Applications both public and internal could use this and will have to | ||
set back up manually.</p> | ||
<form action="/internal/crowdapp/{{.AppID}}/delete" method="post"> | ||
<button class="button is-danger">Delete crowd app</button> | ||
</form> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
</div> | ||
<button class="modal-close is-large" aria-label="close"></button> | ||
</div> | ||
{{end}} | ||
<script> | ||
document.querySelectorAll( | ||
".modal-background, .modal-close,.modal-card-head .delete, .modal-card-foot .button" | ||
).forEach(($el) => { | ||
const $modal = $el.closest(".modal"); | ||
$el.addEventListener("click", () => { | ||
$modal.classList.remove("is-active"); | ||
}); | ||
}); | ||
|
||
function editCrowdAppModal() { | ||
document.getElementById("editCrowdAppModal").classList.add("is-active"); | ||
} | ||
|
||
function deleteCrowdAppModal() { | ||
document.getElementById("deleteCrowdAppModal").classList.add("is-active"); | ||
} | ||
</script> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.