UI for home page and program page
This commit is contained in:
parent
9c642ace52
commit
b43ab3317c
@ -1,31 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class='section-padding section-bg'>
|
|
||||||
<div class='container'>
|
|
||||||
<h3 class='text-center'>Featured Programs</h3>
|
|
||||||
<p class='lead text-center'>Master Engineering</p>
|
|
||||||
<AcademyProgramCard v-for="program in featured_programs" v-bind:id="program" v-bind:title="program"/>
|
|
||||||
<div class='mt-4 text-center'>
|
|
||||||
<a class="btn btn-primary btn-lg" href="/program">View All</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import AcademyProgramCard from "../components/AcademyProgramCard.vue"
|
|
||||||
export default {
|
|
||||||
name: "AcademyCardList",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
featured_programs: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
frappe.call("erpnext.www.academy.get_featured_programs").then(r => {
|
|
||||||
this.featured_programs = r.message
|
|
||||||
})
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AcademyProgramCard
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<template>
|
||||||
|
<section class='section-padding section-bg'>
|
||||||
|
<div class='container'>
|
||||||
|
<h3 class='text-center' v-html="title"></h3>
|
||||||
|
<p class='lead text-center' v-html="description"></p>
|
||||||
|
<slot></slot>
|
||||||
|
<div class='mt-4 text-center'>
|
||||||
|
<a class="btn btn-primary btn-lg" href="/program">View All</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props:['title', 'description'],
|
||||||
|
name: "AcademyList",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='card-deck mt-5'>
|
<div class='card-deck mt-5'>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img :src="program.hero_image" style='height: 150px'>
|
<img :src="program.hero_image" style='height: 150px; width: auto'>
|
||||||
<div class='card-body'>
|
<div class='card-body'>
|
||||||
<router-link :to="'/Program/' + program.name">
|
<router-link :to="'/Program/' + program.name">
|
||||||
<h5 class='card-title'>{{ program.name }}</h5>
|
<h5 class='card-title'>{{ program.program_name }}</h5>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div v-html="program.description"></div>
|
<div v-html="program.description"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['title'],
|
props: ['program_code'],
|
||||||
name: "AcademyProgramCard",
|
name: "AcademyProgramCard",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -28,11 +28,17 @@ export default {
|
|||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.www.academy.get_program_details",
|
method: "erpnext.www.academy.get_program_details",
|
||||||
args: {
|
args: {
|
||||||
program_name: this.title
|
program_name: this.program_code
|
||||||
}
|
}
|
||||||
}).then(r => {
|
}).then(r => {
|
||||||
this.program = r.message
|
this.program = r.message
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -17,18 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
props: ['title', 'description'],
|
||||||
name: "AcademyTopSection",
|
name: "AcademyTopSection",
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
title: '',
|
|
||||||
description: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
frappe.call("erpnext.www.academy.get_portal_details").then(r => {
|
|
||||||
this.title = r.message.title,
|
|
||||||
this.description = r.message.description
|
|
||||||
})
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -1,14 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
Program Page {{ code }}
|
<AcademyTopSection v-bind:title="program.program_name" v-bind:description="program.description"/>
|
||||||
|
<AcademyList :title="'Courses'" :description="''">
|
||||||
|
<AcademyCourseCard v-for="course in course_list" :course="course" :key="course.name"/>
|
||||||
|
</AcademyList>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import AcademyTopSection from "../components/AcademyTopSection.vue"
|
||||||
|
import AcademyList from "../components/AcademyList.vue"
|
||||||
|
import AcademyCourseCard from "../components/AcademyCourseCard.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['code'],
|
props: ['code'],
|
||||||
name: "AcademyProgramPage",
|
name: "AcademyProgramPage",
|
||||||
data() {
|
components: {
|
||||||
return this.code
|
AcademyTopSection,
|
||||||
}
|
AcademyList,
|
||||||
|
AcademyCourseCard
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
program: '',
|
||||||
|
course_list: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.www.academy.get_program_details",
|
||||||
|
args: {
|
||||||
|
program_name: this.code
|
||||||
|
}
|
||||||
|
}).then(r => {
|
||||||
|
this.program = r.message
|
||||||
|
});
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.www.academy.get_courses",
|
||||||
|
args: {
|
||||||
|
program_name: this.code
|
||||||
|
}
|
||||||
|
}).then(r => {
|
||||||
|
this.course_list = r.message
|
||||||
|
})
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$route' (to, from) {
|
||||||
|
// react to route changes...
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
Loading…
x
Reference in New Issue
Block a user