projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UserBio: a few fixes, but still doesn't work as expected
[vchess.git]
/
client
/
src
/
components
/
UserBio.vue
diff --git
a/client/src/components/UserBio.vue
b/client/src/components/UserBio.vue
index
c954f3d
..
181c7df
100644
(file)
--- a/
client/src/components/UserBio.vue
+++ b/
client/src/components/UserBio.vue
@@
-6,11
+6,10
@@
div
data-checkbox="modalBio"
)
.card
data-checkbox="modalBio"
)
.card
- div(v-if="st.user.id
==
id")
+ div(v-if="st.user.id
> 0 && st.user.id == u
id")
h3.section(@click="modeEdit = !modeEdit") Click to edit
textarea(
h3.section(@click="modeEdit = !modeEdit") Click to edit
textarea(
- v-if="userBio !== undefined"
- v-show="modeEdit"
+ v-if="userBio !== undefined && modeEdit"
v-model="userBio"
)
button#submitBtn(@click="sendBio()") Submit
v-model="userBio"
)
button#submitBtn(@click="sendBio()") Submit
@@
-20,7
+19,11
@@
div
@click="modeEdit = !modeEdit"
)
#dialog.text-center {{ st.tr[infoMsg] }}
@click="modeEdit = !modeEdit"
)
#dialog.text-center {{ st.tr[infoMsg] }}
- span.clickable(@click="showBio()") {{ name }}
+ span(
+ :class="{ clickable: !!uname }"
+ @click="showBio()"
+ )
+ | {{ uname || "@nonymous" }}
</template>
<script>
</template>
<script>
@@
-29,7
+32,7
@@
import { ajax } from "@/utils/ajax";
import { processModalClick } from "@/utils/modalClick.js";
export default {
name: "my-user-bio",
import { processModalClick } from "@/utils/modalClick.js";
export default {
name: "my-user-bio",
- props: ["
id", "
name"],
+ props: ["
uid", "u
name"],
data: function() {
return {
st: store.state,
data: function() {
return {
st: store.state,
@@
-44,6
+47,9
@@
export default {
},
methods: {
showBio: function() {
},
methods: {
showBio: function() {
+ if (!this.uname)
+ // Anonymous users have no bio:
+ return;
this.infoMsg = "";
document.getElementById("modalBio").checked = true;
if (this.userBio === undefined) {
this.infoMsg = "";
document.getElementById("modalBio").checked = true;
if (this.userBio === undefined) {
@@
-51,7
+57,7
@@
export default {
"/userbio",
"GET",
{
"/userbio",
"GET",
{
- data: { id: this.id },
+ data: { id: this.
u
id },
success: (res) => {
this.userBio = res.bio;
}
success: (res) => {
this.userBio = res.bio;
}
@@
-77,7
+83,7
@@
export default {
<style lang="sass" scoped>
[type="checkbox"].modal+div .card
<style lang="sass" scoped>
[type="checkbox"].modal+div .card
- max-width:
768
px
+ max-width:
570
px
max-height: 100%
#submitBtn
max-height: 100%
#submitBtn