Move changelog window to Vue

This commit is contained in:
Pavel Djundik 2019-02-20 17:09:44 +02:00
parent 70d9d8d226
commit 3f7889e534
3 changed files with 23 additions and 17 deletions

View file

@ -78,6 +78,7 @@ import Chat from "./Chat.vue";
import SignIn from "./Windows/SignIn.vue"; import SignIn from "./Windows/SignIn.vue";
import Settings from "./Windows/Settings.vue"; import Settings from "./Windows/Settings.vue";
import Help from "./Windows/Help.vue"; import Help from "./Windows/Help.vue";
import Changelog from "./Windows/Changelog.vue";
export default { export default {
name: "App", name: "App",
@ -87,6 +88,7 @@ export default {
SignIn, SignIn,
Settings, Settings,
Help, Help,
Changelog,
}, },
props: { props: {
activeWindow: String, activeWindow: String,

View file

@ -12,24 +12,26 @@
<a <a
id="back-to-help" id="back-to-help"
href="#" href="#"
data-target="#help">« Help</a> data-target="Help">« Help</a>
{{#if version}} <template v-if="version">
<h1 class="title">Release notes for {{ version }}</h1> <h1 class="title">Release notes for {{ version }}</h1>
{{#if changelog}} <template v-if="changelog">
<h3>Introduction</h3> <h3>Introduction</h3>
<div class="changelog-text">{{{changelog}}}</div> <div class="changelog-text">{{ changelog }}</div>
{{else}} </template>
<p>Unable to retrieve releases from GitHub.</p> <template v-else>
<p><a <p>Unable to retrieve releases from GitHub.</p>
href="https://github.com/thelounge/thelounge/releases/tag/v{{version}}" <p>
target="_blank" <a
rel="noopener">View release notes for this version on GitHub</a></p> :href="`https://github.com/thelounge/thelounge/releases/tag/v${version}`"
{{/if}} target="_blank"
{{else}} rel="noopener">View release notes for this version on GitHub</a>
<p>Loading changelog</p> </p>
{{/if}} </template>
</template>
<p v-else>Loading changelog</p>
</div> </div>
</div> </div>
@ -38,5 +40,8 @@
<script> <script>
export default { export default {
name: "Changelog", name: "Changelog",
mounted() {
},
}; };
</script> </script>

View file

@ -4,7 +4,6 @@ const $ = require("jquery");
const socket = require("../socket"); const socket = require("../socket");
const templates = require("../../views"); const templates = require("../../views");
const sidebar = $("#sidebar"); const sidebar = $("#sidebar");
const utils = require("../utils");
const {vueApp, initChannel, findChannel} = require("../vue"); const {vueApp, initChannel, findChannel} = require("../vue");
socket.on("network", function(data) { socket.on("network", function(data) {