mirror of
https://github.com/wekan/wekan.git
synced 2026-03-07 22:22:33 +01:00
Add a possibility of selecting displayed users in admin panel
This commit is contained in:
parent
5a5a01cf17
commit
fb00869e49
3 changed files with 42 additions and 3 deletions
|
|
@ -108,6 +108,7 @@ template(name="peopleGeneral")
|
||||||
tbody
|
tbody
|
||||||
tr
|
tr
|
||||||
th
|
th
|
||||||
|
+selectAllUser
|
||||||
th {{_ 'username'}}
|
th {{_ 'username'}}
|
||||||
th {{_ 'fullname'}}
|
th {{_ 'fullname'}}
|
||||||
th {{_ 'initials'}}
|
th {{_ 'initials'}}
|
||||||
|
|
@ -125,6 +126,10 @@ template(name="peopleGeneral")
|
||||||
each user in peopleList
|
each user in peopleList
|
||||||
+peopleRow(userId=user._id)
|
+peopleRow(userId=user._id)
|
||||||
|
|
||||||
|
template(name="selectAllUser")
|
||||||
|
{{_ 'dueCardsViewChange-choice-all'}}
|
||||||
|
input.allUserChkBox(type="checkbox", id="chkSelectAll")
|
||||||
|
|
||||||
template(name="newOrgRow")
|
template(name="newOrgRow")
|
||||||
a.new-org
|
a.new-org
|
||||||
i.fa.fa-plus-square
|
i.fa.fa-plus-square
|
||||||
|
|
|
||||||
|
|
@ -524,6 +524,41 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('newUserRow');
|
}).register('newUserRow');
|
||||||
|
|
||||||
|
BlazeComponent.extendComponent({
|
||||||
|
events() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'click .allUserChkBox': function(ev){
|
||||||
|
selectedUserChkBoxUserIds = [];
|
||||||
|
const checkboxes = document.getElementsByClassName("selectUserChkBox");
|
||||||
|
if(ev.currentTarget){
|
||||||
|
if(ev.currentTarget.checked){
|
||||||
|
for (let i=0; i<checkboxes.length; i++) {
|
||||||
|
if (!checkboxes[i].disabled) {
|
||||||
|
selectedUserChkBoxUserIds.push(checkboxes[i].id);
|
||||||
|
checkboxes[i].checked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for (let i=0; i<checkboxes.length; i++) {
|
||||||
|
if (!checkboxes[i].disabled) {
|
||||||
|
checkboxes[i].checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selectedUserChkBoxUserIds.length > 0)
|
||||||
|
document.getElementById("divAddOrRemoveTeam").style.display = 'block';
|
||||||
|
else
|
||||||
|
document.getElementById("divAddOrRemoveTeam").style.display = 'none';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
}).register('selectAllUser');
|
||||||
|
|
||||||
Template.editOrgPopup.events({
|
Template.editOrgPopup.events({
|
||||||
submit(event, templateInstance) {
|
submit(event, templateInstance) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -535,8 +570,7 @@ Template.editOrgPopup.events({
|
||||||
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
||||||
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
||||||
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
||||||
const orgIsActive =
|
const orgIsActive = templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
||||||
templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
|
||||||
|
|
||||||
const isChangeOrgDisplayName = orgDisplayName !== org.orgDisplayName;
|
const isChangeOrgDisplayName = orgDisplayName !== org.orgDisplayName;
|
||||||
const isChangeOrgDesc = orgDesc !== org.orgDesc;
|
const isChangeOrgDesc = orgDesc !== org.orgDesc;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ table
|
||||||
.js-teams,.js-teamsNewUser
|
.js-teams,.js-teamsNewUser
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
.selectUserChkBox
|
.selectUserChkBox,.allUserChkBox
|
||||||
position: static !important;
|
position: static !important;
|
||||||
visibility: visible !important;
|
visibility: visible !important;
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue