diff --git a/assets/css/pretendo-common.css b/assets/css/pretendo-common.css index 01a1614..cdce758 100644 --- a/assets/css/pretendo-common.css +++ b/assets/css/pretendo-common.css @@ -362,6 +362,9 @@ input[type="text"], input[type="password"], textarea { box-sizing: border-box; resize: none; } +input[type="text"].inline, input[type="password"].inline, textarea.inline { + width: auto; +} label { font-size: 1em; diff --git a/assets/css/pretendo-pnid.css b/assets/css/pretendo-pnid.css index 0118f35..6b315d1 100644 --- a/assets/css/pretendo-pnid.css +++ b/assets/css/pretendo-pnid.css @@ -22,6 +22,31 @@ body footer .content { max-width: 100vw; padding: 3rem 4rem; } +.infoContainer.hide { + display: none; +} +.infoList { + display: block; + padding: 1em 0; + font-weight: bold; + color: #000; + margin: 0; +} +.infoList span { + font-weight: normal; + display: inline-block; + color: #707070; + width: 6em; +} +.infoList + .infoList { + border-top: 1px solid #afafaf; +} +.infoContainer .btn { + margin-top: 1em; +} +.link-margin { + margin: 0 1em; +} /* aside navigation */ nav.userNav { diff --git a/assets/js/api.js b/assets/js/api.js index 26e42dc..efa373e 100644 --- a/assets/js/api.js +++ b/assets/js/api.js @@ -40,6 +40,24 @@ function login() { } } +function editInfo() { + var xhr = postAjax('/api/v1/editaccount', { + email: document.getElementById('email_input').value, + username: document.getElementById('username_input').value + }); + xhr.onload = function () { + if (xhr.responseText.charAt(0) !== "{") { + return showErrorPopup('Whoops, something went wrong. Try again later.'); + } + response = JSON.parse(xhr.responseText); + if (response.success === true) { + location.pathname = '/pnid/dashboard'; + } else if (response.errors) { + showErrorPopup(response.errors); + } + } +} + function passwordForgot() { var xhr = postAjax('/api/v1/passwordforgot', { email: document.getElementById('email_input').value diff --git a/assets/js/pnid.js b/assets/js/pnid.js new file mode 100644 index 0000000..571669a --- /dev/null +++ b/assets/js/pnid.js @@ -0,0 +1,4 @@ +function toggleEditInfo() { + document.getElementById('userInfo').classList.toggle('hide'); + document.getElementById('editInfo').classList.toggle('hide'); +} \ No newline at end of file diff --git a/views/dashboard.hbs b/views/dashboard.hbs index 62a7feb..6bee9e4 100644 --- a/views/dashboard.hbs +++ b/views/dashboard.hbs @@ -6,15 +6,31 @@ +
{{> nav-default }} - +{{ locale.dashboard.account.caption }}
Username: {{ user.user.pnid.username }}
+Email: {{ user.user.email }}
+ +