Merge branch 'dev' of https://github.com/spicecat/qOverflow into dev
This commit is contained in:
commit
f8209c89cd
8 changed files with 18 additions and 19 deletions
|
|
@ -31,16 +31,16 @@ export default function Badges({ badges: { obtained, unobtained } }) {
|
|||
return (
|
||||
<>
|
||||
<Grid container spacing={{ xs: 2, md: 3 }} columns={{ xs: 4, sm: 8, md: 12 }}>
|
||||
<Grid item xs={4} sm={8} md={12}>
|
||||
<Typography variant='h5'>Obtained Badges</Typography>
|
||||
</Grid>
|
||||
{badgesGrid(obtained)}
|
||||
<Grid item xs={2} sm={4} md={4}>
|
||||
<Typography variant='h5'>Obtained Badges</Typography>
|
||||
</Grid>
|
||||
{badgesGrid(obtained)}
|
||||
</Grid>
|
||||
<Grid container spacing={{ xs: 2, md: 3 }} columns={{ xs: 4, sm: 8, md: 12 }}>
|
||||
<Grid item xs={4} sm={8} md={12}>
|
||||
<Typography variant='h5'>Unobtained Badges</Typography>
|
||||
</Grid>
|
||||
{badgesGrid(unobtained)}
|
||||
<Grid item xs={2} sm={4} md={4}>
|
||||
<Typography variant='h5'>Unobtained Badges</Typography>
|
||||
</Grid>
|
||||
{badgesGrid(unobtained)}
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default function CommentControl({
|
|||
title={
|
||||
canComment
|
||||
? ''
|
||||
: 'You must be level 3 to comment or level 6 if this question is protected'
|
||||
: 'You must be level 3 to comment or level 5 if this question is protected'
|
||||
}
|
||||
>
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export default function CreateAnswer({ canAnswer, show, toggleShow }) {
|
|||
title={
|
||||
canAnswer
|
||||
? ''
|
||||
: 'You need to be authenticated to answer or level 6 if the question is protected'
|
||||
: 'You need to be authenticated to answer or level 5 if the question is protected'
|
||||
}
|
||||
>
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default function Question({
|
|||
Ask question
|
||||
</Button>
|
||||
|
||||
<Tooltip title={canClose ? '' : 'You must be level 9'}>
|
||||
<Tooltip title={canClose ? '' : 'You must be level 7'}>
|
||||
<span>
|
||||
<Button
|
||||
disabled={!canClose}
|
||||
|
|
@ -122,7 +122,7 @@ export default function Question({
|
|||
</Tooltip>
|
||||
|
||||
<Tooltip
|
||||
title={canProtect ? '' : 'You must be level 8 and this question must be open'}
|
||||
title={canProtect ? '' : 'You must be level 6 and this question must be open'}
|
||||
>
|
||||
<span>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default function VoteControl({
|
|||
title={
|
||||
canDownvote
|
||||
? ''
|
||||
: 'Question must be open, not created by you, and you must be level 5 to downvote'
|
||||
: 'Question must be open, not created by you, and you must be level 4 to downvote'
|
||||
}
|
||||
>
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export default function VoteControlController({
|
|||
const [vote, setVote] = useState();
|
||||
const [original, setOriginal] = useState();
|
||||
let isOwnQ = username === creator;
|
||||
const canDownvote = level >= 5 && status !== 'closed' && !isOwnQ;
|
||||
const canDownvote = level >= 4 && status !== 'closed' && !isOwnQ;
|
||||
const canUpvote = level >= 2 && status !== 'closed' && !isOwnQ;
|
||||
|
||||
const loadVote = async () => {
|
||||
|
|
|
|||
|
|
@ -18,18 +18,18 @@ function getPermissions(questionData, userData, ongoingVote) {
|
|||
permissions.canAccept = true;
|
||||
}
|
||||
|
||||
if (level >= 9 && ongoingVote.type !== 'protect') {
|
||||
if (level >= 7 && ongoingVote.type !== 'protect') {
|
||||
permissions.canClose = true;
|
||||
}
|
||||
|
||||
if (level >= 8 && ongoingVote.type !== 'close' && !protection) {
|
||||
if (level >= 6 && ongoingVote.type !== 'close' && !protection) {
|
||||
permissions.canProtect = true;
|
||||
}
|
||||
|
||||
if (
|
||||
status !== 'closed' &&
|
||||
((level >= 3 && status !== 'protected') ||
|
||||
(level >= 6 && status === 'protected') ||
|
||||
(level >= 5 && status === 'protected') ||
|
||||
username === creator)
|
||||
) {
|
||||
permissions.canComment = true;
|
||||
|
|
@ -38,7 +38,7 @@ function getPermissions(questionData, userData, ongoingVote) {
|
|||
if (
|
||||
status !== 'closed' &&
|
||||
((level >= 1 && status !== 'protected') ||
|
||||
(level >= 6 && status === 'protected') ||
|
||||
(level >= 5 && status === 'protected') ||
|
||||
username === creator)
|
||||
) {
|
||||
permissions.canAnswer = true;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ async function Search(req, res) {
|
|||
['view', 'desc'],
|
||||
['comments', 'desc'],
|
||||
];
|
||||
searchQuery['answers'] = 0;
|
||||
break;
|
||||
case 'uvac':
|
||||
sortQuery = [
|
||||
|
|
|
|||
Reference in a new issue