Newer
Older
<template>
<div id="page-content-wrapper" class="main">
<fetch-profile v-if="userData !== null">
<template slot-scope="{response, loading}">
<slot :response="response" :loading="loading">
<div v-if="loading || response === null"></div>
<div v-else>
<!-- {{response}}-->
<h4 class="round">User Profile</h4>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<div class="panel panel-default">
<div class="panel-body">
<div class="container-fluid col-md-12">
<div class="row">
<div class="text col-sm-3">User Name</div>
<div class="col-sm-9">
<b>{{response.username}}</b>
</div>
</div>
<div class="row">
<div class="text col-sm-3">Email</div>
<div class="col-sm-9">
{{response.email}}
</div>
</div>
<div class="row">
<div class="text col-sm-3">Role</div>
<div class="col-sm-9">
{{response.role.name}}
</div>
</div>
<div class="row">
<div class="text col-sm-3">Affiliation</div>
<div class="col-sm-9">
{{response.Affiliation}}
</div>
</div>
<div class="row">
<div class="text col-sm-3">Link</div>
<div class="col-sm-9">
{{response.ProfileLink}}
</div>
</div>
<div class="row">
<div class="text col-sm-3">Joined</div>
<div class="col-sm-9">
{{response.createdAt}}
</div>
</div>
<div class="row">
<div class="text col-sm-3">Updated</div>
<div class="col-sm-9">
{{response.updatedAt}}
</div>
</div>
</div>
</div>
</div>
<h4 class="round">Update Items</h4>
<div class="panel panel-default">
Table
</div>
</div>
</slot>
</template>
</fetch-profile>
<fetch-update-items v-if="userData !== null">
<template slot-scope="{response, loading}">
<slot :response="response" :loading="loading">
<div v-if="loading || response === null"></div>
<div v-else>
{{response}}
</div>
</slot>
</template>
</fetch-update-items>
</div>
</template>
<script>
import FetchProfile from "@/components/CMS/fetchProfile";
import FetchUpdateItems from "@/components/CMS/fetchUpdateItems";
const _ = require('lodash')
export default {
name: 'ProfilePage',
components: {
FetchProfile, FetchUpdateItems
},
props: {
msg: String
},
data() {
return {
isDev: process.env.NODE_ENV === 'development'
}
},
computed: {
userData: function () {
return this.$store.getters['User/userData']
},
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
},
methods: {
},
mounted: function () {
const vm = this
if(vm.userData === null) {
this.$router.push('/login')
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
@import url('~@/assets/bootstrap.css');
.main {
margin: 1.5rem;
}
h3 {
margin: 40px 0 0;
}
a {
color: #42b983;
}
.panel {
font-size: 1.2rem;
}
ul.a {
list-style-type: disc;
list-style-position: inside;
}
</style>