73 lines
2.8 KiB
Plaintext
73 lines
2.8 KiB
Plaintext
extends ../../../templates/base.pug
|
|
|
|
block content
|
|
form(method="POST", action=getUrl("settingsTarget"))
|
|
.form-group.row
|
|
.col-2
|
|
label.col-2.col-form-label(for="username") Username
|
|
.col-6
|
|
input.form-control(type="text", value=session.user._username.value, disabled, name="username", id="username")
|
|
.col-2
|
|
.form-group.row
|
|
.col-2
|
|
label.col-2.col-form-label(for="email") Email
|
|
.col-6
|
|
input.form-control(type="email", value=session.user._email.value, disabled, name="email", id="email")
|
|
.col-2
|
|
.form-group.row
|
|
.col-2
|
|
label.col-2.col-form-label(for="resources") Resources
|
|
.col-6
|
|
input.form-control(type="number", value=session.user._resources.value, name="resources", id="resources")
|
|
.col-2
|
|
.form-group.row
|
|
.col-2
|
|
label.col-2.col-form-label(for="projectId") Project id
|
|
.col-6
|
|
input.form-control(type="number", value=session.user._projectId.value, name="projectId", id="projectId")
|
|
.col-2
|
|
|
|
.form-group.row
|
|
.col-2
|
|
.col-8.form-text.text-muted.
|
|
If you don't know your resources and your project id, simply go
|
|
to your edt, click the export button, click on <em>Generate
|
|
url</em>, copy the url you get and paste it in the field below,
|
|
and click the <em>Set from url</em> button.
|
|
.col-2
|
|
|
|
.form-group.row
|
|
.col-2
|
|
label.col-2.col-from-label(for="url") Set from url
|
|
.col-4
|
|
input.form-control(type="text", id="url", placeholder="Url generated from edt")
|
|
.col-2
|
|
#urlButton.btn.btn-primary Set from url
|
|
|
|
.form-group.row
|
|
.col-4
|
|
.col-4
|
|
input.btn.btn-primary.form-control(type="submit", value="Submit")
|
|
.col-4
|
|
|
|
block extrajs
|
|
script.
|
|
var urlButton = document.getElementById('urlButton');
|
|
var url = document.getElementById('url');
|
|
var resources = document.getElementById('resources');
|
|
var projectId = document.getElementById('projectId');
|
|
|
|
urlButton.addEventListener('click', function() {
|
|
var urlContent = url.value;
|
|
var values = urlContent.split('?')[1].split('&');
|
|
for (var i = 0; i < values.length; i++) {
|
|
var params = values[i].split('=');
|
|
var key = params[0];
|
|
if (key === 'resources') {
|
|
resources.value = parseInt(params[1], 10);
|
|
} else if (key === 'projectId') {
|
|
projectId.value = parseInt(params[1], 10);
|
|
}
|
|
}
|
|
});
|