Introduce a course_tool plugin entry point and migrate the updates, bookmarks and reviews tools into plugins.

This commit is contained in:
Andy Armstrong
2017-06-20 19:03:37 -04:00
committed by Harry Rein
parent aea407b13e
commit 2842533eb4
5 changed files with 215 additions and 32 deletions

View File

@@ -0,0 +1,40 @@
"""
Platform plugins to support course bookmarks.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from openedx.features.course_experience.course_tools import CourseTool
class CourseBookmarksTool(CourseTool):
"""
The course bookmarks tool.
"""
@classmethod
def is_enabled(cls, course_key):
"""
Always show the bookmarks tool.
"""
return True
@classmethod
def title(cls):
"""
Returns the title of this tool.
"""
return _('Bookmarks')
@classmethod
def icon_classes(cls):
"""
Returns the icon classes needed to represent this tool.
"""
return 'fa fa-bookmark'
@classmethod
def url(cls, course_key):
"""
Returns the URL for this tool for the specified course key.
"""
return reverse('openedx.course_bookmarks.home', args=[course_key])