Wines
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
public/index.html
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Vinlottis</title>
|
|
||||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
|
||||||
<link href=/dist/css/vinlottis.37fd51a.css rel=stylesheet></head>
|
|
||||||
<body>
|
|
||||||
<div id=app></div>
|
|
||||||
<script type=text/javascript src=/dist/js/vinlottis.bundle.37fd51a.js></script></body>
|
|
||||||
</html>
|
|
||||||
46
src/ui/Wines.vue
Normal file
46
src/ui/Wines.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="wines.length > 0">
|
||||||
|
<h3>Viner</h3>
|
||||||
|
<ol>
|
||||||
|
<li v-for="wine in wines">
|
||||||
|
<span v-if="wine.vivinoLink == '' || wine.vivinoLink == null">{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</span>
|
||||||
|
<a :href="wine.vivinoLink" v-if="wine.vivinoLink != '' && wine.vivinoLink != null">{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return { wines: [] };
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
let _response = await fetch("/api/wines/statistics");
|
||||||
|
let response = await _response.json();
|
||||||
|
|
||||||
|
response.sort();
|
||||||
|
response = response.filter(
|
||||||
|
wine => wine.name != null && wine.name != ""
|
||||||
|
).sort((a, b) =>
|
||||||
|
a.occurences > b.occurences ? -1 : 1
|
||||||
|
);
|
||||||
|
this.wines = response;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
h3 {
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
font-family: sans-serif;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user