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

82 lines
1.5 KiB
Vue
Raw Normal View History

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