Commit a45cb4b3 authored by Cornee Traas's avatar Cornee Traas
Browse files

Fixed the last of the menu glitches

parent 055c95d3
Pipeline #2526 failed with stages
in 1 minute and 32 seconds
......@@ -250,7 +250,7 @@ export default {
TopbarNav,
BackButton,
MultiSelect,
Datepicker
Datepicker,
},
data() {
return {
......@@ -258,7 +258,7 @@ export default {
isPrimary: false,
level: 0,
top_nav: [],
level_0: ["/home", "/settings"],
level_0: ["/home", "/settings",],
platforms: store.state.platforms,
bottom_nav: nav.bottom_items,
testCount: 5,
......@@ -276,7 +276,7 @@ export default {
action: {
date: null,
title: "",
description: ""
description: "",
},
actionToDelete: {},
......@@ -294,24 +294,24 @@ export default {
filterOptions: [
{
text: "No filter",
id: "no_filter"
id: "no_filter",
},
{
text: "Has paid only",
id: "has_paid"
}
id: "has_paid",
},
],
cohorts: [{ name: "Cohorts not yet implemented", id: "no_cohort" }],
cohorts: [{ name: "Cohorts not yet implemented", id: "no_cohort", },],
selectedCohort: "no_cohort",
countries: [{ name: "Netherlands", id: 1 }, { name: "Germany", id: 2 }],
countries: [{ name: "Netherlands", id: 1, }, { name: "Germany", id: 2, },],
selectedCountries: [],
selectedCourse: settings.course_default,
selectedSubitem: "",
// Mock
courses: {
coursera: []
}
coursera: [],
},
};
},
beforeMount() {
......@@ -325,7 +325,7 @@ export default {
this.courses.coursera.push({
name: course.course_name,
description: "",
slug: course.course_slug
slug: course.course_slug,
});
}
util
......@@ -340,7 +340,7 @@ export default {
},
mounted() {
this.platformOptions = [
{ value: settings.platform_default, text: strings.select_platform }
{ value: settings.platform_default, text: strings.select_platform, },
];
this.setPlatforms();
......@@ -365,14 +365,14 @@ export default {
) {
routes.push({
text: subroute.charAt(0).toUpperCase() + subroute.slice(1),
to: path.substring(0, path.length - 1)
to: path.substring(0, path.length - 1),
});
}
}
routes[0].text = strings.home;
routes[0].to = "/";
return routes;
}
},
},
methods: {
saveAction() {
......@@ -404,7 +404,7 @@ export default {
this.action = {
date: null,
title: "",
description: ""
description: "",
};
this.showAddActionModal = false;
this.showActionsModal = true;
......@@ -562,12 +562,12 @@ export default {
// Dropdown listeners
platformChange(evt) {
if (evt !== settings.platform_default) {
this.$router.push("/" + evt);
this.$router.push("/p/" + evt);
}
},
courseChange(evt) {
if (evt !== settings.course_default) {
this.$router.push("/" + this.selectedPlatform + "/" + evt);
this.$router.push("/p/" + this.selectedPlatform + "/" + evt);
}
},
sideButtonClick(event) {
......@@ -589,8 +589,8 @@ export default {
this.courseOptions = [
{
value: settings.course_default,
text: strings.select_course
}
text: strings.select_course,
},
];
},
setPlatforms() {
......@@ -598,17 +598,17 @@ export default {
this.top_nav[0].push({
name: strings.home,
icon: "cui-home",
url: "/home"
url: "/home",
});
for (var platform of this.platforms) {
this.top_nav[0].push({
name: platform.name,
url: "/p/" + platform.id,
icon: "fa fa-line-chart"
icon: "fa fa-line-chart",
});
this.platformOptions.push({
value: platform.id,
text: platform.name
text: platform.name,
});
}
},
......@@ -616,21 +616,21 @@ export default {
this.courseOptions = [
{
value: settings.course_default,
text: strings.select_course
}
text: strings.select_course,
},
];
this.top_nav[2] = [];
for (var course of c) {
// Push to dropdown
this.courseOptions.push({
value: course.slug,
text: course.name
text: course.name,
});
// Push to navbar
this.top_nav[2].push({
name: course.name,
url: "/p/" + this.selectedPlatform + "/" + course.slug,
icon: "fa fa-line-chart"
icon: "fa fa-line-chart",
});
}
},
......@@ -646,7 +646,7 @@ export default {
"/" +
this.selectedCourse +
"/" +
coursepPage.slug
coursepPage.slug,
});
}
},
......@@ -666,7 +666,7 @@ export default {
this.selectedCourse +
"/videos/" +
video.item_id,
icon: "fa fa-video-camera"
icon: "fa fa-video-camera",
});
this.$forceUpdate();
}
......@@ -693,7 +693,7 @@ export default {
quiz.base_id +
"-" +
quiz.version,
icon: "fa fa-check "
icon: "fa fa-check ",
});
this.$forceUpdate();
}
......@@ -721,7 +721,7 @@ export default {
this.selectedCourse +
"/assignments/" +
assignment.item_id,
icon: "cui-calendar "
icon: "cui-calendar ",
});
this.$forceUpdate();
}
......@@ -730,8 +730,8 @@ export default {
this.top_nav[4] = [];
console.log(err);
});
}
}
},
},
};
</script>
......
......@@ -48,6 +48,10 @@ const router = new VueRouter({
path: '/home',
component: Home,
},
{
path: '/p',
redirect: '/home',
},
{
path: '/p/:platform',
redirect: '/p/:platform',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment