Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
RecommenderXBlock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
RecommenderXBlock
Commits
06b2f0db
Commit
06b2f0db
authored
May 23, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched to mako templates
parent
44f80037
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
recommender/recommender.py
+2
-2
recommender/static/html/recommender.html
+6
-0
recommender/static/html/resourcebox.html
+2
-1
No files found.
recommender/recommender.py
View file @
06b2f0db
...
@@ -57,7 +57,7 @@ class RecommenderXBlock(XBlock):
...
@@ -57,7 +57,7 @@ class RecommenderXBlock(XBlock):
This XBlock will show a set of recommended resources
This XBlock will show a set of recommended resources
"""
"""
# Scope-wide. List of JSON objects corresponding to recommendations combine XML and user.
# Scope-wide. List of JSON objects corresponding to recommendations combine XML and user.
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
0
,
scope
=
Scope
.
content
)
default_
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
0
,
scope
=
Scope
.
content
)
# Scope-wide. List of JSON objects corresponding to recommendations as defined in XML.
# Scope-wide. List of JSON objects corresponding to recommendations as defined in XML.
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
0
,
scope
=
Scope
.
content
)
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
0
,
scope
=
Scope
.
content
)
# Upvotes for this particular user
# Upvotes for this particular user
...
@@ -83,7 +83,7 @@ class RecommenderXBlock(XBlock):
...
@@ -83,7 +83,7 @@ class RecommenderXBlock(XBlock):
self
.
template_lookup
.
put_string
(
"recommender.html"
,
self
.
resource_string
(
"static/html/recommender.html"
))
self
.
template_lookup
.
put_string
(
"recommender.html"
,
self
.
resource_string
(
"static/html/recommender.html"
))
self
.
template_lookup
.
put_string
(
"resourcebox.html"
,
self
.
resource_string
(
"static/html/resourcebox.html"
))
self
.
template_lookup
.
put_string
(
"resourcebox.html"
,
self
.
resource_string
(
"static/html/resourcebox.html"
))
frag
=
Fragment
(
self
.
template_lookup
.
get_template
(
"recommender.html"
)
.
render
())
frag
=
Fragment
(
self
.
template_lookup
.
get_template
(
"recommender.html"
)
.
render
(
resources
=
self
.
recommendations
))
frag
.
add_css_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css"
)
frag
.
add_css_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css"
)
frag
.
add_javascript_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"
)
frag
.
add_javascript_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"
)
frag
.
add_css
(
self
.
resource_string
(
"static/css/recommender.css"
))
frag
.
add_css
(
self
.
resource_string
(
"static/css/recommender.css"
))
...
...
recommender/static/html/recommender.html
View file @
06b2f0db
...
@@ -93,6 +93,12 @@
...
@@ -93,6 +93,12 @@
Textbook Page 505
Textbook Page 505
</div>
</div>
</div>
</div>
<div
class=
"recommender_row"
>
% for elem in resources:
<li>
${elem}
</li>
<
%
include
file=
"resourcebox.html"
args=
"title=elem['title']"
/>
% endfor
</div>
</div>
</div>
<div
class=
"recommender_description"
>
<div
class=
"recommender_description"
>
</div>
</div>
...
...
recommender/static/html/resourcebox.html
View file @
06b2f0db
<
%
page
args=
"title"
/>
<div
class=
"recommender_resource"
>
<div
class=
"recommender_resource"
>
<div
class=
"recommender_vote_box"
>
<div
class=
"recommender_vote_box"
>
<div
class=
"recommender_vote_arrow_up"
role=
"button"
aria-label=
"upvote"
tabindex=
"0"
><span
class=
"ui-icon ui-icon-triangle-1-n"
></span></div>
<div
class=
"recommender_vote_arrow_up"
role=
"button"
aria-label=
"upvote"
tabindex=
"0"
><span
class=
"ui-icon ui-icon-triangle-1-n"
></span></div>
...
@@ -6,6 +7,6 @@
...
@@ -6,6 +7,6 @@
<!--div class="recommender_vote_score_likes">2927</div-->
<!--div class="recommender_vote_score_likes">2927</div-->
<div
class=
"recommender_vote_arrow_down"
role=
"button"
aria-label=
"downvote"
tabindex=
"0"
><span
class=
"ui-icon ui-icon-triangle-1-s"
></span></div>
<div
class=
"recommender_vote_arrow_down"
role=
"button"
aria-label=
"downvote"
tabindex=
"0"
><span
class=
"ui-icon ui-icon-triangle-1-s"
></span></div>
</div>
</div>
<div
class=
"recommender_blurb"
>
Textbook Page 501
</div>
<div
class=
"recommender_blurb"
>
${title}
</div>
<div
class=
"recommender_edit"
><span
class=
"ui-icon ui-icon-pencil"
></span></div>
<div
class=
"recommender_edit"
><span
class=
"ui-icon ui-icon-pencil"
></span></div>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment