Disable the tagging UI for non-admin users

This commit is contained in:
Alex Ling 2021-01-17 08:16:40 +00:00
parent 3071d44e32
commit 7d6d3640ad

View File

@ -265,7 +265,8 @@ const tagsComponent = () => {
$('.tag-select').select2({ $('.tag-select').select2({
tags: true, tags: true,
placeholder: 'Tag the title', placeholder: this.isAdmin ? 'Tag the title' : 'No tags found',
disabled: !this.isAdmin,
templateSelection(state) { templateSelection(state) {
const a = document.createElement('a'); const a = document.createElement('a');
a.setAttribute('href', `${base_url}tags/${encodeURIComponent(state.text)}`); a.setAttribute('href', `${base_url}tags/${encodeURIComponent(state.text)}`);