Introduce a course_tool plugin entry point and migrate the updates, bookmarks and reviews tools into plugins.
This commit is contained in:
committed by
Harry Rein
parent
aea407b13e
commit
2842533eb4
40
openedx/features/course_bookmarks/plugins.py
Normal file
40
openedx/features/course_bookmarks/plugins.py
Normal 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])
|
||||
Reference in New Issue
Block a user