Skip to content

Commit 0b14d66

Browse files
authored
Merge pull request #1968 from jonboiser/profile-fields
Fix order of fields in user profile
2 parents 7208f5c + aa48454 commit 0b14d66

File tree

1 file changed

+24
-31
lines changed
  • kolibri/plugins/user/assets/src/views/profile-page

1 file changed

+24
-31
lines changed

kolibri/plugins/user/assets/src/views/profile-page/index.vue

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,38 @@
1616
</p>
1717
</template>
1818

19-
<template v-if="!canEditUsername">
19+
<form @submit.prevent="submitEdits">
20+
2021
<h3>{{ $tr('username') }}</h3>
21-
<p>{{ session.username }}</p>
22-
</template>
22+
<core-textbox
23+
v-if="canEditUsername"
24+
:disabled="busy"
25+
:invalid="error"
26+
:error="errorMessage"
27+
v-model="username"
28+
autocomplete="username"
29+
type="text"
30+
/>
31+
<p v-else>{{ session.username }}</p>
2332

24-
<template v-if="!canEditName">
2533
<h3>{{ $tr('name') }}</h3>
26-
<p>{{ session.full_name }}</p>
27-
</template>
28-
29-
<form v-if="canEditUsername || canEditName" @submit.prevent="submitEdits">
30-
31-
<template v-if="canEditUsername">
32-
<h3>{{ $tr('username') }}</h3>
33-
<core-textbox
34-
:disabled="busy"
35-
:invalid="error"
36-
:error="errorMessage"
37-
v-model="username"
38-
autocomplete="username"
39-
type="text" />
40-
</template>
41-
42-
<template v-if="canEditName">
43-
<h3>{{ $tr('name') }}</h3>
44-
<core-textbox
45-
:disabled="busy"
46-
v-model="full_name"
47-
autocomplete="name"
48-
type="text" />
49-
</template>
34+
<core-textbox
35+
v-if="canEditName"
36+
:disabled="busy"
37+
v-model="full_name"
38+
autocomplete="name"
39+
type="text"
40+
/>
41+
<p v-else>{{ session.full_name }}</p>
5042

5143
<k-button
44+
v-if="canEditUsername || canEditName"
5245
:disabled="busy"
5346
:primary="true"
5447
:text="$tr('updateProfile')"
5548
class="submit"
56-
type="submit" />
49+
type="submit"
50+
/>
5751
</form>
5852
</div>
5953

@@ -65,7 +59,6 @@
6559
import * as actions from '../../state/actions';
6660
import * as getters from 'kolibri.coreVue.vuex.getters';
6761
import responsiveWindow from 'kolibri.coreVue.mixins.responsiveWindow';
68-
import { totalPoints } from 'kolibri.coreVue.vuex.getters';
6962
import { fetchPoints } from 'kolibri.coreVue.vuex.actions';
7063
import kButton from 'kolibri.coreVue.components.kButton';
7164
import coreTextbox from 'kolibri.coreVue.components.textbox';
@@ -157,7 +150,7 @@
157150
isAdmin: getters.isAdmin,
158151
isCoach: getters.isCoach,
159152
isLearner: getters.isLearner,
160-
totalPoints,
153+
totalPoints: getters.totalPoints,
161154
},
162155
actions: {
163156
editProfile: actions.editProfile,

0 commit comments

Comments
 (0)