From 7d6d3640ad0b66b635211d593e4d8e4e32ac8a1a Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sun, 17 Jan 2021 08:16:40 +0000 Subject: [PATCH] Disable the tagging UI for non-admin users --- public/js/title.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/title.js b/public/js/title.js index 0ec33ff..1aca6d6 100644 --- a/public/js/title.js +++ b/public/js/title.js @@ -265,7 +265,8 @@ const tagsComponent = () => { $('.tag-select').select2({ tags: true, - placeholder: 'Tag the title', + placeholder: this.isAdmin ? 'Tag the title' : 'No tags found', + disabled: !this.isAdmin, templateSelection(state) { const a = document.createElement('a'); a.setAttribute('href', `${base_url}tags/${encodeURIComponent(state.text)}`);