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
7dd659ba
Commit
7dd659ba
authored
Jun 03, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Number of votes
parent
701cd8c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
recommender/recommender.py
+3
-1
recommender/static/html/recommender.html
+1
-1
recommender/static/html/resourcebox.html
+2
-2
No files found.
recommender/recommender.py
View file @
7dd659ba
...
@@ -86,7 +86,9 @@ class RecommenderXBlock(XBlock):
...
@@ -86,7 +86,9 @@ 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
(
resources
=
self
.
recommendations
))
resources
=
[{
'title'
:
r
[
'title'
],
"votes"
:
r
[
'up'
]
-
r
[
'down'
]}
for
r
in
self
.
recommendations
]
frag
=
Fragment
(
self
.
template_lookup
.
get_template
(
"recommender.html"
)
.
render
(
resources
=
resources
))
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 @
7dd659ba
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
<div
class=
"recommender_row"
>
<div
class=
"recommender_row"
>
% for elem in resources:
% for elem in resources:
<li>
${elem}
</li>
<li>
${elem}
</li>
<
%
include
file=
"resourcebox.html"
args=
"title=elem['title']"
/>
<
%
include
file=
"resourcebox.html"
args=
"title=elem['title']
,votes=elem['votes']
"
/>
% endfor
% endfor
</div>
</div>
</div>
</div>
...
...
recommender/static/html/resourcebox.html
View file @
7dd659ba
<
%
page
args=
"title"
/>
<
%
page
args=
"title
,votes
"
/>
<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>
<!--div class="recommender_vote_score_dislikes">2927</div-->
<!--div class="recommender_vote_score_dislikes">2927</div-->
<div
class=
"recommender_vote_score"
>
2926
</div>
<div
class=
"recommender_vote_score"
>
${votes}
</div>
<!--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>
...
...
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