{{ post.title }}
-{{ post.content }}
- {{ ../locale.news.button_text }} -diff --git a/assets/css/pretendo-auth.css b/assets/css/pretendo-auth.css index 1eb5953..76526d9 100644 --- a/assets/css/pretendo-auth.css +++ b/assets/css/pretendo-auth.css @@ -1,45 +1,45 @@ body.flex.center { - justify-content: center; - align-items: center; + justify-content: center; + align-items: center; } body footer { - padding: 0; - background-color: transparent; + padding: 0; + background-color: transparent; } body footer .content { - border-radius: 0; - background-color: transparent; - padding: 1em 0; - box-shadow: none; - width: 30rem; - max-width: 100vw; + border-radius: 0; + background-color: transparent; + padding: 1em 0; + box-shadow: none; + width: 30rem; + max-width: 100vw; } /* login/register card */ .card { - background-color: white; - box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.07); - width: 35rem; - max-width: 100%; + background-color: white; + box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.07); + width: 35rem; + max-width: 100%; } .card .content { - padding: 0 3em 4em 3em; + padding: 0 3em 4em 3em; } .card .head { - background-color: #673ab7; - color: white; - font-size: 1em; - font-weight: normal; - padding: 1.5em 2em; - margin: 0; + background-color: #673ab7; + color: white; + font-size: 1em; + font-weight: normal; + padding: 1.5em 2em; + margin: 0; } .card .content .btnMargin { - display: block; - width: 100%; - margin: 3em 0 0 0; + display: block; + width: 100%; + margin: 3em 0 0 0; } .card .content .lowText { - text-align: right; - color: #707070; + text-align: right; + color: #707070; } \ No newline at end of file diff --git a/assets/css/pretendo-common.css b/assets/css/pretendo-common.css index cdce758..f8c7c97 100644 --- a/assets/css/pretendo-common.css +++ b/assets/css/pretendo-common.css @@ -304,6 +304,11 @@ button, .btn, .btn-alt { padding: .5em 1.5em; } +button:disabled, .btn:disabled, .btn-alt:disabled { + cursor: not-allowed; + background: #bbacd6; +} + /* components - profiles */ /* profiles */ .cardProfiles { @@ -315,24 +320,24 @@ button, .btn, .btn-alt { min-width: 250px; width: 50%; max-width: 550px; - margin-bottom: 10px; - display: flex; + margin-bottom: 10px; + display: flex; } .profileIcon { - margin-right: 10px; - width: 80px; height: 80px; + margin-right: 10px; + width: 80px; height: 80px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.5); } .profileText { width: calc(100% - 130px); - min-width: 200px; - display: flex; - flex-direction: column; - justify-content: center; + min-width: 200px; + display: flex; + flex-direction: column; + justify-content: center; } .profileText h2 { - margin: 0; + margin: 0; } .profileText p { margin-top: 5px; @@ -394,22 +399,22 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus { } .error { - background-color: #eea9a9; - border-left: 3px solid #d83434; - padding: 1em; - color: rgba(0, 0, 0, 0.7); + background-color: #eea9a9; + border-left: 3px solid #d83434; + padding: 1em; + color: rgba(0, 0, 0, 0.7); } .error.hide { - display: none; + display: none; } .success { - background-color: #9fc983; - border-left: 3px solid #337419; - padding: 1em; - color: rgba(0, 0, 0, 0.7); + background-color: #9fc983; + border-left: 3px solid #337419; + padding: 1em; + color: rgba(0, 0, 0, 0.7); } .success.hide { - display: none; + display: none; } @media screen and (max-width: 500px) { diff --git a/assets/css/pretendo-contact.css b/assets/css/pretendo-contact.css index 2f41e97..fb7fa2b 100644 --- a/assets/css/pretendo-contact.css +++ b/assets/css/pretendo-contact.css @@ -1,15 +1,15 @@ .input-container { - display: flex; - flex-direction: row; + display: flex; + flex-direction: row; } .input-container > * { - flex: 1; + flex: 1; } .input-container > *:first-child { - margin-right: 3em; + margin-right: 3em; } @media screen and (max-width: 1000px) { - .input-container { - flex-direction: column; - } + .input-container { + flex-direction: column; + } } \ No newline at end of file diff --git a/assets/css/pretendo-home.css b/assets/css/pretendo-home.css index 33eedac..3a17ed8 100644 --- a/assets/css/pretendo-home.css +++ b/assets/css/pretendo-home.css @@ -1,33 +1,33 @@ /* home header */ header { - text-align: center; - color: white; - background: #673db6; - padding: 5rem 1rem; + text-align: center; + color: white; + background: #673db6; + padding: 5rem 1rem; } header hr { - width: 175px; + width: 175px; height: 2px; - background: white; - display: inline-block; - border: 0; - margin: 0 auto; - display: block; + background: white; + display: inline-block; + border: 0; + margin: 0 auto; + display: block; } header h1 { - font-size: 3.5em; + font-size: 3.5em; font-weight: 400; letter-spacing: 0.25em; - margin: 0; - margin-bottom: 10px; - text-transform: uppercase; + margin: 0; + margin-bottom: 10px; + text-transform: uppercase; } header h3 { - font-weight: normal; - max-width: 80%; - display: inline-block; - font-size: 1.1rem; + font-weight: normal; + max-width: 80%; + display: inline-block; + font-size: 1.1rem; } /* news cards */ @@ -35,59 +35,59 @@ header h3 { padding: 20px; border: 1px solid #9474cc; border-radius: 10px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07); - position: relative; - margin-left: 3em; - height: 100%; - display: flex; - flex-direction: column; - align-items: flex-start; + position: relative; + margin-left: 3em; + height: 100%; + display: flex; + flex-direction: column; + align-items: flex-start; } .smallCard h3 { font-size: 1.5em; margin: 0; } .smallCard p { - flex: 1; + flex: 1; } /* specific */ .smallCardWidth { - width: 100%; + width: 100%; max-width: 300px; } @media screen and (max-width: 1050px) { .bigCard.cont-flex { - flex-direction: column; - } - .bigCard > .flex-item { - margin-bottom: 3em; - } - .smallCardWidth .smallCard { - margin-left: 0; - margin: 1em; - } - .bigCard.cont-flex > .cont-flex { - align-items: center; - justify-content: center; - } + flex-direction: column; + } + .bigCard > .flex-item { + margin-bottom: 3em; + } + .smallCardWidth .smallCard { + margin-left: 0; + margin: 1em; + } + .bigCard.cont-flex > .cont-flex { + align-items: center; + justify-content: center; + } } @media screen and (max-width: 888px) { .profile { - width: 100%; - max-width: 100%; - min-width: 100%; - } - .smallCard { - width: 100%; - max-width: 250px; - height: auto; - } - .bigCard.cont-flex > .cont-flex { - flex-direction: column; - } - header h1 { - font-size: 2.5em; - } + width: 100%; + max-width: 100%; + min-width: 100%; + } + .smallCard { + width: 100%; + max-width: 250px; + height: auto; + } + .bigCard.cont-flex > .cont-flex { + flex-direction: column; + } + header h1 { + font-size: 2.5em; + } } \ No newline at end of file diff --git a/assets/css/pretendo-news.css b/assets/css/pretendo-news.css index 3b25a0a..9ef438f 100644 --- a/assets/css/pretendo-news.css +++ b/assets/css/pretendo-news.css @@ -4,7 +4,7 @@ border: 1px solid rgb(165, 165, 165); border-radius: 10px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07); - position: relative; + position: relative; margin: .5em; width: calc(50% - 1em ); box-sizing: border-box; diff --git a/assets/css/pretendo-pnid.css b/assets/css/pretendo-pnid.css index 6b315d1..9be911f 100644 --- a/assets/css/pretendo-pnid.css +++ b/assets/css/pretendo-pnid.css @@ -1,15 +1,15 @@ body .contentWrapper.userPage { - display: flex; - justify-content: center; - height: 100%; - margin: 10rem 0 7rem 0 !important; /*im sorry, I had to*/ + display: flex; + justify-content: center; + height: 100%; + margin: 10rem 0 7rem 0 !important; /*im sorry, I had to*/ } body footer { - padding: 0; - box-shadow: 0 -3px 10px 0px rgba(0, 0, 0, 0.07); + padding: 0; + box-shadow: 0 -3px 10px 0px rgba(0, 0, 0, 0.07); } body footer .content { - border-radius: 0; + border-radius: 0; } /* content card */ @@ -17,160 +17,160 @@ body footer .content { background-color: white; box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.07); box-sizing: border-box; - color: #707070; - width: 40rem; - max-width: 100vw; - padding: 3rem 4rem; + color: #707070; + width: 40rem; + max-width: 100vw; + padding: 3rem 4rem; } .infoContainer.hide { - display: none; + display: none; } .infoList { - display: block; - padding: 1em 0; - font-weight: bold; - color: #000; - margin: 0; + display: block; + padding: 1em 0; + font-weight: bold; + color: #000; + margin: 0; } .infoList span { - font-weight: normal; - display: inline-block; - color: #707070; - width: 6em; + font-weight: normal; + display: inline-block; + color: #707070; + width: 6em; } .infoList + .infoList { - border-top: 1px solid #afafaf; + border-top: 1px solid #afafaf; } .infoContainer .btn { - margin-top: 1em; + margin-top: 1em; } .link-margin { - margin: 0 1em; + margin: 0 1em; } /* aside navigation */ nav.userNav { - padding: 1em 3em 1em 1em; + padding: 1em 3em 1em 1em; } nav.userNav .userNavProfile { - text-align: center; + text-align: center; } nav.userNav .userNavProfile::after { - content: ""; - width: 10em; - display: inline-block; - height: 1px; - background-color: rgba(0, 0, 0, 0.5);; + content: ""; + width: 10em; + display: inline-block; + height: 1px; + background-color: rgba(0, 0, 0, 0.5);; } nav.userNav .userNavProfile img { - width: 7em; - height: 7em; - background-color: white; - border: 1px solid rgba(0, 0, 0, 0.5); - border-radius: 50%; - display: inline-block; + width: 7em; + height: 7em; + background-color: white; + border: 1px solid rgba(0, 0, 0, 0.5); + border-radius: 50%; + display: inline-block; } nav.userNav .userNavProfile .name { - font-size: 1.5em; - font-weight: bold; - color: #353535; - margin: .5em 1em 0 1em; + font-size: 1.5em; + font-weight: bold; + color: #353535; + margin: .5em 1em 0 1em; } nav.userNav .links { - padding: .7em 0; + padding: .7em 0; } nav.userNav .links .navItem { - display: block; - margin: .3em .5em; - font-size: 1em; - color: #707070; - text-decoration: none; + display: block; + margin: .3em .5em; + font-size: 1em; + color: #707070; + text-decoration: none; } nav.userNav .links .navItem:hover { - color: #505050; - font-weight: bold; - text-decoration: none; + color: #505050; + font-weight: bold; + text-decoration: none; } nav.userNav .links .navItem.active { - color: #673ab7; - font-weight: bold; + color: #673ab7; + font-weight: bold; } /* email popup */ .email_popup { - margin: 10px 4em; - margin-top: 55px; - background-color: white; - border: 1px solid #d1d1d1; - padding: 1em 2em; - transition: transform .2s ease-in, max-height .2s, padding .5s; - overflow: hidden; - max-height: 100vh; + margin: 10px 4em; + margin-top: 55px; + background-color: white; + border: 1px solid #d1d1d1; + padding: 1em 2em; + transition: transform .2s ease-in, max-height .2s, padding .5s; + overflow: hidden; + max-height: 100vh; } .email_popup.closed { - transform: translateY(-15rem); - max-height: 0; - padding: 0; + transform: translateY(-15rem); + max-height: 0; + padding: 0; } .email_popup p { - padding: 0; - display: inline-block; + padding: 0; + display: inline-block; } .email_popup span { - float: right; + float: right; } .email_popup button { - margin: .4em; + margin: .4em; } @media screen and (max-width: 950px) { - body .contentWrapper.userPage { - flex-direction: column; - } - nav.userNav { - display: flex; - flex-direction: row; - justify-content: center; - } - .email_popup { - margin: 10px; - margin-top: 55px; - } - .contentCard { - display: block; - margin: auto; - } - nav.userNav .links { - display: flex; - flex-direction: row; - align-items: flex-end; - } - nav.userNav .links .navItem { - display: inline-block; - } - nav.userNav .userNavProfile::after { - display: none; - } + body .contentWrapper.userPage { + flex-direction: column; + } + nav.userNav { + display: flex; + flex-direction: row; + justify-content: center; + } + .email_popup { + margin: 10px; + margin-top: 55px; + } + .contentCard { + display: block; + margin: auto; + } + nav.userNav .links { + display: flex; + flex-direction: row; + align-items: flex-end; + } + nav.userNav .links .navItem { + display: inline-block; + } + nav.userNav .userNavProfile::after { + display: none; + } } @media screen and (max-width: 500px) { - .contentCard { - width: 100vw; - } + .contentCard { + width: 100vw; + } } @media screen and (max-width: 450px) { - nav.userNav { - display: flex; - flex-direction: column; - justify-content: center; - } - nav.userNav .links { - display: flex; - flex-direction: column; - align-items: center; - } - nav.userNav .userNavProfile::after { - display: inline-block; - } + nav.userNav { + display: flex; + flex-direction: column; + justify-content: center; + } + nav.userNav .links { + display: flex; + flex-direction: column; + align-items: center; + } + nav.userNav .userNavProfile::after { + display: inline-block; + } } \ No newline at end of file diff --git a/assets/css/pretendo-progress.css b/assets/css/pretendo-progress.css index 39f98c4..ff91476 100644 --- a/assets/css/pretendo-progress.css +++ b/assets/css/pretendo-progress.css @@ -1,68 +1,68 @@ section.bigCardWrapper.double { - display: flex; - flex-direction: row; - max-width: 80vw; - margin: auto; + display: flex; + flex-direction: row; + max-width: 80vw; + margin: auto; } section.bigCardWrapper.double > .bigCard { - flex: 1; - padding: 1em 6em; - margin: 0; + flex: 1; + padding: 1em 6em; + margin: 0; } section.bigCardWrapper.double > .bigCard:first-child { - margin-right: 3em; + margin-right: 3em; } .listItem { - position: relative; + position: relative; } .listItem h2 { - font-size: 1rem; - color: #353535; - margin: 1em 0 0 0; + font-size: 1rem; + color: #353535; + margin: 1em 0 0 0; } .listItem p { - margin: .2em 0 0 0; + margin: .2em 0 0 0; } .listItem.state1::before, .listItem.state2::before, .listItem.state3::before { - content: ""; - position: absolute; - top: .2em; - left: -1.5em; - width: 1em; - height: 1em; - border-radius: 50%; - background-color: #f57c7c; /* state 1: no support */ + content: ""; + position: absolute; + top: .2em; + left: -1.5em; + width: 1em; + height: 1em; + border-radius: 50%; + background-color: #f57c7c; /* state 1: no support */ } .listItem.state2::before { - background-color: #e6ae65; /* state 2: partial support/bugged */ + background-color: #e6ae65; /* state 2: partial support/bugged */ } .listItem.state3::before { - background-color: #58ef81; /* state 3: full support/working */ + background-color: #58ef81; /* state 3: full support/working */ } @media screen and (max-width: 1000px) { - section.bigCardWrapper.double { - display: flex; - flex-direction: column; - } - section.bigCardWrapper.double > .bigCard { - flex: 0; - } - section.bigCardWrapper.double > .bigCard:first-child { - margin-right: 0; - margin-bottom: 3em; - } + section.bigCardWrapper.double { + display: flex; + flex-direction: column; + } + section.bigCardWrapper.double > .bigCard { + flex: 0; + } + section.bigCardWrapper.double > .bigCard:first-child { + margin-right: 0; + margin-bottom: 3em; + } } @media screen and (max-width: 500px) { - section.bigCardWrapper.double { - max-width: 100vw; - margin: 0; - } - section.bigCardWrapper.double > .bigCard { - padding: 50px; - } + section.bigCardWrapper.double { + max-width: 100vw; + margin: 0; + } + section.bigCardWrapper.double > .bigCard { + padding: 50px; + } } \ No newline at end of file diff --git a/assets/js/api.js b/assets/js/api.js index efa373e..fe5eec3 100644 --- a/assets/js/api.js +++ b/assets/js/api.js @@ -1,13 +1,21 @@ -function postAjax(url, data, success) { - var params = (typeof data == 'string') ? data : Object.keys(data).map(function (k) { +function postAjax(url, data, callbacks={}) { + const params = (typeof data == 'string') ? data : Object.keys(data).map(function (k) { return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }).join('&'); - var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); + const xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); + for (const event in callbacks) { + const handler = callbacks[event]; + + if (handler instanceof Function) { + xhr.addEventListener(event, handler); + } + } + xhr.open('POST', url); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.send(params); + xhr.send(data); return xhr; } diff --git a/locales/US_en.json b/locales/US_en.json index 9308832..ed012dd 100644 --- a/locales/US_en.json +++ b/locales/US_en.json @@ -60,6 +60,8 @@ "register": { "card": { "title": "Register", + "birthdate_text": "Birthday", + "gender_text": "Gender", "email_text": "Email Address", "username_text": "Username", "password_text": "Password", @@ -125,6 +127,6 @@ } }, "footer": { - "text": "Copyright 2018 PretendoNetwork - Site designed and developed by MrJVS, ben and Jip" + "text": "Copyright 2019 PretendoNetwork - Site designed and developed by MrJVS, ben and Jip" } } \ No newline at end of file diff --git a/locales/default.json b/locales/default.json index a61266e..a539797 100644 --- a/locales/default.json +++ b/locales/default.json @@ -48,6 +48,8 @@ "register": { "card": { "title": "ERROR", + "birthdate_text": "ERROR", + "gender_text": "ERROR", "email_text": "ERROR", "username_text": "ERROR", "password_text": "ERROR", diff --git a/package-lock.json b/package-lock.json index ab6feee..a535ed1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,6 +76,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -126,6 +127,11 @@ "normalize-path": "^2.1.1" } }, + "append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -801,11 +807,48 @@ "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz", "integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg==" }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, "buffer-shims": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" }, + "busboy": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", + "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=", + "requires": { + "dicer": "0.2.5", + "readable-stream": "1.1.x" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -1054,6 +1097,17 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "configstore": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", @@ -1280,6 +1334,38 @@ "kuler": "1.0.x" } }, + "dicer": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", + "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=", + "requires": { + "readable-stream": "1.1.x", + "streamsearch": "0.1.2" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -1944,7 +2030,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1965,12 +2052,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1985,17 +2074,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2112,7 +2204,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2124,6 +2217,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2138,6 +2232,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2145,12 +2240,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2169,6 +2266,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2249,7 +2347,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2261,6 +2360,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2346,7 +2446,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2382,6 +2483,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2401,6 +2503,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2444,12 +2547,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -3092,7 +3197,8 @@ "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "optional": true }, "lowercase-keys": { "version": "1.0.1", @@ -3260,7 +3366,6 @@ "version": "0.5.1", "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" }, @@ -3268,8 +3373,7 @@ "minimist": { "version": "0.0.8", "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, @@ -3415,6 +3519,21 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "multer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.1.tgz", + "integrity": "sha512-zzOLNRxzszwd+61JFuAo0fxdQfvku12aNJgnla0AQ+hHxFmfc/B7jBVuPr5Rmvu46Jze/iJrFpSOsD7afO8SDw==", + "requires": { + "append-field": "^1.0.0", + "busboy": "^0.2.11", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.1", + "on-finished": "^2.3.0", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + } + }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", @@ -3544,8 +3663,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-copy": { "version": "0.1.0", @@ -4505,6 +4623,11 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" }, + "streamsearch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", + "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -4674,6 +4797,11 @@ "mime-types": "~2.1.18" } }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -5082,6 +5210,11 @@ "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", diff --git a/package.json b/package.json index 4f36a24..374532d 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "mongoose": "^5.3.2", "mongoose-unique-validator": "^2.0.2", "morgan": "^1.9.1", + "multer": "^1.4.1", "nodemailer": "^4.7.0", "passport": "^0.4.0", "passport-local": "^1.0.0", diff --git a/routes/pnid.js b/routes/pnid.js index e74d1b0..bc2411f 100644 --- a/routes/pnid.js +++ b/routes/pnid.js @@ -22,7 +22,7 @@ const PNID = require('../models/pnid'); // renders register page router.get('/pnid/register', (request, response) => { - return response.render('register', { + return response.render('pnid/register', { title: 'Pretendo | Register', description: 'On the Pretendo Network ID Dashboard you can manage your personal information and make new virtual consoles to use for login on your home console.', url: request.protocol + '://' + request.get('host') + request.originalUrl, @@ -33,7 +33,7 @@ router.get('/pnid/register', (request, response) => { }); // renders login page router.get('/pnid/login', (request, response) => { - return response.render('login', { + return response.render('pnid/login', { title: 'Pretendo | Login', description: 'On the Pretendo Network ID Dashboard you can manage your personal information and make new virtual consoles to use for login on your home console.', url: request.protocol + '://' + request.get('host') + request.originalUrl, @@ -43,7 +43,7 @@ router.get('/pnid/login', (request, response) => { }); // renders password forget router.get('/pnid/forgotpassword', (request, response) => { - return response.render('forgot', { + return response.render('pnid/forgotpassword', { title: 'Pretendo | Forgot password', description: 'On the Pretendo Network ID Dashboard you can manage your personal information and make new virtual consoles to use for login on your home console.', url: request.protocol + '://' + request.get('host') + request.originalUrl, @@ -54,7 +54,7 @@ router.get('/pnid/forgotpassword', (request, response) => { }); // renders password reset page router.get('/pnid/passwordreset', (request, response) => { - return response.render('password', { + return response.render('passwordreset', { title: 'Pretendo | Password reset', description: 'On the Pretendo Network ID Dashboard you can manage your personal information and make new virtual consoles to use for login on your home console.', url: request.protocol + '://' + request.get('host') + request.originalUrl, @@ -70,7 +70,7 @@ router.get('/pnid/logout', userMiddleware.pnidAuthNeeded, (request, response) => }); // renders pnid dashboard router.get('/pnid/dashboard', userMiddleware.pnidAuthNeeded, (request, response) => { - return response.render('dashboard', { + return response.render('pnid/dashboard', { title: 'Pretendo | Dash', description: 'On the Pretendo Network ID Dashboard you can manage your personal information and make new virtual consoles to use for login on your home console.', url: request.protocol + '://' + request.get('host') + request.originalUrl, @@ -143,11 +143,18 @@ router.post('/api/v1/passwordreset', function (request, response) { * errors: Strings[messages] * } */ -router.post('/api/v1/register', recaptcha.middleware.verify, async (request, response) => { + +const multer = require('multer')(); + +router.post('/api/v1/register', multer.none(), recaptcha.middleware.verify, async (request, response) => { if (!request.body) { return apiHelper.sendApiGenericError(response); } + console.log(request.body); + + return response.send(request.body); + if (request.recaptcha.error) { logger.log('warn', `[reCaptcha ERROR] ${request.recaptcha.error} | IP: ${request.ip} | Data: ${JSON.stringify(request.body)}`); return apiHelper.sendApiError(response, 500, ['Captcha error']); diff --git a/views/404.hbs b/views/404.hbs index e2ba727..c3b392a 100644 --- a/views/404.hbs +++ b/views/404.hbs @@ -1,20 +1,20 @@ -
- {{> head-common }} - - - - -ERROR
-ERROR
+{{ locale.contact.caption }}
-{{ locale.contact.caption }}
+{{ locale.dashboard.account.caption }}
-Username: {{ user.user.pnid.username }}
-Email: {{ user.user.email }}
- -{{ locale.forgot.card.caption }}
-{{ locale.about.caption }}
-{{ locale.about.text }}
-{{ locale.about.caption }}
+{{ locale.about.text }}
+{{ locale.about.caption }}
-{{ locale.about.caption }}
+Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-Project owner, lead developer, very violent young man. Splatoon obsessed as well.
-{{ locale.latest_news.caption }}
-{{ locale.latest_news.description }}
- {{ locale.latest_news.button_text }} -{{ locale.latest_news.caption }}
+{{ locale.latest_news.description }}
+ {{ locale.latest_news.button_text }} +{{ locale.login.card.caption }}
-{{ locale.login.card.link_introduction }} {{ locale.login.card.link_text }}
-{{ user.user.pnid.username }}
- - logout + +{{ user.user.pnid.username }}
+ + logout {{else}} - {{ locale.nav.links.login }} - {{ locale.nav.links.register }} + {{ locale.nav.links.login }} + {{ locale.nav.links.register }} {{/if}} - - - - - + + + + + \ No newline at end of file diff --git a/views/password.hbs b/views/password.hbs deleted file mode 100644 index 54f41b7..0000000 --- a/views/password.hbs +++ /dev/null @@ -1,30 +0,0 @@ - - - - {{> metatags }} -{{ locale.password.card.caption }}
-{{ locale.dashboard.account.caption }}
+Username: {{ user.user.pnid.username }}
+Email: {{ user.user.email }}
+ +{{ locale.forgot.card.caption }}
+{{ locale.login.card.caption }}
+{{ locale.login.card.link_introduction }} {{ locale.login.card.link_text }}
+{{ locale.password.card.caption }}
+{{ locale.register.card.caption }}
+{{ locale.register.card.link_introduction }} {{ locale.register.card.link_text }}
+{{ locale.news.caption }}
-{{ post.content }}
- {{ ../locale.news.button_text }} -{{ locale.news.caption }}
+{{ post.content }}
+ {{ ../locale.news.button_text }} +{{ post.category }} — {{ post.dateString }}
-{{ post.category }} — {{ post.dateString }}
+{{ post.author.description }}
{{ locale.progress.summary.caption }}
-{{ locale.progress.summary.text }}
-{{ locale.progress.compatibility.caption }}
-{{ this.description }}
-{{ locale.progress.misc.caption }}
-{{ this.description }}
-{{ locale.progress.summary.caption }}
+{{ locale.progress.summary.text }}
+{{ locale.progress.compatibility.caption }}
+{{ this.description }}
+{{ locale.progress.misc.caption }}
+{{ this.description }}
+{{ locale.register.card.caption }}
-{{ locale.register.card.link_introduction }} {{ locale.register.card.link_text }}
-