Commit 393920ba authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

updates

parent 73ef53d0
/*
TODO:
Show list of registered services?
*/
// Profile Initialization
$.get( "/api/v1/profile", function(data) {
var title = data.title
var firstname = data.firstname
var lastname = data.lastname
var email = data.email
var industry = data.industry
var organisation = data.organisation
var speciality = data.speciality
// asign to HTML
$("#fullname").text(firstname+' '+lastname);
//document.getElementById('inputFirstname').value = firstname; //JS
$("#inputTitle").val(title); // jQuery
$("#inputFirstname").val(firstname);
$("#inputLastname").val(lastname);
$("#inputEmail").val(email);
$("#inputIndustry").val(industry);
$("#inputOrganisation").val(organisation);
$("#inputSpeciality").val(speciality);
})
.done(function() {
console.log("done");
})
.fail(function() {
console.log( "error" );
})
/*.always(function() {
alert( "finished" );
}) */
\ No newline at end of file
// check password and password confirmation input fields // password requirement
$('#inputNewPwd, #inputConfirm').on('keyup', function () { function checkPasswordReq(pwd) {
var isBest = false; if (pwd.length < 8) {
var isMatch = false;
// password best practice
if ($('#inputNewPwd').val().length < 8) {
$('#recommendation').html('Must be at least 8 characters').css('color', 'red');
isBest = false; isBest = false;
} else { } else {
$('#recommendation').html('').css('color', 'red');
isBest = true; isBest = true;
} }
return isBest
// match or not? }
if ($('#inputNewPwd').val() == $('#inputConfirm').val()) { \ No newline at end of file
$('#message').html('Matching').css('color', 'green');
isMatch = true;
} else {
$('#message').html('Not Matching').css('color', 'red');
isMatch = false;
}
// enable/disable update button
if (isBest && isMatch) {
$('#updateBtn').prop('disabled', false);
} else {
$('#updateBtn').prop('disabled', true);
}
});
\ No newline at end of file
// check password and password confirmation input fields
$('#inputNewPwd, #inputConfirm').on('keyup', function () {
var isBest, isMatch;
isBest = checkPasswordReq($('#inputNewPwd').val())
$('#recommendation').empty();
if (!isBest) {
$('#recommendation').html('Must be at least 8 characters').css('color', 'red');
}
// match or not?
if ($('#inputNewPwd').val() == $('#inputConfirm').val()) {
$('#message').html('Matching').css('color', 'green');
isMatch = true;
} else {
$('#message').html('Not Matching').css('color', 'red');
isMatch = false;
}
// enable/disable update button
if (isBest && isMatch) {
$('#updateBtn').prop('disabled', false);
} else {
$('#updateBtn').prop('disabled', true);
}
});
\ No newline at end of file
...@@ -32,12 +32,12 @@ html(lang="en") ...@@ -32,12 +32,12 @@ html(lang="en")
div(class="row") div(class="row")
div(class="col-3") div(class="col-3")
h5 h5
span#fullname span #{user.firstname} #{user.lastname}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="#" aria-selected="true") Profile a(class="nav-link" href="#" aria-selected="true") Profile
a(class="nav-link" href="/security" aria-selected="false") Security a(class="nav-link" href="/security" aria-selected="false") Security
a(class="nav-link" href="/services" aria-selected="false") Services a(class="nav-link" href="/services" aria-selected="false") Services
div(class="col-sm-9") div(class="col-sm-8")
if successes if successes
for success in successes for success in successes
div.alert.alert-success.alert-dismissible #{ success } div.alert.alert-success.alert-dismissible #{ success }
...@@ -47,32 +47,38 @@ html(lang="en") ...@@ -47,32 +47,38 @@ html(lang="en")
div.alert.alert-danger.alert-dismissible.fade.show #{ error } div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times; a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form#profileForm(method="POST",action="/updateProfile") form#profileForm(method="POST",action="/updateProfile")
div(class="form-group row") div(class="form-row")
label(for="title") Title div(class='form-group col-md-2')
select#inputTitle(name="inputTitle", class="form-control") label(for="title") Title
option(value="Frau") Frau // to read: https://stackoverflow.com/questions/39997579/pug-templates-how-to-mark-option-in-dropdown-list-as-selected
option(value="Herr") Herr select#inputTitle(name="inputTitle", class="form-control", value=user.title)
option(value="Frau/Herr") Frau/Herr option(value="Frau/Herr") Frau/Herr
option(value="Dr.") Dr. option(value="Frau") Frau
option(value="Prof. Dr.") Prof. Dr. option(value="Herr") Herr
div(class="form-group row") option(value="Dr.") Dr.
label(for="firstname") Vorname option(value="Prof. Dr.") Prof. Dr.
input#inputFirstname(name="inputFirstname", type="text", class="form-control", placeholder="Vorname" required) div(class='form-group col-md-3')
div(class="form-group row") label(for="firstname") Vorname
label(for="lastname") Nachname input#inputFirstname(name="inputFirstname", type="text", class="form-control", placeholder="Vorname", value=user.firstname required)
input#inputLastname(name="inputLastname", type="text", class="form-control", placeholder="Nachname" required) div(class='form-group col-md-3')
div(class="form-group row") label(for="lastname") Nachname
label(for="email") Email input#inputLastname(name="inputLastname", type="text", class="form-control", placeholder="Nachname", value=user.lastname required)
input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="Email" required) div(class="form-row")
div(class="form-group row") div(class='form-group col-md-8')
label(for="organisation") Unternehmen label(for="email") Email
input#inputOrganisation(name="inputOrganisation", type="text", class="form-control", placeholder="Unternehmen") input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="Email", value=email required)
div(class="form-group row") div(class="form-row")
label(for="industry") Branche div(class='form-group col-md-8')
input#inputIndustry(name="inputIndustry", type="text", class="form-control", placeholder="Branche") label(for="organisation") Unternehmen
div(class="form-group row") input#inputOrganisation(name="inputOrganisation", type="text", class="form-control", placeholder="Unternehmen", value=user.organisation)
label(for="speciality") Fachgebiete div(class="form-row")
input#inputSpeciality(name="inputSpeciality", type="text", class="form-control", placeholder="Fachgebiete") div(class='form-group col-md-8')
label(for="industry") Branche
input#inputIndustry(name="inputIndustry", type="text", class="form-control", placeholder="Branche", value=user.industry)
div(class="form-row")
div(class='form-group col-md-8')
label(for="speciality") Fachgebiete
input#inputSpeciality(name="inputSpeciality", type="text", class="form-control", placeholder="Fachgebiete", value=user.speciality)
input(type="submit", class="btn btn-primary", value="Update") input(type="submit", class="btn btn-primary", value="Update")
// jQuery // jQuery
...@@ -81,5 +87,5 @@ html(lang="en") ...@@ -81,5 +87,5 @@ html(lang="en")
// Bootstrap // Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/account.js") //script(src="/js/account.js")
script(src="https://transfer.hft-stuttgart.de/js/headfoot.js") script(src="https://transfer.hft-stuttgart.de/js/headfoot.js")
\ No newline at end of file
...@@ -27,12 +27,15 @@ html(lang="en") ...@@ -27,12 +27,15 @@ html(lang="en")
-o-transition-property: height,visibility; -o-transition-property: height,visibility;
transition-property: height,visibility; transition-property: height,visibility;
} }
.warning {
font-size: 11px;
}
body body
div(class="container-fluid") div(class="container-fluid")
div(class="row") div(class="row")
div(class="col-3") div(class="col-3")
h5 h5
span#fullname span #{user.firstName} #{user.lastName}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical") div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/profile" aria-selected="true") Profile a(class="nav-link" href="/profile" aria-selected="true") Profile
a(class="nav-link" href="#" aria-selected="false") Security a(class="nav-link" href="#" aria-selected="false") Security
...@@ -47,20 +50,23 @@ html(lang="en") ...@@ -47,20 +50,23 @@ html(lang="en")
div.alert.alert-danger.alert-dismissible.fade.show #{ error } div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times; a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form(class="needs-validation", method="post", action="/changePwd" novalidate) form(class="needs-validation", method="post", action="/changePwd" novalidate)
div(class="form-group row") div(class="form-row")
label(for="currPwd") Current Password div(class='form-group col-md-6')
input(id="inputCurrPwd", name="inputCurrPwd", type="password", class="form-control" required) label(for="currPwd") Current Password
div(class="invalid-feedback") Please fill in this field. input(id="inputCurrPwd", name="inputCurrPwd", type="password", class="form-control" required)
div(class="form-group row") div(class="invalid-feedback") Please fill in this field.
label(for="newPwd") New Password div(class="form-row")
input#inputNewPwd(name="inputNewPwd", type="password", class="form-control" required) div(class='form-group col-md-6')
span#recommendation label(for="newPwd") New Password
div(class="invalid-feedback") Please fill in this field. input#inputNewPwd(name="inputNewPwd", type="password", class="form-control" required)
div(class="form-group row") span#recommendation(class='warning')
label(for="confirm") Confirm New Password div(class="invalid-feedback") Please fill in this field.
input#inputConfirm(name="inputConfirm", type="password", class="form-control" required) div(class="form-row")
span#message div(class='form-group col-md-6')
div(class="invalid-feedback") Please fill in this field. label(for="confirm") Confirm New Password
input#inputConfirm(name="inputConfirm", type="password", class="form-control" required)
span#message(class='warning')
div(class="invalid-feedback") Please fill in this field.
input#updateBtn(type="submit", class="btn btn-primary", value="Update Password" disabled) input#updateBtn(type="submit", class="btn btn-primary", value="Update Password" disabled)
// jQuery // jQuery
...@@ -69,8 +75,8 @@ html(lang="en") ...@@ -69,8 +75,8 @@ html(lang="en")
// Bootstrap // Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/account.js")
script(src="/js/generalFunction.js") script(src="/js/generalFunction.js")
script(src="/js/security.js")
script(src="https://transfer.hft-stuttgart.de/js/headfoot.js") script(src="https://transfer.hft-stuttgart.de/js/headfoot.js")
script. script.
// check input fields // check input fields
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment