83 lines
1.7 KiB
Vue
Raw Normal View History

2018-11-26 19:16:54 +05:30
<template>
<div class="py-5">
<div class="row">
<div class="col-sm-12">
<div>
<h3>{{ fullName }}</h3>
<ul>
<li class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Email:</div>
<div class="col-md-9 col-sm-8">{{ email }}</div>
</li>
<li v-if="joiningDate" class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Date of Joining:</div>
<div class="col-md-9 col-sm-8">{{ joiningDate }}</div>
</li>
<li class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Programs Enrolled:</div>
<div class="col-md-9 col-sm-8">
<ul v-if="enrolledPrograms">
<li v-for="program in enrolledPrograms" :key="program">{{ program }}</li>
</ul>
<span v-else>None</span>
</div>
</li>
</ul>
2018-11-26 19:16:54 +05:30
</div>
<a href="/update-profile" class="edit-button text-muted">Edit Profile</a>
2018-11-26 19:16:54 +05:30
</div>
</div>
<div ></div>
</div>
2018-11-26 19:16:54 +05:30
</template>
<script>
export default {
props: ['enrolledPrograms'],
name: "ProfileInfo",
data() {
return {
2018-12-11 10:58:14 +05:30
avatar: frappe.user_image,
fullName: frappe.full_name,
2018-11-26 19:16:54 +05:30
abbr: frappe.get_abbr(frappe.get_cookie("full_name")),
email: frappe.session.user,
joiningDate: ''
2018-11-26 19:16:54 +05:30
}
},
mounted(){
this.getJoiningDate().then(data => {
if(data) {
this.joiningDate = lms.moment(String(data)).format('D MMMM YYYY')
}
})
2018-11-26 19:16:54 +05:30
},
computed: {
avatarStyle() {
return `background-image: url("${this.avatar}")`
},
},
methods: {
getJoiningDate() {
return lms.call("get_joining_date")
}
}
};
</script>
<style scoped>
2019-02-28 18:11:46 +05:30
.edit-button {
position: absolute;
top: 0;
right: 0;
2018-11-26 19:16:54 +05:30
}
2019-02-28 18:11:46 +05:30
2018-11-26 19:16:54 +05:30
.standard-image {
font-size: 72px;
border-radius: 6px;
}
2019-02-28 18:11:46 +05:30
2018-11-26 19:16:54 +05:30
ul {
2019-02-28 18:11:46 +05:30
list-style-type: none;
padding: 0;
2018-11-26 19:16:54 +05:30
margin: 0
2019-02-28 18:11:46 +05:30
}
2018-11-26 19:16:54 +05:30
</style>