Commit 9ac26715 by Rocky Duan

Merge branch 'feature/bk_forum_int' into refactor

Conflicts:
	lms/djangoapps/courseware/views.py
	lms/templates/courseware/courseware.html
	lms/templates/discussion/index.html
	requirements.txt
parents 17683c43 bca6699b
......@@ -74,5 +74,4 @@ There is also a script "create-dev-env.sh" that automates these steps.
$ django-admin.py syncdb --settings=envs.dev --pythonpath=.
$ django-admin.py migrate --settings=envs.dev --pythonpath=.
$ django-admin.py runserver --settings=envs.dev --pythonpath=.
......@@ -3,13 +3,16 @@ from django_comment_client.models import Permission, Role
class Command(BaseCommand):
args = ''
args = 'course_id'
help = 'Seed default permisssions and roles'
def handle(self, *args, **options):
administrator_role = Role.objects.get_or_create(name="Administrator", course_id="MITx/6.002x/2012_Fall")[0]
moderator_role = Role.objects.get_or_create(name="Moderator", course_id="MITx/6.002x/2012_Fall")[0]
student_role = Role.objects.get_or_create(name="Student", course_id="MITx/6.002x/2012_Fall")[0]
if len(args) != 1:
raise CommandError("The number of arguments does not match. ")
course_id = args[0]
administrator_role = Role.objects.get_or_create(name="Administrator", course_id=course_id)[0]
moderator_role = Role.objects.get_or_create(name="Moderator", course_id=course_id)[0]
student_role = Role.objects.get_or_create(name="Student", course_id=course_id)[0]
for per in ["vote", "update_thread", "follow_thread", "unfollow_thread",
"update_comment", "create_sub_comment", "unvote" , "create_thread",
......
......@@ -19,6 +19,11 @@ EMAIL_BACKEND = 'django_ses.SESBackend'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
# Disable askbot, enable Berkeley forums
MITX_FEATURES['ENABLE_DISCUSSION'] = False
MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
########################### NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
with open(ENV_ROOT / "env.json") as env_file:
......@@ -60,3 +65,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
if 'COURSE_ID' in ENV_TOKENS:
ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID'])
COMMENTS_SERVICE_URL = ENV_TOKENS["COMMENTS_SERVICE_URL"]
SERVICE_HOST = 'http://localhost:4567'
from django.conf import settings
if hasattr(settings, "COMMENTS_SERVICE_URL"):
SERVICE_HOST = settings.COMMENTS_SERVICE_URL
else:
SERVICE_HOST = 'http://localhost:4567'
PREFIX = SERVICE_HOST + '/api/v1'
......@@ -14,7 +14,7 @@
<%include file="_js_dependencies.html" />
</%block>
<%include file="../course_navigation.html" args="active_page='discussion'" />
<%include file="/courseware/course_navigation.html" args="active_page='discussion'" />
<section class="container">
<div class="course-wrapper">
......
......@@ -10,7 +10,7 @@
<%block name="js_extra">
</%block>
<%include file="course_navigation.html" args="active_page='news'" />
<%include file="/courseware/course_navigation.html" args="active_page='news'" />
<section class="container">
<div class="course-wrapper">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment