projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sort problems by datetime
[vchess.git]
/
client
/
src
/
views
/
Problems.vue
diff --git
a/client/src/views/Problems.vue
b/client/src/views/Problems.vue
index
d3dfdfd
..
9fa2d79
100644
(file)
--- a/
client/src/views/Problems.vue
+++ b/
client/src/views/Problems.vue
@@
-42,7
+42,7
@@
main
.col-sm-12.col-md-10.col-md-offset-2
#topPage
span.vname {{ curproblem.vname }}
.col-sm-12.col-md-10.col-md-offset-2
#topPage
span.vname {{ curproblem.vname }}
- span.uname
{{ "(" + curproblem.uname + ")" }}
+ span.uname
({{ curproblem.uname }})
button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
button.nomargin(
v-if="st.user.id == curproblem.uid"
button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
button.nomargin(
v-if="st.user.id == curproblem.uid"
@@
-86,7
+86,7
@@
main
th {{ st.tr["Instructions"] }}
th {{ st.tr["Number"] }}
tr(
th {{ st.tr["Instructions"] }}
th {{ st.tr["Number"] }}
tr(
- v-for="p in
p
roblems"
+ v-for="p in
sortedP
roblems"
v-show="displayProblem(p)"
@click="setHrefPid(p)"
)
v-show="displayProblem(p)"
@click="setHrefPid(p)"
)
@@
-191,6
+191,12
@@
export default {
this.showOne = false
},
},
this.showOne = false
},
},
+ computed: {
+ sortedProblems: function() {
+ // Newest first:
+ return this.problems.sort( (p1,p2) => p2.added - p1.added);
+ },
+ },
methods: {
setVname: function(prob) {
prob.vname = this.st.variants.find(v => v.id == prob.vid).name;
methods: {
setVname: function(prob) {
prob.vname = this.st.variants.find(v => v.id == prob.vid).name;