Deploy testing

This commit is contained in:
Maximilian Leopold 2019-06-06 12:30:00 +02:00
parent 7380e0e5dc
commit 3d8e04bc10

View File

@ -24,17 +24,42 @@
<q-card class="q-mb-md" v-for="(user) in rankinglist" :key="user.id"> <q-card class="q-mb-md" v-for="(user) in rankinglist" :key="user.id">
<q-item class="q-pr-sm "> <q-item class="q-pr-sm ">
<q-item-section> <q-item-section>
<q-item-label v-if="username === user.username" @click="gotoProfile"><a class="text-green" style="text-decoration: none"><span>{{user.rank}}. {{user.username}}</span></a></q-item-label> <q-item-label v-if="username === user.username" @click="gotoProfile"><a class="text-green"
<q-item-label v-if="username !== user.username"><a class="text-black" style="text-decoration: none"><span>{{user.rank}}. {{user.username}}</span></a></q-item-label> style="text-decoration: none"><span>{{user.rank}}. {{user.username}}</span></a>
</q-item-section> </q-item-label>
<q-item-label v-if="username !== user.username"><a class="text-black"
style="text-decoration: none"><span>{{user.rank}}. {{user.username}}</span></a>
</q-item-label>
</q-item-section>
<q-item-section side> <q-item-section side>
<span class="text-grey">{{user.rankingPointsSum}} Punkte </span> <span class="text-grey">{{user.rankingPointsSum}} Punkte </span>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-card> </q-card>
<div v-if="hasAdminState" class="row"> <div class="column q-gutter-lg" style="">
<q-btn @click="resetRankingList" unelevated color="negative" label="Rangliste zurücksetzen" <div v-if="hasAdminState" class="col">
class="full-width"/> <div class="">
<div class="" style="max-width: 440px">
<q-input lazy-rules outlined filled stack-label
type="text"
label="Username eingeben"
unelevated color="negative"
></q-input>
</div>
</div>
</div>
<div v-if="hasAdminState" class="row">
<q-btn
label="Punkte des Nutzer zurücksetzen"
color="negative"
class="full-width"
/>
</div>
<div v-if="hasAdminState" class="row">
<q-btn @click="resetRankingList" unelevated color="negative" label="Gesamte Rangliste zurücksetzen"
class="full-width"/>
</div>
</div> </div>
</q-list> </q-list>
</q-tab-panel> </q-tab-panel>
@ -44,7 +69,9 @@
<q-card class="q-mb-md" v-for="(team,index) in teamRankinglist" :key="team.id"> <q-card class="q-mb-md" v-for="(team,index) in teamRankinglist" :key="team.id">
<q-item class="q-pr-sm "> <q-item class="q-pr-sm ">
<q-item-section> <q-item-section>
<q-item-label><a class="text-black" style="text-decoration: none"><span>{{index+1}}. {{team.teamname}}</span></a></q-item-label> <q-item-label><a class="text-black"
style="text-decoration: none"><span>{{index+1}}. {{team.teamname}}</span></a>
</q-item-label>
</q-item-section> </q-item-section>
<q-item-section side> <q-item-section side>
<span class="text-grey">{{team.rankingPointsSum}} Punkte </span> <span class="text-grey">{{team.rankingPointsSum}} Punkte </span>
@ -60,10 +87,10 @@
</template> </template>
<style> <style>
/* /*
.my-list-card-item .my-list-card-item
padding-left: 8px padding-left: 8px
*/ */
</style> </style>
<script> <script>
import {dom} from 'quasar' import {dom} from 'quasar'
@ -78,7 +105,7 @@
username: null username: null
} }
}, },
created: function() { created: function () {
console.log("created(): " + this.rankinglist); console.log("created(): " + this.rankinglist);
console.log("created(): " + this.teamRankinglist); console.log("created(): " + this.teamRankinglist);
this.fetchRankinglist(); this.fetchRankinglist();
@ -93,7 +120,7 @@
methods: { methods: {
fetchRankinglist() { fetchRankinglist() {
let token; let token;
if(localStorage.getItem('userToken')){ if (localStorage.getItem('userToken')) {
token = JSON.parse(localStorage.getItem('userToken')).token; token = JSON.parse(localStorage.getItem('userToken')).token;
this.$axios.get('/api/getRankingList', {params: {token}}) this.$axios.get('/api/getRankingList', {params: {token}})
.then((response) => { .then((response) => {
@ -121,10 +148,10 @@
}).catch((error) => { }).catch((error) => {
}) })
}, },
gotoProfile(){ gotoProfile() {
this.$router.push({path: `/Profile`}) this.$router.push({path: `/Profile`})
}, },
resetRankingList(){ resetRankingList() {
let token = JSON.parse(localStorage.getItem('userToken')).token; let token = JSON.parse(localStorage.getItem('userToken')).token;
this.$axios.get('/api/resetRankingList', {params: {token}}) this.$axios.get('/api/resetRankingList', {params: {token}})
.then((response) => { .then((response) => {
@ -143,7 +170,6 @@
}) })
}).catch((error) => { }).catch((error) => {
}).then() }).then()
}, },
calculateRank() { calculateRank() {
// TODO // TODO
@ -156,7 +182,10 @@
// } // }
// lastSum = ranking.rankingPointsSum; // lastSum = ranking.rankingPointsSum;
// } // }
} },
resetPoints(username){
},
} }
} }
</script> </script>