mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: Staff only poll results (#7984)
* FEATURE: Staff only poll results These changes allow only staff to see the results of a poll. Non-staff users will be shown a screen like this: https://review.discourse.org/uploads/default/original/1X/1b8bd76013363860f2bc455049cf35e69ef44e0a.png The "Votes are public" message has been removed from the info section, and the button to show the votes has been replaced with a message stating the results will only be shown to staff. * Update PR based on feedback * Update plugins/poll/app/models/poll.rb make sure we return a boolean Co-Authored-By: Régis Hanol <regis@hanol.fr>
This commit is contained in:
parent
00b91de5e8
commit
69498a58e9
4 changed files with 36 additions and 10 deletions
|
@ -12,6 +12,7 @@ export default Ember.Controller.extend({
|
|||
alwaysPollResult: "always",
|
||||
votePollResult: "on_vote",
|
||||
closedPollResult: "on_close",
|
||||
staffPollResult: "staff_only",
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -36,8 +37,8 @@ export default Ember.Controller.extend({
|
|||
];
|
||||
},
|
||||
|
||||
@computed("alwaysPollResult", "votePollResult", "closedPollResult")
|
||||
pollResults(alwaysPollResult, votePollResult, closedPollResult) {
|
||||
@computed("alwaysPollResult", "votePollResult", "closedPollResult", "staffPollResult")
|
||||
pollResults(alwaysPollResult, votePollResult, closedPollResult, staffPollResult) {
|
||||
return [
|
||||
{
|
||||
name: I18n.t("poll.ui_builder.poll_result.always"),
|
||||
|
@ -50,6 +51,10 @@ export default Ember.Controller.extend({
|
|||
{
|
||||
name: I18n.t("poll.ui_builder.poll_result.closed"),
|
||||
value: closedPollResult
|
||||
},
|
||||
{
|
||||
name: I18n.t("poll.ui_builder.poll_result.staff"),
|
||||
value: staffPollResult
|
||||
}
|
||||
];
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue