Skip to content

Commit fba2d17

Browse files
committed
educator profile tag is changed according to prevPath
1 parent 5033bd4 commit fba2d17

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

zubhub_backend/zubhub/activities/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class ActivityDeleteAPIView(DestroyAPIView):
128128
"""
129129
queryset = Activity.objects.all()
130130
serializer_class = ActivitySerializer
131-
permission_classes = [IsAuthenticated, IsOwner]
131+
permission_classes = [IsAuthenticated, IsOwner, IsStaffOrModeratorOrEducator]
132132

133133
def delete(self, request, *args, **kwargs):
134134
activity = self.get_object()

zubhub_frontend/zubhub/src/views/activity_details/ActivityDetailsV2.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ export default function ActivityDetailsV2(props) {
128128
{open ? <ReactConfetti width={width} height={height} /> : null}
129129
<div className={classes.card}>
130130
<div className={classes.headerFlex}>
131-
<Link className={commonClasses.textDecorationNone} to={`/creators/${creator?.username}`}>
131+
<Link
132+
className={commonClasses.textDecorationNone}
133+
to={{ pathname: `/creators/${creator?.username}`, state: { prevPath: window.location.pathname } }}
134+
>
132135
<div className={classes.creatorBox}>
133136
<Avatar src={creator?.avatar} alt={creator?.username} className={classes.avatar} />
134137
<div>

zubhub_frontend/zubhub/src/views/profile/Profile.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import styles from '../../assets/js/styles/views/profile/profileStyles';
6464
import commonStyles from '../../assets/js/styles';
6565
import ProjectsDraftsGrid from '../../components/projects_drafts/ProjectsDraftsGrid';
6666
import UserActivitylog from '../../components/user_activitylog/UserActivitylog';
67+
import { USER_TAGS } from '../../assets/js/utils/constants.js';
6768

6869
const useStyles = makeStyles(styles);
6970
const useCommonStyles = makeStyles(commonStyles);
@@ -206,7 +207,17 @@ function Profile(props) {
206207
{profile.username}
207208
</Typography>
208209
<Box className={classes.tagsContainerStyle}>
209-
{sortTags(profile.tags).map(tag => (
210+
{props.location.state?.prevPath.split('/')[1] === 'activities' ? (
211+
<Typography
212+
className={clsx(common_classes.baseTagStyle, {
213+
[common_classes.extendedTagStyle]: !isBaseTag(USER_TAGS.educator),
214+
})}
215+
component="h2"
216+
>
217+
{USER_TAGS.educator}
218+
</Typography>
219+
) :
220+
sortTags(profile.tags).map(tag => (
210221
<Typography
211222
key={tag}
212223
className={clsx(common_classes.baseTagStyle, {

0 commit comments

Comments
 (0)