mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Compare commits
2 Commits
fiz/item-c
...
fiz/ToS-st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd06148422 | ||
|
|
a0b179561b |
@@ -44,7 +44,7 @@ describe('POST /user/auth/local/login', () => {
|
|||||||
})).to.eventually.be.rejected.and.eql({
|
})).to.eventually.be.rejected.and.eql({
|
||||||
code: 401,
|
code: 401,
|
||||||
error: 'NotAuthorized',
|
error: 'NotAuthorized',
|
||||||
message: t('accountSuspended', { communityManagerEmail: nconf.get('EMAILS_COMMUNITY_MANAGER_EMAIL'), userId: user._id }),
|
message: t('accountSuspended', { communityManagerEmail: nconf.get('EMAILS_COMMUNITY_MANAGER_EMAIL'), userId: user._id, username: user.auth.local.username }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -43,9 +43,11 @@ export default {
|
|||||||
const AUTH_SETTINGS = localStorage.getItem(LOCALSTORAGE_AUTH_KEY);
|
const AUTH_SETTINGS = localStorage.getItem(LOCALSTORAGE_AUTH_KEY);
|
||||||
const parseSettings = JSON.parse(AUTH_SETTINGS);
|
const parseSettings = JSON.parse(AUTH_SETTINGS);
|
||||||
const userId = parseSettings ? parseSettings.auth.apiId : '';
|
const userId = parseSettings ? parseSettings.auth.apiId : '';
|
||||||
|
const username = this.$store?.state?.user?.data?.auth?.local?.username || '';
|
||||||
|
|
||||||
return this.$t('accountSuspended', {
|
return this.$t('accountSuspended', {
|
||||||
userId,
|
userId,
|
||||||
|
username,
|
||||||
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -120,7 +120,6 @@
|
|||||||
<div
|
<div
|
||||||
slot="drawer-slider"
|
slot="drawer-slider"
|
||||||
class="equipment items items-one-line"
|
class="equipment items items-one-line"
|
||||||
:class="getContainerClass()"
|
|
||||||
>
|
>
|
||||||
<item
|
<item
|
||||||
v-for="(label, group) in gearTypesToStrings"
|
v-for="(label, group) in gearTypesToStrings"
|
||||||
@@ -239,86 +238,6 @@
|
|||||||
background: $gray-10 !important;
|
background: $gray-10 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.equipment.items.items-one-line {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 0 8px;
|
|
||||||
|
|
||||||
.item-wrapper {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
margin-right: 0;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.equipment-scale-default .item-wrapper {
|
|
||||||
.item {
|
|
||||||
width: 94px;
|
|
||||||
height: 92px;
|
|
||||||
}
|
|
||||||
.item-label {
|
|
||||||
width: 94px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.equipment-scale-small .item-wrapper {
|
|
||||||
.item {
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
}
|
|
||||||
.item-label {
|
|
||||||
width: 70px;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-wrapper:nth-child(4n+1) {
|
|
||||||
clear: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 769px) and (max-width: 1024px) {
|
|
||||||
.equipment.items.items-one-line {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 0 12px;
|
|
||||||
|
|
||||||
.item-wrapper {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
margin-right: 0;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.equipment-scale-default .item-wrapper {
|
|
||||||
.item {
|
|
||||||
width: 84px;
|
|
||||||
height: 82px;
|
|
||||||
}
|
|
||||||
.item-label {
|
|
||||||
width: 84px;
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.equipment-scale-small .item-wrapper {
|
|
||||||
.item {
|
|
||||||
width: 65px;
|
|
||||||
height: 65px;
|
|
||||||
}
|
|
||||||
.item-label {
|
|
||||||
width: 65px;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -432,7 +351,6 @@ export default {
|
|||||||
searchText: null,
|
searchText: null,
|
||||||
searchTextThrottled: null,
|
searchTextThrottled: null,
|
||||||
costumeMode: false,
|
costumeMode: false,
|
||||||
windowWidth: window.innerWidth,
|
|
||||||
groupByItems: [
|
groupByItems: [
|
||||||
'type', 'class',
|
'type', 'class',
|
||||||
],
|
],
|
||||||
@@ -605,27 +523,8 @@ export default {
|
|||||||
subSection: this.$t('equipment'),
|
subSection: this.$t('equipment'),
|
||||||
section: this.$t('inventory'),
|
section: this.$t('inventory'),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.handleResize = throttle(() => {
|
|
||||||
this.windowWidth = window.innerWidth;
|
|
||||||
}, 250);
|
|
||||||
window.addEventListener('resize', this.handleResize);
|
|
||||||
},
|
|
||||||
beforeDestroy () {
|
|
||||||
window.removeEventListener('resize', this.handleResize);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getContainerClass () {
|
|
||||||
const equippedCount = Object.keys(this.gearTypesToStrings).filter(group => {
|
|
||||||
const item = this.flatGear[this.activeItems[group]];
|
|
||||||
return item && item.key.indexOf('_base_0') === -1;
|
|
||||||
}).length;
|
|
||||||
|
|
||||||
if (this.windowWidth <= 1024) {
|
|
||||||
return equippedCount > 4 ? 'equipment-scale-small' : 'equipment-scale-default';
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
selectDrawerTab (tabName) {
|
selectDrawerTab (tabName) {
|
||||||
let tabNameValue;
|
let tabNameValue;
|
||||||
if (tabName === 'costume') {
|
if (tabName === 'costume') {
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
.toggle-switch-inner:before {
|
.toggle-switch-inner:before {
|
||||||
content: "";
|
content: "";
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
background-color: $purple-300;
|
background-color: $green-50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-switch-inner:after {
|
.toggle-switch-inner:after {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
"passwordReset": "If we have your email or username on file, instructions for setting a new password have been sent to your email.",
|
"passwordReset": "If we have your email or username on file, instructions for setting a new password have been sent to your email.",
|
||||||
"invalidLoginCredentialsLong": "Uh-oh - your email address / username or password is incorrect.\n- Make sure they are typed correctly. Your username and password are case-sensitive.\n- You may have signed up with Facebook or Google-sign-in, not email so double-check by trying them.\n- If you forgot your password, click \"Forgot Password\".",
|
"invalidLoginCredentialsLong": "Uh-oh - your email address / username or password is incorrect.\n- Make sure they are typed correctly. Your username and password are case-sensitive.\n- You may have signed up with Facebook or Google-sign-in, not email so double-check by trying them.\n- If you forgot your password, click \"Forgot Password\".",
|
||||||
"invalidCredentials": "There is no account that uses those credentials.",
|
"invalidCredentials": "There is no account that uses those credentials.",
|
||||||
"accountSuspended": "This account, User ID \"<%= userId %>\", has been blocked for breaking the Community Guidelines (https://habitica.com/static/community-guidelines) or Terms of Service (https://habitica.com/static/terms). For details or to ask to be unblocked, please email our Community Manager at <%= communityManagerEmail %> or ask your parent or guardian to email them. Please include your @Username in the email.",
|
"accountSuspended": "Your account @<%= username %> has been blocked. For additional information, or to request an appeal, email admin@habitica.com with your Habitica username or User ID.",
|
||||||
"accountSuspendedTitle": "Account has been suspended",
|
"accountSuspendedTitle": "Account has been suspended",
|
||||||
"unsupportedNetwork": "This network is not currently supported.",
|
"unsupportedNetwork": "This network is not currently supported.",
|
||||||
"cantDetachSocial": "Account lacks another authentication method; can't detach this authentication method.",
|
"cantDetachSocial": "Account lacks another authentication method; can't detach this authentication method.",
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ export function loginRes (user, req, res) {
|
|||||||
if (user.auth.blocked) {
|
if (user.auth.blocked) {
|
||||||
throw new NotAuthorized(res.t(
|
throw new NotAuthorized(res.t(
|
||||||
'accountSuspended',
|
'accountSuspended',
|
||||||
{ communityManagerEmail: COMMUNITY_MANAGER_EMAIL, userId: user._id },
|
{
|
||||||
|
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||||
|
userId: user._id,
|
||||||
|
username: user.auth.local.username,
|
||||||
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
const urlPath = url.parse(req.url).pathname;
|
const urlPath = url.parse(req.url).pathname;
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ export function authWithHeaders (options = {}) {
|
|||||||
throw new NotAuthorized(common.i18n.t('accountSuspended', {
|
throw new NotAuthorized(common.i18n.t('accountSuspended', {
|
||||||
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||||
userId: user._id,
|
userId: user._id,
|
||||||
|
username: user.auth.local.username,
|
||||||
}, language));
|
}, language));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user