Merge pull request #3017 from nichwall/playlist_user_permissions

Users can edit playlist in UI
This commit is contained in:
advplyr 2024-05-26 14:15:25 -05:00 committed by GitHub
commit 3111d1860a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View File

@ -38,7 +38,7 @@
<div v-if="userCanUpdate" class="mx-1" :class="isHovering ? '' : 'ml-6'"> <div v-if="userCanUpdate" class="mx-1" :class="isHovering ? '' : 'ml-6'">
<ui-icon-btn icon="edit" borderless @click="clickEdit" /> <ui-icon-btn icon="edit" borderless @click="clickEdit" />
</div> </div>
<div v-if="userCanDelete" class="mx-1"> <div class="mx-1" :class="isHovering ? '' : 'ml-6'">
<ui-icon-btn icon="close" borderless @click="removeClick" /> <ui-icon-btn icon="close" borderless @click="removeClick" />
</div> </div>
</div> </div>
@ -75,8 +75,7 @@ export default {
}, },
computed: { computed: {
translateDistance() { translateDistance() {
if (!this.userCanUpdate && !this.userCanDelete) return 'translate-x-0' if (!this.userCanUpdate) return '-translate-x-12'
else if (!this.userCanUpdate || !this.userCanDelete) return '-translate-x-12'
return '-translate-x-24' return '-translate-x-24'
}, },
libraryItem() { libraryItem() {
@ -233,4 +232,4 @@ export default {
}, },
mounted() {} mounted() {}
} }
</script> </script>

View File

@ -19,9 +19,9 @@
{{ streaming ? $strings.ButtonPlaying : $strings.ButtonPlay }} {{ streaming ? $strings.ButtonPlaying : $strings.ButtonPlay }}
</ui-btn> </ui-btn>
<ui-icon-btn v-if="userCanUpdate" icon="edit" class="mx-0.5" @click="editClick" /> <ui-icon-btn icon="edit" class="mx-0.5" @click="editClick" />
<ui-icon-btn v-if="userCanDelete" icon="delete" class="mx-0.5" @click="removeClick" /> <ui-icon-btn icon="delete" class="mx-0.5" @click="removeClick" />
</div> </div>
<div class="my-8 max-w-2xl"> <div class="my-8 max-w-2xl">