X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2FApp.vue;h=15e2f101dc8c3fc040b2470338176ebca84d8ea4;hb=6f2f94374f1e73c375edf732d9425e575e81fff7;hp=8258dc3ed574608360a6b807628abe490db4056c;hpb=42a9284896b9cf9a579d32b7cf77dfc1f5786472;p=vchess.git diff --git a/client/src/App.vue b/client/src/App.vue index 8258dc3e..15e2f101 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -34,8 +34,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"] }} - a.menuitem(href="https://discord.gg/a9ZFKBe") Discord - 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"] }} @@ -45,6 +50,7 @@ import ContactForm from "@/components/ContactForm.vue"; import Settings from "@/components/Settings.vue"; import UpsertUser from "@/components/UpsertUser.vue"; import { store } from "@/store.js"; +import { ajax } from "@/utils/ajax.js"; export default { components: { ContactForm, @@ -52,9 +58,19 @@ export default { UpsertUser }, data: function() { - return { - st: store.state - }; + return { st: store.state }; + }, + mounted: function() { + ajax( + "/newsts", + "GET", + { + success: (res) => { + if (this.st.user.newsRead < res.timestamp) + document.getElementById("newsMenu").classList.add("somenews"); + } + } + ); }, methods: { hideDrawer: function(e) { @@ -68,8 +84,8 @@ export default {