projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better challenge display: 'with' instead of 'from'
[vchess.git]
/
client
/
src
/
components
/
ChallengeList.vue
diff --git
a/client/src/components/ChallengeList.vue
b/client/src/components/ChallengeList.vue
index
ed49067
..
a350c70
100644
(file)
--- a/
client/src/components/ChallengeList.vue
+++ b/
client/src/components/ChallengeList.vue
@@
-4,7
+4,7
@@
div
thead
tr
th {{ st.tr["Variant"] }}
thead
tr
th {{ st.tr["Variant"] }}
- th {{ st.tr["
From
"] }}
+ th {{ st.tr["
With
"] }}
th {{ st.tr["Cadence"] }}
tbody
tr(
th {{ st.tr["Cadence"] }}
tbody
tr(
@@
-13,7
+13,7
@@
div
@click="$emit('click-challenge',c)"
)
td {{ c.vname }}
@click="$emit('click-challenge',c)"
)
td {{ c.vname }}
- td {{
c.from.name || "@nonymous"
}}
+ td {{
withWho(c)
}}
td {{ c.cadence }}
</template>
td {{ c.cadence }}
</template>
@@
-46,6
+46,13
@@
export default {
return c2.priority - c1.priority + (c2.added - c1.added) / deltaAdded;
});
}
return c2.priority - c1.priority + (c2.added - c1.added) / deltaAdded;
});
}
+ },
+ methods: {
+ withWho: function(c) {
+ if (c.from.sid == this.st.user.sid || c.from.id == this.st.user.id)
+ return c.to || this.st.tr["Any player"];
+ return c.from.name || "@nonymous";
+ }
}
};
</script>
}
};
</script>