mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
Minor improvements
This commit is contained in:
@@ -8,9 +8,10 @@
|
|||||||
Course Content
|
Course Content
|
||||||
<ul class="mb-0 mt-1">
|
<ul class="mb-0 mt-1">
|
||||||
<li v-for="content in course.course_content" :key="content.name">
|
<li v-for="content in course.course_content" :key="content.name">
|
||||||
<router-link tag="a" :class="'text-muted'" :to="{name: 'content', params:{program_name: program_name, course: course.name, type:content.content_type, content: content.content} }">
|
<router-link v-if="isLogin" tag="a" :class="'text-muted'" :to="{name: 'content', params:{program_name: program_name, course: course.name, type:content.content_type, content: content.content} }">
|
||||||
<span style="padding-right: 0.4em"><i :class="iconClass(content.content_type)"></i></span>{{ content.content }}
|
<span style="padding-right: 0.4em"><i :class="iconClass(content.content_type)"></i></span>{{ content.content }}
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<div v-else><span style="padding-right: 0.4em"><i :class="iconClass(content.content_type)"></i></span>{{ content.content }}</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</span>
|
</span>
|
||||||
@@ -37,22 +38,17 @@ export default {
|
|||||||
name: "CourseCard",
|
name: "CourseCard",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isLogin: lms.store.isLogin,
|
||||||
courseMeta: {}
|
courseMeta: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCourseMeta().then(data => this.courseMeta = data)
|
if(this.isLogin) this.getCourseMeta().then(data => this.courseMeta = data)
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AButton
|
AButton
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showStart() {
|
|
||||||
return lms.loggedIn && !this.courseMeta.flag == "Complete";
|
|
||||||
},
|
|
||||||
showCompleted() {
|
|
||||||
return lms.loggedIn && this.courseMeta.flag == "Complete";
|
|
||||||
},
|
|
||||||
firstContentRoute() {
|
firstContentRoute() {
|
||||||
return `${this.program_name}/${this.course.name}/${this.courseMeta.content_type}/${this.courseMeta.content}`
|
return `${this.program_name}/${this.course.name}/${this.courseMeta.content_type}/${this.courseMeta.content}`
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,8 +6,21 @@ import ListPage from "./pages/ListPage.vue";
|
|||||||
const routes = [
|
const routes = [
|
||||||
{name: 'home', path: '', component: Home},
|
{name: 'home', path: '', component: Home},
|
||||||
{name: 'program', path: '/Program/:program_name', component: ProgramPage, props: true},
|
{name: 'program', path: '/Program/:program_name', component: ProgramPage, props: true},
|
||||||
{name: 'content', path: '/Program/:program_name/:course/:type/:content', component: ContentPage, props: true},
|
{
|
||||||
{name: 'list', path: '/List/:master', component: ListPage, props: true},
|
name: 'content',
|
||||||
|
path: '/Program/:program_name/:course/:type/:content',
|
||||||
|
component: ContentPage,
|
||||||
|
props: true,
|
||||||
|
beforeEnter: (to, from, next) => {
|
||||||
|
if(!lms.store.isLogin) next({name: 'home'})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'list',
|
||||||
|
path: '/List/:master',
|
||||||
|
component: ListPage,
|
||||||
|
props: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'signup',
|
name: 'signup',
|
||||||
path: '/Signup',
|
path: '/Signup',
|
||||||
|
|||||||
Reference in New Issue
Block a user