Skip to content

Commit

Permalink
Merge pull request #21 from eduNEXT/eric/fix_studio_view
Browse files Browse the repository at this point in the history
[BD-6] Fix studio view
  • Loading branch information
awais786 authored Jul 10, 2020
2 parents 191e38b + d2344e9 commit 1f7c465
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions recommender/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def emit(param1, param2):
pass


def load(path):
"""Handy helper for getting resources from our kit."""
data = pkg_resources.resource_string(__name__, path)
return data.decode("utf8")


def stem_url(url):
"""
Get the base form of url.
Expand Down Expand Up @@ -996,9 +1002,9 @@ def studio_view(self, _context=None): # pylint: disable=unused-argument
self._init_template_lookup()

frag = Fragment(template_lookup.get_template("recommenderstudio.html").render())
frag.add_css(pkg_resources.resource_string(__name__, "static/css/recommenderstudio.css"))
frag.add_css(load("static/css/recommenderstudio.css"))
frag.add_javascript_url("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js")
frag.add_javascript(pkg_resources.resource_string(__name__, "static/js/src/recommenderstudio.js"))
frag.add_javascript(load("static/js/src/recommenderstudio.js"))
frag.initialize_js('RecommenderXBlock')
return frag

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def package_data(pkg, root_list):

setup(
name='recommender-xblock',
version='1.4.8',
version='1.4.9',
description='recommender XBlock', # TODO: write a better description.
long_description=README,
author='edX',
Expand Down

0 comments on commit 1f7c465

Please sign in to comment.