Commit 90293479 authored by Tomas Vaagen Gule's avatar Tomas Vaagen Gule
Browse files

#7 Show personal info

parent ea90158c
Pipeline #162154 passed with stages
in 1 minute and 50 seconds
......@@ -23,6 +23,94 @@
<div class="container">
<h1>My page</h1>
<form id="form-register-user">
<div class="input-group mb-2">
<span class="input-group-text"> <i class="fas fa-user"></i> </span>
<input
id="username"
name="username"
class="form-control"
placeholder="User name"
type="text"
required
/>
</div>
<!-- form-group// -->
<div class="input-group mb-2">
<span class="input-group-text">
<i class="fas fa-envelope"></i>
</span>
<input
id="email"
name="email"
class="form-control"
placeholder="Email address"
type="email"
required
/>
</div>
<!-- form-group// -->
<div class="input-group mb-2">
<span class="input-group-text"> <i class="fas fa-mobile"></i> </span>
<input
id="phone_number"
class="form-control"
name="phone_number"
placeholder="Phone number"
type="text"
required
/>
</div>
<!-- form-group// -->
<div class="input-group mb-2">
<span class="input-group-text"> <i class="fas fa-globe"></i> </span>
<input
id="country"
class="form-control"
name="country"
placeholder="Country"
type="text"
required
/>
</div>
<!-- form-group// -->
<div class="input-group mb-2">
<span class="input-group-text">
<i class="fas fa-building"></i>
</span>
<input
id="city"
class="form-control"
name="city"
placeholder="City"
type="text"
required
/>
</div>
<!-- form-group// -->
<div class="input-group mb-2">
<span class="input-group-text"> <i class="fas fa-hotel"></i> </span>
<input
id="street_address"
class="form-control"
name="street_address"
placeholder="Street address"
type="text"
required
/>
</div>
<!-- form-group// -->
<div class="d-grid">
<input
type="button"
class="btn btn-primary"
id="btn-create-account"
value=" Create Account "
/>
</div>
<!-- form-group// -->
</form>
</div>
<script src="scripts/defaults.js"></script>
......
getCurrentUser().then((user) => {
console.log(user);
let input = document.querySelector("#username");
input.value = user.username;
input.disabled = true;
input = document.querySelector("#email");
input.value = user.email;
input.disabled = true;
input = document.querySelector("#phone_number");
input.value = user.phone_number;
input.disabled = true;
input = document.querySelector("#country");
input.value = user.country;
input.disabled = true;
input = document.querySelector("#city");
input.value = user.city;
input.disabled = true;
input = document.querySelector("#street_address");
input.value = user.street_address;
input.disabled = true;
});
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