UI Fixes
This commit is contained in:
parent
72fd3bc0ea
commit
15012c08a4
@ -13,7 +13,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.$root.$data.checkCourseCompletion(this.course)){
|
if(this.$root.$data.checkCourseCompletion(this.course)){
|
||||||
console.log('Completed', this.course)
|
|
||||||
this.buttonName = 'Completed'
|
this.buttonName = 'Completed'
|
||||||
this.className = 'btn-success'
|
this.className = 'btn-success'
|
||||||
}
|
}
|
||||||
|
@ -10,18 +10,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p class='lead' v-html="description"></p>
|
<p class='lead' v-html="description"></p>
|
||||||
<p class="mt-4">
|
<p class="mt-4">
|
||||||
<AcademyTopSectionButton/>
|
<slot></slot>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import AcademyTopSectionButton from "./AcademyTopSectionButton.vue"
|
|
||||||
export default {
|
export default {
|
||||||
props: ['title', 'description'],
|
props: ['title', 'description'],
|
||||||
name: "AcademyTopSection",
|
name: "AcademyTopSection",
|
||||||
components: {
|
|
||||||
AcademyTopSectionButton
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<button v-if="isLoggedIn" class='btn btn-primary btn-lg' @click="getUrl()">{{ buttonName }}</button>
|
<button v-if="isLoggedIn" class='btn btn-primary btn-lg' @click="$router.push(getUrl())">{{ buttonName }}</button>
|
||||||
<a v-else class='btn btn-primary btn-lg' href="/login#signup">{{ buttonName }}</a>
|
<a v-else class='btn btn-primary btn-lg' href="/login#signup">{{ buttonName }}</a>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -8,11 +8,28 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
buttonName: '',
|
buttonName: '',
|
||||||
isLoggedIn: this.$root.$data.checkLogin()
|
isLoggedIn: this.$root.$data.checkLogin(),
|
||||||
|
nextContent: '',
|
||||||
|
nextContentType: '',
|
||||||
|
nextCourse: '',
|
||||||
|
link: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.$root.$data.checkLogin()){
|
if(this.isLoggedIn && this.$route.name == 'program'){
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.www.academy.get_continue_data",
|
||||||
|
args: {
|
||||||
|
program_name: this.$route.params.code
|
||||||
|
}
|
||||||
|
}).then( r => {
|
||||||
|
this.nextContent = r.message.content,
|
||||||
|
this.nextContentType = r.message.content_type,
|
||||||
|
this.nextCourse = r.message.course
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.isLoggedIn){
|
||||||
if(this.$route.name == 'home'){
|
if(this.$route.name == 'home'){
|
||||||
this.buttonName = 'Explore Courses'
|
this.buttonName = 'Explore Courses'
|
||||||
}
|
}
|
||||||
@ -26,12 +43,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUrl() {
|
getUrl() {
|
||||||
console.log('method getUrl() called')
|
|
||||||
if(this.$route.name == 'home'){
|
if(this.$route.name == 'home'){
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
else if(this.$route.name == 'program'){
|
else if(this.$route.name == 'program'){
|
||||||
return 'Program/' + this.$route.params.code + this.$route.params.course
|
this.link = this.$route.params.code + '/' + this.nextCourse + '/' + this.nextContentType + '/' + this.nextContent
|
||||||
|
return this.link
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<AcademyTopSection :title="title" :description="description"/>
|
<AcademyTopSection :title="title" :description="description">
|
||||||
|
<AcademyTopSectionButton/>
|
||||||
|
</AcademyTopSection>
|
||||||
<AcademyList :title="'Featured Programs'" :description="'Master ERPNext'">
|
<AcademyList :title="'Featured Programs'" :description="'Master ERPNext'">
|
||||||
<AcademyProgramCard v-for="program in featured_programs" :key="program.name" :program_code="program"/>
|
<AcademyProgramCard v-for="program in featured_programs" :key="program.name" :program_code="program"/>
|
||||||
</AcademyList>
|
</AcademyList>
|
||||||
@ -10,6 +12,7 @@
|
|||||||
import AcademyTopSection from "../components/AcademyTopSection.vue"
|
import AcademyTopSection from "../components/AcademyTopSection.vue"
|
||||||
import AcademyList from "../components/AcademyList.vue"
|
import AcademyList from "../components/AcademyList.vue"
|
||||||
import AcademyProgramCard from "../components/AcademyProgramCard.vue"
|
import AcademyProgramCard from "../components/AcademyProgramCard.vue"
|
||||||
|
import AcademyTopSectionButton from "../components/AcademyTopSectionButton.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AcademyHome",
|
name: "AcademyHome",
|
||||||
@ -21,7 +24,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AcademyTopSection, AcademyList, AcademyProgramCard
|
AcademyTopSection,
|
||||||
|
AcademyList,
|
||||||
|
AcademyProgramCard,
|
||||||
|
AcademyTopSectionButton
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
frappe.call("erpnext.www.academy.get_portal_details").then(r => {
|
frappe.call("erpnext.www.academy.get_portal_details").then(r => {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<AcademyTopSection v-bind:title="program.program_name" v-bind:description="program.description"/>
|
<AcademyTopSection v-bind:title="program.program_name" v-bind:description="program.description">
|
||||||
|
<AcademyTopSectionButton/>
|
||||||
|
</AcademyTopSection>
|
||||||
<AcademyList :title="'Courses'" :description="''">
|
<AcademyList :title="'Courses'" :description="''">
|
||||||
<AcademyCourseCard v-for="course in course_list" :course="course" :key="course.name"/>
|
<AcademyCourseCard v-for="course in course_list" :course="course" :key="course.name"/>
|
||||||
</AcademyList>
|
</AcademyList>
|
||||||
@ -10,6 +12,7 @@
|
|||||||
import AcademyTopSection from "../components/AcademyTopSection.vue"
|
import AcademyTopSection from "../components/AcademyTopSection.vue"
|
||||||
import AcademyList from "../components/AcademyList.vue"
|
import AcademyList from "../components/AcademyList.vue"
|
||||||
import AcademyCourseCard from "../components/AcademyCourseCard.vue"
|
import AcademyCourseCard from "../components/AcademyCourseCard.vue"
|
||||||
|
import AcademyTopSectionButton from "../components/AcademyTopSectionButton.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['code'],
|
props: ['code'],
|
||||||
@ -17,7 +20,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
AcademyTopSection,
|
AcademyTopSection,
|
||||||
AcademyList,
|
AcademyList,
|
||||||
AcademyCourseCard
|
AcademyCourseCard,
|
||||||
|
AcademyTopSectionButton
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user