mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Number of users
This commit is contained in:
parent
308417852c
commit
070feb4b66
5 changed files with 43 additions and 20 deletions
|
|
@ -4,9 +4,12 @@ template(name="people")
|
||||||
| {{_ 'error-notAuthorized'}}
|
| {{_ 'error-notAuthorized'}}
|
||||||
else
|
else
|
||||||
.content-title.ext-box
|
.content-title.ext-box
|
||||||
|
.ext-box-left
|
||||||
span {{_ 'people'}}
|
span {{_ 'people'}}
|
||||||
input#searchInput(placeholder="{{_ 'search'}}")
|
input#searchInput(placeholder="{{_ 'search'}}")
|
||||||
button#searchButton {{_ 'enter'}}
|
button#searchButton {{_ 'enter'}}
|
||||||
|
.ext-box-right
|
||||||
|
span {{_ 'people-number'}} #{peopleNumber}
|
||||||
.content-body
|
.content-body
|
||||||
.side-menu
|
.side-menu
|
||||||
ul
|
ul
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ BlazeComponent.extendComponent({
|
||||||
this.loading = new ReactiveVar(false);
|
this.loading = new ReactiveVar(false);
|
||||||
this.people = new ReactiveVar(true);
|
this.people = new ReactiveVar(true);
|
||||||
this.findUsersOptions = new ReactiveVar({});
|
this.findUsersOptions = new ReactiveVar({});
|
||||||
|
this.number = new ReactiveVar(0);
|
||||||
|
|
||||||
this.page = new ReactiveVar(1);
|
this.page = new ReactiveVar(1);
|
||||||
this.loadNextPageLocked = false;
|
this.loadNextPageLocked = false;
|
||||||
|
|
@ -30,6 +31,16 @@ BlazeComponent.extendComponent({
|
||||||
events() {
|
events() {
|
||||||
return [{
|
return [{
|
||||||
'click #searchButton'(event) {
|
'click #searchButton'(event) {
|
||||||
|
this.filterPeople(event);
|
||||||
|
},
|
||||||
|
'keydown #searchInput'(event) {
|
||||||
|
if (event.keyCode === 13 && !event.shiftKey) {
|
||||||
|
this.filterPeople(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
},
|
||||||
|
filterPeople(event) {
|
||||||
const value = $('#searchInput').first().val();
|
const value = $('#searchInput').first().val();
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
this.findUsersOptions.set({});
|
this.findUsersOptions.set({});
|
||||||
|
|
@ -43,8 +54,6 @@ BlazeComponent.extendComponent({
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}];
|
|
||||||
},
|
},
|
||||||
loadNextPage() {
|
loadNextPage() {
|
||||||
if (this.loadNextPageLocked === false) {
|
if (this.loadNextPageLocked === false) {
|
||||||
|
|
@ -69,11 +78,16 @@ BlazeComponent.extendComponent({
|
||||||
this.loading.set(w);
|
this.loading.set(w);
|
||||||
},
|
},
|
||||||
peopleList() {
|
peopleList() {
|
||||||
// get users in front to cache them
|
const users = Users.find(this.findUsersOptions.get(), {
|
||||||
return Users.find(this.findUsersOptions.get(), {
|
|
||||||
fields: {_id: true},
|
fields: {_id: true},
|
||||||
});
|
});
|
||||||
|
this.number.set(users.count());
|
||||||
|
return users;
|
||||||
},
|
},
|
||||||
|
peopleNumber() {
|
||||||
|
return this.number.get();
|
||||||
|
}
|
||||||
|
|
||||||
}).register('people');
|
}).register('people');
|
||||||
|
|
||||||
Template.peopleRow.helpers({
|
Template.peopleRow.helpers({
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ table
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
|
|
||||||
|
.ext-box-left
|
||||||
|
display: flex;
|
||||||
|
width: 40%
|
||||||
|
|
||||||
span
|
span
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
|
|
|
||||||
|
|
@ -686,5 +686,6 @@
|
||||||
"error-ldap-login": "An error occurred while trying to login",
|
"error-ldap-login": "An error occurred while trying to login",
|
||||||
"display-authentication-method": "Display Authentication Method",
|
"display-authentication-method": "Display Authentication Method",
|
||||||
"default-authentication-method": "Default Authentication Method",
|
"default-authentication-method": "Default Authentication Method",
|
||||||
"duplicate-board": "Duplicate Board"
|
"duplicate-board": "Duplicate Board",
|
||||||
|
"people-number": "The number of people is: "
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -683,5 +683,6 @@
|
||||||
"error-ldap-login": "Une erreur s'est produite lors de la tentative de connexion",
|
"error-ldap-login": "Une erreur s'est produite lors de la tentative de connexion",
|
||||||
"display-authentication-method": "Afficher la méthode d'authentification",
|
"display-authentication-method": "Afficher la méthode d'authentification",
|
||||||
"default-authentication-method": "Méthode d'authentification par défaut",
|
"default-authentication-method": "Méthode d'authentification par défaut",
|
||||||
"duplicate-board": "Dupliquer le tableau"
|
"duplicate-board": "Dupliquer le tableau",
|
||||||
|
"people-number": "Le nombre d'utilisateurs est de : "
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue