mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Fix Admin Panel / People editing and layout.
Thanks to xet7 ! Fixes #5961
This commit is contained in:
parent
8d3b53f51d
commit
7a585a3dfb
5 changed files with 67 additions and 65 deletions
|
|
@ -93,6 +93,29 @@
|
||||||
max-height: inherit;
|
max-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Admin edit popups: use full height */
|
||||||
|
.pop-over[data-popup="editUser"],
|
||||||
|
.pop-over[data-popup="editOrg"],
|
||||||
|
.pop-over[data-popup="editTeam"] {
|
||||||
|
height: calc(100vh - 20px) !important;
|
||||||
|
max-height: calc(100vh - 20px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over[data-popup="editUser"] .content-wrapper,
|
||||||
|
.pop-over[data-popup="editOrg"] .content-wrapper,
|
||||||
|
.pop-over[data-popup="editTeam"] .content-wrapper {
|
||||||
|
max-height: calc(100vh - 80px) !important; /* Subtract header height */
|
||||||
|
height: calc(100vh - 80px) !important;
|
||||||
|
overflow-y: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over[data-popup="editUser"] .content-container,
|
||||||
|
.pop-over[data-popup="editOrg"] .content-container,
|
||||||
|
.pop-over[data-popup="editTeam"] .content-container {
|
||||||
|
max-height: calc(100vh - 80px) !important; /* Subtract header height */
|
||||||
|
height: calc(100vh - 80px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ensure language popup list can scroll properly */
|
/* Ensure language popup list can scroll properly */
|
||||||
.pop-over .pop-over-list {
|
.pop-over .pop-over-list {
|
||||||
max-height: none;
|
max-height: none;
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,13 @@ table tr:nth-child(even) {
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make checkbox column fit content */
|
||||||
|
table th:first-child,
|
||||||
|
table td:first-child {
|
||||||
|
width: auto;
|
||||||
|
min-width: auto;
|
||||||
|
}
|
||||||
#divAddOrRemoveTeam {
|
#divAddOrRemoveTeam {
|
||||||
background: #008000;
|
background: #008000;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
@ -141,7 +148,7 @@ table tr:nth-child(even) {
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-active-status {
|
.account-active-status {
|
||||||
width: 20px;
|
width: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +177,7 @@ table tr:nth-child(even) {
|
||||||
}
|
}
|
||||||
|
|
||||||
.account-status {
|
.account-status {
|
||||||
width: 20px;
|
width: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ template(name="people")
|
||||||
option(value="locked") {{_ 'admin-people-filter-locked'}}
|
option(value="locked") {{_ 'admin-people-filter-locked'}}
|
||||||
option(value="active") {{_ 'admin-people-filter-active'}}
|
option(value="active") {{_ 'admin-people-filter-active'}}
|
||||||
option(value="inactive") {{_ 'admin-people-filter-inactive'}}
|
option(value="inactive") {{_ 'admin-people-filter-inactive'}}
|
||||||
|
option(value="admin") Admin
|
||||||
button#unlockAllUsers.unlock-all-btn
|
button#unlockAllUsers.unlock-all-btn
|
||||||
| 🔓
|
| 🔓
|
||||||
| {{_ 'accounts-lockout-unlock-all'}}
|
| {{_ 'accounts-lockout-unlock-all'}}
|
||||||
|
|
@ -57,7 +58,7 @@ template(name="people")
|
||||||
| {{_ 'add'}} / {{_ 'delete'}} {{_ 'teams'}}
|
| {{_ 'add'}} / {{_ 'delete'}} {{_ 'teams'}}
|
||||||
else if lockedUsersSetting.get
|
else if lockedUsersSetting.get
|
||||||
span
|
span
|
||||||
| 🔒.text-red
|
span.text-red 🔒
|
||||||
unless isMiniScreen
|
unless isMiniScreen
|
||||||
| {{_ 'accounts-lockout-locked-users'}}
|
| {{_ 'accounts-lockout-locked-users'}}
|
||||||
|
|
||||||
|
|
@ -78,7 +79,7 @@ template(name="people")
|
||||||
| {{_ 'people'}}
|
| {{_ 'people'}}
|
||||||
li
|
li
|
||||||
a.js-locked-users-menu(data-id="locked-users-setting")
|
a.js-locked-users-menu(data-id="locked-users-setting")
|
||||||
| 🔒.text-red
|
span.text-red 🔒
|
||||||
| {{_ 'accounts-lockout-locked-users'}}
|
| {{_ 'accounts-lockout-locked-users'}}
|
||||||
.main-body
|
.main-body
|
||||||
if loading.get
|
if loading.get
|
||||||
|
|
@ -100,7 +101,6 @@ template(name="orgGeneral")
|
||||||
th {{_ 'displayName'}}
|
th {{_ 'displayName'}}
|
||||||
th {{_ 'description'}}
|
th {{_ 'description'}}
|
||||||
th {{_ 'shortName'}}
|
th {{_ 'shortName'}}
|
||||||
th {{_ 'autoAddUsersWithDomainName'}}
|
|
||||||
th {{_ 'website'}}
|
th {{_ 'website'}}
|
||||||
th {{_ 'createdAt'}}
|
th {{_ 'createdAt'}}
|
||||||
th {{_ 'active'}}
|
th {{_ 'active'}}
|
||||||
|
|
@ -140,16 +140,9 @@ template(name="peopleGeneral")
|
||||||
th {{_ 'admin-people-active-status'}}
|
th {{_ 'admin-people-active-status'}}
|
||||||
th {{_ 'username'}}
|
th {{_ 'username'}}
|
||||||
th {{_ 'fullname'}}
|
th {{_ 'fullname'}}
|
||||||
th {{_ 'initials'}}
|
|
||||||
th {{_ 'admin'}}
|
th {{_ 'admin'}}
|
||||||
th {{_ 'email'}}
|
th {{_ 'email'}}
|
||||||
th {{_ 'verified'}}
|
|
||||||
th {{_ 'createdAt'}}
|
th {{_ 'createdAt'}}
|
||||||
th {{_ 'active'}}
|
|
||||||
th {{_ 'authentication-method'}}
|
|
||||||
th {{_ 'import-usernames'}}
|
|
||||||
th {{_ 'organizations'}}
|
|
||||||
th {{_ 'teams'}}
|
|
||||||
th
|
th
|
||||||
+newUserRow
|
+newUserRow
|
||||||
tbody
|
tbody
|
||||||
|
|
@ -190,10 +183,6 @@ template(name="orgRow")
|
||||||
td {{ orgData.orgShortName }}
|
td {{ orgData.orgShortName }}
|
||||||
else
|
else
|
||||||
td <s>{{ orgData.orgShortName }}</s>
|
td <s>{{ orgData.orgShortName }}</s>
|
||||||
if orgData.orgIsActive
|
|
||||||
td {{ orgData.orgAutoAddUsersWithDomainName }}
|
|
||||||
else
|
|
||||||
td <s>{{ orgData.orgAutoAddUsersWithDomainName }}</s>
|
|
||||||
if orgData.orgIsActive
|
if orgData.orgIsActive
|
||||||
td {{ orgData.orgWebsite }}
|
td {{ orgData.orgWebsite }}
|
||||||
else
|
else
|
||||||
|
|
@ -258,14 +247,14 @@ template(name="peopleRow")
|
||||||
input.selectUserChkBox(type="checkbox", id="{{userData._id}}")
|
input.selectUserChkBox(type="checkbox", id="{{userData._id}}")
|
||||||
td.account-status
|
td.account-status
|
||||||
if isUserLocked
|
if isUserLocked
|
||||||
| 🔒.text-red.js-toggle-lock-status(data-user-id=userData._id, data-is-locked="true", title="{{_ 'accounts-lockout-click-to-unlock'}}")
|
span.text-red.js-toggle-lock-status(data-user-id=userData._id, data-is-locked="true", title="{{_ 'accounts-lockout-click-to-unlock'}}") 🔒
|
||||||
else
|
else
|
||||||
| 🔓.text-green.js-toggle-lock-status(data-user-id=userData._id, data-is-locked="false", title="{{_ 'accounts-lockout-user-unlocked'}}")
|
span.text-green.js-toggle-lock-status(data-user-id=userData._id, data-is-locked="false", title="{{_ 'accounts-lockout-user-unlocked'}}") 🔓
|
||||||
td.account-active-status
|
td.account-active-status
|
||||||
if userData.loginDisabled
|
if userData.loginDisabled
|
||||||
| 🚫.text-red.js-toggle-active-status(data-user-id=userData._id, data-is-active="false", title="{{_ 'admin-people-user-inactive'}}")
|
span.text-red.js-toggle-active-status(data-user-id=userData._id, data-is-active="false", title="{{_ 'admin-people-user-inactive'}}") 🚫
|
||||||
else
|
else
|
||||||
| ✅.text-green.js-toggle-active-status(data-user-id=userData._id, data-is-active="true", title="{{_ 'admin-people-user-active'}}")
|
span.text-green.js-toggle-active-status(data-user-id=userData._id, data-is-active="true", title="{{_ 'admin-people-user-active'}}") ✅
|
||||||
if userData.loginDisabled
|
if userData.loginDisabled
|
||||||
td.username <s>{{ userData.username }}</s>
|
td.username <s>{{ userData.username }}</s>
|
||||||
else if isUserLocked
|
else if isUserLocked
|
||||||
|
|
@ -276,10 +265,6 @@ template(name="peopleRow")
|
||||||
td <s>{{ userData.profile.fullname }}</s>
|
td <s>{{ userData.profile.fullname }}</s>
|
||||||
else
|
else
|
||||||
td {{ userData.profile.fullname }}
|
td {{ userData.profile.fullname }}
|
||||||
if userData.loginDisabled
|
|
||||||
td <s>{{ userData.profile.initials }}</s>
|
|
||||||
else
|
|
||||||
td {{ userData.profile.initials }}
|
|
||||||
if userData.loginDisabled
|
if userData.loginDisabled
|
||||||
td
|
td
|
||||||
if userData.isAdmin
|
if userData.isAdmin
|
||||||
|
|
@ -296,43 +281,10 @@ template(name="peopleRow")
|
||||||
td <s>{{ userData.emails.[0].address }}</s>
|
td <s>{{ userData.emails.[0].address }}</s>
|
||||||
else
|
else
|
||||||
td {{ userData.emails.[0].address }}
|
td {{ userData.emails.[0].address }}
|
||||||
if userData.loginDisabled
|
|
||||||
td
|
|
||||||
if userData.emails.[0].verified
|
|
||||||
| <s>{{_ 'yes'}}</s>
|
|
||||||
else
|
|
||||||
| <s>{{_ 'no'}}</s>
|
|
||||||
else
|
|
||||||
td
|
|
||||||
if userData.emails.[0].verified
|
|
||||||
| {{_ 'yes'}}
|
|
||||||
else
|
|
||||||
| {{_ 'no'}}
|
|
||||||
if userData.loginDisabled
|
if userData.loginDisabled
|
||||||
td <s>{{ moment userData.createdAt 'LLL' }}</s>
|
td <s>{{ moment userData.createdAt 'LLL' }}</s>
|
||||||
else
|
else
|
||||||
td {{ moment userData.createdAt 'LLL' }}
|
td {{ moment userData.createdAt 'LLL' }}
|
||||||
td
|
|
||||||
if userData.loginDisabled
|
|
||||||
| {{_ 'no'}}
|
|
||||||
else
|
|
||||||
| {{_ 'yes'}}
|
|
||||||
if userData.loginDisabled
|
|
||||||
td <s>{{_ userData.authenticationMethod }}</s>
|
|
||||||
else
|
|
||||||
td {{_ userData.authenticationMethod }}
|
|
||||||
if userData.loginDisabled
|
|
||||||
td <s>{{ userData.importUsernamesString }}</s>
|
|
||||||
else
|
|
||||||
td {{ userData.importUsernamesString }}
|
|
||||||
if userData.loginDisabled
|
|
||||||
td <s>{{ userData.orgsUserBelongs }}</s>
|
|
||||||
else
|
|
||||||
td {{ userData.orgsUserBelongs }}
|
|
||||||
if userData.loginDisabled
|
|
||||||
td <s>{{ userData.teamsUserBelongs }}</s>
|
|
||||||
else
|
|
||||||
td {{ userData.teamsUserBelongs }}
|
|
||||||
td
|
td
|
||||||
a.edit-user
|
a.edit-user
|
||||||
| ✏️
|
| ✏️
|
||||||
|
|
@ -448,8 +400,8 @@ template(name="editUserPopup")
|
||||||
option(value="{{value}}") {{_ value}}
|
option(value="{{value}}") {{_ value}}
|
||||||
label
|
label
|
||||||
| {{_ 'organizations'}}
|
| {{_ 'organizations'}}
|
||||||
| ➕#addUserOrg
|
span#addUserOrg ➕
|
||||||
| ➖#removeUserOrg
|
span#removeUserOrg ➖
|
||||||
select.js-orgs#jsOrgs
|
select.js-orgs#jsOrgs
|
||||||
option(value="-1") {{_ 'organizations'}} :
|
option(value="-1") {{_ 'organizations'}} :
|
||||||
each value in orgsDatas
|
each value in orgsDatas
|
||||||
|
|
@ -458,8 +410,8 @@ template(name="editUserPopup")
|
||||||
input#jsUserOrgIdsInPut.js-userOrgIds.hide(type="hidden" value=user.orgIdsUserBelongs)
|
input#jsUserOrgIdsInPut.js-userOrgIds.hide(type="hidden" value=user.orgIdsUserBelongs)
|
||||||
label
|
label
|
||||||
| {{_ 'teams'}}
|
| {{_ 'teams'}}
|
||||||
| ➕#addUserTeam
|
span#addUserTeam ➕
|
||||||
| ➖#removeUserTeam
|
span#removeUserTeam ➖
|
||||||
select.js-teams#jsTeams
|
select.js-teams#jsTeams
|
||||||
option(value="-1") {{_ 'teams'}} :
|
option(value="-1") {{_ 'teams'}} :
|
||||||
each value in teamsDatas
|
each value in teamsDatas
|
||||||
|
|
@ -591,8 +543,8 @@ template(name="newUserPopup")
|
||||||
option(value="{{value}}") {{_ value}}
|
option(value="{{value}}") {{_ value}}
|
||||||
label
|
label
|
||||||
| {{_ 'organizations'}}
|
| {{_ 'organizations'}}
|
||||||
| ➕#addUserOrgNewUser
|
span#addUserOrgNewUser ➕
|
||||||
| ➖#removeUserOrgNewUser
|
span#removeUserOrgNewUser ➖
|
||||||
select.js-orgsNewUser#jsOrgsNewUser
|
select.js-orgsNewUser#jsOrgsNewUser
|
||||||
option(value="-1") {{_ 'organizations'}} :
|
option(value="-1") {{_ 'organizations'}} :
|
||||||
each value in orgsDatas
|
each value in orgsDatas
|
||||||
|
|
@ -601,8 +553,8 @@ template(name="newUserPopup")
|
||||||
input#jsUserOrgIdsInPutNewUser.js-userOrgIdsNewUser.hide(type="text" value=user.orgIdsUserBelongs)
|
input#jsUserOrgIdsInPutNewUser.js-userOrgIdsNewUser.hide(type="text" value=user.orgIdsUserBelongs)
|
||||||
label
|
label
|
||||||
| {{_ 'teams'}}
|
| {{_ 'teams'}}
|
||||||
| ➕#addUserTeamNewUser
|
span#addUserTeamNewUser ➕
|
||||||
| ➖#removeUserTeamNewUser
|
span#removeUserTeamNewUser ➖
|
||||||
select.js-teamsNewUser#jsTeamsNewUser
|
select.js-teamsNewUser#jsTeamsNewUser
|
||||||
option(value="-1") {{_ 'teams'}} :
|
option(value="-1") {{_ 'teams'}} :
|
||||||
each value in teamsDatas
|
each value in teamsDatas
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,10 @@ BlazeComponent.extendComponent({
|
||||||
// Show only inactive users (loginDisabled is true)
|
// Show only inactive users (loginDisabled is true)
|
||||||
query['loginDisabled'] = true;
|
query['loginDisabled'] = true;
|
||||||
break;
|
break;
|
||||||
|
case 'admin':
|
||||||
|
// Show only admin users (isAdmin is true)
|
||||||
|
query['isAdmin'] = true;
|
||||||
|
break;
|
||||||
case 'all':
|
case 'all':
|
||||||
default:
|
default:
|
||||||
// Show all users, no additional filter
|
// Show all users, no additional filter
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,22 @@ window.Popup = new (class {
|
||||||
const viewportHeight = $(window).height();
|
const viewportHeight = $(window).height();
|
||||||
const popupWidth = Math.min(380, viewportWidth * 0.55) + 15; // Add 15px for margin
|
const popupWidth = Math.min(380, viewportWidth * 0.55) + 15; // Add 15px for margin
|
||||||
|
|
||||||
|
// Check if this is an admin panel edit popup
|
||||||
|
const isAdminEditPopup = $element.hasClass('edit-user') ||
|
||||||
|
$element.hasClass('edit-org') ||
|
||||||
|
$element.hasClass('edit-team');
|
||||||
|
|
||||||
|
if (isAdminEditPopup) {
|
||||||
|
// Center the popup horizontally and use full height
|
||||||
|
const centeredLeft = (viewportWidth - popupWidth) / 2;
|
||||||
|
|
||||||
|
return {
|
||||||
|
left: Math.max(10, centeredLeft), // Ensure popup doesn't go off screen
|
||||||
|
top: 10, // Start from top with small margin
|
||||||
|
maxHeight: viewportHeight - 20, // Use full height minus small margins
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate available height for popup
|
// Calculate available height for popup
|
||||||
const popupTop = offset.top + $element.outerHeight();
|
const popupTop = offset.top + $element.outerHeight();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue