Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support public authority for admin. #218

Merged
1 commit merged into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions cmd/gopcomm/yap/edit_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,27 @@
</div>
</div>

<!-- Current user is private -->
<div v-if="showArticlePublicNotice" class="fixed top-4 left-1/2 transform -translate-x-1/2 z-10">
<div class="bg-white shadow-xl rounded-lg p-4 right-0 mr-4 mt-4 border border-gray-300">
<div class="flex items-start justify-between">
<div class="flex items-center">
<div class="text-red-500 mr-1">
<i class="ph-duotone ph-warning" style="font-size: 27px;"></i>
</div>
<div class="ml-3">
<p class="text-lg font-semibold text-red-500">Please contact admin to be public!
</p>
<p class="text-sm text-gray-500">Your article is private.</p>
</div>
</div>
<n-button quaternary size="tiny" class="ml-3" @click="showArticlePublicNotice=false">
<i class="ph-bold ph-x" style="font-size: 15px;"></i>
</n-button>
</div>
</div>
</div>

<!-- Fill in Title -->
<div v-if="showTitleNotice" class="fixed top-4 left-1/2 transform -translate-x-1/2 z-10">
<div class="bg-white shadow-xl rounded-lg p-4 right-0 mr-4 mt-4 border border-gray-300">
Expand Down Expand Up @@ -328,6 +349,7 @@
/*======= article info =======*/
const showBothNotice = ref(false);
const showTitleNotice = ref(false);
const showArticlePublicNotice = ref(false);
const showContentNotice = ref(false);
const showTranNotice = ref(false);
const showModal = ref(false);
Expand Down Expand Up @@ -516,6 +538,9 @@
return
}

// Check user is public
showArticlePublicNotice.value = true;

// Extract summaries automatically
const cherryHtml = window.GoplusMarkdown.MarkdownEditor.methods.getCherryHtml()
let template = document.createElement('div');
Expand Down Expand Up @@ -612,6 +637,7 @@
showBothNotice,
showTitleNotice,
showContentNotice,
showArticlePublicNotice,
showTranNotice,
showModal,

Expand Down Expand Up @@ -678,6 +704,13 @@
}, 3000);
}
},
showArticlePublicNotice(newValue) {
if (newValue) {
setTimeout(() => {
showArticlePublicNotice.value = false;
}, 3000);
}
},
},
});

Expand Down
Loading