X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2FApp.vue;h=369391e7b495beb85f2abb78b3f811c473691c60;hb=472c0c4f5aa29d96e080873ebfce2a04f664d852;hp=3839976c4ca0ade076f3d0fd2d9880a5f695d693;hpb=afde76668963c4d0d96002fcae2ebabb9acf81e4;p=vchess.git diff --git a/client/src/App.vue b/client/src/App.vue index 3839976c..369391e7 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -24,8 +24,7 @@ router-link(to="/problems") | {{ st.tr["Problems"] }} #rightMenu - .clickable(onClick="window.doClick('modalUser')") - | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }} + .clickable(onClick="window.doClick('modalUser')") {{ userName }} #divSettings.clickable(onClick="window.doClick('modalSettings')") span {{ st.tr["Settings"] }} img(src="/images/icons/settings.svg") @@ -34,7 +33,13 @@ .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 footer router-link.menuitem(to="/about") {{ st.tr["About"] }} - router-link.menuitem(to="/news") {{ st.tr["News"] }} + router-link.menuitem#newsMenu(to="/news") {{ st.tr["News"] }} + a.menuitem(href="https://discord.gg/a9ZFKBe") + span Discord + img(src="/images/icons/discord.svg") + a.menuitem(href="https://github.com/yagu0/vchess") + span {{ st.tr["Code"] }} + img(src="/images/icons/github.svg") p.clickable(onClick="window.doClick('modalContact')") | {{ st.tr["Contact"] }} @@ -43,8 +48,8 @@ import ContactForm from "@/components/ContactForm.vue"; import Settings from "@/components/Settings.vue"; import UpsertUser from "@/components/UpsertUser.vue"; -import { store } from "./store.js"; -import { processModalClick } from "./utils/modalClick.js"; +import { store } from "@/store.js"; +import { ajax } from "@/utils/ajax.js"; export default { components: { ContactForm, @@ -52,15 +57,28 @@ export default { UpsertUser }, data: function() { - return { - st: store.state - }; + return { st: store.state }; }, mounted: function() { - let dialogs = document.querySelectorAll("div[role='dialog']"); - dialogs.forEach(d => { - d.addEventListener("click", processModalClick); - }); + ajax( + "/newsts", + "GET", + { + success: (res) => { + if (this.st.user.newsRead < res.timestamp) + document.getElementById("newsMenu").classList.add("somenews"); + } + } + ); + }, + computed: { + userName: function() { + return ( + this.st.user.id > 0 + ? (this.st.user.name || "@nonymous") + : "Login" + ); + } }, methods: { hideDrawer: function(e) { @@ -74,8 +92,8 @@ export default {