Make the team discussion thread private

Develop the capability to allow instructors to designate teams to have private discussions. This way, so non-teammembers cannot view discussion. And the intend is for course teams to manage the team membership as well.
MST-10
This commit is contained in:
Kyle McCormick
2019-10-04 16:40:13 -04:00
committed by Simon Chen
parent 855346e9e1
commit cd3bc236eb
9 changed files with 338 additions and 210 deletions

View File

@@ -176,9 +176,15 @@
this.threadListView.$('.is-active').focus();
},
hideDiscussion: function() {
this.$('section.discussion').addClass('is-hidden');
this.toggleDiscussionBtn.removeClass('shown');
this.toggleDiscussionBtn.find('.button-text').text(gettext('Show Discussion'));
this.showed = false;
},
toggleDiscussion: function() {
var self = this;
if (this.showed) {
this.hideDiscussion();
} else {
@@ -188,25 +194,27 @@
this.$('section.discussion').removeClass('is-hidden');
this.showed = true;
} else {
this.loadDiscussions(this.$el, function() {
self.hideDiscussion();
DiscussionUtil.discussionAlert(
gettext('Error'),
gettext('This discussion could not be loaded. Refresh the page and try again.')
);
this.loadDiscussions(this.$el, function(request) {
if (request.status === 403 && request.responseText) {
DiscussionUtil.discussionAlert(
gettext('Warning'),
request.responseText
);
self.$el.text(request.responseText);
self.showed = true;
} else {
self.hideDiscussion();
DiscussionUtil.discussionAlert(
gettext('Error'),
gettext('This discussion could not be loaded. Refresh the page and try again.')
);
}
});
}
}
this.toggleDiscussionBtn.focus();
},
hideDiscussion: function() {
this.$('section.discussion').addClass('is-hidden');
this.toggleDiscussionBtn.removeClass('shown');
this.toggleDiscussionBtn.find('.button-text').text(gettext('Show Discussion'));
this.showed = false;
},
toggleNewPost: function(event) {
event.preventDefault();
if (!this.newPostForm) {