brotherton-erpnext/erpnext/public/js/hub/pages/Profile.vue

67 lines
1.2 KiB
Vue
Raw Normal View History

2018-08-26 07:39:19 +00:00
<template>
<div
class="marketplace-page"
:data-page-name="page_name"
>
<detail-view v-if="profile"
:title="title"
:subtitles="subtitles"
:image="image"
:sections="sections"
>
</detail-view>
</div>
</template>
<script>
import DetailView from '../components/DetailView.vue';
export default {
2018-08-26 10:59:32 +00:00
name: 'profile-page',
2018-08-26 07:39:19 +00:00
components: {
DetailView
},
data() {
return {
page_name: frappe.get_route()[1],
profile: null,
title: null,
subtitles: [],
image: null,
sections: []
};
},
created() {
this.get_profile();
},
methods: {
get_profile() {
hub.call(
'get_hub_seller_profile',
{ hub_seller: hub.settings.company_email }
).then(profile => {
this.profile = profile;
this.title = profile.company;
this.subtitles = [
__(profile.country),
__(profile.site_name),
__(`Joined ${comment_when(profile.creation)}`)
];
this.image = profile.logo;
this.sections = [
{
title: __('About the Company'),
content: profile.company_description
? __(profile.company_description)
: __('No description')
}
];
});
}
}
}
</script>
<style scoped></style>