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

Updates on the frontends with a questions category and students /instructor default group #10

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions install/data/categories.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job getting a new category to show

Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,14 @@
"color": "#ffffff",
"icon" : "fa-question",
"order": 3
},
{
"name": "Questions",
"description": "Post any question you have!",
"descriptionParsed": "<p>Post any question you have!</p>\n",
"bgColor": "#e95c5a",
"color": "#ffffff",
"icon" : "fa-question",
"order": 5
}
]
38 changes: 38 additions & 0 deletions src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,42 @@ async function createGlobalModeratorsGroup() {
await groups.show('Global Moderators');
}

async function createStudents() {
const groups = require('./groups');
const exists = await groups.exists('Students');
if (exists) {
winston.info('Students group found, skipping creation!');
} else {
await groups.create({
name: 'Students',
userTitle: 'Student',
description: 'Cute students here',
hidden: 0,
private: 0,
disableJoinRequests: 0,
});
}
await groups.show('Students');
}

async function createInstructors() {
const groups = require('./groups');
const exists = await groups.exists('instructors');
if (exists) {
winston.info('Instructors group found, skipping creation!');
} else {
await groups.create({
name: 'instructors',
userTitle: 'Instructor',
description: 'Cool instructors are here',
hidden: 0,
private: 0,
disableJoinRequests: 0,
});
}
await groups.show('Instructors');
}

async function giveGlobalPrivileges() {
const privileges = require('./privileges');
const defaultPrivileges = [
Expand Down Expand Up @@ -584,6 +620,8 @@ install.setup = async function () {
await createDefaultUserGroups();
const adminInfo = await createAdministrator();
await createGlobalModeratorsGroup();
await createStudents();
await createInstructors();
await giveGlobalPrivileges();
await createMenuItems();
await createWelcomePost();
Expand Down
Loading