add active members count and fixing style for small screens

resolve tickets #220 and ticket #221
https://groeger-clan.duckdns.org/redmine/issues/220
https://groeger-clan.duckdns.org/redmine/issues/221
This commit is contained in:
Gregor 2020-03-10 00:32:06 +01:00
parent 53676763ea
commit 811111f486
2 changed files with 54 additions and 8 deletions

View File

@ -107,7 +107,7 @@
</v-col> </v-col>
</v-row> </v-row>
<v-row> <v-row>
<v-col> <v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-combobox <v-combobox
outlined outlined
multiple multiple
@ -131,17 +131,17 @@
</template> </template>
</v-combobox> </v-combobox>
</v-col> </v-col>
<v-col> <v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-text-field outlined :value="computeStatus" readonly label="Mitgliedsstatus"/> <v-text-field outlined :value="computeStatus" readonly label="Mitgliedsstatus"/>
</v-col> </v-col>
<v-col> <v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-text-field outlined :value="user.voting ? 'ja' : 'nein'" readonly label="Stimmrecht" /> <v-text-field outlined :value="user.voting ? 'ja' : 'nein'" readonly label="Stimmrecht" />
</v-col> </v-col>
</v-row> </v-row>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn text color="primary" @click="save">Save</v-btn> <v-btn text color="primary" @click="save">Speicherns</v-btn>
</v-card-actions> </v-card-actions>
<v-expand-transition> <v-expand-transition>
<v-alert type="error" v-if="error">{{ error }}</v-alert> <v-alert type="error" v-if="error">{{ error }}</v-alert>
@ -172,6 +172,7 @@ export default {
lastname: null, lastname: null,
password: null, password: null,
controlPassword: null, controlPassword: null,
isFulllineText: false,
equal_password: value => equal_password: value =>
this.password === value || 'Passwörter sind nicht identisch.', this.password === value || 'Passwörter sind nicht identisch.',
email: value => { email: value => {
@ -183,11 +184,21 @@ export default {
} }
} }
}, },
mounted() {
this.$nextTick(function() {
window.addEventListener('resize', this.getWindowWidth);
this.getWindowWidth()
})
},
methods: { methods: {
...mapActions({ ...mapActions({
saveConfig: 'user/saveConfig', saveConfig: 'user/saveConfig',
getStatus: 'user/getStatus' getStatus: 'user/getStatus'
}), }),
getWindowWidth() {
this.isFulllineText = document.documentElement.clientWidth <= 600;
},
save() { save() {
let user = {} let user = {}
if (this.firstname) user.firstname = this.firstname if (this.firstname) user.firstname = this.firstname
@ -237,4 +248,7 @@ export default {
} }
</script> </script>
<style scoped></style> <style scoped>
.fulllineText{
flex-basis: unset;
}</style>

View File

@ -85,7 +85,7 @@
<v-card-text> <v-card-text>
<v-container> <v-container>
<v-row> <v-row>
<v-col> <v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-text-field <v-text-field
outlined outlined
:value="users.length" :value="users.length"
@ -93,7 +93,15 @@
readonly readonly
/> />
</v-col> </v-col>
<v-col> <v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-text-field
outlined
:value="allActiveUsers"
label="Anzahl aller aktiven Mitglieder"
readonly
/>
</v-col>
<v-col v-bind:class="{ fulllineText: isFulllineText }">
<v-text-field <v-text-field
outlined outlined
:value="allVotings" :value="allVotings"
@ -117,6 +125,7 @@ export default {
return { return {
editIcon: mdiPencil, editIcon: mdiPencil,
searchIcon: mdiMagnify, searchIcon: mdiMagnify,
isFulllineText: false,
editUser: false, editUser: false,
disableVoting: null, disableVoting: null,
search: null, search: null,
@ -160,6 +169,15 @@ export default {
} }
} }
}, },
mounted() {
this.$nextTick(function() {
window.addEventListener('resize', this.getWindowWidth);
this.getWindowWidth()
})
},
methods: { methods: {
...mapActions({ ...mapActions({
getUsers: 'usermanager/getUsers', getUsers: 'usermanager/getUsers',
@ -167,6 +185,9 @@ export default {
updateStatusUser: 'usermanager/updateStatusUser', updateStatusUser: 'usermanager/updateStatusUser',
updateVoting: 'usermanager/updateVoting' updateVoting: 'usermanager/updateVoting'
}), }),
getWindowWidth() {
this.isFulllineText = document.documentElement.clientWidth <= 750;
},
close() { close() {
this.editUser = false this.editUser = false
setTimeout(() => { setTimeout(() => {
@ -228,9 +249,16 @@ export default {
} }
}, },
allVotings() { allVotings() {
console.log(this.users);
return this.users.filter(a => { return this.users.filter(a => {
return a.voting return a.voting
}).length }).length
},
allActiveUsers(){
return this.users.filter(a => {
return a.statusgroup === 1
}).length
} }
}, },
created() { created() {
@ -240,4 +268,8 @@ export default {
} }
</script> </script>
<style scoped></style> <style scoped>
.fulllineText{
flex-basis: unset;
}
</style>