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, 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, 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, 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, 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 Generate
url, copy the url you get and paste it in the field below,
and click the Set from url 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);
}
}
});