Added owner role, fixed reputation scaling
This commit is contained in:
parent
e9723303d8
commit
010bccc89d
3 changed files with 9 additions and 2 deletions
|
@ -39,7 +39,7 @@ let calcVote = function(up,down, type) {
|
|||
rating = Math.round(rating * Math.log(totalPadded) * 10);
|
||||
}
|
||||
|
||||
return rating * Math.log(totalPadded);
|
||||
return rating;
|
||||
}
|
||||
|
||||
let handleSubmit = async e => {
|
||||
|
|
|
@ -16,5 +16,8 @@ export async function load({ fetch, params, url }) {
|
|||
const resUser = await fetch(`/api/userGet?user=${user}`);
|
||||
const postJsonUser = (await resUser.json()) || {};
|
||||
|
||||
return { postJson, id, postJsonUser, user };
|
||||
const resUserBio = await fetch(`/api/userBio?user=${user}`);
|
||||
const postJsonUserBio = (await resUserBio.json()) || {};
|
||||
|
||||
return { postJson, id, postJsonUser, postJsonUserBio, user };
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
export let data;
|
||||
|
||||
let userData = data.postJsonUser.data;
|
||||
let userBio = data.postJsonUserBio.data;
|
||||
</script>
|
||||
|
||||
{#if userData}
|
||||
|
@ -26,6 +27,9 @@
|
|||
<p>
|
||||
<b>Downvotes:</b> {userData.downvotes}
|
||||
</p>
|
||||
{#if userBio && userBio.roles == 69}
|
||||
<p><b>This user is an Owner.</b></p>
|
||||
{/if}
|
||||
</span>
|
||||
<span slot="footer">
|
||||
|
||||
|
|
Loading…
Reference in a new issue