mirror of
https://github.com/plexguide/Huntarr.io.git
synced 2026-08-07 10:23:12 -04:00
User Refactor
This commit is contained in:
1 parent
5e687ca248
commit
ca17636c31
13 files changed
+390
-238
No files matched your search
@@ -415,14 +415,20 @@ export class RequestarrSettings {
|
||||
const posterUrl = item.poster_path || './static/images/blackout.jpg';
|
||||
|
||||
const typeBadgeLabel = item.media_type === 'tv' ? 'TV' : 'Movie';
|
||||
|
||||
// Show scope badge for non-owner users
|
||||
const isNonOwner = window._huntarrUserRole && window._huntarrUserRole !== 'owner';
|
||||
const isGlobal = item.is_global === true;
|
||||
const scopeBadge = isNonOwner ? (isGlobal
|
||||
? '<span class="hidden-scope-badge hidden-scope-global" title="Hidden by owner (all users)">Global</span>'
|
||||
: '<span class="hidden-scope-badge hidden-scope-personal" title="Hidden by you (personal)">Personal</span>') : '';
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="media-card-poster">
|
||||
<button class="media-card-unhide-btn" title="Unhide this media">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
${!isGlobal || !isNonOwner ? '<button class="media-card-unhide-btn" title="Unhide this media"><i class="fas fa-eye"></i></button>' : ''}
|
||||
<img src="${posterUrl}" alt="${item.title}" onerror="this.src='./static/images/blackout.jpg'">
|
||||
<span class="media-type-badge">${typeBadgeLabel}</span>
|
||||
${scopeBadge}
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@ window.RequestarrUsers = {
|
||||
<label>Role</label>
|
||||
<select id="requsers-modal-role" ${isEdit && user.role === 'owner' ? 'disabled' : ''} onchange="RequestarrUsers.onRoleChange()">
|
||||
<option value="user" ${(!isEdit || user.role === 'user') ? 'selected' : ''}>User</option>
|
||||
<option value="admin" ${(isEdit && user.role === 'admin') ? 'selected' : ''}>Admin</option>
|
||||
${isEdit && user.role === 'owner' ? '<option value="owner" selected>Owner</option>' : ''}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user