projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
882ec6f
)
Add basic news navigation with prev/next buttons
author
Benjamin Auder
<benjamin.auder@somewhere>
Tue, 24 Mar 2020 15:09:28 +0000
(16:09 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Tue, 24 Mar 2020 15:09:28 +0000
(16:09 +0100)
client/src/translations/en.js
patch
|
blob
|
blame
|
history
client/src/translations/es.js
patch
|
blob
|
blame
|
history
client/src/translations/fr.js
patch
|
blob
|
blame
|
history
client/src/views/News.vue
patch
|
blob
|
blame
|
history
client/src/views/Problems.vue
patch
|
blob
|
blame
|
history
diff --git
a/client/src/translations/en.js
b/client/src/translations/en.js
index
513922a
..
75d9b89
100644
(file)
--- a/
client/src/translations/en.js
+++ b/
client/src/translations/en.js
@@
-77,6
+77,7
@@
export const translations = {
"Name or Email": "Name or Email",
Next_p: "Next",
Next_g: "Next",
"Name or Email": "Name or Email",
Next_p: "Next",
Next_g: "Next",
+ Next_n: "Next",
"New connexion detected: tab now offline": "New connexion detected: tab now offline",
"New correspondance game:": "New correspondance game:",
"New game": "New game",
"New connexion detected: tab now offline": "New connexion detected: tab now offline",
"New correspondance game:": "New correspondance game:",
"New game": "New game",
@@
-100,7
+101,8
@@
export const translations = {
Practice: "Practice",
"Prefix?": "Prefix?",
"Preset challenges": "Preset challenges",
Practice: "Practice",
"Prefix?": "Prefix?",
"Preset challenges": "Preset challenges",
- Previous: "Previous",
+ Previous_n: "Previous",
+ Previous_p: "Previous",
"Processing... Please wait": "Processing... Please wait",
Problems: "Problems",
"Random?": "Random?",
"Processing... Please wait": "Processing... Please wait",
Problems: "Problems",
"Random?": "Random?",
diff --git
a/client/src/translations/es.js
b/client/src/translations/es.js
index
fb13e28
..
465f39f
100644
(file)
--- a/
client/src/translations/es.js
+++ b/
client/src/translations/es.js
@@
-77,6
+77,7
@@
export const translations = {
"Name or Email": "Nombre o Email",
Next_p: "Siguiente",
Next_g: "Siguiente",
"Name or Email": "Nombre o Email",
Next_p: "Siguiente",
Next_g: "Siguiente",
+ Next_n: "Siguiente",
"New connexion detected: tab now offline": "Nueva conexión detectada: pestaña ahora desconectada",
"New correspondance game:": "Nueva partida por correspondencia:",
"New game": "Nueva partida",
"New connexion detected: tab now offline": "Nueva conexión detectada: pestaña ahora desconectada",
"New correspondance game:": "Nueva partida por correspondencia:",
"New game": "Nueva partida",
@@
-100,7
+101,8
@@
export const translations = {
Practice: "Práctica",
"Prefix?": "¿Prefijo?",
"Preset challenges": "Desafíos registrados",
Practice: "Práctica",
"Prefix?": "¿Prefijo?",
"Preset challenges": "Desafíos registrados",
- Previous: "Anterior",
+ Previous_p: "Anterior",
+ Previous_n: "Anterior",
"Processing... Please wait": "Procesando... por favor espere",
Problems: "Problemas",
"Random?": "Aleatorio?",
"Processing... Please wait": "Procesando... por favor espere",
Problems: "Problemas",
"Random?": "Aleatorio?",
diff --git
a/client/src/translations/fr.js
b/client/src/translations/fr.js
index
8524dcb
..
62dd3ba
100644
(file)
--- a/
client/src/translations/fr.js
+++ b/
client/src/translations/fr.js
@@
-77,6
+77,7
@@
export const translations = {
"Name or Email": "Nom ou Email",
Next_p: "Suivant",
Next_g: "Suivante",
"Name or Email": "Nom ou Email",
Next_p: "Suivant",
Next_g: "Suivante",
+ Next_n: "Suivante",
"New connexion detected: tab now offline": "Nouvelle connexion détectée : onglet désormais hors ligne",
"New correspondance game:": "Nouvelle partie par corespondance :",
"New game": "Nouvelle partie",
"New connexion detected: tab now offline": "Nouvelle connexion détectée : onglet désormais hors ligne",
"New correspondance game:": "Nouvelle partie par corespondance :",
"New game": "Nouvelle partie",
@@
-100,7
+101,8
@@
export const translations = {
Practice: "Pratiquer",
"Prefix?": "Préfixe ?",
"Preset challenges": "Défis enregistrés",
Practice: "Pratiquer",
"Prefix?": "Préfixe ?",
"Preset challenges": "Défis enregistrés",
- Previous: "Précédent",
+ Previous_p: "Précédent",
+ Previous_n: "Précédente",
"Processing... Please wait": "Traitement en cours... Attendez SVP",
Problems: "Problèmes",
"Random?": "Aléatoire?",
"Processing... Please wait": "Traitement en cours... Attendez SVP",
Problems: "Problèmes",
"Random?": "Aléatoire?",
diff --git
a/client/src/views/News.vue
b/client/src/views/News.vue
index
a4ce579
..
dd3c84e
100644
(file)
--- a/
client/src/views/News.vue
+++ b/
client/src/views/News.vue
@@
-23,12
+23,15
@@
main
| {{ st.tr["Write news"] }}
.news(
v-for="n,idx in newsList"
| {{ st.tr["Write news"] }}
.news(
v-for="n,idx in newsList"
+ :id="'n' + n.id"
:class="{margintop:idx>0}"
)
span.ndt {{ formatDatetime(n.added) }}
.dev-buttons(v-if="devs.includes(st.user.id)")
button(@click="editNews(n)") {{ st.tr["Edit"] }}
button(@click="deleteNews(n)") {{ st.tr["Delete"] }}
:class="{margintop:idx>0}"
)
span.ndt {{ formatDatetime(n.added) }}
.dev-buttons(v-if="devs.includes(st.user.id)")
button(@click="editNews(n)") {{ st.tr["Edit"] }}
button(@click="deleteNews(n)") {{ st.tr["Delete"] }}
+ button(@click="gotoPrevNext(n, 1)") {{ st.tr["Previous_n"] }}
+ button(@click="gotoPrevNext(n, -1)") {{ st.tr["Next_n"] }}
.news-content(v-html="parseHtml(n.content)")
button#loadMoreBtn(
v-if="hasMore"
.news-content(v-html="parseHtml(n.content)")
button#loadMoreBtn(
v-if="hasMore"
@@
-107,6
+110,10
@@
export default {
this.curnews.content = "";
// No need for added and uid fields: never updated
},
this.curnews.content = "";
// No need for added and uid fields: never updated
},
+ gotoPrevNext: function(n, dir) {
+ document.getElementById("n" + n.id)[
+ (dir < 0 ? "previous" : "next") + "ElementSibling"].scrollIntoView();
+ },
showModalNews: function() {
this.resetCurnews();
window.doClick("modalNews");
showModalNews: function() {
this.resetCurnews();
window.doClick("modalNews");
@@
-122,7
+129,7
@@
export default {
success: (res) => {
if (edit) {
let n = this.newsList.find(n => n.id == this.curnews.id);
success: (res) => {
if (edit) {
let n = this.newsList.find(n => n.id == this.curnews.id);
- if (n) n.content = this.curnews.content;
+ if (
!!
n) n.content = this.curnews.content;
} else {
const newNews = {
content: this.curnews.content,
} else {
const newNews = {
content: this.curnews.content,
diff --git
a/client/src/views/Problems.vue
b/client/src/views/Problems.vue
index
f1c2d08
..
1884852
100644
(file)
--- a/
client/src/views/Problems.vue
+++ b/
client/src/views/Problems.vue
@@
-54,7
+54,7
@@
main
span.uname ({{ curproblem.uname }})
button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
button.nomargin(@click="gotoPrevNext($event,curproblem,1)")
span.uname ({{ curproblem.uname }})
button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
button.nomargin(@click="gotoPrevNext($event,curproblem,1)")
- | {{ st.tr["Previous"] }}
+ | {{ st.tr["Previous
_p
"] }}
button.nomargin(@click="gotoPrevNext($event,curproblem,-1)")
| {{ st.tr["Next_p"] }}
p.oneInstructions.clickable(
button.nomargin(@click="gotoPrevNext($event,curproblem,-1)")
| {{ st.tr["Next_p"] }}
p.oneInstructions.clickable(