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:
52a8ab5
)
Add chat to Hall, clickable FEN, fix contact form
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 27 Jan 2020 07:50:20 +0000
(08:50 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 27 Jan 2020 07:50:20 +0000
(08:50 +0100)
client/src/components/BaseGame.vue
patch
|
blob
|
blame
|
history
client/src/components/ContactForm.vue
patch
|
blob
|
blame
|
history
client/src/translations/en.js
patch
|
blob
|
blame
|
history
client/src/views/Hall.vue
patch
|
blob
|
blame
|
history
server/routes/messages.js
patch
|
blob
|
blame
|
history
diff --git
a/client/src/components/BaseGame.vue
b/client/src/components/BaseGame.vue
index
6d9904e
..
e880de5
100644
(file)
--- a/
client/src/components/BaseGame.vue
+++ b/
client/src/components/BaseGame.vue
@@
-17,7
+17,7
@@
div
button(@click="gotoBegin") GotoBegin
button(@click="gotoEnd") GotoEnd
#fenDiv(v-if="showFen && !!vr")
button(@click="gotoBegin") GotoBegin
button(@click="gotoEnd") GotoEnd
#fenDiv(v-if="showFen && !!vr")
- p {{ vr.getFen() }}
+ p
(@click="gotoFenContent")
{{ vr.getFen() }}
#pgnDiv
a#download(href="#")
button(@click="download") {{ st.tr["Download PGN"] }}
#pgnDiv
a#download(href="#")
button(@click="download") {{ st.tr["Download PGN"] }}
@@
-104,6
+104,10
@@
export default {
this.cursor = L-1;
this.lastMove = (L > 0 ? this.moves[L-1] : null);
},
this.cursor = L-1;
this.lastMove = (L > 0 ? this.moves[L-1] : null);
},
+ gotoFenContent: function(event) {
+ this.$router.push("/analyze/" + this.game.vname +
+ "/?fen=" + event.target.innerText.replace(/ /g, "_"));
+ },
download: function() {
const content = this.getPgn();
// Prepare and trigger download link
download: function() {
const content = this.getPgn();
// Prepare and trigger download link
diff --git
a/client/src/components/ContactForm.vue
b/client/src/components/ContactForm.vue
index
20d35b0
..
aae0a50
100644
(file)
--- a/
client/src/components/ContactForm.vue
+++ b/
client/src/components/ContactForm.vue
@@
-16,13
+16,15
@@
div
br
textarea#mailContent
fieldset
br
textarea#mailContent
fieldset
- button(type="button"
onClick="trySendMessage()
") Send
+ button(type="button"
@click="trySendMessage
") Send
p#emailSent {{ st.tr["Email sent!"] }}
</template>
<script>
import { ajax } from "../utils/ajax";
import { store } from "@/store";
p#emailSent {{ st.tr["Email sent!"] }}
</template>
<script>
import { ajax } from "../utils/ajax";
import { store } from "@/store";
+import { checkNameEmail } from "@/data/userCheck";
+
export default {
name: "my-contact-form",
data: function() {
export default {
name: "my-contact-form",
data: function() {
diff --git
a/client/src/translations/en.js
b/client/src/translations/en.js
index
23bb487
..
2a50968
100644
(file)
--- a/
client/src/translations/en.js
+++ b/
client/src/translations/en.js
@@
-4,8
+4,8
@@
export const translations =
"Variants": "Variants",
"My games": "My games",
"Forum": "Forum",
"Variants": "Variants",
"My games": "My games",
"Forum": "Forum",
- "Contact
form": "Contact form
",
- "
Source code": "Source code
",
+ "Contact
": "Contact
",
+ "
About": "About
",
"Language": "Language",
"Email": "Email",
"Language": "Language",
"Email": "Email",
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
3a57944
..
e090d9e
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-26,10
+26,12
@@
main
input#inputFen(type="text" v-model="newchallenge.fen")
button(@click="newChallenge") {{ st.tr["Send challenge"] }}
.row
input#inputFen(type="text" v-model="newchallenge.fen")
button(@click="newChallenge") {{ st.tr["Send challenge"] }}
.row
- .col-sm-12.col-md-
10.col-md-offset-1.col-lg-8.col-lg-offset-2
+ .col-sm-12.col-md-
9.col-md-offset-3
button(onClick="doClick('modalNewgame')") New game
.row
button(onClick="doClick('modalNewgame')") New game
.row
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
+ .col-sm-12.col-md-3
+ Chat(:players="[]")
+ .col-sm-12.col-md-9
.collapse
input#challengeSection(type="radio" checked aria-hidden="true" name="accordion")
label(for="challengeSection" aria-hidden="true") Challenges
.collapse
input#challengeSection(type="radio" checked aria-hidden="true" name="accordion")
label(for="challengeSection" aria-hidden="true") Challenges
@@
-73,12
+75,14
@@
import { checkChallenge } from "@/data/challengeCheck";
import { ArrayFun } from "@/utils/array";
import { ajax } from "@/utils/ajax";
import { getRandString, shuffle } from "@/utils/alea";
import { ArrayFun } from "@/utils/array";
import { ajax } from "@/utils/ajax";
import { getRandString, shuffle } from "@/utils/alea";
+import Chat from "@/components/Chat.vue";
import GameList from "@/components/GameList.vue";
import ChallengeList from "@/components/ChallengeList.vue";
import { GameStorage } from "@/utils/gameStorage";
export default {
name: "my-hall",
components: {
import GameList from "@/components/GameList.vue";
import ChallengeList from "@/components/ChallengeList.vue";
import { GameStorage } from "@/utils/gameStorage";
export default {
name: "my-hall",
components: {
+ Chat,
GameList,
ChallengeList,
},
GameList,
ChallengeList,
},
diff --git
a/server/routes/messages.js
b/server/routes/messages.js
index
74ec8bd
..
02ddec5
100644
(file)
--- a/
server/routes/messages.js
+++ b/
server/routes/messages.js
@@
-2,16
+2,19
@@
let router = require("express").Router();
const mailer = require(__dirname.replace("/routes", "/utils/mailer"));
let router = require("express").Router();
const mailer = require(__dirname.replace("/routes", "/utils/mailer"));
+const params = require(__dirname.replace("/routes", "/config/parameters"));
// Send a message through contact form
router.post("/messages", (req,res,next) => {
if (!req.xhr)
return res.json({errmsg: "Unauthorized access"});
// Send a message through contact form
router.post("/messages", (req,res,next) => {
if (!req.xhr)
return res.json({errmsg: "Unauthorized access"});
- const from = req.body["email"];
+ console.log(req.body);
+ const from = req.body["email"];
const subject = req.body["subject"];
const subject = req.body["subject"];
- const body = req.body["body"];
+ const body = req.body["content"];
+
// TODO: sanitize ?
// TODO: sanitize ?
- mailer
.send(from, mailer
.contact, subject, body, err => {
+ mailer
(from, params.mail
.contact, subject, body, err => {
if (!!err)
return res.json({errmsg:err});
// OK, everything fine
if (!!err)
return res.json({errmsg:err});
// OK, everything fine